OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | Private Member Functions | List of all members
SymmetricBandMatrix Class Reference

#include <newmat.h>

Inheritance diagram for SymmetricBandMatrix:
GeneralMatrix BaseMatrix

Public Member Functions

 SymmetricBandMatrix ()
 
 ~SymmetricBandMatrix ()
 
 SymmetricBandMatrix (int n, int lb)
 
 SymmetricBandMatrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const SymmetricBandMatrix &m)
 
Real & operator() (int, int)
 
Real & element (int, int)
 
Real operator() (int, int) const
 
Real element (int, int) const
 
MatrixType Type () const
 
 SymmetricBandMatrix (const SymmetricBandMatrix &gm)
 
GeneralMatrixMakeSolver ()
 
Real SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
Real MaximumAbsoluteValue () const
 
Real MinimumAbsoluteValue () const
 
Real Maximum () const
 
Real Minimum () const
 
Real Trace () const
 
LogAndSign LogDeterminant () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void RestoreCol (MatrixRowCol &)
 
void RestoreCol (MatrixColX &)
 
GeneralMatrixTranspose (TransposedMatrix *, MatrixType)
 
void ReSize (int, int)
 
void ReSize (const GeneralMatrix &A)
 
bool SameStorageType (const GeneralMatrix &A) const
 
void ReSizeForAdd (const GeneralMatrix &A, const GeneralMatrix &B)
 
void ReSizeForSP (const GeneralMatrix &A, const GeneralMatrix &B)
 
MatrixBandWidth BandWidth () const
 
void SetParameters (const GeneralMatrix *)
 
void operator<< (const Real *r)
 
void operator<< (const int *r)
 
void operator<< (const BaseMatrix &X)
 
- Public Member Functions inherited from GeneralMatrix
GeneralMatrixEvaluate (MatrixType mt=MatrixTypeUnSp)
 
int Nrows () const
 
int Ncols () const
 
int Storage () const
 
RealStore () const
 
virtual ~GeneralMatrix ()
 
void tDelete ()
 
bool reuse ()
 
void Protect ()
 
int Tag () const
 
bool IsZero () const
 
void Release ()
 
void Release (int t)
 
void ReleaseAndDelete ()
 
void operator<< (const Real *)
 
void operator<< (const int *)
 
void operator<< (const BaseMatrix &X)
 
void Inject (const GeneralMatrix &)
 
void operator+= (const BaseMatrix &)
 
void operator-= (const BaseMatrix &)
 
void operator*= (const BaseMatrix &)
 
void operator|= (const BaseMatrix &)
 
void operator &= (const BaseMatrix &)
 
void operator+= (Real)
 
void operator-= (Real r)
 
void operator*= (Real)
 
void operator/= (Real r)
 
virtual void Solver (MatrixColX &, const MatrixColX &)
 
virtual void RestoreRow (MatrixRowCol &)
 
virtual void NextRow (MatrixRowCol &)
 
virtual void NextCol (MatrixRowCol &)
 
virtual void NextCol (MatrixColX &)
 
Real MaximumAbsoluteValue1 (int &i) const
 
Real MinimumAbsoluteValue1 (int &i) const
 
Real Maximum1 (int &i) const
 
Real Minimum1 (int &i) const
 
Real MaximumAbsoluteValue2 (int &i, int &j) const
 
Real MinimumAbsoluteValue2 (int &i, int &j) const
 
Real Maximum2 (int &i, int &j) const
 
Real Minimum2 (int &i, int &j) const
 
virtual bool IsEqual (const GeneralMatrix &) const
 
void CheckStore () const
 
 operator ReturnMatrix () const
 
ReturnMatrix ForReturn () const
 
MatrixInput operator<< (Real)
 
MatrixInput operator<< (int f)
 
void CleanUp ()
 
- Public Member Functions inherited from BaseMatrix
AddedMatrix operator+ (const BaseMatrix &) const
 
MultipliedMatrix operator* (const BaseMatrix &) const
 
SubtractedMatrix operator- (const BaseMatrix &) const
 
ConcatenatedMatrix operator| (const BaseMatrix &) const
 
StackedMatrix operator & (const BaseMatrix &) const
 
ShiftedMatrix operator+ (Real) const
 
ScaledMatrix operator* (Real) const
 
ScaledMatrix operator/ (Real) const
 
ShiftedMatrix operator- (Real) const
 
TransposedMatrix t () const
 
NegatedMatrix operator- () const
 
ReversedMatrix Reverse () const
 
InvertedMatrix i () const
 
RowedMatrix AsRow () const
 
ColedMatrix AsColumn () const
 
DiagedMatrix AsDiagonal () const
 
MatedMatrix AsMatrix (int, int) const
 
GetSubMatrix SubMatrix (int, int, int, int) const
 
GetSubMatrix SymSubMatrix (int, int) const
 
GetSubMatrix Row (int) const
 
GetSubMatrix Rows (int, int) const
 
GetSubMatrix Column (int) const
 
GetSubMatrix Columns (int, int) const
 
Real AsScalar () const
 
Real Determinant () const
 
Real NormFrobenius () const
 
Real Norm1 () const
 
Real NormInfinity () const
 
void IEQND () const
 

Public Attributes

int lower
 

Private Member Functions

GeneralMatrixImage () const
 
void CornerClear () const
 
short SimpleAddOK (const GeneralMatrix *gm)
 

Additional Inherited Members

- Protected Member Functions inherited from GeneralMatrix
 GeneralMatrix ()
 
 GeneralMatrix (ArrayLengthSpecifier)
 
void Add (GeneralMatrix *, Real)
 
void Add (Real)
 
void NegAdd (GeneralMatrix *, Real)
 
void NegAdd (Real)
 
void Multiply (GeneralMatrix *, Real)
 
void Multiply (Real)
 
void Negate (GeneralMatrix *)
 
void Negate ()
 
void ReverseElements ()
 
void ReverseElements (GeneralMatrix *)
 
void operator= (Real)
 
Real * GetStore ()
 
GeneralMatrixBorrowStore (GeneralMatrix *, MatrixType)
 
void GetMatrix (const GeneralMatrix *)
 
void Eq (const BaseMatrix &, MatrixType)
 
void Eq (const GeneralMatrix &)
 
void Eq (const BaseMatrix &, MatrixType, bool)
 
void Eq2 (const BaseMatrix &, MatrixType)
 
int search (const BaseMatrix *) const
 
void CheckConversion (const BaseMatrix &)
 
void ReSize (int, int, int)
 
virtual void MiniCleanUp ()
 
void PlusEqual (const GeneralMatrix &gm)
 
void MinusEqual (const GeneralMatrix &gm)
 
void PlusEqual (Real f)
 
void MinusEqual (Real f)
 
- Protected Attributes inherited from GeneralMatrix
int tag
 
int nrows
 
int ncols
 
int storage
 
Realstore
 

Detailed Description

Definition at line 1056 of file newmat.h.

Constructor & Destructor Documentation

◆ SymmetricBandMatrix() [1/4]

SymmetricBandMatrix::SymmetricBandMatrix ( )
inline

Definition at line 1063 of file newmat.h.

Referenced by Image().

1063 :GeneralMatrix() { lower=0; CornerClear(); }
void CornerClear() const
Definition: bandmat.cpp:515

◆ ~SymmetricBandMatrix()

SymmetricBandMatrix::~SymmetricBandMatrix ( )
inline

Definition at line 1064 of file newmat.h.

1064 {}

◆ SymmetricBandMatrix() [2/4]

SymmetricBandMatrix::SymmetricBandMatrix ( int  n,
int  lb 
)
inline

Definition at line 1065 of file newmat.h.

References n.

1065 { ReSize(n,lb); CornerClear(); }
void CornerClear() const
Definition: bandmat.cpp:515
os2<< "> n<< " > nendobj n
void ReSize(int, int)
Definition: bandmat.cpp:449

◆ SymmetricBandMatrix() [3/4]

SymmetricBandMatrix::SymmetricBandMatrix ( const BaseMatrix M)

Definition at line 429 of file bandmat.cpp.

References GeneralMatrix::Evaluate(), REPORT, and MatrixType::SB.

430 {
431  REPORT // CheckConversion(M);
432  // MatrixConversionCheck mcc;
434  GetMatrix(gmx);
435 }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: bandmat.cpp:24
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

◆ SymmetricBandMatrix() [4/4]

SymmetricBandMatrix::SymmetricBandMatrix ( const SymmetricBandMatrix gm)
inline

Definition at line 1079 of file newmat.h.

1079 :GeneralMatrix(gm) { GetMatrix(&gm); }
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

Member Function Documentation

◆ BandWidth()

MatrixBandWidth SymmetricBandMatrix::BandWidth ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 530 of file bandmat.cpp.

References REPORT.

531  { REPORT return MatrixBandWidth(lower,lower); }
#define REPORT
Definition: bandmat.cpp:24

◆ CornerClear()

void SymmetricBandMatrix::CornerClear ( ) const
private

Definition at line 515 of file bandmat.cpp.

References REPORT.

516 {
517  // set unused parts of BandMatrix to zero
518  REPORT
519  int i = lower; Real* s = store; int bw = lower + 1;
520  if (i) for(;;)
521  {
522  int j = i;
523  Real* sj = s;
524  while (j--) *sj++ = 0.0;
525  if (!(--i)) break;
526  s += bw;
527  }
528 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real * store
Definition: newmat.h:393
#define REPORT
Definition: bandmat.cpp:24

◆ element() [1/2]

Real & SymmetricBandMatrix::element ( int  m,
int  n 
)

Definition at line 837 of file newmat6.cpp.

References n, and REPORT.

838 {
839  REPORT
840  int w = lower+1;
841  if (m>=n)
842  {
843  REPORT
844  int i = lower+n-m;
845  if ( m>=nrows || n<0 || i<0 )
846  Throw(IndexException(m,n,*this,true));
847  return store[w*m+i];
848  }
849  else
850  {
851  REPORT
852  int i = lower+m-n;
853  if ( n>=nrows || m<0 || i<0 )
854  Throw(IndexException(m,n,*this,true));
855  return store[w*n+i];
856  }
857 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ element() [2/2]

Real SymmetricBandMatrix::element ( int  m,
int  n 
) const

Definition at line 859 of file newmat6.cpp.

References n, and REPORT.

860 {
861  REPORT
862  int w = lower+1;
863  if (m>=n)
864  {
865  REPORT
866  int i = lower+n-m;
867  if ( m>=nrows || n<0 || i<0 )
868  Throw(IndexException(m,n,*this,true));
869  return store[w*m+i];
870  }
871  else
872  {
873  REPORT
874  int i = lower+m-n;
875  if ( n>=nrows || m<0 || i<0 )
876  Throw(IndexException(m,n,*this,true));
877  return store[w*n+i];
878  }
879 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ GetCol() [1/2]

void SymmetricBandMatrix::GetCol ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 685 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, HaveStore, MatrixRowCol::length, LoadOnEntry, MatrixErrorNoSpace(), MONITOR_REAL_NEW, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, StoreHere, and StoreOnExit.

686 {
687  // do not allow StoreHere
688  if (+(mrc.cw*StoreHere))
689  Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixRowCol&)"));
690 
691  int c=mrc.rowcol; int w1 = lower+1; mrc.length=nrows;
692  REPORT
693  int s = c-lower; int o = c*w1;
694  if (s<0) { w1 += s; o -= s; s = 0; }
695  mrc.skip = s;
696 
697  if (+(mrc.cw*DirectPart))
698  { REPORT mrc.data = store+o; mrc.storage = w1; }
699  else
700  {
701  // do not allow StoreOnExit and !DirectPart
702  if (+(mrc.cw*StoreOnExit))
703  Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixRowCol&)"));
704  int w = w1+lower; s += w-ncols; Real* ColCopy;
705  if (s>0) w -= s; mrc.storage = w; int w2 = w-w1;
706 
707  if ( +(mrc.cw*HaveStore) ) { REPORT ColCopy = mrc.data; }
708  else
709  {
710  REPORT ColCopy = new Real [2*lower+1]; MatrixErrorNoSpace(ColCopy);
711  MONITOR_REAL_NEW("Make (SmBGetCol)",2*lower+1,ColCopy)
712  mrc.cw += HaveStore; mrc.data = ColCopy;
713  }
714 
715  if (+(mrc.cw*LoadOnEntry))
716  {
717  REPORT
718  Real* Mstore = store+o;
719  while (w1--) *ColCopy++ = *Mstore++;
720  Mstore--;
721  while (w2--) { Mstore += lower; *ColCopy++ = *Mstore; }
722  }
723  }
724 }
double Real
Definition: include.h:57
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
LoadAndStoreFlag cw
Definition: newmatrc.h:44
#define MONITOR_REAL_NEW(Operation, Size, Pointer)
Definition: myexcept.h:317
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetCol() [2/2]

void SymmetricBandMatrix::GetCol ( MatrixColX mrc)
virtual

Implements GeneralMatrix.

Definition at line 726 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, MatrixRowCol::length, LoadOnEntry, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, MatrixColX::store, and StoreOnExit.

727 {
728  int c=mrc.rowcol; int w1 = lower+1; mrc.length=nrows;
729  if (+(mrc.cw*DirectPart))
730  {
731  REPORT
732  int b = c*w1+lower;
733  mrc.skip = c; c += w1-nrows; w1 -= c; mrc.storage = w1;
734  Real* ColCopy = mrc.data = mrc.store+mrc.skip;
735  if (+(mrc.cw*LoadOnEntry))
736  {
737  REPORT
738  Real* Mstore = store+b;
739  // while (w1--) { *ColCopy++ = *Mstore; Mstore += lower; }
740  if (w1) for (;;)
741  { *ColCopy++ = *Mstore; if (!(--w1)) break; Mstore += lower; }
742  }
743  }
744  else
745  {
746  REPORT
747  // do not allow StoreOnExit and !DirectPart
748  if (+(mrc.cw*StoreOnExit))
749  Throw(InternalException("SymmetricBandMatrix::GetCol(MatrixColX&)"));
750  int s = c-lower; int o = c*w1;
751  if (s<0) { w1 += s; o -= s; s = 0; }
752  mrc.skip = s;
753 
754  int w = w1+lower; s += w-ncols;
755  if (s>0) w -= s; mrc.storage = w; int w2 = w-w1;
756 
757  Real* ColCopy = mrc.data = mrc.store+mrc.skip;
758 
759  if (+(mrc.cw*LoadOnEntry))
760  {
761  REPORT
762  Real* Mstore = store+o;
763  while (w1--) *ColCopy++ = *Mstore++;
764  Mstore--;
765  while (w2--) { Mstore += lower; *ColCopy++ = *Mstore; }
766  }
767 
768  }
769 }
double Real
Definition: include.h:57
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmatrc.h:139
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetRow()

void SymmetricBandMatrix::GetRow ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 648 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, DirectPart, HaveStore, MatrixRowCol::length, LoadOnEntry, MatrixErrorNoSpace(), MONITOR_REAL_NEW, REPORT, MatrixRowCol::rowcol, MatrixRowCol::skip, MatrixRowCol::storage, and StoreOnExit.

649 {
650  REPORT
651  int r=mrc.rowcol; int s = r-lower; int w1 = lower+1; int o = r*w1;
652  mrc.length = ncols;
653  if (s<0) { w1 += s; o -= s; s = 0; }
654  mrc.skip = s;
655 
656  if (+(mrc.cw*DirectPart))
657  { REPORT mrc.data = store+o; mrc.storage = w1; }
658  else
659  {
660  // do not allow StoreOnExit and !DirectPart
661  if (+(mrc.cw*StoreOnExit))
662  Throw(InternalException("SymmetricBandMatrix::GetRow(MatrixRowCol&)"));
663  int w = w1+lower; s += w-ncols; Real* RowCopy;
664  if (s>0) w -= s; mrc.storage = w; int w2 = w-w1;
665  if (!(mrc.cw*HaveStore))
666  {
667  REPORT
668  RowCopy = new Real [2*lower+1]; MatrixErrorNoSpace(RowCopy);
669  MONITOR_REAL_NEW("Make (SmBGetRow)",2*lower+1,RowCopy)
670  mrc.cw += HaveStore; mrc.data = RowCopy;
671  }
672  else { REPORT RowCopy = mrc.data; }
673 
674  if (+(mrc.cw*LoadOnEntry))
675  {
676  REPORT
677  Real* Mstore = store+o;
678  while (w1--) *RowCopy++ = *Mstore++;
679  Mstore--;
680  while (w2--) { Mstore += lower; *RowCopy++ = *Mstore; }
681  }
682  }
683 }
double Real
Definition: include.h:57
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
LoadAndStoreFlag cw
Definition: newmatrc.h:44
#define MONITOR_REAL_NEW(Operation, Size, Pointer)
Definition: myexcept.h:317
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ Image()

GeneralMatrix * SymmetricBandMatrix::Image ( ) const
privatevirtual

Reimplemented from GeneralMatrix.

Definition at line 817 of file newmat4.cpp.

References MatrixErrorNoSpace(), REPORT, and SymmetricBandMatrix().

818 {
819  REPORT
821  return gm;
822 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ LogDeterminant()

LogAndSign SymmetricBandMatrix::LogDeterminant ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 440 of file bandmat.cpp.

References REPORT.

441 {
442  REPORT
443  BandLUMatrix C(*this); return C.LogDeterminant();
444 }
#define REPORT
Definition: bandmat.cpp:24

◆ MakeSolver()

GeneralMatrix * SymmetricBandMatrix::MakeSolver ( )
virtual

Reimplemented from GeneralMatrix.

Definition at line 422 of file bandmat.cpp.

References MatrixErrorNoSpace(), and REPORT.

423 {
424  REPORT
425  GeneralMatrix* gm = new BandLUMatrix(*this);
426  MatrixErrorNoSpace(gm); gm->ReleaseAndDelete(); return gm;
427 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: bandmat.cpp:24

◆ Maximum()

Real SymmetricBandMatrix::Maximum ( ) const
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1088 of file newmat.h.

References GeneralMatrix::Maximum2().

1088 { int i, j; return GeneralMatrix::Maximum2(i, j); }
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real Maximum2(int &i, int &j) const
Definition: newmat8.cpp:322

◆ MaximumAbsoluteValue()

Real SymmetricBandMatrix::MaximumAbsoluteValue ( ) const
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1084 of file newmat.h.

References GeneralMatrix::MaximumAbsoluteValue().

void CornerClear() const
Definition: bandmat.cpp:515
Real MaximumAbsoluteValue() const
Definition: newmat8.cpp:214

◆ Minimum()

Real SymmetricBandMatrix::Minimum ( ) const
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1089 of file newmat.h.

References GeneralMatrix::Minimum2().

1089 { int i, j; return GeneralMatrix::Minimum2(i, j); }
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real Minimum2(int &i, int &j) const
Definition: newmat8.cpp:337

◆ MinimumAbsoluteValue()

Real SymmetricBandMatrix::MinimumAbsoluteValue ( ) const
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1086 of file newmat.h.

References GeneralMatrix::MinimumAbsoluteValue2().

1087  { int i, j; return GeneralMatrix::MinimumAbsoluteValue2(i, j); }
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real MinimumAbsoluteValue2(int &i, int &j) const
Definition: newmat8.cpp:307

◆ operator()() [1/2]

Real & SymmetricBandMatrix::operator() ( int  m,
int  n 
)

Definition at line 119 of file newmat6.cpp.

References n, and REPORT.

120 {
121  REPORT
122  int w = lower+1;
123  if (m>=n)
124  {
125  REPORT
126  int i = lower+n-m;
127  if ( m>nrows || n<=0 || i<0 )
128  Throw(IndexException(m,n,*this));
129  return store[w*(m-1)+i];
130  }
131  else
132  {
133  REPORT
134  int i = lower+m-n;
135  if ( n>nrows || m<=0 || i<0 )
136  Throw(IndexException(m,n,*this));
137  return store[w*(n-1)+i];
138  }
139 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator()() [2/2]

Real SymmetricBandMatrix::operator() ( int  m,
int  n 
) const

Definition at line 231 of file newmat6.cpp.

References n, and REPORT.

232 {
233  REPORT
234  int w = lower+1;
235  if (m>=n)
236  {
237  REPORT
238  int i = lower+n-m;
239  if ( m>nrows || n<=0 || i<0 )
240  Throw(IndexException(m,n,*this));
241  return store[w*(m-1)+i];
242  }
243  else
244  {
245  REPORT
246  int i = lower+m-n;
247  if ( n>nrows || m<=0 || i<0 )
248  Throw(IndexException(m,n,*this));
249  return store[w*(n-1)+i];
250  }
251 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator<<() [1/3]

void SymmetricBandMatrix::operator<< ( const Real *  r)

Definition at line 456 of file newmat5.cpp.

457 { Throw(ProgramException("Cannot use array read with a BandMatrix")); }

◆ operator<<() [2/3]

void SymmetricBandMatrix::operator<< ( const int *  r)

Definition at line 459 of file newmat5.cpp.

460 { Throw(ProgramException("Cannot use array read with a BandMatrix")); }

◆ operator<<() [3/3]

void SymmetricBandMatrix::operator<< ( const BaseMatrix X)
inline

Definition at line 1107 of file newmat.h.

References GeneralMatrix::operator<<().

void operator<<(const Real *)
Definition: newmat6.cpp:422

◆ operator=() [1/3]

void SymmetricBandMatrix::operator= ( const BaseMatrix X)

Definition at line 508 of file bandmat.cpp.

References REPORT, and MatrixType::SB.

509 {
510  REPORT // CheckConversion(X);
511  // MatrixConversionCheck mcc;
512  Eq(X,MatrixType::SB);
513 }
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637
#define REPORT
Definition: bandmat.cpp:24

◆ operator=() [2/3]

void SymmetricBandMatrix::operator= ( Real  f)
inline

Definition at line 1068 of file newmat.h.

References GeneralMatrix::operator=().

void operator=(Real)
Definition: newmat6.cpp:342

◆ operator=() [3/3]

void SymmetricBandMatrix::operator= ( const SymmetricBandMatrix m)
inline

Definition at line 1069 of file newmat.h.

1069 { Eq(m); }
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ ReSize() [1/2]

void SymmetricBandMatrix::ReSize ( int  n,
int  lb 
)

Definition at line 449 of file bandmat.cpp.

References n, REPORT, and GeneralMatrix::ReSize().

450 {
451  REPORT
452  Tracer tr("SymmetricBandMatrix::ReSize");
453  if (lb<0) Throw(ProgramException("Undefined bandwidth"));
454  lower = (lb<=n) ? lb : n-1;
456 }
os2<< "> n<< " > nendobj n
void ReSize(int, int, int)
Definition: newmat4.cpp:216
#define REPORT
Definition: bandmat.cpp:24

◆ ReSize() [2/2]

void SymmetricBandMatrix::ReSize ( const GeneralMatrix A)
virtual

Reimplemented from GeneralMatrix.

Definition at line 458 of file bandmat.cpp.

References A, MatrixBandWidth::Lower(), n, REPORT, and MatrixBandWidth::Upper().

459 {
460  REPORT
461  int n = A.Nrows();
462  if (n != A.Ncols())
463  {
464  Tracer tr("SymmetricBandMatrix::ReSize(GM)");
465  Throw(NotSquareException(*this));
466  }
467  MatrixBandWidth mbw = A.BandWidth(); int b = mbw.Lower();
468  if (b != mbw.Upper())
469  {
470  Tracer tr("SymmetricBandMatrix::ReSize(GM)");
471  Throw(ProgramException("Upper and lower band-widths not equal"));
472  }
473  ReSize(n, b);
474 }
#define A(r, c)
int Lower() const
Definition: newmat.h:204
os2<< "> n<< " > nendobj n
int Upper() const
Definition: newmat.h:203
#define REPORT
Definition: bandmat.cpp:24
void ReSize(int, int)
Definition: bandmat.cpp:449

◆ ReSizeForAdd()

void SymmetricBandMatrix::ReSizeForAdd ( const GeneralMatrix A,
const GeneralMatrix B 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 483 of file bandmat.cpp.

485 {
486  REPORT
487  Tracer tr("SymmetricBandMatrix::ReSizeForAdd");
488  MatrixBandWidth A_BW = A.BandWidth(); MatrixBandWidth B_BW = B.BandWidth();
489  if ((A_BW.Lower() < 0) | (B_BW.Lower() < 0))
490  Throw(ProgramException("Can't ReSize to SymmetricBandMatrix" ));
491  // already know A and B are square
492  ReSize(A.Nrows(), my_max(A_BW.Lower(), B_BW.Lower()));
493 }
virtual MatrixBandWidth BandWidth() const
Definition: newmat4.cpp:431
#define A(r, c)
int Lower() const
Definition: newmat.h:204
#define REPORT
Definition: bandmat.cpp:24
void ReSize(int, int)
Definition: bandmat.cpp:449

◆ ReSizeForSP()

void SymmetricBandMatrix::ReSizeForSP ( const GeneralMatrix A,
const GeneralMatrix B 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 495 of file bandmat.cpp.

497 {
498  REPORT
499  Tracer tr("SymmetricBandMatrix::ReSizeForSP");
500  MatrixBandWidth A_BW = A.BandWidth(); MatrixBandWidth B_BW = B.BandWidth();
501  if ((A_BW.Lower() < 0) | (B_BW.Lower() < 0))
502  Throw(ProgramException("Can't ReSize to SymmetricBandMatrix" ));
503  // already know A and B are square
504  ReSize(A.Nrows(), my_min(A_BW.Lower(), B_BW.Lower()));
505 }
virtual MatrixBandWidth BandWidth() const
Definition: newmat4.cpp:431
#define A(r, c)
int Lower() const
Definition: newmat.h:204
#define REPORT
Definition: bandmat.cpp:24
void ReSize(int, int)
Definition: bandmat.cpp:449

◆ RestoreCol() [1/2]

void SymmetricBandMatrix::RestoreCol ( MatrixRowCol )
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1095 of file newmat.h.

1095 {}

◆ RestoreCol() [2/2]

void SymmetricBandMatrix::RestoreCol ( MatrixColX mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 771 of file newmat3.cpp.

References MatrixRowCol::data, REPORT, MatrixRowCol::rowcol, and MatrixRowCol::storage.

772 {
773  REPORT
774  int c = mrc.rowcol;
775  Real* Mstore = store + c*lower+c+lower;
776  Real* Cstore = mrc.data; int w = mrc.storage;
777  // while (w--) { *Mstore = *Cstore++; Mstore += lower; }
778  if (w) for (;;)
779  { *Mstore = *Cstore++; if (!(--w)) break; Mstore += lower; }
780 }
double Real
Definition: include.h:57
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ SameStorageType()

bool SymmetricBandMatrix::SameStorageType ( const GeneralMatrix A) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 476 of file bandmat.cpp.

References A, and REPORT.

477 {
478  if (Type() != A.Type()) { REPORT return false; }
479  REPORT
480  return BandWidth() == A.BandWidth();
481 }
#define A(r, c)
MatrixType Type() const
Definition: newmat4.cpp:425
MatrixBandWidth BandWidth() const
Definition: bandmat.cpp:530
#define REPORT
Definition: bandmat.cpp:24

◆ SetParameters()

void SymmetricBandMatrix::SetParameters ( const GeneralMatrix gmx)
virtual

Reimplemented from GeneralMatrix.

Definition at line 446 of file bandmat.cpp.

References BaseMatrix::BandWidth(), MatrixBandWidth::lower, and REPORT.

447 { REPORT lower = gmx->BandWidth().lower; }
virtual MatrixBandWidth BandWidth() const
Definition: newmat4.cpp:431
#define REPORT
Definition: bandmat.cpp:24

◆ SimpleAddOK()

short SymmetricBandMatrix::SimpleAddOK ( const GeneralMatrix gm)
privatevirtual

Reimplemented from GeneralMatrix.

Definition at line 73 of file bandmat.cpp.

References lower, and REPORT.

74 {
75  const SymmetricBandMatrix* bm = (const SymmetricBandMatrix*)gm;
76  if (bm->lower == lower) { REPORT return 0; }
77  else if (bm->lower > lower) { REPORT return 1; }
78  else { REPORT return 2; }
79 }
#define REPORT
Definition: bandmat.cpp:24

◆ Sum()

Real SymmetricBandMatrix::Sum ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 556 of file bandmat.cpp.

References REPORT.

557 {
558  REPORT
559  CornerClear();
560  Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows; int l=lower;
561  while (i--)
562  { int j = l; while (j--) sum2 += *s++; sum1 += *s++; }
563  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
564 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void CornerClear() const
Definition: bandmat.cpp:515
Real * store
Definition: newmat.h:393
#define REPORT
Definition: bandmat.cpp:24

◆ SumAbsoluteValue()

Real SymmetricBandMatrix::SumAbsoluteValue ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 546 of file bandmat.cpp.

References REPORT.

547 {
548  REPORT
549  CornerClear();
550  Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows; int l=lower;
551  while (i--)
552  { int j = l; while (j--) sum2 += std::fabs(*s++); sum1 += std::fabs(*s++); }
553  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
554 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void CornerClear() const
Definition: bandmat.cpp:515
Real * store
Definition: newmat.h:393
#define REPORT
Definition: bandmat.cpp:24

◆ SumSquare()

Real SymmetricBandMatrix::SumSquare ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 536 of file bandmat.cpp.

References REPORT, and square().

537 {
538  REPORT
539  CornerClear();
540  Real sum1=0.0; Real sum2=0.0; Real* s=store; int i=nrows; int l=lower;
541  while (i--)
542  { int j = l; while (j--) sum2 += square(*s++); sum1 += square(*s++); }
543  ((GeneralMatrix&)*this).tDelete(); return sum1 + 2.0 * sum2;
544 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
void CornerClear() const
Definition: bandmat.cpp:515
Real square(Real x)
Definition: bandmat.cpp:533
Real * store
Definition: newmat.h:393
#define REPORT
Definition: bandmat.cpp:24

◆ Trace()

Real SymmetricBandMatrix::Trace ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 592 of file newmat8.cpp.

References REPORT.

593 {
594  REPORT
595  int i = nrows; int w = lower+1;
596  Real sum = 0.0; Real* s = store+lower;
597  // while (i--) { sum += *s; s += w; }
598  if (i) for (;;) { sum += *s; if (!(--i)) break; s += w; }
599  ((GeneralMatrix&)*this).tDelete(); return sum;
600 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ Transpose()

GeneralMatrix * SymmetricBandMatrix::Transpose ( TransposedMatrix ,
MatrixType  mt 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 437 of file bandmat.cpp.

References REPORT.

438 { REPORT return Evaluate(mt); }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: bandmat.cpp:24

◆ Type()

MatrixType SymmetricBandMatrix::Type ( ) const
virtual

Implements GeneralMatrix.

Definition at line 425 of file newmat4.cpp.

References MatrixType::SB.

425 { return MatrixType::SB; }

Member Data Documentation

◆ lower

int SymmetricBandMatrix::lower

Definition at line 1062 of file newmat.h.

Referenced by Cholesky(), and SimpleAddOK().


The documentation for this class was generated from the following files: