22 #define UpperTriangularMatrix UTMatrix 23 #define LowerTriangularMatrix LTMatrix 24 #define SymmetricMatrix SMatrix 25 #define DiagonalMatrix DMatrix 26 #define BandMatrix BMatrix 27 #define UpperBandMatrix UBMatrix 28 #define LowerBandMatrix LBMatrix 29 #define SymmetricBandMatrix SBMatrix 30 #define BandLUMatrix BLUMatrix 48 void operator*=(
Real);
74 void operator++() { nexe++; }
106 UT = Valid + Upper + Square,
107 LT = Valid + Lower + Square,
110 Sm = Valid + Symmetric + Square,
111 Sk = Valid + Skew + Square,
112 Dg = Valid + Diagonal + Band + Lower + Upper + Symmetric
114 Id = Valid + Diagonal + Band + Lower + Upper + Symmetric
118 BM = Valid + Band + Square,
119 UB = Valid + Band + Upper + Square,
120 LB = Valid + Band + Lower + Square,
121 SB = Valid + Band + Symmetric + Square,
122 Ct = Valid + LUDeco + Square,
123 BC = Valid + Band + LUDeco + Square,
137 MatrixType (
int i,
bool dlok) : attribute(i), DataLossOK(dlok) {}
139 : attribute(mt.attribute), DataLossOK(mt.DataLossOK) {}
154 {
return ( attribute & ~mt.
attribute & Mask ) == 0; }
156 {
return ( attribute & ~mt.attribute & Mask ) != 0; }
161 bool operator!()
const {
return (attribute & Valid) == 0; }
165 {
return MatrixType(attribute & (Valid + Symmetric + Square)); }
174 const char* Value()
const;
178 bool IsBand()
const {
return (attribute & Band) != 0; }
179 bool IsDiagonal()
const {
return (attribute & Diagonal) != 0; }
201 {
return (lower == bw.
lower) && (upper == bw.
upper); }
271 #define MatrixTypeUnSp 0 278 virtual int search(
const BaseMatrix*)
const = 0;
313 Real AsScalar()
const;
321 virtual Real MaximumAbsoluteValue1(
int& i)
const;
322 virtual Real MaximumAbsoluteValue2(
int& i,
int& j)
const;
324 virtual Real MinimumAbsoluteValue1(
int& i)
const;
325 virtual Real MinimumAbsoluteValue2(
int& i,
int& j)
const;
327 virtual Real Maximum1(
int& i)
const;
328 virtual Real Maximum2(
int& i,
int& j)
const;
330 virtual Real Minimum1(
int& i)
const;
331 virtual Real Minimum2(
int& i,
int& j)
const;
404 void ReverseElements();
406 void operator=(
Real);
418 void ReSize(
int,
int,
int);
421 virtual void MiniCleanUp() { store = 0; storage = 0; nrows = 0; ncols = 0; tag = -1;}
425 void PlusEqual(
Real f);
426 void MinusEqual(
Real f);
438 int Tag()
const {
return tag; }
446 { Eq(X,this->Type(),
true); }
453 void operator+=(
Real);
455 void operator*=(
Real);
471 Real MaximumAbsoluteValue1(
int& i)
const;
472 Real MinimumAbsoluteValue1(
int& i)
const;
473 Real Maximum1(
int& i)
const;
474 Real Minimum1(
int& i)
const;
476 Real MaximumAbsoluteValue2(
int& i,
int& j)
const;
478 Real MinimumAbsoluteValue2(
int& i,
int& j)
const;
480 Real Maximum2(
int& i,
int& j)
const;
482 Real Minimum2(
int& i,
int& j)
const;
486 void CheckStore()
const;
555 Real& operator()(
int,
int);
556 Real& element(
int,
int);
557 Real operator()(
int,
int)
const;
558 Real element(
int,
int)
const;
559 #ifdef SETUP_C_SUBSCRIPTS 560 Real* operator[](
int m) {
return store+m*ncols; }
561 const Real* operator[](
int m)
const {
return store+m*ncols; }
574 virtual void ReSize(
int,
int);
577 Real MaximumAbsoluteValue2(
int& i,
int& j)
const;
578 Real MinimumAbsoluteValue2(
int& i,
int& j)
const;
579 Real Maximum2(
int& i,
int& j)
const;
580 Real Minimum2(
int& i,
int& j)
const;
600 void operator=(
const Matrix& m);
605 virtual void ReSize(
int,
int);
620 void MakeRowPointer();
621 void DeleteRowPointer();
625 :
Matrix(m,
n) { MakeRowPointer(); }
627 :
Matrix(bm) { MakeRowPointer(); }
632 { DeleteRowPointer(); Eq(m); MakeRowPointer(); }
634 { DeleteRowPointer(); Eq(X,this->Type(),
true); MakeRowPointer(); }
640 Real**
nric()
const { CheckStore();
return row_pointer-1; }
661 Real& operator()(
int,
int);
662 Real& element(
int,
int);
663 Real operator()(
int,
int)
const;
664 Real element(
int,
int)
const;
665 #ifdef SETUP_C_SUBSCRIPTS 666 Real* operator[](
int m) {
return store+(m*(m+1))/2; }
667 const Real* operator[](
int m)
const {
return store+(m*(m+1))/2; }
702 Real& operator()(
int,
int);
703 Real& element(
int,
int);
704 Real operator()(
int,
int)
const;
705 Real element(
int,
int)
const;
706 #ifdef SETUP_C_SUBSCRIPTS 707 Real* operator[](
int m) {
return store+m*ncols-(m*(m+1))/2; }
708 const Real* operator[](
int m)
const {
return store+m*ncols-(m*(m+1))/2; }
743 Real& operator()(
int,
int);
744 Real& element(
int,
int);
745 Real operator()(
int,
int)
const;
746 Real element(
int,
int)
const;
747 #ifdef SETUP_C_SUBSCRIPTS 748 Real* operator[](
int m) {
return store+(m*(m+1))/2; }
749 const Real* operator[](
int m)
const {
return store+(m*(m+1))/2; }
784 Real& operator()(
int,
int);
785 Real& operator()(
int);
786 Real operator()(
int,
int)
const;
787 Real operator()(
int)
const;
788 Real& element(
int,
int);
790 Real element(
int,
int)
const;
791 Real element(
int)
const;
792 #ifdef SETUP_C_SUBSCRIPTS 793 Real& operator[](
int m) {
return store[m]; }
794 const Real& operator[](
int m)
const {
return store[m]; }
812 { CheckStore();
return store-1; }
834 Real& operator()(
int);
836 Real operator()(
int)
const;
837 Real element(
int)
const;
838 #ifdef SETUP_C_SUBSCRIPTS 839 Real& operator[](
int m) {
return store[m]; }
840 const Real& operator[](
int m)
const {
return store[m]; }
851 void ReSize(
int,
int);
854 { CheckStore();
return store-1; }
856 void MiniCleanUp() { store = 0; storage = 0; nrows = 1; ncols = 0; tag = -1; }
877 Real& operator()(
int);
879 Real operator()(
int)
const;
880 Real element(
int)
const;
881 #ifdef SETUP_C_SUBSCRIPTS 882 Real& operator[](
int m) {
return store[m]; }
883 const Real& operator[](
int m)
const {
return store[m]; }
888 void ReSize(
int,
int);
891 { CheckStore();
return store-1; }
893 void MiniCleanUp() { store = 0; storage = 0; nrows = 0; ncols = 1; tag = -1; }
912 void lubksb(
Real*,
int=0);
933 void CornerClear()
const;
946 Real& operator()(
int,
int);
947 Real& element(
int,
int);
948 Real operator()(
int,
int)
const;
949 Real element(
int,
int)
const;
950 #ifdef SETUP_C_SUBSCRIPTS 951 Real* operator[](
int m) {
return store+(upper+lower)*m+lower; }
952 const Real* operator[](
int m)
const {
return store+(upper+lower)*m+lower; }
975 virtual void ReSize(
int,
int,
int);
1009 void ReSize(
int,
int,
int);
1013 Real& operator()(
int,
int);
1014 Real operator()(
int,
int)
const;
1015 Real& element(
int,
int);
1016 Real element(
int,
int)
const;
1017 #ifdef SETUP_C_SUBSCRIPTS 1018 Real* operator[](
int m) {
return store+upper*m; }
1019 const Real* operator[](
int m)
const {
return store+upper*m; }
1041 void ReSize(
int,
int,
int);
1045 Real& operator()(
int,
int);
1046 Real operator()(
int,
int)
const;
1047 Real& element(
int,
int);
1048 Real element(
int,
int)
const;
1049 #ifdef SETUP_C_SUBSCRIPTS 1050 Real* operator[](
int m) {
return store+lower*(m+1); }
1051 const Real* operator[](
int m)
const {
return store+lower*(m+1); }
1059 void CornerClear()
const;
1070 Real& operator()(
int,
int);
1071 Real& element(
int,
int);
1072 Real operator()(
int,
int)
const;
1073 Real element(
int,
int)
const;
1074 #ifdef SETUP_C_SUBSCRIPTS 1075 Real* operator[](
int m) {
return store+lower*(m+1); }
1076 const Real* operator[](
int m)
const {
return store+lower*(m+1); }
1098 void ReSize(
int,
int);
1125 void lubksb(
Real*,
int=0);
1149 { nrows = ncols =
n.Value(); *store = 1; }
1201 void operator+=(
Real);
1203 void operator*=(
Real);
1224 : bm1(bm1x),bm2(bm2x) {}
1514 row_skip(rs), row_number(rn), col_skip(cs), col_number(cn), IsSym(is) {}
1521 :
NegatedMatrix(g.bm), row_skip(g.row_skip), row_number(g.row_number),
1522 col_skip(g.col_skip), col_number(g.col_number), IsSym(g.IsSym) {}
1535 void operator=(
Real);
1536 void operator+=(
Real);
1538 void operator*=(
Real);
1593 int& operator[](
int i);
1594 int operator[](
int i)
const;
1596 void operator=(
int ai);
1604 const int*
Data()
const {
return a; }
1606 void ReSize(
int i,
bool keep =
false);
1724 {
return ! (
A==B); }
1726 {
return ! (
A==B); }
1731 {
A.IEQND();
return true; }
1733 {
A.IEQND();
return true; }
1735 {
A.IEQND();
return true; }
1737 {
A.IEQND();
return true; }
1783 #ifdef use_namespace static unsigned long Select
void Add(GeneralMatrix *, Real)
void operator<<(const BaseMatrix &)
StackedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
void RestoreCol(MatrixRowCol &)
Real MaximumAbsoluteValue() const
void operator-=(const Matrix &M)
void operator=(const BaseMatrix &bm)
RowVector(const RowVector &gm)
void operator-=(const Matrix &M)
void operator=(const SymmetricMatrix &m)
virtual Real MaximumAbsoluteValue() const
ossimRationalNumber operator-(ossim_int32 i, ossimRationalNumber &r)
void operator+=(const BaseMatrix &)
void operator+=(const Matrix &M)
void operator=(const CroutMatrix &)
void operator=(const RowVector &m)
bool operator>=(MatrixType mt) const
GeneralMatrix * MakeSolver()
Real sign(Real x, Real y)
Real Sum(const BaseMatrix &B)
MatrixBandWidth(const int i)
virtual void RestoreRow(MatrixRowCol &)
void operator=(const MatrixType &mt)
void operator<<(const BaseMatrix &X)
ScaledMatrix(const BaseMatrix *bmx, Real fx)
MatrixBandWidth t() const
SolvedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
Real Maximum(const BaseMatrix &B)
ShiftedMatrix(const BaseMatrix *bmx, Real fx)
static unsigned long Select
IdentityMatrix(ArrayLengthSpecifier n)
ossimRationalNumber operator/(ossim_int32 i, ossimRationalNumber &r)
MatrixBandWidth(const int l, const int u)
LowerBandMatrix(const LowerBandMatrix &gm)
void operator-=(const Matrix &M)
SPMatrix SP(const BaseMatrix &bm1, const BaseMatrix &bm2)
virtual Real Minimum() const
void operator+=(const Matrix &M)
void operator=(const nricMatrix &m)
void GetCol(MatrixColX &c)
virtual MatrixBandWidth BandWidth() const
virtual void MiniCleanUp()
void operator=(const DiagonalMatrix &m)
OSSIM_DLL Matrix CrossProduct(const Matrix &A, const Matrix &B)
ReversedMatrix(const BaseMatrix *bmx)
ColumnVector(const ColumnVector &gm)
static unsigned long Select
AddedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
NegShiftedMatrix(Real fx, const BaseMatrix *bmx)
LowerTriangularMatrix(const LowerTriangularMatrix &gm)
friend class LinearEquationSolver
void operator-=(const SymmetricMatrix &M)
#define FREE_CHECK(Class)
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator=(const ColumnVector &m)
ScaledMatrix operator*(Real t) const
Real MaximumAbsoluteValue(const BaseMatrix &B)
bool CannotConvert() const
MatrixInput operator<<(Real)
void operator=(const UpperTriangularMatrix &m)
ossimRationalNumber operator*(ossim_int32 i, ossimRationalNumber &r)
virtual short SimpleAddOK(const GeneralMatrix *)
DiagonalMatrix(const DiagonalMatrix &gm)
Real Norm1(const BaseMatrix &B)
UpperBandMatrix(const UpperBandMatrix &gm)
GenericMatrix(const BaseMatrix &bm)
nricMatrix(const BaseMatrix &bm)
virtual void ReSize(int, int, int)
Real Maximum2(int &i, int &j) const
bool operator!=(MatrixType t) const
Real MaximumAbsoluteValue() const
bool operator!=(const GeneralMatrix &A, const GeneralMatrix &B)
bool Compare(const MatrixType &source, MatrixType &destination)
virtual Real MinimumAbsoluteValue() const
void operator+=(const Matrix &M)
GeneralMatrix * MakeSolver()
MatrixBandWidth BandWidth() const
Real MinimumAbsoluteValue() const
void RestoreCol(MatrixColX &c)
void operator<<(const BaseMatrix &X)
SPMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
GenericMatrix(const GenericMatrix &bm)
void operator=(const UpperBandMatrix &m)
void operator=(const LowerBandMatrix &m)
Real MinimumAbsoluteValue(const BaseMatrix &B)
GeneralMatrix * MakeSolver()
IdentityMatrix(const IdentityMatrix &gm)
ostream & operator<<(ostream &out, const ossimAxes &axes)
ReturnMatrix(const GeneralMatrix *gmx)
MatedMatrix(const BaseMatrix *bmx, int nrx, int ncx)
bool operator<(const BaseMatrix &A, const BaseMatrix &)
void MatrixErrorNoSpace(const void *)
ColedMatrix(const BaseMatrix *bmx)
virtual void ReSize(int, int)
UpperBandMatrix(int n, int ubw)
KPMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
Real MinimumAbsoluteValue2(int &i, int &j) const
GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)
void operator-=(const Matrix &M)
void operator-=(const BaseMatrix &)
int search(const BaseMatrix *) const
OSSIM_DLL ReturnMatrix CrossProductRows(const Matrix &A, const Matrix &B)
ArrayLengthSpecifier(int l)
os2<< "> n<< " > nendobj n
Real NormInfinity(const BaseMatrix &B)
void operator+=(const Matrix &M)
GeneralMatrix * MakeSolver()
void operator=(const SymmetricBandMatrix &m)
void ReSize(const GeneralMatrix &A)
OSSIM_DLL ReturnMatrix CrossProductColumns(const Matrix &A, const Matrix &B)
NegatedMatrix(const BaseMatrix *bmx)
void operator+=(const SymmetricMatrix &M)
bool operator==(const MatrixBandWidth &bw) const
bool operator>(const BaseMatrix &A, const BaseMatrix &)
void ReSize(int n, int lbw)
ReturnMatrix(const ReturnMatrix &tm)
ColumnVector(ArrayLengthSpecifier n)
bool operator==(const GeneralMatrix &A, const GeneralMatrix &B)
SquareMatrix(const SquareMatrix &gm)
void RestoreCol(MatrixColX &c)
bool operator>=(const BaseMatrix &A, const BaseMatrix &)
void operator+=(const Matrix &M)
virtual void RestoreCol(MatrixColX &)
void RestoreCol(MatrixRowCol &)
SymmetricMatrix(const SymmetricMatrix &gm)
Real SumAbsoluteValue(const BaseMatrix &B)
bool Rectangular(MatrixType a, MatrixType b, MatrixType c)
GeneralMatrix * MakeSolver()
void operator=(const IdentityMatrix &m)
Real Determinant(const BaseMatrix &B)
Real NormFrobenius() const
MatrixType operator+(MatrixType mt) const
void GetCol(MatrixColX &c)
void operator+=(const LowerTriangularMatrix &M)
virtual LogAndSign LogDeterminant() const
GeneralMatrix * MakeSolver()
LogAndSign LogDeterminant(const BaseMatrix &B)
SymmetricBandMatrix(int n, int lb)
LowerBandMatrix(int n, int lbw)
virtual Real Maximum() const
MatrixType AddEqualEl() const
static unsigned long Select
static unsigned long Select
Real MinimumAbsoluteValue() const
void operator=(const SquareMatrix &m)
void operator<<(const Real *)
MatrixBandWidth BandWidth() const
Real MaximumAbsoluteValue() const
virtual Real SumSquare() const
virtual GeneralMatrix * Image() const
BandMatrix(const BandMatrix &gm)
Real NormInfinity() const
static unsigned long Select
void operator<<(const BaseMatrix &X)
BandMatrix(int n, int lb, int ub)
virtual GeneralMatrix * Evaluate(MatrixType mt=MatrixTypeUnSp)=0
SymmetricBandMatrix(const SymmetricBandMatrix &gm)
void operator=(const BandMatrix &m)
void RestoreCol(MatrixColX &c)
GeneralMatrix * Evaluate(MatrixType)
nricMatrix(const nricMatrix &gm)
void RestoreCol(MatrixRowCol &)
static unsigned long Select
bool operator<(MatrixType mt) const
void operator+=(const UpperTriangularMatrix &M)
OSSIM_DLL Real DotProduct(const Matrix &A, const Matrix &B)
UpperTriangularMatrix(const UpperTriangularMatrix &gm)
void operator=(const BaseMatrix &)
virtual void RestoreCol(MatrixRowCol &)
GetSubMatrix(const GetSubMatrix &g)
static unsigned long Select
void operator-=(const UpperTriangularMatrix &M)
void operator=(const Matrix &m)
void operator-=(const Matrix &M)
MatrixType(const MatrixType &mt)
DiagedMatrix(const BaseMatrix *bmx)
void operator-=(const LowerTriangularMatrix &M)
RowedMatrix(const BaseMatrix *bmx)
void ReSize(int m, int n)
ConcatenatedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
MatrixType(int i, bool dlok)
virtual Real SumAbsoluteValue() const
Real SumAbsoluteValue() const
static unsigned long Select
static unsigned long Select
bool operator!=(const MatrixBandWidth &bw) const
void operator=(const GetSubMatrix &m)
KPMatrix KP(const BaseMatrix &bm1, const BaseMatrix &bm2)
static unsigned long Select
virtual void Solver(MatrixColX &, const MatrixColX &)
static unsigned long Select
void operator-=(const DiagonalMatrix &M)
Real NormFrobenius(const BaseMatrix &B)
MultipliedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
void operator+=(const DiagonalMatrix &M)
Real Minimum(const BaseMatrix &B)
GeneralMatrix * MakeSolver()
bool operator<=(const BaseMatrix &A, const BaseMatrix &)
Real Minimum2(int &i, int &j) const
virtual Real Trace() const
static unsigned long Select
void operator=(const LowerTriangularMatrix &m)
#define NEW_DELETE(Class)
void ReSize(int n, int ubw)
Real SumAbsoluteValue() const
void ReSize(const GeneralMatrix &A)
ossimRationalNumber operator+(ossim_int32 i, ossimRationalNumber &r)
bool operator==(MatrixType t) const
SubtractedMatrix(const BaseMatrix *bm1x, const BaseMatrix *bm2x)
TransposedMatrix(const BaseMatrix *bmx)
GeneralMatrix * Evaluate(MatrixType=MatrixTypeUnSp)
virtual void SetParameters(const GeneralMatrix *)
MultipliedMatrix operator*(const BaseMatrix &) const
GeneralMatrix * MakeSolver()
RowVector(ArrayLengthSpecifier n)
bool IsZero(const BaseMatrix &A)
void operator=(const BandLUMatrix &)
Real SumSquare(const BaseMatrix &B)
MatrixType operator|(const MatrixType &mt) const
Real Trace(const BaseMatrix &B)
InvertedMatrix(const BaseMatrix *bmx)
void operator<<(const BaseMatrix &X)