Isis 3 Programmer Reference
SparseBlockMatrix.cpp
1 #include "SparseBlockMatrix.h"
2 
3 // std lib
4 #include <iostream>
5 #include <iomanip>
6 
7 // qt lib
8 #include <QDataStream>
9 #include <QDebug>
10 #include <QMapIterator>
11 #include <QListIterator>
12 
13 // boost lib
14 #include <boost/numeric/ublas/matrix_sparse.hpp>
15 #include <boost/numeric/ublas/matrix_proxy.hpp>
16 #include <boost/numeric/ublas/io.hpp>
17 
18 // Isis lib
19 #include "IString.h"
20 #include "LinearAlgebra.h"
21 
22 using namespace boost::numeric::ublas;
23 
24 namespace Isis {
25 
29  SparseBlockColumnMatrix::SparseBlockColumnMatrix() {
30  m_startColumn = 0;
31  }
32 
33 
37  SparseBlockColumnMatrix::~SparseBlockColumnMatrix() {
38  wipe();
39  }
40 
41 
46  void SparseBlockColumnMatrix::wipe() {
47  qDeleteAll(values());
48  clear();
49  }
50 
51 
57  SparseBlockColumnMatrix::SparseBlockColumnMatrix(const SparseBlockColumnMatrix& src) {
58  copy(src);
59  }
60 
61 
67  void SparseBlockColumnMatrix::copy(const SparseBlockColumnMatrix& src) {
68  // handi-wipe
69  wipe();
70 
71  // copy matrix blocks from src
72  QMapIterator<int, LinearAlgebra::Matrix *> it(src);
73  while ( it.hasNext() ) {
74  it.next();
75 
76  // copy matrix block from src
77  LinearAlgebra::Matrix *m = new LinearAlgebra::Matrix(*(it.value()));
78 
79  // insert matrix into map
80  this->insert(it.key(),m);
81  }
82 
83  m_startColumn = src.startColumn();
84  }
85 
86 
93  SparseBlockColumnMatrix::operator=(const SparseBlockColumnMatrix& src) {
94  if ( this == &src )
95  return *this;
96 
97  copy(src);
98 
99  return *this;
100  }
101 
102 
115  bool SparseBlockColumnMatrix::insertMatrixBlock(int nColumnBlock, int nRows, int nCols) {
116  // check if matrix already exists at the key "nColumnBlock"
117  if ( this->contains(nColumnBlock) )
118  return true;
119 
120  // allocate matrix block with nRows and nCols
121  LinearAlgebra::Matrix *m = new LinearAlgebra::Matrix(nRows,nCols);
122 
123  if ( !m )
124  return false;
125 
126  // zero matrix elements
127  m->clear();
128 
129  // insert matrix into map
130  this->insert(nColumnBlock,m);
131 
132  return true;
133  }
134 
135 
141  void SparseBlockColumnMatrix::setStartColumn(int nStartColumn) {
142  m_startColumn = nStartColumn;
143  }
144 
145 
151  int SparseBlockColumnMatrix::startColumn() const {
152  return m_startColumn;
153  }
154 
155 
162  int SparseBlockColumnMatrix::numberOfElements() {
163  int nElements = 0;
164 
165  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
166  while ( it.hasNext() ) {
167  it.next();
168 
169  if( !it.value() )
170  continue;
171 
172  nElements += it.value()->size1()*it.value()->size2();
173  }
174 
175  return nElements;
176  }
177 
178 
184  int SparseBlockColumnMatrix::numberOfColumns() {
185 
186  int nColumns = 0;
187 
188  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
189  while ( it.hasNext() ) {
190  it.next();
191 
192  if( !it.value() )
193  continue;
194 
195  nColumns = it.value()->size2();
196  break;
197  }
198 
199  return nColumns;
200  }
201 
202 
209  int SparseBlockColumnMatrix::numberOfRows() {
210 
211  // iterate to last block (the diagonal one)
212  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
213  while ( it.hasNext() ) {
214  it.next();
215 
216  if( !it.value() )
217  continue;
218  }
219 
220  int nRows = it.value()->size1();
221 
222  return nRows;
223  }
224 
225 
233  void SparseBlockColumnMatrix::print(std::ostream& outstream) {
234  if ( size() == 0 ) {
235  outstream << "Empty SparseBlockColumnMatrix..." << std::endl;
236  return;
237  }
238 
239  outstream << "Printing SparseBlockColumnMatrix..." << std::endl;
240  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
241  while ( it.hasNext() ) {
242  it.next();
243 
244  if( it.value() )
245  outstream << it.key() << std::endl << *(it.value()) << std::endl
246  << std::endl;
247  else
248  outstream << "NULL block pointer at row[" << IString(it.key())
249  << "]!" << std::endl;
250  }
251  }
252 
253 
260  void SparseBlockColumnMatrix::printClean(std::ostream& outstream) {
261  if ( size() == 0 ) {
262  outstream << "Empty SparseBlockColumnMatrix..." << std::endl;
263  return;
264  }
265 
266  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
267  while ( it.hasNext() ) {
268  it.next();
269 
270  LinearAlgebra::Matrix * m = it.value();
271 
272  int rows = m->size1();
273  int cols = m->size2();
274 
275  for ( int i = 0; i < rows; i++ ) {
276  for ( int j = 0; j < cols; j++ ) {
277  double d = m->at_element(i,j);
278  if ( j == cols-1 )
279  outstream << std::setprecision(12) << d << std::endl;
280  else
281  outstream << std::setprecision(12) << d << ",";
282  }
283  }
284 
285  }
286  outstream << std::endl;
287  }
288 
289 
293  void SparseBlockColumnMatrix::zeroBlocks() {
294  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
295  while ( it.hasNext() ) {
296  it.next();
297  it.value()->clear();
298  }
299  }
300 
301 
308  QDataStream &operator<<(QDataStream &stream, const SparseBlockColumnMatrix &sbcm) {
309  // write number of blocks in this column
310  int nBlocks = sbcm.size();
311  stream << (qint32)nBlocks;
312 
313  QMapIterator<int, LinearAlgebra::Matrix *> it(sbcm);
314  while ( it.hasNext() ) {
315  it.next();
316 
317  if( !it.value() )
318  continue;
319 
320  int nRows = it.value()->size1();
321  int nCols = it.value()->size2();
322 
323  // write block number (key); rows (size1); and columns (size2)
324  stream << it.key() << (qint32)nRows << (qint32)nCols;
325 
326  double* data = &it.value()->data()[0];
327 
328  // write raw matrix data
329  stream.writeRawData((const char*)data, nRows*nCols*sizeof(double));
330  }
331 
332  return stream;
333  }
334 
335 
342  QDataStream &operator>>(QDataStream &stream, SparseBlockColumnMatrix &sbcm) {
343  qint32 nBlocks, nBlockNumber, nRows, nCols;
344  int i, r, c;
345 
346  stream >> nBlocks;
347 
348  for ( i = 0; i < nBlocks; i++ ) {
349  // read block number (key); rows (size1); and columns (size2)
350  stream >> nBlockNumber >> nRows >> nCols;
351 
352  double data[nRows*nCols];
353 
354  // read raw matrix data
355  stream.readRawData((char*)data, nRows*nCols*sizeof(double));
356 
357  // insert matrix at correct key
358  sbcm.insertMatrixBlock(nBlockNumber, nRows, nCols);
359 
360  // get matrix
361  LinearAlgebra::Matrix *matrix = sbcm[nBlockNumber];
362 
363  // fill with data
364  for ( r = 0; r < nRows; r++ ) {
365  for ( c = 0; c < nCols; c++ ) {
366  int nLocation = r*nRows + c;
367  (*matrix)(r,c) = data[nLocation];
368  }
369  }
370  }
371 
372  return stream;
373  }
374 
375 
382  QDebug operator<<(QDebug dbg, const SparseBlockColumnMatrix &sbcm) {
383  dbg.space() << "New Block" << endl;
384 
385  QMapIterator<int, LinearAlgebra::Matrix *> it(sbcm);
386  while ( it.hasNext() ) {
387  it.next();
388 
389  if( !it.value() )
390  continue;
391 
392  // get matrix
393  LinearAlgebra::Matrix *matrix = it.value();
394 
395  // matrix rows, columns
396  int nRows = matrix->size1();
397  int nCols = matrix->size2();
398 
399  dbg.nospace() << qSetFieldWidth(4);
400  dbg.nospace() << qSetRealNumberPrecision(8);
401 
402  for ( int r = 0; r < nRows; r++ ) {
403  for ( int c = 0; c < nCols; c++ ) {
404  dbg.space() << (*matrix)(r,c);
405  }
406  dbg.space() << endl;
407  }
408 
409  dbg.space() << endl;
410  }
411 
412  return dbg;
413  }
414 
415 
417  // SparseBlockRowMatrix methods
418 
422  SparseBlockRowMatrix::~SparseBlockRowMatrix() {
423  wipe();
424  }
425 
426 
431  void SparseBlockRowMatrix::wipe() {
432  qDeleteAll(values());
433  clear();
434  }
435 
436 
442  SparseBlockRowMatrix::SparseBlockRowMatrix(const SparseBlockRowMatrix& src) {
443  copy(src);
444  }
445 
446 
452  void SparseBlockRowMatrix::copy(const SparseBlockRowMatrix& src) {
453  // handi-wipe
454  wipe();
455 
456  // copy matrix blocks from src
457  QMapIterator<int, LinearAlgebra::Matrix *> it(src);
458  while ( it.hasNext() ) {
459  it.next();
460 
461  // copy matrix block from src
462  LinearAlgebra::Matrix *m = new LinearAlgebra::Matrix(*(it.value()));
463 
464  // insert matrix into map
465  this->insert(it.key(),m);
466  }
467  }
468 
469 
476  SparseBlockRowMatrix::operator=(const SparseBlockRowMatrix& src) {
477  if ( this == &src )
478  return *this;
479 
480  copy(src);
481 
482  return *this;
483  }
484 
485 
501  bool SparseBlockRowMatrix::insertMatrixBlock(int nRowBlock, int nRows, int nCols) {
502  if ( this->contains(nRowBlock) )
503  return false;
504 
505  LinearAlgebra::Matrix *m = new LinearAlgebra::Matrix(nRows,nCols);
506 
507  if ( !m )
508  return false;
509 
510  m->clear();
511 
512  this->insert(nRowBlock,m);
513 
514  return true;
515  }
516 
517 
524  int SparseBlockRowMatrix::numberOfElements() {
525  int nElements = 0;
526 
527  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
528  while ( it.hasNext() ) {
529  it.next();
530 
531  if( !it.value() )
532  continue;
533 
534  nElements += it.value()->size1()*it.value()->size2();
535  }
536 
537  return nElements;
538  }
539 
540 
546  void SparseBlockRowMatrix::print(std::ostream& outstream) {
547  if ( size() == 0 ) {
548  outstream << "Empty SparseBlockRowMatrix..." << std::endl;
549  return;
550  }
551 
552  outstream << "Printing SparseBlockRowMatrix..." << std::endl;
553  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
554  while ( it.hasNext() ) {
555  it.next();
556 
557  if( it.value() )
558  outstream << it.key() << std::endl << *(it.value()) << std::endl
559  << std::endl;
560  else
561  outstream << "NULL block pointer at column[" << IString(it.key())
562  << "]!" << std::endl;
563  }
564  }
565 
566 
572  void SparseBlockRowMatrix::printClean(std::ostream& outstream) {
573  if ( size() == 0 ) {
574  outstream << "Empty SparseBlockRowMatrix..." << std::endl;
575  return;
576  }
577 
578  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
579  while ( it.hasNext() ) {
580  it.next();
581 
582  LinearAlgebra::Matrix *m = it.value();
583 
584  int rows = m->size1();
585  int cols = m->size2();
586 
587  for ( int i = 0; i < rows; i++ ) {
588  for ( int j = 0; j < cols; j++ ) {
589  double d = m->at_element(i,j);
590  if ( j == cols-1 )
591  outstream << std::setprecision(9) << d << std::endl;
592  else
593  outstream << std::setprecision(9) << d << ",";
594  }
595  }
596 
597  }
598  outstream << std::endl;
599  }
600 
601 
605  void SparseBlockRowMatrix::zeroBlocks() {
606  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
607  while ( it.hasNext() ) {
608  it.next();
609  it.value()->clear();
610  }
611  }
612 
613 
620  void SparseBlockRowMatrix::copyToBoost(compressed_matrix<double>& B) {
621  B.clear();
622 
623  int ncols, nstart, nend, nrowBlock;
624  range rRow = range(0,3);
625  range rCol;
626 
627  QMapIterator<int, LinearAlgebra::Matrix *> it(*this);
628  while ( it.hasNext() ) {
629  it.next();
630 
631  nrowBlock = it.key();
632  LinearAlgebra::Matrix *m = it.value();
633 
634  ncols = m->size2();
635 
636  nstart = nrowBlock*ncols;
637  nend = nstart + ncols;
638 
639  rCol = range(nstart,nend);
640 
641  matrix_range<compressed_matrix<double> > m1 (B, rRow, rCol);
642 
643  m1 = *m;
644  }
645  }
646 
647 
655  int SparseBlockRowMatrix::getLeadingColumnsForBlock(int nblockColumn) {
656 
657  if ( nblockColumn == 0 )
658  return 0;
659 
660  int nLeadingColumnsElements = 0;
661 
662  int nCol = 0;
663 
664  while ( nCol < nblockColumn ) {
665  if ( !(*this)[nCol] ) {
666  nCol++;
667  continue;
668  }
669 
670  int ncolumns = (*this)[nCol]->size2();
671 
672  if ( ncolumns == -1 )
673  continue;
674 
675  nLeadingColumnsElements += ncolumns;
676 
677  nCol++;
678  }
679 
680  return nLeadingColumnsElements;
681  }
682 
683 
690  QDataStream &operator<<(QDataStream &stream, const SparseBlockRowMatrix &sbrm) {
691  // write number of blocks in this column
692  int nBlocks = sbrm.size();
693  stream << (qint32)nBlocks;
694 
695  QMapIterator<int, LinearAlgebra::Matrix *> it(sbrm);
696  while ( it.hasNext() ) {
697  it.next();
698 
699  if( !it.value() )
700  continue;
701 
702  int nRows = it.value()->size1();
703  int nCols = it.value()->size2();
704 
705  // write block number (key); rows (size1); and columns (size2)
706  stream << it.key() << (qint32)nRows << (qint32)nCols;
707 
708  double* data = &it.value()->data()[0];
709 
710  // write raw matrix data
711  stream.writeRawData((const char*)data, nRows*nCols*sizeof(double));
712  }
713 
714  return stream;
715  }
716 
717 
724  QDataStream &operator>>(QDataStream &stream, SparseBlockRowMatrix &sbrm) {
725  qint32 nBlocks, nBlockNumber, nRows, nCols;
726  int i, r, c;
727 
728  stream >> nBlocks;
729 
730  for ( i = 0; i < nBlocks; i++ ) {
731  // read block number (key); rows (size1); and columns (size2)
732  stream >> nBlockNumber >> nRows >> nCols;
733 
734  double data[nRows*nCols];
735 
736  // read raw matrix data
737  stream.readRawData((char*)data, nRows*nCols*sizeof(double));
738 
739  // insert matrix at correct key
740  sbrm.insertMatrixBlock(nBlockNumber, nRows, nCols);
741 
742  // get matrix
743  LinearAlgebra::Matrix *matrix = sbrm[nBlockNumber];
744 
745  // fill with data
746  for ( r = 0; r < nRows; r++ ) {
747  for ( c = 0; c < nCols; c++ ) {
748  int nLocation = r*nRows + c;
749  (*matrix)(r,c) = data[nLocation];
750  }
751  }
752  }
753 
754  return stream;
755  }
756 
757 
764  QDebug operator<<(QDebug dbg, const SparseBlockRowMatrix &sbrm) {
765  dbg.space() << "New Block" << endl;
766 
767  QMapIterator<int, LinearAlgebra::Matrix *> it(sbrm);
768  while ( it.hasNext() ) {
769  it.next();
770 
771  if( !it.value() )
772  continue;
773 
774  // get matrix
775  LinearAlgebra::Matrix *matrix = it.value();
776 
777  // matrix rows, columns
778  int nRows = matrix->size1();
779  int nCols = matrix->size2();
780 
781  dbg.nospace() << qSetFieldWidth(4);
782  dbg.nospace() << qSetRealNumberPrecision(8);
783 
784  for ( int r = 0; r < nRows; r++ ) {
785  for ( int c = 0; c < nCols; c++ ) {
786  dbg.space() << (*matrix)(r,c);
787  }
788  dbg.space() << endl;
789  }
790  dbg.space() << endl;
791  }
792 
793  return dbg;
794  }
795 
796 
798  // SparseBlockMatrix methods
799 
803  SparseBlockMatrix::~SparseBlockMatrix() {
804  wipe();
805  }
806 
807 
812  void SparseBlockMatrix::wipe() {
813  qDeleteAll(*this);
814  clear();
815  }
816 
817 
823  SparseBlockMatrix::SparseBlockMatrix(const SparseBlockMatrix& src) {
824  copy(src);
825  }
826 
827 
833  void SparseBlockMatrix::copy(const SparseBlockMatrix& src) {
834  // handi-wipe
835  wipe();
836 
837  // copy all SparseBlockColumnMatrix objects from src
838  for( int i = 0; i < src.size(); i++ ) {
839  append( new SparseBlockColumnMatrix(*(src.at(i))));
840  }
841  }
842 
843 
849  SparseBlockMatrix& SparseBlockMatrix::operator=(const SparseBlockMatrix& src) {
850  if ( this == &src )
851  return *this;
852 
853  copy(src);
854 
855  return *this;
856  }
857 
858 
867  bool SparseBlockMatrix::setNumberOfColumns( int n ) {
868 
869  for( int i = 0; i < n; i++ )
870  append( new SparseBlockColumnMatrix() );
871 
872  return true;
873  }
874 
875 
889  bool SparseBlockMatrix::insertMatrixBlock(int nColumnBlock, int nRowBlock, int nRows, int nCols) {
890  return (*this)[nColumnBlock]->insertMatrixBlock(nRowBlock, nRows, nCols);
891  }
892 
893 
899  int SparseBlockMatrix::numberOfBlocks() {
900  int nBlocks = 0;
901 
902  for( int i = 0; i < size(); i++ ) {
903  if ( !(*this)[i] )
904  continue;
905 
906  nBlocks += (*this)[i]->size();
907  }
908 
909  return nBlocks;
910  }
911 
912 
918  int SparseBlockMatrix::numberOfDiagonalBlocks() {
919  int ndiagBlocks = 0;
920 
921  for( int i = 0; i < size(); i++ ) {
922  SparseBlockColumnMatrix* column = at(i);
923 
924  if ( !column )
925  continue;
926 
927  QMapIterator<int, LinearAlgebra::Matrix *> it(*column);
928  while ( it.hasNext() ) {
929  it.next();
930 
931  if( it.key() == i ) {
932  ndiagBlocks++;
933  break;
934  }
935  }
936  }
937 
938  return ndiagBlocks;
939  }
940 
941 
947  int SparseBlockMatrix::numberOfOffDiagonalBlocks() {
948  return (numberOfBlocks() - numberOfDiagonalBlocks());
949  }
950 
951 
957  int SparseBlockMatrix::numberOfElements() {
958  int nElements = 0;
959 
960  for( int i = 0; i < size(); i++ ) {
961  if ( !(*this)[i] )
962  continue;
963 
964  nElements += (*this)[i]->numberOfElements();
965  }
966 
967  return nElements;
968  }
969 
970 
980  LinearAlgebra::Matrix *SparseBlockMatrix::getBlock(int column, int row) {
981  return (*(*this)[column])[row];
982  }
983 
984 
988  void SparseBlockMatrix::zeroBlocks() {
989  for ( int i = 0; i < size(); i++ )
990  (*this)[i]->zeroBlocks();
991  }
992 
993 
999  void SparseBlockMatrix::print(std::ostream& outstream) {
1000  if ( size() == 0 ) {
1001  outstream << "Empty SparseBlockMatrix..." << std::endl;
1002  return;
1003  }
1004 
1005  outstream << "Printing SparseBlockMatrix..." << std::endl;
1006  for( int i = 0; i < size(); i++ ) {
1007  SparseBlockColumnMatrix* column = at(i);
1008 
1009  if ( column )
1010  column->print(outstream);
1011  else
1012  outstream << "NULL column pointer at column[" << IString(i)
1013  << "]!" << std::endl;
1014  }
1015  }
1016 
1017 
1023  void SparseBlockMatrix::printClean(std::ostream& outstream) {
1024  if ( size() == 0 ) {
1025  outstream << "Empty SparseBlockMatrix..." << std::endl;
1026  return;
1027  }
1028 
1029  for( int i = 0; i < size(); i++ ) {
1030  SparseBlockColumnMatrix* column = at(i);
1031 
1032  if ( column )
1033  column->printClean(outstream);
1034  else
1035  outstream << "NULL column pointer at column[" << IString(i)
1036  << "]!" << std::endl;
1037  }
1038  }
1039 
1040 
1048  int SparseBlockMatrix::getLeadingColumnsForBlock(int nblockColumn) {
1049 
1050  if ( nblockColumn == 0 )
1051  return 0;
1052 
1053  int nLeadingColumnsElements = 0;
1054 
1055  int nCol = 0;
1056 
1057  while ( nCol < nblockColumn ) {
1058  if ( !(*this)[nCol] )
1059  continue;
1060 
1061  int ncolumns = (*this)[nCol]->numberOfColumns();
1062 
1063  if ( ncolumns == -1 )
1064  continue;
1065 
1066  nLeadingColumnsElements += ncolumns;
1067 
1068  nCol++;
1069  }
1070 
1071  return nLeadingColumnsElements;
1072  }
1073 
1074 
1082  int SparseBlockMatrix::getLeadingRowsForBlock(int nblockRow) {
1083 
1084  if ( nblockRow == 0 )
1085  return 0;
1086 
1087  int i = 0;
1088  int nLeadingRows = 0;
1089 
1090  while ( i < nblockRow ) {
1091  SparseBlockColumnMatrix* column = at(i);
1092 
1093  if ( !column )
1094  continue;
1095 
1096  QMapIterator<int, LinearAlgebra::Matrix *> it(*column);
1097  // iterate to last element in column
1098  while ( it.hasNext() ) {
1099  it.next();
1100 
1101  if( it.key() == i )
1102  nLeadingRows += it.value()->size1();
1103  }
1104  i++;
1105  }
1106 
1107  return nLeadingRows;
1108  }
1109 
1110 
1117  QDataStream &operator<<(QDataStream &stream, const SparseBlockMatrix &sparseBlockMatrix) {
1118  int nBlockColumns = sparseBlockMatrix.size();
1119 
1120  stream << (qint32)nBlockColumns;
1121 
1122  for ( int i =0; i < nBlockColumns; i++ )
1123  stream << *sparseBlockMatrix.at(i);
1124 
1125  return stream;
1126  }
1127 
1128 
1135  QDataStream &operator>>(QDataStream &stream, SparseBlockMatrix &sparseBlockMatrix) {
1136  qint32 nBlockColumns;
1137 
1138  // read and set number of block columns
1139  stream >> nBlockColumns;
1140  sparseBlockMatrix.setNumberOfColumns(nBlockColumns);
1141 
1142  for ( int i =0; i < nBlockColumns; i++ )
1143  stream >> *sparseBlockMatrix.at(i);
1144 
1145  return stream;
1146  }
1147 
1154  QDebug operator<<(QDebug dbg, const SparseBlockMatrix &m) {
1155  int nBlockColumns = m.size();
1156 
1157  for ( int i =0; i < nBlockColumns; i++ )
1158  dbg << *m.at(i);
1159 
1160  return dbg;
1161  }
1162 }
SparseBlockMatrix.
SparseBlockColumnMatrix.
boost::numeric::ublas::matrix< double > Matrix
Definition for an Isis::LinearAlgebra::Matrix of doubles.
void printClean(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
Definition: Angle.cpp:383
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...
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:463
void print(std::ostream &outstream)
Prints matrix blocks to std output stream out for debugging.
Adds specific functionality to C++ strings.
Definition: IString.h:181
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
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...
bool setNumberOfColumns(int n)
Initializes number of columns (SparseBlockColumnMatrix).
int startColumn() const
Sets starting column for block in full matrix.
SparseBlockRowMatrix.