LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Public Attributes | List of all members
lsst::afw::math::LeastSquares::Impl Class Referenceabstract

Public Types

enum  StateFlags {
  LOWER_FISHER_MATRIX = 0x001, FULL_FISHER_MATRIX = 0x002, RHS_VECTOR = 0x004, SOLUTION_ARRAY = 0x008,
  COVARIANCE_ARRAY = 0x010, DIAGNOSTIC_ARRAY = 0x020, DESIGN_AND_DATA = 0x040
}
 

Public Member Functions

template<typename D >
void setRank (Eigen::MatrixBase< D > const &values)
 
void ensure (int desired)
 
virtual void factor ()=0
 
virtual void updateRank ()=0
 
virtual void updateSolution ()=0
 
virtual void updateCovariance ()=0
 
virtual void updateDiagnostic ()=0
 
 Impl (int dimension_, double threshold_=std::numeric_limits< double >::epsilon())
 
virtual ~Impl ()
 

Public Attributes

int state
 
int dimension
 
int rank
 
Factorization factorization
 
Factorization whichDiagnostic
 
double threshold
 
Eigen::MatrixXd design
 
Eigen::VectorXd data
 
Eigen::MatrixXd fisher
 
Eigen::VectorXd rhs
 
ndarray::Array< double, 1, 1 > solution
 
ndarray::Array< double, 2, 2 > covariance
 
ndarray::Array< double, 1, 1 > diagnostic
 
pex::logging::Debug log
 

Detailed Description

Definition at line 37 of file LeastSquares.cc.

Member Enumeration Documentation

Constructor & Destructor Documentation

lsst::afw::math::LeastSquares::Impl::Impl ( int  dimension_,
double  threshold_ = std::numeric_limits<double>::epsilon() 
)
inline

Definition at line 118 of file LeastSquares.cc.

118  :
119  state(0), dimension(dimension_), rank(dimension_), threshold(threshold_),
120  log("afw.math.LeastSquares")
121  {}
virtual lsst::afw::math::LeastSquares::Impl::~Impl ( )
inlinevirtual

Definition at line 123 of file LeastSquares.cc.

123 {}

Member Function Documentation

void lsst::afw::math::LeastSquares::Impl::ensure ( int  desired)
inline

Definition at line 78 of file LeastSquares.cc.

78  {
80  if (desired & FULL_FISHER_MATRIX) desired |= LOWER_FISHER_MATRIX;
81  int toAdd = ~state & desired;
82  if (toAdd & LOWER_FISHER_MATRIX) {
83  assert(state & DESIGN_AND_DATA);
84  fisher = Eigen::MatrixXd::Zero(design.cols(), design.cols());
85  fisher.selfadjointView<Eigen::Lower>().rankUpdate(design.adjoint());
86  }
87  if (toAdd & FULL_FISHER_MATRIX) {
88  fisher.triangularView<Eigen::StrictlyUpper>() = fisher.adjoint();
89  }
90  if (toAdd & RHS_VECTOR) {
91  assert(state & DESIGN_AND_DATA);
92  rhs = design.adjoint() * data;
93  }
94  if (toAdd & SOLUTION_ARRAY) {
97  }
98  if (toAdd & COVARIANCE_ARRAY) {
101  }
102  if (toAdd & DIAGNOSTIC_ARRAY) {
105  }
106  state |= toAdd;
107  }
ndarray::Array< double, 1, 1 > diagnostic
Definition: LeastSquares.cc:64
ndarray::Array< double, 1, 1 > solution
Definition: LeastSquares.cc:62
detail::SimpleInitializer< N > allocate(Vector< int, N > const &shape)
Create an expression that allocates uninitialized memory for an array.
bool isEmpty() const
Return true if the array has a null data point.
Definition: ArrayBase.h:120
ndarray::Array< double, 2, 2 > covariance
Definition: LeastSquares.cc:63
virtual void lsst::afw::math::LeastSquares::Impl::factor ( )
pure virtual
template<typename D >
void lsst::afw::math::LeastSquares::Impl::setRank ( Eigen::MatrixBase< D > const &  values)
inline

Definition at line 69 of file LeastSquares.cc.

69  {
70  double cond = threshold * values[0];
71  if (cond <= 0.0) {
72  rank = 0;
73  } else {
74  for (rank = dimension; (rank > 1) && (values[rank-1] < cond); --rank);
75  }
76  }
virtual void lsst::afw::math::LeastSquares::Impl::updateCovariance ( )
pure virtual
virtual void lsst::afw::math::LeastSquares::Impl::updateDiagnostic ( )
pure virtual
virtual void lsst::afw::math::LeastSquares::Impl::updateRank ( )
pure virtual
virtual void lsst::afw::math::LeastSquares::Impl::updateSolution ( )
pure virtual

Member Data Documentation

ndarray::Array<double,2,2> lsst::afw::math::LeastSquares::Impl::covariance

Definition at line 63 of file LeastSquares.cc.

Eigen::VectorXd lsst::afw::math::LeastSquares::Impl::data

Definition at line 58 of file LeastSquares.cc.

Eigen::MatrixXd lsst::afw::math::LeastSquares::Impl::design

Definition at line 57 of file LeastSquares.cc.

ndarray::Array<double,1,1> lsst::afw::math::LeastSquares::Impl::diagnostic

Definition at line 64 of file LeastSquares.cc.

int lsst::afw::math::LeastSquares::Impl::dimension

Definition at line 51 of file LeastSquares.cc.

Factorization lsst::afw::math::LeastSquares::Impl::factorization

Definition at line 53 of file LeastSquares.cc.

Eigen::MatrixXd lsst::afw::math::LeastSquares::Impl::fisher

Definition at line 59 of file LeastSquares.cc.

pex::logging::Debug lsst::afw::math::LeastSquares::Impl::log

Definition at line 66 of file LeastSquares.cc.

int lsst::afw::math::LeastSquares::Impl::rank

Definition at line 52 of file LeastSquares.cc.

Eigen::VectorXd lsst::afw::math::LeastSquares::Impl::rhs

Definition at line 60 of file LeastSquares.cc.

ndarray::Array<double,1,1> lsst::afw::math::LeastSquares::Impl::solution

Definition at line 62 of file LeastSquares.cc.

int lsst::afw::math::LeastSquares::Impl::state

Definition at line 50 of file LeastSquares.cc.

double lsst::afw::math::LeastSquares::Impl::threshold

Definition at line 55 of file LeastSquares.cc.

Factorization lsst::afw::math::LeastSquares::Impl::whichDiagnostic

Definition at line 54 of file LeastSquares.cc.


The documentation for this class was generated from the following file: