verbosity

parent 70622dee
......@@ -30,6 +30,7 @@ env.Append(CXXFLAGS = ['-fdiagnostics-color=always'])
env.Append(CXXFLAGS = ['-Wno-variadic-macros'])
# Warning raised by GCC 9
env.Append(CXXFLAGS = ['-Wno-deprecated-copy'])
env.Append(CXXFLAGS = ['-Wno-extra'])
Export('env');
SConscript('src/SConscript', variant_dir='build', duplicate=0)
......@@ -85,6 +85,18 @@ void buildmats(const std::string& critpairs_file,
C->col_dec_ = v1;
D->col_dec_ = v2;
std::cerr << "buildmats: " << std::endl;
std::cerr << " F4 matrix size: " << A->row_size() + C->row_size() <<
"*" << A->column_size() + B->column_size() << std::endl;
std::cerr << " size of A: " << A->row_size() << std::endl;
std::cerr << " density of A, B, C, D: " <<
A->density()*100 << "%, " <<
B->density()*100 << "%, " <<
C->density()*100 << "%, " <<
D->density()*100 << "%. " << std::endl;
TINYGB_TRY(WriteSpMat (*A, matA_file), "buildmats");
TINYGB_TRY(WriteRowMajMat(*B, matB_file), "buildmats");
TINYGB_TRY(WriteRowMajMat(*C, matC_file), "buildmats");
......
......@@ -81,6 +81,15 @@ class RowMajMat {
entries_[i*column_size_ + j] = v;
}
double density() const {
std::size_t nb_nonzero_elts = 0;
for (std::size_t i = 0; i < row_size(); ++i)
for (std::size_t j = 0; j < column_size(); ++j)
if (!GivaroWrapper::k.isZero((*this)(i, j)))
nb_nonzero_elts++;
return (double)nb_nonzero_elts/(double)row_size()/(double)column_size();
}
// TODO(pj): should be private
std::size_t row_size_;
std::size_t column_size_;
......
......@@ -20,6 +20,7 @@ class SpMatEntry {
: i_(i), j_(j) { GivaroWrapper::k.assign(v_, v); }
};
// TODO: we only need square matrices
class SpMat {
public:
SpMat(): row_size_(0), column_size_(0) {}
......@@ -49,6 +50,13 @@ class SpMat {
return nb_nonzero_elts_by_row_[n];
}
double density() const {
std::size_t nb_nonzero_elts = 0;
for (std::size_t i = 0; i < row_size(); ++i)
nb_nonzero_elts += nb_nonzero_elts_by_row_[i];
return (double)nb_nonzero_elts/(double)row_size()/(double)column_size();
}
void Print() const;
// TODO(pj): should be private
......
......@@ -20,6 +20,8 @@ void selcrit(const std::string& infile,
std::vector<CriticalPair> Select =
NormalStrategy::SelectCriticalPairs(VecCrit);
std::cerr << "selcrit:" << std::endl;
std::cerr << " nb pairs: " << Select.size() << std::endl;
TINYGB_TRY(SaveCritPairs(infile, VecCrit), "selcrit");
TINYGB_TRY(SaveCritPairs(outfile, Select), "selcrit");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment