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

#include <newmat.h>

Inheritance diagram for UpperBandMatrix:
BandMatrix GeneralMatrix BaseMatrix

Public Member Functions

 UpperBandMatrix ()
 
 ~UpperBandMatrix ()
 
 UpperBandMatrix (int n, int ubw)
 
 UpperBandMatrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const UpperBandMatrix &m)
 
MatrixType Type () const
 
 UpperBandMatrix (const UpperBandMatrix &gm)
 
GeneralMatrixMakeSolver ()
 
void Solver (MatrixColX &, const MatrixColX &)
 
LogAndSign LogDeterminant () const
 
void ReSize (int, int, int)
 
void ReSize (int n, int ubw)
 
void ReSize (const GeneralMatrix &A)
 
Real & operator() (int, int)
 
Real operator() (int, int) const
 
Real & element (int, int)
 
Real element (int, int) const
 
- Public Member Functions inherited from BandMatrix
 BandMatrix ()
 
 ~BandMatrix ()
 
 BandMatrix (int n, int lb, int ub)
 
 BandMatrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const BandMatrix &m)
 
Real & operator() (int, int)
 
Real & element (int, int)
 
Real operator() (int, int) const
 
Real element (int, int) const
 
 BandMatrix (const BandMatrix &gm)
 
Real Trace () const
 
Real SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
Real MaximumAbsoluteValue () const
 
Real MinimumAbsoluteValue () const
 
Real Maximum () const
 
Real Minimum () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void RestoreCol (MatrixRowCol &)
 
void RestoreCol (MatrixColX &c)
 
void NextRow (MatrixRowCol &)
 
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 *)
 
MatrixInput operator<< (Real)
 
