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

#include <newmat.h>

Inheritance diagram for LowerTriangularMatrix:
GeneralMatrix BaseMatrix

Public Member Functions

 LowerTriangularMatrix ()
 
 ~LowerTriangularMatrix ()
 
 LowerTriangularMatrix (ArrayLengthSpecifier)
 
 LowerTriangularMatrix (const LowerTriangularMatrix &gm)
 
 LowerTriangularMatrix (const BaseMatrix &M)
 
void operator= (const BaseMatrix &)
 
void operator= (Real f)
 
void operator= (const LowerTriangularMatrix &m)
 
Real & operator() (int, int)
 
Real & element (int, int)
 
Real operator() (int, int) const
 
Real element (int, int) const
 
MatrixType Type () const
 
GeneralMatrixMakeSolver ()
 
void Solver (MatrixColX &, const MatrixColX &)
 
LogAndSign LogDeterminant () const
 
Real Trace () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void RestoreCol (MatrixRowCol &)
 
void RestoreCol (MatrixColX &c)
 
void NextRow (MatrixRowCol &)
 
void ReSize (int)
 
void ReSize (const GeneralMatrix &A)
 
MatrixBandWidth BandWidth () const
 
void operator+= (const LowerTriangularMatrix &M)
 
void operator-= (const LowerTriangularMatrix &M)
 
void operator+= (Real f)
 
void operator-= (Real f)
 
- 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 SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
Real MaximumAbsoluteValue1 (int &i) const
 
Real MinimumAbsoluteValue1 (int &i) const
 
Real Maximum1 (int &i) const
 
Real Minimum1 (int &i) const
 
Real MaximumAbsoluteValue () const
 
Real MaximumAbsoluteValue2 (int &i, int &j) const
 
Real MinimumAbsoluteValue () const
 
Real MinimumAbsoluteValue2 (int &i, int &j) const
 
Real Maximum () const
 
Real Maximum2 (int &i, int &j) const
 
Real Minimum () const
 
Real Minimum2 (int &i, int &j) const
 
virtual bool IsEqual (const GeneralMatrix &) const
 
void CheckStore () const
 
virtual void SetParameters (const GeneralMatrix *)
 
 operator ReturnMatrix () const
 
ReturnMatrix ForReturn () const
 
virtual bool SameStorageType (const GeneralMatrix &A) const
 
virtual void ReSizeForAdd (const GeneralMatrix &A, const GeneralMatrix &B)
 
virtual void ReSizeForSP (const GeneralMatrix &A, const GeneralMatrix &B)
 
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

- 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 short SimpleAddOK (const GeneralMatrix *)
 
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 731 of file newmat.h.

Constructor & Destructor Documentation

◆ LowerTriangularMatrix() [1/4]

LowerTriangularMatrix::LowerTriangularMatrix ( )
inline

Definition at line 735 of file newmat.h.

Referenced by Image().

735 :GeneralMatrix() {}

◆ ~LowerTriangularMatrix()

LowerTriangularMatrix::~LowerTriangularMatrix ( )
inline

Definition at line 736 of file newmat.h.

736 {}

◆ LowerTriangularMatrix() [2/4]

LowerTriangularMatrix::LowerTriangularMatrix ( ArrayLengthSpecifier  n)

Definition at line 63 of file newmat4.cpp.

64  : GeneralMatrix(tristore(n.Value()))
65 { REPORT nrows=n.Value(); ncols=n.Value(); }
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n

◆ LowerTriangularMatrix() [3/4]

LowerTriangularMatrix::LowerTriangularMatrix ( const LowerTriangularMatrix gm)
inline

Definition at line 738 of file newmat.h.

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

◆ LowerTriangularMatrix() [4/4]

LowerTriangularMatrix::LowerTriangularMatrix ( const BaseMatrix M)

Definition at line 137 of file newmat4.cpp.

References GeneralMatrix::Evaluate(), GeneralMatrix::GetMatrix(), MatrixType::LT, and REPORT.

138 {
139  REPORT // CheckConversion(M);
140  // MatrixConversionCheck mcc;
142  GetMatrix(gmx);
143 }
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
Definition: newmat5.cpp:79
#define REPORT
Definition: newmat4.cpp:19
void GetMatrix(const GeneralMatrix *)
Definition: newmat4.cpp:610

Member Function Documentation

◆ BandWidth()

MatrixBandWidth LowerTriangularMatrix::BandWidth ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 438 of file newmat4.cpp.

References REPORT.

439  { REPORT return MatrixBandWidth(-1,0); }
#define REPORT
Definition: newmat4.cpp:19

◆ element() [1/2]

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

Definition at line 709 of file newmat6.cpp.

References n, and REPORT.

Referenced by QRZT(), and UpdateQRZT().

