MatrixFunctors.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // This file is part of GNSSTk, the ARL:UT GNSS Toolkit.
4 //
5 // The GNSSTk is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published
7 // by the Free Software Foundation; either version 3.0 of the License, or
8 // any later version.
9 //
10 // The GNSSTk is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with GNSSTk; if not, write to the Free Software Foundation,
17 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 //
19 // This software was developed by Applied Research Laboratories at the
20 // University of Texas at Austin.
21 // Copyright 2004-2022, The Board of Regents of The University of Texas System
22 //
23 //==============================================================================
24 
25 //==============================================================================
26 //
27 // This software was developed by Applied Research Laboratories at the
28 // University of Texas at Austin, under contract to an agency or agencies
29 // within the U.S. Department of Defense. The U.S. Government retains all
30 // rights to use, duplicate, distribute, disclose, or release this software.
31 //
32 // Pursuant to DoD Directive 523024
33 //
34 // DISTRIBUTION STATEMENT A: This software has been approved for public
35 // release, distribution is unlimited.
36 //
37 //==============================================================================
38 
41 
42 #ifndef GNSSTK_MATRIX_FUNCTORS_HPP
43 #define GNSSTK_MATRIX_FUNCTORS_HPP
44 
45 #include <cmath>
46 #include <limits>
47 #include <algorithm>
48 
49 namespace gnsstk
50 {
51 
53 
54 
98  template <class T>
99  class SVD
100  {
101  public:
102  SVD() : iterationMax(30) {}
103 
107  template <class BaseClass>
109  {
110  const T eps=T(8)*std::numeric_limits<T>::epsilon();
111  bool flip=false;
112  U = mat;
113  if(mat.rows() > mat.cols()) {
114  flip = true;
115  U = transpose(mat);
116  }
117 
118  size_t n(U.cols()), m(U.rows());
119  size_t i, j, k, l, nm, jj;
120  T anorm(0), scale(0), g(0), s, f, h, c, x, y, z;
121 
122  V = Matrix<T>(n, n, T(0));
123  S = Vector<T>(n, T(1));
124  Vector<T> B(n, T(1));
125 
126  for (i = 0; i < n; i++) {
127  l = i + 1;
128  B[i] = scale * g;
129  g = s = scale = T(0);
130  if (i < m) {
131  for(k = i; k < m; k++) scale += ABS(U(k, i));
132  if (scale) {
133  for(k = i; k < m; k++) {
134  U(k, i) /= scale;
135  s += U(k, i) * U(k, i);
136  }
137  f = U(i, i);
138  g = -SIGN(SQRT(s),f);
139  h = f * g - s;
140  U(i,i) = f - g;
141  for(j = l; j < n; j++) {
142  for(s = T(0), k = i; k < m; k++) s += U(k, i) * U(k, j);
143  f = s / h;
144  for(k = i; k < m; k++) U(k, j) += f * U(k, i);
145  }
146  for(k = i; k < m; k++) U(k, i) *= scale;
147  } // if (scale)
148  } // if (i < m)
149  S[i] = scale * g;
150  g = s = scale = T(0);
151  if ( (i < m) && (i != n-1) ) {
152  for(k = l; k < n; k++) scale += ABS(U(i, k));
153  if (scale) {
154  for(k = l; k < n; k++) {
155  U(i, k) /= scale;
156  s += U(i, k) * U(i, k);
157  }
158  f = U(i, l);
159  g = -SIGN(SQRT(s),f);
160  h = f * g - s;
161  U(i, l) = f - g;
162  for(k = l; k < n; k++) B[k] = U(i, k) / h;
163  for(j = l; j < m; j++) {
164  for(s = T(0), k = l; k < n; k++) s += U(j, k) * U(i, k);
165  for(k = l; k < n; k++) U(j, k) += s * B[k];
166  }
167  for(k = l; k < n; k++) U(i, k) *= scale;
168  }
169  }
170  if(ABS(S[i])+ABS(B[i]) > anorm) anorm=ABS(S[i])+ABS(B[i]);
171  }
172  for(i = n - 1; ; i--) {
173  if (i < n - 1) {
174  if (g) {
175  for(j = l; j < n; j++) V(j, i) = (U(i, j) / U(i, l)) / g;
176  for(j = l; j < n; j++) {
177  for(s = T(0), k = l; k < n; k++) s += U(i, k) * V(k, j);
178  for(k = l; k < n; k++) V(k, j) += s * V(k, i);
179  }
180  }
181  for(j = l; j < n; j++) V(j, i) = V(i, j) = T(0);
182  }
183  V(i,i) =T(1);
184  g = B[i];
185  l = i;
186  if(i==0) break;
187  }
188  for(i = ( (m-1 < n-1) ? m-1 : n-1); ; i--) {
189  l = i+1;
190  g = S[i];
191  for(j=l; j<n; j++) U(i, j) = T(0);
192  if (g) {
193  g = T(1) / g;
194  for(j = l; j < n; j++) {
195  for(s = T(0), k = l; k < m; k++) s += U(k,i) * U(k,j);
196  f = (s / U(i,i)) * g;
197  for(k=i; k<m; k++) U(k,j) += f * U(k,i);
198  }
199  for(j = i; j < m; j++) U(j,i) *= g;
200  }
201  else {
202  for(j=i; j<m; j++) U(j,i) = T(0);
203  }
204  ++U(i,i);
205  if(i==0) break;
206  }
207  for(k = n - 1; ; k--) {
208  size_t its;
209  for(its = 1; its <= iterationMax; its++) {
210  bool flag = true;
211  for(l = k; ; l--) {
212  nm = l - 1;
213  if (ABS(B[l])/MAX(ABS(B[l]),anorm) < eps) {
214  flag = false;
215  break;
216  }
217  if (l == 0) { // should never happen
218  MatrixException e("SVD algorithm has nm==-1");
219  GNSSTK_THROW(e);
220  }
221  if (ABS(S[nm])/MAX(ABS(S[nm]),anorm) < eps) break;
222  if(l == 0) break; // since l is unsigned...
223  }
224  if (flag) {
225  c = T(0);
226  s = T(1);
227  for(i = l; i <= k; i++) {
228  f = s * B[i];
229  B[i] = c * B[i];
230  if (ABS(f)/MAX(ABS(f),anorm) < eps) break;
231  g = S[i];
232  h = RSS(f,g);
233  S[i] = h;
234  h = T(1) / h;
235  c = g * h;
236  s = -f * h;
237  for(j = 0; j < m; j++) {
238  y = U(j, nm);
239  z = U(j,i);
240  U(j, nm) = y * c + z * s;
241  U(j,i) = z * c - y * s;
242  }
243  }
244  }
245  z = S[k];
246  if (l == k) {
247  if (z < T(0)) {
248  S[k] = -z;
249  for(j = 0; j < n; j++) V(j,k) = -V(j,k);
250  }
251  break;
252  }
253 
254  if (its == iterationMax) {
255  MatrixException e("SVD algorithm did not converge");
256  GNSSTK_THROW(e);
257  }
258  x = S[l];
259  if(k == 0) { // should never happen
260  MatrixException e("SVD algorithm has k==0");
261  GNSSTK_THROW(e);
262  }
263  nm = k - 1;
264  y = S[nm];
265  g = B[nm];
266  h = B[k];
267  f = ( (y-z) * (y+z) + (g-h) * (g+h)) / (T(2) * h * y);
268  g = RSS(f,T(1));
269  f = ( (x-z) * (x+z) + h * ((y/(f + SIGN(g,f))) - h)) / x;
270  c = s = 1.0;
271  for(j = l; j <= nm; j++) {
272  i = j + 1;
273  g = B[i];
274  y = S[i];
275  h = s * g;
276  g = c * g;
277  z = RSS(f, h);
278  B[j] = z;
279  c = f / z;
280  s = h / z;
281  f = x * c + g * s;
282  g = g * c - x * s;
283  h = y * s;
284  y *= c;
285  for(jj = 0; jj < n; jj++) {
286  x = V(jj, j);
287  z = V(jj, i);
288  V(jj, j) = x * c + z * s;
289  V(jj, i) = z * c - x * s;
290  }
291  z = RSS(f, h);
292  S[j] = z;
293  if (z) {
294  z = T(1) / z;
295  c = f * z;
296  s = h * z;
297  }
298  f = c * g + s * y;
299  x = c * y - s * g;
300  for(jj = 0; jj < m; jj++) {
301  y = U(jj, j);
302  z = U(jj, i);
303  U(jj, j) = y * c + z * s;
304  U(jj, i) = z * c - y * s;
305  }
306  }
307  B[l] = T(0);
308  B[k] = f;
309  S[k] = x;
310  }
311  if(k==0) break; // since k is unsigned...
312  }
313  // if U is not square - last n-m columns of U are zero - remove
314  if(U.cols() > U.rows()) {
315  for(i=1; i<S.size(); i++) { // sort in descending order
316  T sv=S[i],svj;
317  int kk = i-1; // not size_t ~ unsigned
318  while(kk >= 0) {
319  svj = S[kk];
320  if(sv < svj) break;
321  S[kk+1] = svj;
322  // exchange columns kk and kk+1 in U and V
323  U.swapCols(kk,kk+1);
324  V.swapCols(kk,kk+1);
325  kk = kk - 1;
326  }
327  S[kk+1] = sv;
328  }
329  Matrix<T> Temp(U);
330  U = Matrix<T>(Temp,0,0,Temp.rows(),Temp.rows());
331  S.resize(Temp.rows());
332  }
333 
334  if(flip) {
335  Matrix<T> Temp(U);
336  U = V;
337  V = Temp;
338  }
339 
340  return true;
341 
342  } // end SVD::operator() - the SVD algorithm
343 
344 
354  template <class BaseClass>
356  {
357  if(b.size() != U.rows())
358  {
359  MatrixException e("SVD::BackSub called with unequal dimensions");
360  GNSSTK_THROW(e);
361  }
362 
363  size_t i, n=V.cols(), m=U.rows();
364  Matrix<T> W(n,m,T(0)); // build the 'inverse singular values' matrix
365  for(i=0; i<S.size(); i++) W(i,i)=(S(i)==T(0)?T(0):T(1)/S(i));
366  Vector<T> Y;
367  Y = V*W*transpose(U)*b;
368  //b = Y;
369  // this fails because operator= is not defined for the base class
370  // (op= not inherited); use assignFrom instead
371  b.assignFrom(Y);
372 
373  } // end SVD::backSub
374 
378  void sort(bool descending=true)
379  {
380  size_t i;
381  int j; // j must be allowed to go negative
382  for(i=1; i<S.size(); i++) {
383  T sv=S(i),svj;
384  j = i - 1;
385  while(j >= 0) {
386  svj = S(j);
387  if(descending && sv < svj) break;
388  if(!descending && sv > svj) break;
389  S(j+1) = svj;
390  // exchange columns j and j+1 in U and V
391  U.swapCols(j,j+1);
392  V.swapCols(j,j+1);
393  j = j - 1;
394  }
395  S(j+1) = sv;
396  }
397  } // end SVD::sort
398 
402  inline T det(void)
403  {
404  T d(1);
405  for(size_t i=0; i<S.size(); i++) d *= S(i);
406  return d;
407  } // end SVD::det
408 
415 
416  private:
417  const size_t iterationMax;
418 
419  T SIGN(T a, T b)
420  {
421  if (b >= T(0))
422  return ABS(a);
423  else
424  return -ABS(a);
425  }
426 
427  }; // end class SVD
428 
433  template <class T>
434  class LUDecomp
435  {
436  public:
437  LUDecomp() {} // why is there no constructor from ConstMatrixBase?
438 
442  template <class BaseClass>
444  {
445  if(!m.isSquare() || m.rows()<1) {
446  MatrixException e("LUDecomp requires a square, non-trivial matrix");
447  GNSSTK_THROW(e);
448  }
449 
450  size_t N=m.rows(),i,j,k,imax;
451  T big,t,d;
452  Vector<T> V(N,T(0));
453 
454  LU = m;
455  Pivot = Vector<int>(N);
456  parity = 1;
457 
458  for(i=0; i<N; i++) { // get scale of each row
459  big = T(0);
460  for(j=0; j<N; j++) {
461  t = ABS(LU(i,j));
462  if(t > big) big=t;
463  }
464  if(big <= T(0)) { // m is singular
465  //LU *= T(0);
466  SingularMatrixException e("singular matrix!");
467  GNSSTK_THROW(e);
468  }
469  V(i) = T(1)/big;
470  }
471 
472  for(j=0; j<N; j++) { // loop over columns
473  for(i=0; i<j; i++) {
474  t = LU(i,j);
475  for(k=0; k<i; k++) t -= LU(i,k)*LU(k,j);
476  LU(i,j) = t;
477  }
478  big = T(0); // find largest pivot
479  for(i=j; i<N; i++) {
480  t = LU(i,j);
481  for(k=0; k<j; k++) t -= LU(i,k)*LU(k,j);
482  LU(i,j) = t;
483  d = V(i)*ABS(t);
484  if(d >= big) {
485  big = d;
486  imax = i;
487  }
488  }
489  if(j != imax) {
490  LU.swapRows(imax,j);
491  V(imax) = V(j);
492  parity = -parity;
493  }
494  Pivot(j) = imax;
495 
496  t = LU(j,j);
497  if(t == 0.0) { // m is singular
498  //LU *= T(0);
499  SingularMatrixException e("singular matrix!");
500  GNSSTK_THROW(e);
501  }
502  if(j != N-1) {
503  d = T(1)/t;
504  for(i=j+1; i<N; i++) LU(i,j) *= d;
505  }
506  }
507  } // end LUDecomp()
508 
513  template <class BaseClass2>
515  {
516  if(LU.rows() != v.size()) {
517  MatrixException e("Vector size does not match dimension of LUDecomp");
518  GNSSTK_THROW(e);
519  }
520 
521  bool first=true;
522  size_t N=LU.rows(),i,j,ii(0);
523  T sum;
524 
525  // un-pivot
526  for(i=0; i<N; i++) {
527  sum = v(Pivot(i));
528  v(Pivot(i)) = v(i);
529  if(first && sum != T(0)) {
530  ii = i;
531  first = false;
532  }
533  else for(j=ii; j<i; j++) sum -= LU(i,j)*v(j);
534  v(i) = sum;
535  }
536  // back substitution
537  for(i=N-1; ; i--) {
538  sum = v(i);
539  for(j=i+1; j<N; j++) sum -= LU(i,j)*v(j);
540  v(i) = sum / LU(i,i);
541  if(i == 0) break; // b/c i is unsigned
542  }
543  } // end LUD::backSub
544 
548  inline T det(void)
549  {
550  T d(static_cast<T>(parity));
551  for(size_t i=0; i<LU.rows(); i++) d *= LU(i,i);
552  return d;
553  }
554 
561  int parity;
562 
563  }; // end class LUDecomp
564 
565 
566  // Compute Cholesky decomposition (triangular square root) of the given matrix,
567  // which must be square and positive definite. That is, if M is square and positive
568  // definite, then M = C * transpose(C) where C is the Cholesky decomposition. This
569  // routine computes both the upper (U) and lower (L) triangular C's;
570  // thus M = L * transpose(L) = U * transpose(U).
571  //
572  // NB Note that M = U*UT NOT UT*U; if M = U'T*U' is desired, use U'=transpose(L);
573  // then note the similarity to LU decomposition: M = L*U' = L*LT = U'T*U'.
574  //
575  // Positive definite (PD) implies positive eigenvalues, and the reverse.
576  //
577  // Note that the result is not unique, as any orthogonal transformation R of UT,
578  // including a change in sign, will preserve the result m = U*UT = U*RT*R*UT.
579  //
580  // @code
581  // Matrix<double> M(i,i); // square and PD
583  // Ch(M);
584  // cout << Ch.U << endl << Ch.L << endl;
585  // // note that M = Ch.L * transpose(Ch.L);
586  // // note that M = Ch.U * transpose(Ch.U);
587  // // and that if Matrix<double> Up(transpose(Ch.L)); then
588  // // M = transpose(Up) * Up;
589  // @endcode
590  template <class T>
591  class Cholesky
592  {
593  public:
594  Cholesky() {}
595 
599  template <class BaseClass>
601  {
602  if(!m.isSquare()) {
603  MatrixException e("Cholesky requires a square matrix");
604  GNSSTK_THROW(e);
605  }
606 
607  size_t N=m.rows(),i,j,k;
608  double d;
609  Matrix<T> P(m);
610  U = Matrix<T>(m.rows(),m.cols(),T(0));
611 
612  for(j=N-1; ; j--) {
613  if(P(j,j) <= T(0)) {
614  MatrixException e("Cholesky fails - eigenvalue <= 0");
615  GNSSTK_THROW(e);
616  }
617  U(j,j) = SQRT(P(j,j));
618  d = T(1)/U(j,j);
619  if(j > 0) {
620  for(k=0; k<j; k++) U(k,j)=d*P(k,j);
621  for(k=0; k<j; k++)
622  for(i=0; i<=k; i++)
623  P(i,k) -= U(k,j)*U(i,j);
624  }
625  if(j==0) break; // since j is unsigned
626  }
627 
628  P = m;
629  L = Matrix<T>(m.rows(),m.cols(),T(0));
630  for(j=0; j<=N-1; j++) {
631  if(P(j,j) <= T(0)) {
632  MatrixException e("Cholesky fails - eigenvalue <= 0");
633  GNSSTK_THROW(e);
634  }
635  L(j,j) = SQRT(P(j,j));
636  d = T(1)/L(j,j);
637  if(j < N-1) {
638  for(k=j+1; k<N; k++) L(k,j)=d*P(k,j);
639  for(k=j+1; k<N; k++) {
640  for(i=k; i<N; i++) {
641  P(i,k) -= L(i,j)*L(k,j);
642  }
643  }
644  }
645  }
646 
647  } // end Cholesky::operator()
648 
655  template <class BaseClass2>
657  {
658  if (L.rows() != b.size())
659  {
660  MatrixException e("Vector size does not match dimension of Cholesky");
661  GNSSTK_THROW(e);
662  }
663  size_t i,j,N=L.rows();
664 
665  Vector<T> y(b.size());
666  y(0) = b(0)/L(0,0);
667  for(i=1; i<N; i++) {
668  y(i) = b(i);
669  for(j=0; j<i; j++) y(i)-=L(i,j)*y(j);
670  y(i) /= L(i,i);
671  }
672  // b is now x
673  b(N-1) = y(N-1)/L(N-1,N-1);
674  for(i=N-1; ; i--) {
675  b(i) = y(i);
676  for(j=i+1; j<N; j++) b(i)-=L(j,i)*b(j);
677  b(i) /= L(i,i);
678  if(i==0) break;
679  }
680 
681  } // end Cholesky::backSub
682 
685 
686  }; // end class Cholesky
687 
699  template <class T>
700  class CholeskyCrout : public Cholesky<T>
701  {
702  public:
706  template <class BaseClass>
708  {
709  if(!m.isSquare()) {
710  MatrixException e("CholeskyCrout requires a square matrix");
711  GNSSTK_THROW(e);
712  }
713 
714  int N = m.rows(), i, j, k;
715  double sum;
716  (*this).L = Matrix<T>(N,N, 0.0);
717 
718  for(j=0; j<N; j++) {
719  sum = m(j,j);
720  for(k=0; k<j; k++ ) sum -= (*this).L(j,k)*(*this).L(j,k);
721  if(sum > 0.0) {
722  (*this).L(j,j) = SQRT(sum);
723  } else {
724  MatrixException e("CholeskyCrout fails - eigenvalue <= 0");
725  GNSSTK_THROW(e);
726  }
727 
728  for(i=j+1; i<N; i++){
729  sum = m(i,j);
730  for(k=0; k<j; k++) sum -= (*this).L(i,k)*(*this).L(j,k);
731  (*this).L(i,j) = sum/(*this).L(j,j);
732  }
733  }
734 
735  (*this).U = transpose((*this).L);
736  }
737 
738  }; // end class CholeskyCrout
739 
740 
741  // The Householder transformation is simply an orthogonal transformation
742  // designed to make the elements below the diagonal zero. It applies to any
743  // matrix.
744  template <class T>
746  {
747  public:
749 
764  template <class BaseClass>
766  {
767  A = m;
768  size_t i,j,k;
769  Vector<T> v(A.rows());
770  T sum,alpha;
771 
772  // loop over cols
773  const T EPS(1.e-200);
774  for(j=0; (j<A.cols()-1 && j<A.rows()-1); j++) {
775  sum = T(0);
776  // loop over rows at diagonal and below
777  for(i=j; i<A.rows(); i++) {
778  v(i) = A(i,j);
779  A(i,j) = T(0); // this is optional - below the diag is trash
780  sum += v(i)*v(i);
781  }
782 
783  if(sum < EPS) continue; // already zero below diagonal
784 
785  sum = SQRT(sum);
786  if(v(j) > T(0)) sum = -sum;
787  A(j,j) = sum;
788  v(j) = v(j) - sum;
789  sum = T(1)/(sum*v(j));
790 
791  // loop over columns beyond j
792  for(k=j+1; k<A.cols(); k++) {
793  alpha = T(0);
794  // loop over rows at and below j
795  for(i=j; i<A.rows(); i++) {
796  alpha += A(i,k)*v(i);
797  }
798  alpha *= sum;
799  if(alpha*alpha < EPS) continue;
800  // modify column k at and below j
801  for(i=j; i<A.rows(); i++) {
802  A(i,k) += alpha*v(i);
803  }
804  } // end loop over cols > j
805 
806  } // end loop over cols
807 
808  } // end Householder::operator()
809 
812 
813  }; // end class Householder
814 
816 
817 } // namespace
818 
819 #endif
gnsstk::LUDecomp::Pivot
Vector< int > Pivot
The pivot array.
Definition: MatrixFunctors.hpp:559
gnsstk::SVD::U
Matrix< T > U
Matrix U.
Definition: MatrixFunctors.hpp:410
gnsstk::Cholesky
Cholesky<double> Ch;.
Definition: MatrixFunctors.hpp:591
SQRT
#define SQRT(x)
Definition: MathBase.hpp:74
gnsstk::Cholesky::L
Matrix< T > L
Lower triangular and Upper triangular Cholesky decompositions.
Definition: MatrixFunctors.hpp:684
gnsstk::CholeskyCrout::operator()
void operator()(const ConstMatrixBase< T, BaseClass > &m)
Definition: MatrixFunctors.hpp:707
gnsstk::TrackingCode::Y
@ Y
Encrypted legacy GPS precise code.
gnsstk::Cholesky::Cholesky
Cholesky()
Definition: MatrixFunctors.hpp:594
gnsstk::sum
T sum(const ConstVectorBase< T, BaseClass > &l)
Definition: VectorBaseOperators.hpp:84
gnsstk::SVD::SVD
SVD()
Definition: MatrixFunctors.hpp:102
gnsstk::Matrix::rows
size_t rows() const
The number of rows in the matrix.
Definition: Matrix.hpp:165
gnsstk::RefVectorBase
Definition: VectorBase.hpp:155
gnsstk
For Sinex::InputHistory.
Definition: BasicFramework.cpp:50
gnsstk::LUDecomp::det
T det(void)
Definition: MatrixFunctors.hpp:548
y
page HOWTO subpage DoxygenGuide Documenting Your Code page DoxygenGuide Documenting Your Code todo Flesh out this document section doctips Tips for Documenting When defining make sure that the prototype is identical between the cpp and hpp including both the namespaces and the parameter names for you have std::string as the return type in the hpp file and string as the return type in the cpp Doxygen may get confused and autolink to the cpp version with no documentation If you don t use the same parameter names between the cpp and hpp that will also confuse Doxygen Don t put type information in return or param documentation It doesn t really add anything and will often cause Doxygen to complain and not produce the documentation< br > use note Do not put a comma after a param name unless you mean to document multiple parameters< br/> the output stream</code >< br/> y
Definition: DOCUMENTING.dox:15
gnsstk::SVD::operator()
bool operator()(const ConstMatrixBase< T, BaseClass > &mat)
Definition: MatrixFunctors.hpp:108
gnsstk::SVD::det
T det(void)
Definition: MatrixFunctors.hpp:402
gnsstk::LUDecomp
Definition: MatrixFunctors.hpp:434
gnsstk::transpose
SparseMatrix< T > transpose(const SparseMatrix< T > &M)
transpose
Definition: SparseMatrix.hpp:829
gnsstk::ConstMatrixBase::rows
size_t rows() const
the number of rows in the matrix
Definition: MatrixBase.hpp:81
gnsstk::Matrix
Definition: Matrix.hpp:72
gnsstk::LUDecomp::backSub
void backSub(RefVectorBase< T, BaseClass2 > &v) const
Definition: MatrixFunctors.hpp:514
gnsstk::Cholesky::backSub
void backSub(RefVectorBase< T, BaseClass2 > &b) const
Definition: MatrixFunctors.hpp:656
gnsstk::ConstMatrixBase::cols
size_t cols() const
the number of columns in the matrix
Definition: MatrixBase.hpp:78
gnsstk::LUDecomp::LU
Matrix< T > LU
Definition: MatrixFunctors.hpp:557
gnsstk::SVD::sort
void sort(bool descending=true)
Definition: MatrixFunctors.hpp:378
gnsstk::LUDecomp::LUDecomp
LUDecomp()
Definition: MatrixFunctors.hpp:437
gnsstk::Householder::A
Matrix< T > A
The upper triangular transformed matrix.
Definition: MatrixFunctors.hpp:811
gnsstk::SVD::backSub
void backSub(RefVectorBase< T, BaseClass > &b) const
Definition: MatrixFunctors.hpp:355
gnsstk::RSS
T RSS(T aa, T bb, T cc)
Perform the root sum square of aa, bb and cc.
Definition: MiscMath.hpp:246
gnsstk::Vector
Definition: Vector.hpp:67
gnsstk::TrackingCode::P
@ P
Legacy GPS precise code.
gnsstk::ConstVectorBase::size
size_t size() const
Returns the size of the base class.
Definition: VectorBase.hpp:112
ABS
#define ABS(x)
Definition: MathBase.hpp:73
gnsstk::LUDecomp::parity
int parity
Parity.
Definition: MatrixFunctors.hpp:561
gnsstk::ConstMatrixBase
Definition: MatrixBase.hpp:65
gnsstk::Householder::operator()
void operator()(const ConstMatrixBase< T, BaseClass > &m)
Definition: MatrixFunctors.hpp:765
MAX
#define MAX(x, y)
Definition: MathBase.hpp:75
gnsstk::Cholesky::operator()
void operator()(const ConstMatrixBase< T, BaseClass > &m)
Definition: MatrixFunctors.hpp:600
gnsstk::SVD::S
Vector< T > S
Vector of singular values.
Definition: MatrixFunctors.hpp:412
gnsstk::SVD::V
Matrix< T > V
Matrix V (not transpose(V))
Definition: MatrixFunctors.hpp:414
gnsstk::Householder::Householder
Householder()
Definition: MatrixFunctors.hpp:748
gnsstk::Householder
Definition: MatrixFunctors.hpp:745
GNSSTK_THROW
#define GNSSTK_THROW(exc)
Definition: Exception.hpp:366
gnsstk::SVD::SIGN
T SIGN(T a, T b)
Definition: MatrixFunctors.hpp:419
gnsstk::LUDecomp::operator()
void operator()(const ConstMatrixBase< T, BaseClass > &m)
Definition: MatrixFunctors.hpp:443
gnsstk::CholeskyCrout
Definition: MatrixFunctors.hpp:700
gnsstk::SVD::iterationMax
const size_t iterationMax
Definition: MatrixFunctors.hpp:417
gnsstk::ConstMatrixBase::isSquare
bool isSquare() const
returns true if this is a square matrix (false for a null matrix).
Definition: MatrixBase.hpp:89
gnsstk::Cholesky::U
Matrix< T > U
Definition: MatrixFunctors.hpp:684
gnsstk::SVD
Definition: MatrixFunctors.hpp:99


gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40