Go to the documentation of this file.
58 using namespace StringUtils;
62 SRIFilter::SRIFilter() { defaults(); }
66 SRIFilter::SRIFilter(
const unsigned int N)
97 MatrixException me(
"Invalid input dimensions: R is " +
98 asString<int>(Rin.
rows()) +
"x" +
99 asString<int>(Rin.
cols()) +
", Z has length " +
100 asString<int>(Zin.
size()) +
", and NL has length " +
101 asString<int>(NLin.
size()));
130 string msg(
"\nInvalid input dimensions:\n SRI is ");
131 msg += asString<int>(R.rows()) +
"x" + asString<int>(R.cols()) +
132 ",\n Partials is " + asString<int>(H.
rows()) +
"x" +
133 asString<int>(H.
cols()) +
",\n Data has length " +
134 asString<int>(D.
size());
137 msg +=
",\n and Cov is " + asString<int>(CM.
rows()) +
"x" +
138 asString<int>(CM.
cols());
141 MatrixException me(msg);
166 catch (MatrixException& me)
170 catch (VectorException& ve)
187 string msg(
"\nInvalid input dimensions:\n SRI is ");
188 msg += asString<int>(R.rows()) +
"x" + asString<int>(R.cols()) +
189 ",\n Partials is " + asString<int>(H.
rows()) +
"x" +
190 asString<int>(H.
cols()) +
",\n Data has length " +
191 asString<int>(D.
size());
194 msg +=
",\n and Cov is " + asString<int>(CM.
rows()) +
"x" +
195 asString<int>(CM.
cols());
198 MatrixException me(msg);
223 catch (MatrixException& me)
227 catch (VectorException& ve)
241 SrifTU(R, Z, PhiInv, Rw, G, Zw, Rwx);
243 catch (MatrixException& me)
257 SrifSU(R, Z, Phi, Rw, G, Zw, Rwx);
259 catch (MatrixException& me)
273 SrifSU_DM(
P, X, Phinv, Rw, G, Zw, Rwx);
275 catch (MatrixException& me)
283 void SRIFilter::zeroAll() { SRI::zeroAll(); }
290 void SRIFilter::reset(
const int N)
292 if (N > 0 && N != (
int)R.rows())
402 const T EPS = -T(1.e-200);
403 unsigned int n = R.
rows(), ns = Rw.
rows();
404 unsigned int i, j, k;
407 if (PhiInv.
rows() < n || PhiInv.
cols() < n || G.
rows() < n ||
412 "Invalid input dimensions:\n R is " + asString<int>(R.
rows()) +
413 "x" + asString<int>(R.
cols()) +
", Z has length " +
414 asString<int>(Z.
size()) +
"\n PhiInv is " +
415 asString<int>(PhiInv.
rows()) +
"x" + asString<int>(PhiInv.
cols()) +
416 "\n Rw is " + asString<int>(Rw.
rows()) +
"x" +
417 asString<int>(Rw.
cols()) +
"\n G is " + asString<int>(G.
rows()) +
418 "x" + asString<int>(G.
cols()) +
"\n Zw has length " +
419 asString<int>(Zw.
size()) +
"\n Rwx is " +
420 asString<int>(Rwx.
rows()) +
"x" + asString<int>(Rwx.
cols()));
440 for (j = 0; j < ns; j++)
443 for (i = 0; i < n; i++)
444 sum += G(i, j) * G(i, j);
447 sum = (dum > T(0) ? -T(1) : T(1)) * ::sqrt(
sum);
462 for (k = j + 1; k < ns; k++)
464 sum = delta * Rw(j, k);
465 for (i = 0; i < n; i++)
466 sum += G(i, j) * G(i, k);
472 Rw(j, k) +=
sum * delta;
473 for (i = 0; i < n; i++)
474 G(i, k) +=
sum * G(i, j);
480 for (k = 0; k < n; k++)
482 sum = delta * Rwx(j, k);
483 for (i = 0; i < n; i++)
484 sum += PhiInv(i, k) * G(i, j);
490 Rwx(j, k) +=
sum * delta;
491 for (i = 0; i < n; i++)
492 PhiInv(i, k) +=
sum * G(i, j);
498 for (i = 0; i < n; i++)
499 sum += Z(i) * G(i, j);
505 Zw(j) +=
sum * delta;
506 for (i = 0; i < n; i++)
507 Z(i) +=
sum * G(i, j);
511 for (j = 0; j < n; j++)
514 for (i = j + 1; i < n; i++)
515 sum += PhiInv(i, j) * PhiInv(i, j);
518 sum = (dum > T(0) ? -T(1) : T(1)) * ::sqrt(
sum);
530 for (k = j + 1; k < n; k++)
532 sum = delta * PhiInv(j, k);
533 for (i = j + 1; i < n; i++)
534 sum += PhiInv(i, j) * PhiInv(i, k);
540 PhiInv(j, k) +=
sum * delta;
541 for (i = j + 1; i < n; i++)
542 PhiInv(i, k) +=
sum * PhiInv(i, j);
547 for (i = j + 1; i < n; i++)
548 sum += Z(i) * PhiInv(i, j);
555 for (i = j + 1; i < n; i++)
556 Z(i) +=
sum * PhiInv(i, j);
565 for (j = 0; j < n; j++)
566 for (i = 0; i <= j; i++)
567 R(i, j) = PhiInv(i, j);
569 catch (MatrixException& me)
653 unsigned int N = R.
rows(), Ns = Rw.
rows();
660 "Invalid input dimensions:\n R is " + asString<int>(R.
rows()) +
661 "x" + asString<int>(R.
cols()) +
", Z has length " +
662 asString<int>(Z.
size()) +
"\n Phi is " +
663 asString<int>(Phi.
rows()) +
"x" + asString<int>(Phi.
cols()) +
664 "\n Rw is " + asString<int>(Rw.
rows()) +
"x" +
665 asString<int>(Rw.
cols()) +
"\n G is " + asString<int>(G.
rows()) +
666 "x" + asString<int>(G.
cols()) +
"\n Zw has length " +
667 asString<int>(Zw.
size()) +
"\n Rwx is " +
668 asString<int>(Rwx.
rows()) +
"x" + asString<int>(Rwx.
cols()));
672 const T EPS = -T(1.e-200);
689 for (j = 0; j < Ns; j++)
692 for (i = j + 1; i < Ns; i++)
694 sum += A(i, j) * A(i, j);
696 for (i = 0; i < N; i++)
698 sum += G(i, j) * G(i, j);
703 sum = (
diag > T(0) ? -T(1) : T(1)) * ::sqrt(
sum);
714 for (k = j + 1; k < Ns; k++)
716 sum = delta * A(j, k);
717 for (i = j + 1; i < Ns; i++)
719 sum += A(i, j) * A(i, k);
721 for (i = 0; i < N; i++)
723 sum += G(i, j) * G(i, k);
731 A(j, k) +=
sum * delta;
733 for (i = j + 1; i < Ns; i++)
735 A(i, k) +=
sum * A(i, j);
737 for (i = 0; i < N; i++)
739 G(i, k) +=
sum * G(i, j);
744 for (k = 0; k < N; k++)
746 sum = delta * Rwx(j, k);
747 for (i = j + 1; i < Ns; i++)
749 sum += A(i, j) * Rwx(i, k);
751 for (i = 0; i < N; i++)
753 sum += G(i, j) * Phi(i, k);
760 Rwx(j, k) +=
sum * delta;
761 for (i = j + 1; i < Ns; i++)
763 Rwx(i, k) +=
sum * A(i, j);
765 for (i = 0; i < N; i++)
767 Phi(i, k) +=
sum * G(i, j);
773 for (i = j + 1; i < Ns; i++)
775 sum += A(i, j) * Zw(i);
777 for (i = 0; i < N; i++)
779 sum += Z(i) * G(i, j);
786 Zw(j) +=
sum * delta;
787 for (i = j + 1; i < Ns; i++)
789 Zw(i) +=
sum * A(i, j);
791 for (i = 0; i < N; i++)
793 Z(i) +=
sum * G(i, j);
798 for (j = 0; j < N; j++)
801 for (i = j + 1; i < N; i++)
803 sum += Phi(i, j) * Phi(i, j);
807 sum = (
diag > T(0) ? -T(1) : T(1)) * ::sqrt(
sum);
818 for (k = j + 1; k < N; k++)
820 sum = delta * Phi(j, k);
821 for (i = j + 1; i < N; i++)
823 sum += Phi(i, j) * Phi(i, k);
830 Phi(j, k) +=
sum * delta;
831 for (i = j + 1; i < N; i++)
833 Phi(i, k) +=
sum * Phi(i, j);
838 for (i = j + 1; i < N; i++)
840 sum += Z(i) * Phi(i, j);
848 for (i = j + 1; i < N; i++)
850 Z(i) +=
sum * Phi(i, j);
859 for (j = 0; j < N; j++)
861 for (i = 0; i <= j; i++)
918 unsigned int N =
P.rows(), Ns = Rw.
rows();
920 if (
P.cols() !=
P.rows() || X.
size() != N || Rwx.
cols() != N ||
921 Zw.
size() != Ns || Rwx.
rows() != Ns || Rwx.
cols() != N ||
922 Phinv.
rows() != N || Phinv.
cols() != N || G.
rows() != N ||
926 "Invalid input dimensions:\n P is " + asString<int>(
P.rows()) +
927 "x" + asString<int>(
P.cols()) +
", X has length " +
928 asString<int>(X.
size()) +
"\n Phinv is " +
929 asString<int>(Phinv.
rows()) +
"x" + asString<int>(Phinv.
cols()) +
930 "\n Rw is " + asString<int>(Rw.
rows()) +
"x" +
931 asString<int>(Rw.
cols()) +
"\n G is " + asString<int>(G.
rows()) +
932 "x" + asString<int>(G.
cols()) +
"\n Zw has length " +
933 asString<int>(Zw.
size()) +
"\n Rwx is " +
934 asString<int>(Rwx.
rows()) +
"x" + asString<int>(Rwx.
cols()));
942 F = ident<T>(N) + G * Rwx;
964 unsigned int N =
P.rows(), Ns = Rw.
rows();
966 if (
P.cols() !=
P.rows() || X.
size() != N || Rwx.
cols() != N ||
967 Zw.
size() != Ns || Rwx.
rows() != Ns || Rwx.
cols() != N ||
968 Phinv.
rows() != N || Phinv.
cols() != N || G.
rows() != N ||
972 "Invalid input dimensions:\n P is " + asString<int>(
P.rows()) +
973 "x" + asString<int>(
P.cols()) +
", X has length " +
974 asString<int>(X.
size()) +
"\n Phinv is " +
975 asString<int>(Phinv.
rows()) +
"x" + asString<int>(Phinv.
cols()) +
976 "\n Rw is " + asString<int>(Rw.
rows()) +
"x" +
977 asString<int>(Rw.
cols()) +
"\n G is " + asString<int>(G.
rows()) +
978 "x" + asString<int>(G.
cols()) +
"\n Zw has length " +
979 asString<int>(Zw.
size()) +
"\n Rwx is " +
980 asString<int>(Rwx.
rows()) +
"x" + asString<int>(Rwx.
cols()) +
981 "\n U has length " + asString<int>(U.
size()));
989 F = ident<T>(N) + G * Rwx;
992 C = F * X - G * Zw - U;
const Matrix< double > SRINullMatrix
constant (empty) Matrix used for default input arguments
Matrix< T > inverseLUD(const ConstMatrixBase< T, BaseClass > &m)
SparseMatrix< T > lowerCholesky(const SparseMatrix< T > &A)
SparseVector< T > colCopy(const unsigned int j) const
return col j of this SparseMatrix as a SparseVector
T sum(const ConstVectorBase< T, BaseClass > &l)
size_t cols() const
The number of columns in the matrix.
size_t rows() const
The number of rows in the matrix.
Matrix< double > R
Information matrix, an upper triangular (square) matrix.
Matrix< T > diag(const ConstMatrixBase< T, BaseClass > &m)
unsigned int rows() const
get number of rows - of the real Matrix, not the data array
Vector< double > Z
SRI state vector, of length equal to the dimension (row and col) of R.
void SrifMU(Matrix< T > &R, Vector< T > &Z, SparseMatrix< T > &A, const unsigned int M)
const SparseMatrix< double > SRINullSparseMatrix
constant (empty) SparseMatrix used for default input arguments
SparseMatrix< T > transpose(const SparseMatrix< T > &M)
transpose
SparseMatrix< T > inverseLT(const SparseMatrix< T > <, T *ptrSmall, T *ptrBig)
Compute inverse of lower-triangular SparseMatrix.
unsigned int size() const
return the size of the list.
double beta(double x, double y)
unsigned int cols() const
get number of columns - of the real Matrix, not the data array
Namelist names
Namelist parallel to R and Z, labelling the elements of the state vector.
#define GNSSTK_RETHROW(exc)
@ P
Legacy GPS precise code.
size_t size() const
STL size.
void DMsmootherUpdateWithControl(Matrix< double > &P, Vector< double > &X, Matrix< double > &Phinv, Matrix< double > &Rw, Matrix< double > &G, Vector< double > &Zw, Matrix< double > &Rwx, Vector< double > &U)
#define GNSSTK_THROW(exc)
Matrix< T > outer(const ConstVectorBase< T, BaseClass > &v, const ConstVectorBase< T, BaseClass > &w)
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:41