710 {
711  REPORT
712  if (n<0 || m<n || m>=nrows)
713  Throw(IndexException(m,n,*this,true));
714  return store[tristore(m)+n];
715 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ element() [2/2]

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

Definition at line 717 of file newmat6.cpp.

References n, and REPORT.

718 {
719  REPORT
720  if (n<0 || m<n || m>=nrows)
721  Throw(IndexException(m,n,*this,true));
722  return store[tristore(m)+n];
723 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ GetCol() [1/2]

void LowerTriangularMatrix::GetCol ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 341 of file newmat3.cpp.

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

342 {
343  REPORT
344  int col=mrc.rowcol; mrc.skip=col; mrc.length=nrows;
345  int i=nrows-col; mrc.storage=i; Real* ColCopy;
346  if ( +(mrc.cw*(StoreHere+HaveStore)) )
347  { REPORT ColCopy = mrc.data; }
348  else
349  {
350  REPORT // not accessed
351  ColCopy = new Real [nrows]; MatrixErrorNoSpace(ColCopy);
352  MONITOR_REAL_NEW("Make (LT GetCol)",nrows,ColCopy)
353  mrc.cw += HaveStore; mrc.data = ColCopy;
354  }
355 
356  if (+(mrc.cw*LoadOnEntry))
357  {
358  REPORT
359  Real* Mstore = store+(col*(col+3))/2;
360  // while (i--) { *ColCopy++ = *Mstore; Mstore += ++col; }
361  if (i) for (;;)
362  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore += ++col; }
363  }
364 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
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
Real * store
Definition: newmat.h:393
#define MONITOR_REAL_NEW(Operation, Size, Pointer)
Definition: myexcept.h:317
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetCol() [2/2]

void LowerTriangularMatrix::GetCol ( MatrixColX mrc)
virtual

Implements GeneralMatrix.

Definition at line 366 of file newmat3.cpp.

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

367 {
368  REPORT
369  int col=mrc.rowcol; mrc.skip=col; mrc.length=nrows;
370  int i=nrows-col; mrc.storage=i; mrc.data = mrc.store + col;
371 
372  if (+(mrc.cw*LoadOnEntry))
373  {
374  REPORT Real* ColCopy = mrc.data;
375  Real* Mstore = store+(col*(col+3))/2;
376  // while (i--) { *ColCopy++ = *Mstore; Mstore += ++col; }
377  if (i) for (;;)
378  { *ColCopy++ = *Mstore; if (!(--i)) break; Mstore += ++col; }
379  }
380 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#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 LowerTriangularMatrix::GetRow ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 334 of file newmat3.cpp.

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

335 {
336  REPORT
337  int row=mrc.rowcol; mrc.skip=0; mrc.storage=row+1; mrc.length=ncols;
338  mrc.data=store+(row*(row+1))/2;
339 }
#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
int length
Definition: newmatrc.h:38

◆ Image()

GeneralMatrix * LowerTriangularMatrix::Image ( ) const
privatevirtual

Reimplemented from GeneralMatrix.

Definition at line 768 of file newmat4.cpp.

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

769 {
770  REPORT
771  GeneralMatrix* gm = new LowerTriangularMatrix(*this);
772  MatrixErrorNoSpace(gm); return gm;
773 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ LogDeterminant()

LogAndSign LowerTriangularMatrix::LogDeterminant ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 657 of file newmat8.cpp.

References REPORT.

658 {
659  REPORT
660  int i = nrows; LogAndSign sum; Real* s = store; int j = 2;
661  // while (i--) { sum *= *s; s += j++; }
662  if (i) for(;;) { sum *= *s; if (!(--i)) break; s += j++; }
663  ((GeneralMatrix&)*this).tDelete(); return sum;
664 }
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

◆ MakeSolver()

GeneralMatrix* LowerTriangularMatrix::MakeSolver ( )
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 752 of file newmat.h.

752 { return this; } // for solving

◆ NextRow()

void LowerTriangularMatrix::NextRow ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 392 of file newmat3.cpp.

References MatrixRowCol::IncrLT(), and REPORT.

392 { REPORT mrc.IncrLT(); }
#define REPORT
Definition: newmat3.cpp:20
void IncrLT()
Definition: newmatrc.h:49

◆ operator()() [1/2]

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

Definition at line 55 of file newmat6.cpp.

References n, and REPORT.

56 {
57  REPORT
58  if (n<=0 || m<n || m>nrows)
59  Throw(IndexException(m,n,*this));
60  return store[tristore(m-1)+n-1];
61 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator()() [2/2]

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

Definition at line 167 of file newmat6.cpp.

References n, and REPORT.

168 {
169  REPORT
170  if (n<=0 || m<n || m>nrows)
171  Throw(IndexException(m,n,*this));
172  return store[tristore(m-1)+n-1];
173 }
os2<< "> n<< " > nendobj n
#define REPORT
Definition: newmat6.cpp:19
Real * store
Definition: newmat.h:393

◆ operator+=() [1/2]

void LowerTriangularMatrix::operator+= ( const LowerTriangularMatrix M)
inline

Definition at line 765 of file newmat.h.

765 { PlusEqual(M); }
void PlusEqual(const GeneralMatrix &gm)
Definition: newmat7.cpp:148

◆ operator+=() [2/2]

void LowerTriangularMatrix::operator+= ( Real  f)
inline

Definition at line 767 of file newmat.h.

References GeneralMatrix::operator+=().

void operator+=(const BaseMatrix &)
Definition: newmat6.cpp:469

◆ operator-=() [1/2]

void LowerTriangularMatrix::operator-= ( const LowerTriangularMatrix M)
inline

Definition at line 766 of file newmat.h.

766 { MinusEqual(M); }
void MinusEqual(const GeneralMatrix &gm)
Definition: newmat7.cpp:178

◆ operator-=() [2/2]

void LowerTriangularMatrix::operator-= ( Real  f)
inline

Definition at line 768 of file newmat.h.

References GeneralMatrix::operator-=().

void operator-=(const BaseMatrix &)
Definition: newmat6.cpp:482

◆ operator=() [1/3]

void LowerTriangularMatrix::operator= ( const BaseMatrix X)

Definition at line 401 of file newmat6.cpp.

References MatrixType::LT, and REPORT.

402 {
403  REPORT //CheckConversion(X);
404  // MatrixConversionCheck mcc;
405  Eq(X,MatrixType::LT);
406 }
#define REPORT
Definition: newmat6.cpp:19
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ operator=() [2/3]

void LowerTriangularMatrix::operator= ( Real  f)
inline

Definition at line 741 of file newmat.h.

References GeneralMatrix::operator=().

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

◆ operator=() [3/3]

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

Definition at line 742 of file newmat.h.

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

◆ ReSize() [1/2]

void LowerTriangularMatrix::ReSize ( int  nr)

Definition at line 253 of file newmat4.cpp.

References REPORT, and GeneralMatrix::ReSize().

Referenced by QRZT(), and ReSize().

254 { REPORT GeneralMatrix::ReSize(nr,nr,tristore(nr)); }
#define REPORT
Definition: newmat4.cpp:19
void ReSize(int, int, int)
Definition: newmat4.cpp:216

◆ ReSize() [2/2]

void LowerTriangularMatrix::ReSize ( const GeneralMatrix A)
virtual

Reimplemented from GeneralMatrix.

Definition at line 343 of file newmat4.cpp.

References A, n, REPORT, and ReSize().

344 {
345  REPORT
346  int n = A.Nrows();
347  if (n != A.Ncols())
348  {
349  Tracer tr("LowerTriangularMatrix::ReSize(GM)");
350  Throw(NotSquareException(*this));
351  }
352  ReSize(n);
353 }
#define A(r, c)
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n

◆ RestoreCol() [1/2]

void LowerTriangularMatrix::RestoreCol ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 382 of file newmat3.cpp.

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

383 {
384  REPORT
385  int col=mrc.rowcol; Real* Cstore = mrc.data;
386  Real* Mstore = store+(col*(col+3))/2; int i=nrows-col;
387  //while (i--) { *Mstore = *Cstore++; Mstore += ++col; }
388  if (i) for (;;)
389  { *Mstore = *Cstore++; if (!(--i)) break; Mstore += ++col; }
390 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ RestoreCol() [2/2]

void LowerTriangularMatrix::RestoreCol ( MatrixColX c)
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 760 of file newmat.h.

References RestoreCol().

Referenced by RestoreCol().

760 { RestoreCol((MatrixRowCol&)c); }
void RestoreCol(MatrixRowCol &)
Definition: newmat3.cpp:382

◆ Solver()

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

Reimplemented from GeneralMatrix.

Definition at line 70 of file newmat7.cpp.

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

72 {
73  REPORT
74  int i = mcin.skip-mcout.skip; Real* elx = mcin.data-i;
75  while (i-- > 0) *elx++ = 0.0;
76  int nc = mcin.skip; i = nc+mcin.storage; elx = mcin.data+mcin.storage;
77  int nr = mcout.skip+mcout.storage; int j = nr-i; i = nr-nc;
78  while (j-- > 0) *elx++ = 0.0;
79  Real* el = mcin.data; Real* Ael = store + (nc*(nc+1))/2; j = 0;
80  while (i-- > 0)
81  {
82  elx = el; Real sum = 0.0; int jx = j++; Ael += nc;
83  while (jx--) sum += *Ael++ * *elx++;
84  *elx = (*elx - sum) / *Ael++;
85  }
86 }
double Real
Definition: include.h:57
InvertedMatrix i() const
Definition: newmat6.cpp:325
#define REPORT
Definition: newmat7.cpp:18
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmat.h:393

◆ Trace()

Real LowerTriangularMatrix::Trace ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 565 of file newmat8.cpp.

References REPORT.

566 {
567  REPORT
568  int i = nrows; Real sum = 0.0; Real* s = store; int j = 2;
569  // while (i--) { sum += *s; s += j++; }
570  if (i) for (;;) { sum += *s; if (!(--i)) break; s += j++; }
571  ((GeneralMatrix&)*this).tDelete(); return sum;
572 }
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

◆ Type()

MatrixType LowerTriangularMatrix::Type ( ) const
virtual

Implements GeneralMatrix.

Definition at line 417 of file newmat4.cpp.

References MatrixType::LT.

417 { return MatrixType::LT; }

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