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

#include <newmat.h>

Inheritance diagram for IdentityMatrix:
GeneralMatrix BaseMatrix

Public Member Functions

 IdentityMatrix ()
 
 ~IdentityMatrix ()
 
 IdentityMatrix (ArrayLengthSpecifier n)
 
 IdentityMatrix (const IdentityMatrix &gm)
 
 IdentityMatrix (const BaseMatrix &)
 
void operator= (const BaseMatrix &)
 
void operator= (const IdentityMatrix &m)
 
void operator= (Real f)
 
MatrixType Type () const
 
LogAndSign LogDeterminant () const
 
Real Trace () const
 
Real SumSquare () const
 
Real SumAbsoluteValue () const
 
Real Sum () const
 
void GetRow (MatrixRowCol &)
 
void GetCol (MatrixRowCol &)
 
void GetCol (MatrixColX &)
 
void NextRow (MatrixRowCol &)
 
void NextCol (MatrixRowCol &)
 
void NextCol (MatrixColX &)
 
GeneralMatrixMakeSolver ()
 
void Solver (MatrixColX &, const MatrixColX &)
 
GeneralMatrixTranspose (TransposedMatrix *, MatrixType)
 
void ReSize (int n)
 
void ReSize (const GeneralMatrix &A)
 
MatrixBandWidth BandWidth () const
 
- 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 RestoreCol (MatrixRowCol &)
 
virtual void RestoreCol (MatrixColX &)
 
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
 
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 1142 of file newmat.h.

Constructor & Destructor Documentation

◆ IdentityMatrix() [1/4]

IdentityMatrix::IdentityMatrix ( )
inline

Definition at line 1146 of file newmat.h.

Referenced by Image().

1146 :GeneralMatrix() {}

◆ ~IdentityMatrix()

IdentityMatrix::~IdentityMatrix ( )
inline

Definition at line 1147 of file newmat.h.

1147 {}

◆ IdentityMatrix() [2/4]

IdentityMatrix::IdentityMatrix ( ArrayLengthSpecifier  n)
inline

Definition at line 1148 of file newmat.h.

References n.

1148  : GeneralMatrix(1)
1149  { nrows = ncols = n.Value(); *store = 1; }
os2<< "> n<< " > nendobj n
Real * store
Definition: newmat.h:393

◆ IdentityMatrix() [3/4]

IdentityMatrix::IdentityMatrix ( const IdentityMatrix gm)
inline

Definition at line 1150 of file newmat.h.

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

◆ IdentityMatrix() [4/4]

IdentityMatrix::IdentityMatrix ( const BaseMatrix M)

Definition at line 153 of file newmat4.cpp.

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

154 {
155  REPORT //CheckConversion(M);
156  // MatrixConversionCheck mcc;
158  GetMatrix(gmx);
159 }
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 IdentityMatrix::BandWidth ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 433 of file newmat4.cpp.

References REPORT.

433 { REPORT return 0; }
#define REPORT
Definition: newmat4.cpp:19

◆ GetCol() [1/2]

void IdentityMatrix::GetCol ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 790 of file newmat3.cpp.

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

791 {
792  REPORT
793  mrc.skip=mrc.rowcol; mrc.storage=1; mrc.length=nrows;
794  if (+(mrc.cw*StoreHere)) // should not happen
795  Throw(InternalException("IdentityMatrix::GetCol(MatrixRowCol&)"));
796  else { REPORT mrc.data=store; }
797 }
#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
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetCol() [2/2]

void IdentityMatrix::GetCol ( MatrixColX mrc)
virtual

Implements GeneralMatrix.

Definition at line 799 of file newmat3.cpp.

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

800 {
801  REPORT
802  mrc.skip=mrc.rowcol; mrc.storage=1; mrc.length=nrows;
803  mrc.data = mrc.store+mrc.skip; *(mrc.data)=*store;
804 }
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmatrc.h:139
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41
int length
Definition: newmatrc.h:38

◆ GetRow()

void IdentityMatrix::GetRow ( MatrixRowCol mrc)
virtual

