Compress is now a static member of RowMajMat

parent d562e20d
......@@ -472,7 +472,7 @@ void ReadRowMajMat(std::shared_ptr<RowMajMat> *pR, const std::string& filename)
}
void
Compress(std::shared_ptr<RowMajMat> D, std::shared_ptr<RowMajMat> B, std::list<std::size_t> &pivots) {
RowMajMat::Compress(std::shared_ptr<RowMajMat> D, std::shared_ptr<RowMajMat> B, std::list<std::size_t> &pivots) {
assert(D->col_dec_ == B->col_dec_);
assert(!B->col_dec_.empty() || !B->column_size());
......
......@@ -90,6 +90,9 @@ class RowMajMat {
return (double)nb_nonzero_elts/(double)row_size()/(double)column_size();
}
static void
Compress(std::shared_ptr<RowMajMat> D, std::shared_ptr<RowMajMat> B, std::list<std::size_t> &pivots);
// TODO(pj): should be private
std::size_t row_size_;
std::size_t column_size_;
......@@ -106,8 +109,6 @@ class RowMajMat {
void WriteRowMajMat(const RowMajMat& M, const std::string& filename);
void ReadRowMajMat(std::shared_ptr<RowMajMat> *pR, const std::string& filename);
void
Compress(std::shared_ptr<RowMajMat> D, std::shared_ptr<RowMajMat> B, std::list<std::size_t> &pivots);
} // namespace tinygb
......
......@@ -21,7 +21,7 @@ rowech(std::string resD_file, std::string resB_file,
std::list<std::size_t> pivots;
pD->RowEchelon(pB, pivots);
Compress(pD, pB, pivots);
RowMajMat::Compress(pD, pB, pivots);
WriteRowMajMat(*pD, resD_file);
WriteRowMajMat(*pB, resB_file);
......
......@@ -35,7 +35,7 @@ std::shared_ptr<const StorageMatrix> Interreduce(const std::vector<Polynomial>&
D->RowEchelon(B, pivots);
Compress(D, B, pivots);
RowMajMat::Compress(D, B, pivots);
auto p_current_storage_matrix = std::make_shared<const StorageMatrix>(D, D->col_dec_, D->row_dec_, "interreduced_system");
......
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