Change storage in BlockRandomAccessSparseMatrix

- TripletSparseMatrix in BlockRandomAccessSparseMatrix is replaced with
   BlockSparseMatrix
 - BlockSparseMatrix::ToCompressedRowSparseMatrix is performed in a
   direct sort-less way

Change-Id: Ib951fda1b9394050e2c47a9721172c5e3c674801
This commit is contained in:
Dmitriy Korchemkin
2023-04-08 14:12:25 +03:00
parent d340f81bd0
commit 77ad8bb4e5
14 changed files with 361 additions and 207 deletions
+14 -1
View File
@@ -91,7 +91,20 @@ class CERES_NO_EXPORT BlockSparseMatrix final : public SparseMatrix {
void ScaleColumns(const double* scale,
ContextImpl* context,
int num_threads) final;
void ToCompressedRowSparseMatrix(CompressedRowSparseMatrix* matrix) const;
// Convert to CompressedRowSparseMatrix
std::unique_ptr<CompressedRowSparseMatrix> ToCompressedRowSparseMatrix()
const;
// Create CompressedRowSparseMatrix corresponding to transposed matrix
std::unique_ptr<CompressedRowSparseMatrix>
ToCompressedRowSparseMatrixTranspose() const;
// Copy values to CompressedRowSparseMatrix that has compatible structure
void UpdateCompressedRowSparseMatrix(
CompressedRowSparseMatrix* crs_matrix) const;
// Copy values to CompressedRowSparseMatrix that has structure of transposed
// matrix
void UpdateCompressedRowSparseMatrixTranspose(
CompressedRowSparseMatrix* crs_matrix) const;
void ToDenseMatrix(Matrix* dense_matrix) const final;
void ToTextFile(FILE* file) const final;