27 #include "tnt/tnt_array2d.h" 119 int sparseRows = 0,
int sparseCols = 0,
bool jigsaw =
false);
121 void AddKnown(
const std::vector<double> &input,
double expected,
122 double weight = 1.0);
124 std::vector<double>
GetInput(
int row)
const;
134 double Evaluate(
const std::vector<double> &input);
137 void Weight(
int index,
double weight);
146 return p_expected.size();
154 std::vector<double>
GetEpsilons ()
const {
return p_epsilonsSparse; }
161 void SolveCholesky () {}
164 void FillSparseA(
const std::vector<double> &data);
165 bool ApplyParameterWeights();
168 std::vector<double> p_epsilonsSparse;
169 std::vector<double> p_parameterWeights;
171 arma::SpMat<double> p_sparseA;
172 arma::SpMat<double> p_normals;
174 arma::mat p_SLU_Factor;
180 int p_currentFillRow;
183 int p_constrainedParameters;
184 int p_degreesOfFreedom;
188 std::vector<std::vector<double> > p_input;
190 std::vector<double> p_expected;
192 std::vector<double> p_sqrtWeight;
195 std::vector<double> p_residuals;
void Weight(int index, double weight)
Reset the weight for the ith known.
Definition: LeastSquares.cpp:630
QR Decomposition.
Definition: LeastSquares.h:129
std::vector< double > Residuals() const
Returns a vector of residuals (errors).
Definition: LeastSquares.cpp:586
int GetDegreesOfFreedom()
Definition: LeastSquares.h:150
LeastSquares(Isis::BasisFunction &basis, bool sparse=false, int sparseRows=0, int sparseCols=0, bool jigsaw=false)
Creates a LeastSquares Object.
Definition: LeastSquares.cpp:39
double Residual(int i) const
Returns the ith residual.
Definition: LeastSquares.cpp:606
int Knowns() const
The number of knowns (or times AddKnown was invoked) linear combination of the variables.
Definition: LeastSquares.h:145
Sparse.
Definition: LeastSquares.h:130
int Rows() const
This methods returns the number of rows in the matrix.
Definition: LeastSquares.cpp:203
std::vector< double > GetInput(int row) const
This method returns the data at the given row.
Definition: LeastSquares.cpp:174
~LeastSquares()
Destroys the LeastSquares object.
Definition: LeastSquares.cpp:78
SolveMethod
Definition: LeastSquares.h:128
Singular Value Decomposition.
Definition: LeastSquares.h:128
double Evaluate(const std::vector< double > &input)
Invokes the BasisFunction Evaluate method.
Definition: LeastSquares.cpp:569
double GetExpected(int row) const
This method returns the expected value at the given row.
Definition: LeastSquares.cpp:189
void SetParameterWeights(const std::vector< double > weights)
Definition: LeastSquares.h:155
void Reset()
Definition: LeastSquares.cpp:539
std::vector< double > GetEpsilons() const
Definition: LeastSquares.h:154
Generic least square fitting class.
Definition: LeastSquares.h:115
void AddKnown(const std::vector< double > &input, double expected, double weight=1.0)
Invoke this method for each set of knowns.
Definition: LeastSquares.cpp:112
Generic linear equation class.
Definition: BasisFunction.h:64
void SetNumberOfConstrainedParameters(int n)
Definition: LeastSquares.h:156
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void ResetSparse()
Definition: LeastSquares.h:153
int Solve(Isis::LeastSquares::SolveMethod method=SVD)
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
Definition: LeastSquares.cpp:221
double GetSigma0()
Definition: LeastSquares.h:149