OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
newmatap.h
Go to the documentation of this file.
1 //$$ newmatap.h definition file for matrix package applications
2 
3 // Copyright (C) 1991,2,3,4,8: R B Davies
4 
5 #ifndef NEWMATAP_LIB
6 #define NEWMATAP_LIB 0
7 
8 #include <ossim/matrix/newmat.h>
9 
10 #ifdef use_namespace
11 namespace NEWMAT {
12 #endif
13 
14 
15 // ************************** applications *****************************/
16 
17 
19 
20 void QRZT(const Matrix&, Matrix&, Matrix&);
21 
23 
24 void QRZ(const Matrix&, Matrix&, Matrix&);
25 
27 { QRZT(X,L); }
28 
29 inline void HHDecompose(const Matrix& X, Matrix& Y, Matrix& M)
30 { QRZT(X, Y, M); }
31 
33 
35 
36 
38 
40 
41 
42 // produces the Cholesky decomposition of A + x.t() * x where A = chol.t() * chol
43 // and x is a RowVector
44 void UpdateCholesky(UpperTriangularMatrix &chol, RowVector r1Modification);
45 
46 // produces the Cholesky decomposition of A - x.t() * x where A = chol.t() * chol
47 // and x is a RowVector
49 
50 // a RIGHT circular shift of the rows and columns from
51 // 1,...,k-1,k,k+1,...l,l+1,...,p to
52 // 1,...,k-1,l,k,k+1,...l-1,l+1,...p
53 void RightCircularUpdateCholesky(UpperTriangularMatrix &chol, int k, int l);
54 
55 // a LEFT circular shift of the rows and columns from
56 // 1,...,k-1,k,k+1,...l,l+1,...,p to
57 // 1,...,k-1,k+1,...l,k,l+1,...,p to
58 void LeftCircularUpdateCholesky(UpperTriangularMatrix &chol, int k, int l);
59 
60 
61 void SVD(const Matrix&, DiagonalMatrix&, Matrix&, Matrix&,
62  bool=true, bool=true);
63 
64 void SVD(const Matrix&, DiagonalMatrix&);
65 
66 inline void SVD(const Matrix& A, DiagonalMatrix& D, Matrix& U,
67  bool withU = true) { SVD(A, D, U, U, withU, false); }
68 
69 void SortSV(DiagonalMatrix& D, Matrix& U, bool ascending = false);
70 
71 void SortSV(DiagonalMatrix& D, Matrix& U, Matrix& V, bool ascending = false);
72 
74 
76 
78 
80  Matrix&, bool=true);
81 
83 
85 
87 
89 // not implemented yet
90 {
91 public:
93 private:
98 };
99 
101 
103 
104 
105 // class for deciding which fft to use and containing new fft function
107 {
108 public:
109  static bool OnlyOldFFT;
110  static bool ar_1d_ft (int PTS, Real* X, Real *Y);
111  static bool CanFactor(int PTS);
112 };
113 
114 void FFT(const ColumnVector&, const ColumnVector&,
116 
117 void FFTI(const ColumnVector&, const ColumnVector&,
119 
121 
122 void RealFFTI(const ColumnVector&, const ColumnVector&, ColumnVector&);
123 
124 void DCT_II(const ColumnVector&, ColumnVector&);
125 
127 
128 void DST_II(const ColumnVector&, ColumnVector&);
129 
131 
132 void DCT(const ColumnVector&, ColumnVector&);
133 
134 void DCT_inverse(const ColumnVector&, ColumnVector&);
135 
136 void DST(const ColumnVector&, ColumnVector&);
137 
138 void DST_inverse(const ColumnVector&, ColumnVector&);
139 
140 void FFT2(const Matrix& U, const Matrix& V, Matrix& X, Matrix& Y);
141 
142 void FFT2I(const Matrix& U, const Matrix& V, Matrix& X, Matrix& Y);
143 
144 
145 // This class is used by the new FFT program
146 
147 // Suppose an integer is expressed as a sequence of digits with each
148 // digit having a different radix.
149 // This class supposes we are counting with this multi-radix number
150 // but also keeps track of the number with the digits (and radices)
151 // reversed.
152 // The integer starts at zero
153 // operator++() increases it by 1
154 // Counter gives the number of increments
155 // Reverse() gives the value with the digits in reverse order
156 // Swap is true if reverse is less than counter
157 // Finish is true when we have done a complete cycle and are back at zero
158 
160 {
162  // radix of each digit
163  // n-1 highest order, 0 lowest order
164  SimpleIntArray& Value; // value of each digit
165  const int n; // number of digits
166  int reverse; // value when order of digits is reversed
167  int product; // product of radices
168  int counter; // counter
169  bool finish; // true when we have gone over whole range
170 public:
171  MultiRadixCounter(int nx, const SimpleIntArray& rx,
172  SimpleIntArray& vx);
173  void operator++(); // increment the multi-radix counter
174  bool Swap() const { return reverse < counter; }
175  bool Finish() const { return finish; }
176  int Reverse() const { return reverse; }
177  int Counter() const { return counter; }
178 };
179 
180 
181 #ifdef use_namespace
182 }
183 #endif
184 
185 
186 
187 #endif
188 
189 // body file: cholesky.cpp
190 // body file: evalue.cpp
191 // body file: fft.cpp
192 // body file: hholder.cpp
193 // body file: jacobi.cpp
194 // body file: newfft.cpp
195 // body file: sort.cpp
196 // body file: svd.cpp
197 
198 
199 
200 
201 
void UpdateCholesky(UpperTriangularMatrix &chol, RowVector r1Modification)
Definition: cholesky.cpp:96
void EigenValues(const SymmetricMatrix &, DiagonalMatrix &)
Definition: evalue.cpp:286
void DST_inverse(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:402
ossim_uint32 x
double Real
Definition: include.h:57
const SimpleIntArray & Radix
Definition: newmatap.h:161
SymmetricMatrix backtransform
Definition: newmatap.h:96
void UpdateQRZT(Matrix &X, LowerTriangularMatrix &L)
Definition: hholder.cpp:222
void SortAscending(GeneralMatrix &)
Definition: sort.cpp:121
bool Swap() const
Definition: newmatap.h:174
void RealFFTI(const ColumnVector &, const ColumnVector &, ColumnVector &)
Definition: fft.cpp:162
void FFT(const ColumnVector &, const ColumnVector &, ColumnVector &, ColumnVector &)
Definition: fft.cpp:197
const int n
Definition: newmatap.h:165
void DCT_II_inverse(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:277
#define FREE_CHECK(Class)
Definition: myexcept.h:316
void LeftCircularUpdateCholesky(UpperTriangularMatrix &chol, int k, int l)
Definition: cholesky.cpp:225
#define A(r, c)
void DCT(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:393
bool Finish() const
Definition: newmatap.h:175
SimpleIntArray & Value
Definition: newmatap.h:164
void FFT2(const Matrix &U, const Matrix &V, Matrix &X, Matrix &Y)
Definition: fft.cpp:440
void RightCircularUpdateCholesky(UpperTriangularMatrix &chol, int k, int l)
Definition: cholesky.cpp:170
void RealFFT(const ColumnVector &, ColumnVector &, ColumnVector &)
Definition: fft.cpp:126
void DCT_inverse(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:359
void SVD(const Matrix &, DiagonalMatrix &, Matrix &, Matrix &, bool=true, bool=true)
Definition: svd.cpp:26
void FFT2I(const Matrix &U, const Matrix &V, Matrix &X, Matrix &Y)
Definition: fft.cpp:461
DiagonalMatrix diag
Definition: newmatap.h:94
void DST_II(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:304
Definition: newmat.h:543
DiagonalMatrix offdiag
Definition: newmatap.h:95
ReturnMatrix Cholesky(const SymmetricMatrix &)
Definition: cholesky.cpp:30
void DCT_II(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:249
static bool OnlyOldFFT
Definition: newmatap.h:109
int Reverse() const
Definition: newmatap.h:176
#define OSSIM_DLL
int Counter() const
Definition: newmatap.h:177
void DST(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:430
void UpdateQRZ(Matrix &X, UpperTriangularMatrix &U)
Definition: hholder.cpp:261
void DST_II_inverse(const ColumnVector &, ColumnVector &)
Definition: fft.cpp:332
void DowndateCholesky(UpperTriangularMatrix &chol, RowVector x)
Definition: cholesky.cpp:123
void HHDecompose(Matrix &X, LowerTriangularMatrix &L)
Definition: newmatap.h:26
void SortDescending(GeneralMatrix &)
Definition: sort.cpp:45
void QRZ(Matrix &, UpperTriangularMatrix &)
Definition: hholder.cpp:111
void FFTI(const ColumnVector &, const ColumnVector &, ColumnVector &, ColumnVector &)
Definition: fft.cpp:116
void Jacobi(const SymmetricMatrix &, DiagonalMatrix &)
Definition: jacobi.cpp:110
void QRZT(Matrix &, LowerTriangularMatrix &)
Definition: hholder.cpp:28
void SortSV(DiagonalMatrix &D, Matrix &U, bool ascending=false)
Definition: sort.cpp:190