Implements GeneralMatrix.

Definition at line 784 of file newmat3.cpp.

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

785 {
786  REPORT
787  mrc.skip=mrc.rowcol; mrc.storage=1; mrc.data=store; mrc.length=ncols;
788 }
#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 * IdentityMatrix::Image ( ) const
privatevirtual

Reimplemented from GeneralMatrix.

Definition at line 831 of file newmat4.cpp.

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

832 {
833  REPORT
834  GeneralMatrix* gm = new IdentityMatrix(*this); MatrixErrorNoSpace(gm);
835  return gm;
836 }
void MatrixErrorNoSpace(const void *)
Definition: newmatex.cpp:292
#define REPORT
Definition: newmat4.cpp:19

◆ LogDeterminant()

LogAndSign IdentityMatrix::LogDeterminant ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 674 of file newmat8.cpp.

References LogAndSign::PowEq(), and REPORT.

675 {
676  REPORT
677  int i = nrows; LogAndSign sum;
678  if (i > 0) { sum = *store; sum.PowEq(i); }
679  ((GeneralMatrix&)*this).tDelete(); return sum;
680 }
InvertedMatrix i() const
Definition: newmat6.cpp:325
void PowEq(int k)
Definition: newmat8.cpp:624
#define REPORT
Definition: newmat8.cpp:21
Real * store
Definition: newmat.h:393

◆ MakeSolver()

GeneralMatrix* IdentityMatrix::MakeSolver ( )
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1168 of file newmat.h.

1168 { return this; } // for solving

◆ NextCol() [1/2]

void IdentityMatrix::NextCol ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 808 of file newmat3.cpp.

References MatrixRowCol::IncrId(), and REPORT.

808 { REPORT mrc.IncrId(); }
void IncrId()
Definition: newmatrc.h:47
#define REPORT
Definition: newmat3.cpp:20

◆ NextCol() [2/2]

void IdentityMatrix::NextCol ( MatrixColX mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 810 of file newmat3.cpp.

References MatrixRowCol::cw, MatrixRowCol::data, MatrixRowCol::IncrDiag(), LoadOnEntry, REPORT, MatrixRowCol::rowcol, and StoreOnExit.

811 {
812  REPORT
813  if (+(mrc.cw*StoreOnExit)) { REPORT *store=*(mrc.data); }
814  mrc.IncrDiag(); // must increase mrc.data so need IncrDiag
815  int t1 = +(mrc.cw*LoadOnEntry);
816  if (t1 && mrc.rowcol < ncols) { REPORT *(mrc.data)=*store; }
817 }
void IncrDiag()
Definition: newmatrc.h:46
#define REPORT
Definition: newmat3.cpp:20
Real * data
Definition: newmatrc.h:43
LoadAndStoreFlag cw
Definition: newmatrc.h:44
Real * store
Definition: newmat.h:393
int rowcol
Definition: newmatrc.h:41

◆ NextRow()

void IdentityMatrix::NextRow ( MatrixRowCol mrc)
virtual

Reimplemented from GeneralMatrix.

Definition at line 806 of file newmat3.cpp.

References MatrixRowCol::IncrId(), and REPORT.

806 { REPORT mrc.IncrId(); }
void IncrId()
Definition: newmatrc.h:47
#define REPORT
Definition: newmat3.cpp:20

◆ operator=() [1/3]

void IdentityMatrix::operator= ( const BaseMatrix X)

Definition at line 415 of file newmat6.cpp.

References MatrixType::Id, and REPORT.

416 {
417  REPORT // CheckConversion(X);
418  // MatrixConversionCheck mcc;
419  Eq(X,MatrixType::Id);
420 }
#define REPORT
Definition: newmat6.cpp:19
void Eq(const BaseMatrix &, MatrixType)
Definition: newmat4.cpp:637

◆ operator=() [2/3]

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

Definition at line 1153 of file newmat.h.

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

◆ operator=() [3/3]

void IdentityMatrix::operator= ( Real  f)
inline

Definition at line 1154 of file newmat.h.

References GeneralMatrix::operator=().

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

◆ ReSize() [1/2]

void IdentityMatrix::ReSize ( int  n)

Definition at line 279 of file newmat4.cpp.

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

Referenced by ReSize().

280 { REPORT GeneralMatrix::ReSize(nr,nr,1); *store = 1; }
#define REPORT
Definition: newmat4.cpp:19
Real * store
Definition: newmat.h:393
void ReSize(int, int, int)
Definition: newmat4.cpp:216

◆ ReSize() [2/2]

void IdentityMatrix::ReSize ( const GeneralMatrix A)
virtual

Reimplemented from GeneralMatrix.

Definition at line 355 of file newmat4.cpp.

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

356 {
357  REPORT
358  int n = A.Nrows();
359  if (n != A.Ncols())
360  {
361  Tracer tr("IdentityMatrix::ReSize(GM)");
362  Throw(NotSquareException(*this));
363  }
364  ReSize(n);
365 }
#define A(r, c)
#define REPORT
Definition: newmat4.cpp:19
os2<< "> n<< " > nendobj n
void ReSize(int n)
Definition: newmat4.cpp:279

◆ Solver()

void IdentityMatrix::Solver ( MatrixColX mrc,
const MatrixColX mrc1 
)
virtual

Reimplemented from GeneralMatrix.

Definition at line 513 of file newmat2.cpp.

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

514 {
515  // mrc = mrc / mrc1 (elementwise)
516  REPORT
517  int f = mrc1.skip; int f0 = mrc.skip;
518  int l = f + mrc1.storage; int lx = f0 + mrc.storage;
519  if (f < f0) { f = f0; if (l < f) l = f; }
520  if (l > lx) { l = lx; if (f > lx) f = lx; }
521 
522  Real* elx = mrc.data; Real eldv = *store;
523 
524  int l1 = f-f0; while (l1--) *elx++ = 0.0;
525  l1 = l-f; while (l1--) *elx++ /= eldv;
526  lx -= l; while (lx--) *elx++ = 0.0;
527  // Solver makes sure input and output point to same memory
528 }
double Real
Definition: include.h:57
#define REPORT
Definition: newmat2.cpp:21
Real * data
Definition: newmatrc.h:43
int storage
Definition: newmatrc.h:40
Real * store
Definition: newmat.h:393

◆ Sum()

Real IdentityMatrix::Sum ( ) const
inlinevirtual

Reimplemented from GeneralMatrix.

Definition at line 1161 of file newmat.h.

References Trace().

1161 { return Trace(); }
Real Trace() const
Definition: newmat8.cpp:602

◆ SumAbsoluteValue()

Real IdentityMatrix::SumAbsoluteValue ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 410 of file newmat8.cpp.

References REPORT, and Trace().

411  { REPORT return fabs(Trace()); } // no need to do tDelete?
Real Trace() const
Definition: newmat8.cpp:602
#define REPORT
Definition: newmat8.cpp:21

◆ SumSquare()

Real IdentityMatrix::SumSquare ( ) const
virtual

Reimplemented from GeneralMatrix.

Definition at line 426 of file newmat8.cpp.

427 {
428  Real sum = *store * *store * nrows;
429  ((GeneralMatrix&)*this).tDelete(); return sum;
430 }
double Real
Definition: include.h:57
Real * store
Definition: newmat.h:393

◆ Trace()

Real IdentityMatrix::Trace ( ) const
virtual

Reimplemented from BaseMatrix.

Definition at line 602 of file newmat8.cpp.

603 {
604  Real sum = *store * nrows;
605  ((GeneralMatrix&)*this).tDelete(); return sum;
606 }
double Real
Definition: include.h:57
Real * store
Definition: newmat.h:393

◆ Transpose()

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

Reimplemented from GeneralMatrix.

Definition at line 76 of file newmat5.cpp.

References REPORT.

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

◆ Type()

MatrixType IdentityMatrix::Type ( ) const
virtual

Implements GeneralMatrix.

Definition at line 427 of file newmat4.cpp.

References MatrixType::Id.

427 { return MatrixType::Id; }

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