MatrixInput operator<< (int f)
 
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 RestoreRow (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
 

Private Member Functions

GeneralMatrixImage () const
 

Additional Inherited Members

- Public Attributes inherited from BandMatrix
int lower
 
int upper
 
- Protected Member Functions inherited from BandMatrix
void CornerClear () const
 
short SimpleAddOK (const GeneralMatrix *gm)
 
- 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
 
virtual GeneralMatrixTranspose (TransposedMatrix *, MatrixType)
 
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 992 of file newmat.h.

Constructor & Destructor Documentation

◆ UpperBandMatrix() [1/4]

UpperBandMatrix::UpperBandMatrix ( )
inline

Definition at line 996 of file newmat.h.

Referenced by Image().

996 :BandMatrix() {}
BandMatrix()
Definition: newmat.h:937

◆ ~UpperBandMatrix()

UpperBandMatrix::~UpperBandMatrix ( )
inline

Definition at line 997 of file newmat.h.

997 {}

◆ UpperBandMatrix() [2/4]

UpperBandMatrix::UpperBandMatrix ( int  n,
int  ubw 
)
inline

Definition at line 998 of file newmat.h.

999  : BandMatrix(n, 0, ubw) {}
BandMatrix()
Definition: newmat.h:937
os2<< "> n<< " > nendobj n

◆ UpperBandMatrix() [3/4]

UpperBandMatrix::UpperBandMatrix ( const BaseMatrix M)

Definition at line 196 of file bandmat.cpp.

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

197 {
198  REPORT // CheckConversion(M);
199  // MatrixConversionCheck mcc;
201  GetMatrix(gmx); CornerClear();
202 }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
void CornerClear() const
Definition: bandmat.cpp:157
#define REPORT
Definition: bandmat.cpp:24
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

◆ UpperBandMatrix() [4/4]

UpperBandMatrix::UpperBandMatrix ( const UpperBandMatrix gm)
inline

Definition at line 1005 of file newmat.h.

1005 :BandMatrix(gm) { GetMatrix(&gm); }
BandMatrix()
Definition: newmat.h:937
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

Member Function Documentation

◆ element() [1/2]

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

Definition at line 801 of file newmat6.cpp.

References n, and REPORT.

802 {
803  REPORT
804  int w = upper+1; int i = n-m;
805  if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
806  Throw(IndexException(m,n,*this,true));
807  return store[w*m+i];
808 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936

◆ element() [2/2]

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

Definition at line 810 of file newmat6.cpp.

References n, and REPORT.

811 {
812  REPORT
813  int w = upper+1; int i = n-m;
814  if (m<0 || m>= nrows || n<0 || n>= ncols || i<0 || i>=w)
815  Throw(IndexException(m,n,*this,true));
816  return store[w*m+i];
817 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936

◆ Image()

GeneralMatrix * UpperBandMatrix::Image ( ) const
privatevirtual

Reimplemented from BandMatrix.

Definition at line 803 of file newmat4.cpp.

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

804 {
805  REPORT
806  GeneralMatrix* gm = new UpperBandMatrix(*this); MatrixErrorNoSpace(gm);
807  return gm;
808 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ LogDeterminant()

LogAndSign UpperBandMatrix::LogDeterminant ( ) const
virtual

Reimplemented from BandMatrix.

Definition at line 413 of file bandmat.cpp.

References REPORT.

414 {
415  REPORT
416  int i = nrows; LogAndSign sum; Real* s = store; int j = upper + 1;
417 // while (i--) { sum *= *s; s += j; }
418  if (i) for (;;) { sum *= *s; if (!(--i)) break; s += j; }
419  ((GeneralMatrix&)*this).tDelete(); return sum;
420 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936
#define REPORT
Definition: bandmat.cpp:24

◆ MakeSolver()

GeneralMatrix* UpperBandMatrix::MakeSolver ( )
inlinevirtual

Reimplemented from BandMatrix.

Definition at line 1006 of file newmat.h.

1006 { return this; }

◆ operator()() [1/2]

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

Definition at line 101 of file newmat6.cpp.

References n, and REPORT.

102 {
103  REPORT
104  int w = upper+1; int i = n-m;
105  if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
106  Throw(IndexException(m,n,*this));
107  return store[w*(m-1)+i];
108 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936

◆ operator()() [2/2]

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

Definition at line 213 of file newmat6.cpp.

References n, and REPORT.

214 {
215  REPORT
216  int w = upper+1; int i = n-m;
217  if (m<=0 || m>nrows || n<=0 || n>ncols || i<0 || i>=w)
218  Throw(IndexException(m,n,*this));
219  return store[w*(m-1)+i];
220 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936

◆ operator=() [1/3]

void UpperBandMatrix::operator= ( const BaseMatrix X)

Definition at line 204 of file bandmat.cpp.

References REPORT, and MatrixType::UB.

205 {
206  REPORT // CheckConversion(X);
207  // MatrixConversionCheck mcc;
209 }
void CornerClear() const
Definition: bandmat.cpp:157
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637
#define REPORT
Definition: bandmat.cpp:24

◆ operator=() [2/3]

void UpperBandMatrix::operator= ( Real  f)
inline

Definition at line 1002 of file newmat.h.

References GeneralMatrix::operator=().

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

◆ operator=() [3/3]

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

Definition at line 1003 of file newmat.h.

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

◆ ReSize() [1/3]

void UpperBandMatrix::ReSize ( int  n,
int  lb,
int  ub 
)
virtual

Reimplemented from BandMatrix.

Definition at line 81 of file bandmat.cpp.

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

82 {
83  REPORT
84  if (lb != 0)
85  {
86  Tracer tr("UpperBandMatrix::ReSize");
87  Throw(ProgramException("UpperBandMatrix with non-zero lower band" ));
88  }
89  BandMatrix::ReSize(n, lb, ub);
90 }
virtual void ReSize(int, int, int)
Definition: bandmat.cpp:46
os2<< "> n<< " > nendobj n
#define REPORT
Definition: bandmat.cpp:24

◆ ReSize() [2/3]

void UpperBandMatrix::ReSize ( int  n,
int  ubw 
)
inline

Definition at line 1010 of file newmat.h.

References n, and BandMatrix::ReSize().

1011  { BandMatrix::ReSize(n,0,ubw); }
virtual void ReSize(int, int, int)
Definition: bandmat.cpp:46
os2<< "> n<< " > nendobj n

◆ ReSize() [3/3]

void UpperBandMatrix::ReSize ( const GeneralMatrix A)
inlinevirtual

Reimplemented from BandMatrix.

Definition at line 1012 of file newmat.h.

References A, and BandMatrix::ReSize().

1012 { BandMatrix::ReSize(A); }
#define A(r, c)
virtual void ReSize(int, int, int)
Definition: bandmat.cpp:46

◆ Solver()

void UpperBandMatrix::Solver ( MatrixColX mcout,
const MatrixColX mcin 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 354 of file bandmat.cpp.

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

356 {
357  REPORT
358  int i = mcin.skip-mcout.skip; Real* elx = mcin.data-i;
359  while (i-- > 0) *elx++ = 0.0;
360  int nr = mcin.skip+mcin.storage;
361  elx = mcin.data+mcin.storage; Real* el = elx;
362  int j = mcout.skip+mcout.storage-nr; i = nr-mcout.skip;
363  while (j-- > 0) *elx++ = 0.0;
364 
365  Real* Ael = store + (upper+1)*(i-1)+1; j = 0;
366  if (i > 0) for(;;)
367  {
368  elx = el; Real sum = 0.0; int jx = j;
369  while (jx--) sum += *(--Ael) * *(--elx);
370  elx--; *elx = (*elx - sum) / *(--Ael);
371  if (--i <= 0) break;
372  if (j<upper) Ael -= upper - (++j); else el--;
373  }
374 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmat.h:393
int upper
Definition: newmat.h:936
#define REPORT
Definition: bandmat.cpp:24

◆ Type()

MatrixType UpperBandMatrix::Type ( ) const
virtual

Reimplemented from BandMatrix.

Definition at line 423 of file newmat4.cpp.

References MatrixType::UB.

423 { return MatrixType::UB; }

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