|
Isis 3 Programmer Reference
|
11 #include "tnt/tnt_array2d.h"
15 #include "BasisFunction.h"
103 int sparseRows = 0,
int sparseCols = 0,
bool jigsaw =
false);
105 void AddKnown(
const std::vector<double> &input,
double expected,
106 double weight = 1.0);
108 std::vector<double>
GetInput(
int row)
const;
118 double Evaluate(
const std::vector<double> &input);
121 void Weight(
int index,
double weight);
133 double GetSigma0() {
return p_sigma0; }
137 void ResetSparse() { Reset(); }
139 void SetParameterWeights(
const std::vector<double> weights) {
p_parameterWeights = weights; }
145 void SolveCholesky () {}
149 bool ApplyParameterWeights();
164 int p_currentFillRow;
LeastSquares(Isis::BasisFunction &basis, bool sparse=false, int sparseRows=0, int sparseCols=0, bool jigsaw=false)
Creates a LeastSquares Object.
std::vector< double > p_epsilonsSparse
sparse vector of total parameter corrections
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...
arma::mat p_xSparse
sparse solution matrix
void SolveSVD()
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
int p_constrainedParameters
constrained parameters
std::vector< double > GetInput(int row) const
This method returns the data at the given row.
int Knowns() const
The number of knowns (or times AddKnown was invoked) linear combination of the variables.
Generic linear equation class.
void FillSparseA(const std::vector< double > &data)
Invoke this method for each set of knowns for sparse solutions.
std::vector< double > p_parameterWeights
vector of parameter weights
std::vector< double > p_expected
A vector of the expected values when solved.
double Evaluate(const std::vector< double > &input)
Invokes the BasisFunction Evaluate method.
int Rows() const
This methods returns the number of rows in the matrix.
double Residual(int i) const
Returns the ith residual.
std::vector< std::vector< double > > p_input
A vector of the input variables to evaluate.
~LeastSquares()
Destroys the LeastSquares object.
Generic least square fitting class.
arma::SpMat< double > p_sparseA
design matrix 'A'
arma::SpMat< double > p_normals
normal equations matrix 'N'
Isis::BasisFunction * p_basis
Pointer to the BasisFunction object.
double GetExpected(int row) const
This method returns the expected value at the given row.
std::vector< double > p_residuals
A vector of the residuals (or difference between expected and solved values).
std::vector< double > p_sqrtWeight
A vector of the square roots of the weights for each known value.
arma::mat p_ATb
right-hand side vector
arma::mat p_SLU_Factor
decomposed normal equations matrix
double p_sigma0
sigma nought - reference variance
bool p_solved
Boolean value indicating solution is complete.
int SolveSparse()
Solve using sparse class.
void AddKnown(const std::vector< double > &input, double expected, double weight=1.0)
Invoke this method for each set of knowns.
@ SVD
Singular Value Decomposition.
int p_degreesOfFreedom
degrees of freedom (redundancy)
This is free and unencumbered software released into the public domain.
void Weight(int index, double weight)
Reset the weight for the ith known.
void SolveQRD()
After all the data has been registered through AddKnown, invoke this method to solve the system of eq...
std::vector< double > Residuals() const
Returns a vector of residuals (errors).