Delete obsolete code

Remove outer product computation code from CompressedRowSparseMatrix.
In the process also remove the crsb_cols and crsb_rows vectors from
the matrix, which were added to carry the block sparsity of the matrix
so that the outer product could be computed fast.

InnerProductComputer and its reliance on BlockSparseMatrix has
rendered all of this code moot.

Change-Id: If3ee0dc8ad4ff79594fd1eebc15a647c4495d726
This commit is contained in:
Sameer Agarwal
2017-06-22 00:21:09 -07:00
parent 08e60379ba
commit 1ece5a95fb
4 changed files with 0 additions and 609 deletions
@@ -154,15 +154,6 @@ class CompressedRowSparseMatrix : public SparseMatrix {
const std::vector<int>& col_blocks() const { return col_blocks_; }
std::vector<int>* mutable_col_blocks() { return &col_blocks_; }
const std::vector<int>& block_offsets() const { return block_offsets_; }
std::vector<int>* mutable_block_offsets() { return &block_offsets_; }
const std::vector<int>& crsb_rows() const { return crsb_rows_; }
std::vector<int>* mutable_crsb_rows() { return &crsb_rows_; }
const std::vector<int>& crsb_cols() const { return crsb_cols_; }
std::vector<int>* mutable_crsb_cols() { return &crsb_cols_; }
// Create a block diagonal CompressedRowSparseMatrix with the given
// block structure. The individual blocks are assumed to be laid out
// contiguously in the diagonal array, one block at a time.
@@ -217,38 +208,7 @@ class CompressedRowSparseMatrix : public SparseMatrix {
static CompressedRowSparseMatrix* CreateRandomMatrix(
const RandomMatrixOptions& options);
// Compute the sparsity structure of the product m.transpose() * m
// and create a CompressedRowSparseMatrix corresponding to it.
//
// Also compute a "program" vector, which for every term in the
// block outer product provides the information for the entry
// in the values array of the result matrix where it should be accumulated.
//
// This program is used by the ComputeOuterProduct function below to
// compute the outer product.
//
// Since the entries of the program are the same for rows with the
// same sparsity structure, the program only stores the result for
// one row per row block. The ComputeOuterProduct function reuses
// this information for each row in the row block.
//
// storage_type controls the form of the output matrix. It can be
// LOWER_TRIANGULAR or UPPER_TRIANGULAR.
static CompressedRowSparseMatrix* CreateOuterProductMatrixAndProgram(
const CompressedRowSparseMatrix& m,
const StorageType storage_type,
std::vector<int>* program);
// Compute the values array for the expression m.transpose() * m,
// where the matrix used to store the result and a program have been
// created using the CreateOuterProductMatrixAndProgram function
// above.
static void ComputeOuterProduct(const CompressedRowSparseMatrix& m,
const std::vector<int>& program,
CompressedRowSparseMatrix* result);
private:
static CompressedRowSparseMatrix* FromTripletSparseMatrix(
const TripletSparseMatrix& input, bool transpose);
@@ -266,18 +226,6 @@ class CompressedRowSparseMatrix : public SparseMatrix {
// any way.
std::vector<int> row_blocks_;
std::vector<int> col_blocks_;
// For outer product matrix (J' * J), we pre-compute its block
// offsets information here for fast outer product computation in
// block unit. Since the outer product matrix is symmetric, we do
// not need to distinguish row or col block. In another word, this
// is the prefix sum of row_blocks_/col_blocks_.
std::vector<int> block_offsets_;
// If the matrix has an underlying block structure, then it can also
// carry with it compressed row sparse block information.
std::vector<int> crsb_rows_;
std::vector<int> crsb_cols_;
};
} // namespace internal