1#ifndef SparseBlockMatrix_h
2#define SparseBlockMatrix_h
19#include <boost/numeric/ublas/fwd.hpp>
22#include "LinearAlgebra.h"
58 public QMap< int, LinearAlgebra::Matrix * > {
80 void print(std::ostream& outstream);
125 public QMap< int, LinearAlgebra::Matrix * > {
142 void copyToBoost(boost::numeric::ublas::compressed_matrix<double>& B);
145 void print(std::ostream& outstream);
208 void print(std::ostream& outstream);
210 bool write(std::ofstream &fp_out,
bool binary=
true);
boost::numeric::ublas::matrix< double > Matrix
Definition for an Isis::LinearAlgebra::Matrix of doubles.
int numberOfElements()
Returns total number of matrix elements in map (NOTE: NOT the number of matrix blocks).
void wipe()
Deletes all pointer elements and removes them from the map.
void printClean(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
int startColumn() const
Sets starting column for block in full matrix.
~SparseBlockColumnMatrix()
Destructor.
void print(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
SparseBlockColumnMatrix & operator=(const SparseBlockColumnMatrix &src)
"Equals" operator.
void zeroBlocks()
Sets all elements of all matrix blocks to zero.
bool insertMatrixBlock(int nColumnBlock, int nRows, int nCols)
Inserts a "newed" LinearAlgebra::Matrix pointer of size (nRows, nCols) into the map with the block co...
int numberOfColumns()
Returns total number of columns in map (NOTE: NOT the number of matrix blocks).
int numberOfRows()
Returns total number of rows in map (this needs to be clarified and maybe rewritten).
int m_startColumn
starting column for this Block Column in full matrix e.g.
SparseBlockColumnMatrix()
Default constructor.
void copy(const SparseBlockColumnMatrix &src)
Copy method.
void setStartColumn(int nStartColumn)
Sets starting column for block in full matrix.
void copy(const SparseBlockMatrix &src)
Copy method.
void zeroBlocks()
Sets all elements of all matrix blocks to zero.
int numberOfBlocks()
Returns total number of blocks in matrix.
int numberOfDiagonalBlocks()
Returns number of diagonal matrix blocks (equivalent to size - there is one per column).
int getLeadingRowsForBlock(int nblockRow)
Sums and returns the number of rows in each matrix block prior to nblockRow.
void wipe()
Deletes all pointer elements and removes them from the list.
bool insertMatrixBlock(int nColumnBlock, int nRowBlock, int nRows, int nCols)
Inserts a "newed" boost LinearAlgebra::Matrix pointer of size (nRows, nCols) into the matrix at nColu...
int numberOfOffDiagonalBlocks()
Returns number of off-diagonal matrix blocks.
void print(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
SparseBlockMatrix & operator=(const SparseBlockMatrix &src)
"Equals" operator.
~SparseBlockMatrix()
Destructor.
void printClean(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
LinearAlgebra::Matrix * getBlock(int column, int row)
Returns pointer to boost matrix at position (column, row).
bool setNumberOfColumns(int n)
Initializes number of columns (SparseBlockColumnMatrix).
int getLeadingColumnsForBlock(int nblockColumn)
Sums and returns the number of columns in each matrix block prior to nblockColumn.
int numberOfElements()
Returns number of matrix elements in matrix.
int numberOfElements()
Returns total number of matrix elements in map (NOTE: NOT the number of matrix blocks).
void print(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
void copy(const SparseBlockRowMatrix &src)
Copy method.
void printClean(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
SparseBlockRowMatrix & operator=(const SparseBlockRowMatrix &src)
"Equals" operator.
~SparseBlockRowMatrix()
Destructor.
void copyToBoost(boost::numeric::ublas::compressed_matrix< double > &B)
Copies a SparseBlockRowMatrix to a Boost compressed_matrix.
void zeroBlocks()
Sets all elements of all matrix blocks to zero.
void wipe()
Deletes all pointer elements and removes them from the map.
int getLeadingColumnsForBlock(int nblockColumn)
Sums and returns the number of columns in each matrix block prior to nblockColumn.
bool insertMatrixBlock(int nRowBlock, int nRows, int nCols)
Inserts a "newed" LinearAlgebra::Matrix pointer of size (nRows, nCols) into the map with the block ro...
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.