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
Classes | Public Member Functions | Private Attributes | List of all members
lsst::meas::algorithms::shapelet::EllipseSolver3 Class Reference

#include <EllipseSolver.h>

Inheritance diagram for lsst::meas::algorithms::shapelet::EllipseSolver3:
lsst::meas::algorithms::shapelet::NLSolver

Classes

struct  ESImpl3
 

Public Member Functions

 EllipseSolver3 (const BVec &b0, int order, bool fixcen=false, bool fixgam=false, bool fixmu=false)
 
 ~EllipseSolver3 ()
 
void calculateF (const DVector &x, DVector &f) const
 
void calculateJ (const DVector &x, const DVector &f, DMatrix &df) const
 
void useNumericJ ()
 
void dontZeroB11 ()
 
void getCovariance (DMatrix &cov) const
 
void getInverseCovariance (DMatrix &invcov) const
 
void callF (const DVector &x, DVector &f) const
 
bool solve (DVector &x, DVector &f) const
 
bool testJ (const DVector &x, DVector &f, std::ostream *os=0, double relerr=0.) const
 
- Public Member Functions inherited from lsst::meas::algorithms::shapelet::NLSolver
 NLSolver ()
 
virtual ~NLSolver ()
 
virtual void useHybrid ()
 
virtual void useDogleg ()
 
virtual void setFTol (double fTol)
 
virtual void setGTol (double gTol)
 
virtual void setTol (double fTol, double gTol)
 
virtual void setMinStep (double minStep)
 
virtual void setMaxIter (int maxIter)
 
virtual void setTau (double tau)
 
virtual void setDelta0 (double delta0)
 
virtual double getFTol ()
 
virtual double getGTol ()
 
virtual double getMinStep ()
 
virtual int getMaxIter ()
 
virtual double getTau ()
 
virtual double getDelta0 ()
 
virtual void setOutput (std::ostream &os)
 
virtual void useVerboseOutput ()
 
virtual void useExtraVerboseOutput ()
 
virtual void noUseVerboseOutput ()
 
virtual void useDirectH ()
 
virtual void useSVD ()
 
virtual void useCholesky ()
 
virtual void noUseDirectH ()
 
virtual void noUseSVD ()
 
virtual void noUseCholesky ()
 

Private Attributes

ESImpl3_pimpl
 

Detailed Description

Definition at line 14 of file EllipseSolver.h.

Constructor & Destructor Documentation

lsst::meas::algorithms::shapelet::EllipseSolver3::EllipseSolver3 ( const BVec b0,
int  order,
bool  fixcen = false,
bool  fixgam = false,
bool  fixmu = false 
)

Definition at line 97 of file EllipseSolver.cc.

99  :
100  _pimpl(new ESImpl3(b0,order,fixcen,fixgam,fixmu))
101  {}
lsst::meas::algorithms::shapelet::EllipseSolver3::~EllipseSolver3 ( )

Definition at line 103 of file EllipseSolver.cc.

Member Function Documentation

void lsst::meas::algorithms::shapelet::EllipseSolver3::calculateF ( const DVector x,
DVector f 
) const
virtual
void lsst::meas::algorithms::shapelet::EllipseSolver3::calculateJ ( const DVector x,
const DVector f,
DMatrix df 
) const
virtual

Reimplemented from lsst::meas::algorithms::shapelet::NLSolver.

Definition at line 109 of file EllipseSolver.cc.

111  {
112 #ifdef ALWAYS_NUMERIC_J
113  NLSolver::calculateJ(x,f,J);
114 #else
116  else _pimpl->calculateJ(x,f,J);
117 #endif
118  }
void calculateJ(const DVector &x, const DVector &f, DMatrix &J) const
virtual void calculateJ(const DVector &x, const DVector &f, DMatrix &j) const
Definition: NLSolver.cc:1201
double x
void lsst::meas::algorithms::shapelet::EllipseSolver3::callF ( const DVector x,
DVector f 
) const

Definition at line 915 of file EllipseSolver.cc.

916  {
917  Assert(x.size() == 5);
918  Assert(f.size() == 5);
919  _pimpl->xinit = x;
920  if (_pimpl->fixcen) { _pimpl->fixuc = x[0]; _pimpl->fixvc = x[1]; }
921  if (_pimpl->fixgam) { _pimpl->fixg1 = x[2]; _pimpl->fixg2 = x[3]; }
922  if (_pimpl->fixmu) { _pimpl->fixm = x[4]; }
923 
924  _pimpl->x_short = _pimpl->U * x;
925 
927 
929  }
double x
void calculateF(const DVector &x, DVector &f) const
#define EIGEN_Transpose(m)
Definition: MyMatrix.h:211
#define Assert(x)
Definition: dbg.h:73
void lsst::meas::algorithms::shapelet::EllipseSolver3::dontZeroB11 ( )
void lsst::meas::algorithms::shapelet::EllipseSolver3::getCovariance ( DMatrix cov) const
virtual

Reimplemented from lsst::meas::algorithms::shapelet::NLSolver.

Definition at line 895 of file EllipseSolver.cc.

896  {
897  DMatrix cov1(_pimpl->x_short.size(),_pimpl->x_short.size());
899  cov = _pimpl->U.transpose()*cov1*_pimpl->U;
900  dbg<<"getCovariance:\n";
901  dbg<<"cov1 = "<<cov1<<std::endl;
902  dbg<<"full cov = "<<cov<<std::endl;
903  }
virtual void getCovariance(DMatrix &cov) const
Definition: NLSolver.cc:1638
#define dbg
Definition: dbg.h:69
void lsst::meas::algorithms::shapelet::EllipseSolver3::getInverseCovariance ( DMatrix invcov) const
virtual

Reimplemented from lsst::meas::algorithms::shapelet::NLSolver.

Definition at line 905 of file EllipseSolver.cc.

906  {
907  DMatrix invcov1(_pimpl->x_short.size(),_pimpl->x_short.size());
909  invcov = _pimpl->U.transpose()*invcov1*_pimpl->U;
910  dbg<<"getInverseCovariance:\n";
911  dbg<<"invcov1 = "<<invcov1<<std::endl;
912  dbg<<"full invcov = "<<invcov<<std::endl;
913  }
virtual void getInverseCovariance(DMatrix &invcov) const
Definition: NLSolver.cc:1675
#define dbg
Definition: dbg.h:69
bool lsst::meas::algorithms::shapelet::EllipseSolver3::solve ( DVector x,
DVector f 
) const
virtual

Reimplemented from lsst::meas::algorithms::shapelet::NLSolver.

Definition at line 931 of file EllipseSolver.cc.

932  {
933  Assert(x.size() == 5);
934  Assert(f.size() == 5);
935  _pimpl->xinit = x;
936  _pimpl->bx.TMV_setAllTo(1.); // In case we bail out with f = 2*bx/b(0)
937  if (_pimpl->fixcen) { _pimpl->fixuc = x[0]; _pimpl->fixvc = x[1]; }
938  if (_pimpl->fixgam) { _pimpl->fixg1 = x[2]; _pimpl->fixg2 = x[3]; }
939  if (_pimpl->fixmu) { _pimpl->fixm = x[4]; }
940  if (_pimpl->fixcen && (x[0] != 0. || x[1] != 0.)) {
942  std::complex<double>(x[0],x[1]),_pimpl->bxorder,_pimpl->Taug);
943  }
944  if (_pimpl->fixgam && (x[2] != 0. || x[3] != 0.)) {
946  std::complex<double>(x[2],x[3]),_pimpl->bxorder,_pimpl->Saug);
947  }
948  if (_pimpl->fixmu && x[4] != 0.) {
950  }
951 
952  _pimpl->x_short = _pimpl->U * x;
953 
954  bool ret;
955  try {
957  } catch (...) {
958  xdbg<<"Caught exception during NLSolver::solve"<<std::endl;
959  ret = false;
960  }
961 
963  if (_pimpl->fixcen) { x[0] = _pimpl->fixuc; x[1] = _pimpl->fixvc; }
964  if (_pimpl->fixgam) { x[2] = _pimpl->fixg1; x[3] = _pimpl->fixg2; }
965  if (_pimpl->fixmu) { x[4] = _pimpl->fixm; }
967 
968  return ret;
969  }
virtual bool solve(DVector &x, DVector &f) const
Definition: NLSolver.cc:1620
void calculateGTransform(std::complex< double > g, int order1, int order2, DMatrix &S)
Definition: BVec.cc:468
void calculateZTransform(std::complex< double > z, int order1, int order2, DMatrix &T)
Definition: BVec.cc:84
double x
#define xdbg
Definition: dbg.h:70
#define EIGEN_Transpose(m)
Definition: MyMatrix.h:211
#define Assert(x)
Definition: dbg.h:73
void calculateMuTransform(double mu, int order1, int order2, DMatrix &D)
Definition: BVec.cc:227
bool lsst::meas::algorithms::shapelet::EllipseSolver3::testJ ( const DVector x,
DVector f,
std::ostream *  os = 0,
double  relerr = 0. 
) const
virtual

Reimplemented from lsst::meas::algorithms::shapelet::NLSolver.

Definition at line 971 of file EllipseSolver.cc.

974  {
975  Assert(x.size() == 5);
976  Assert(f.size() == 5);
977  _pimpl->xinit = x;
978  if (_pimpl->fixcen) { _pimpl->fixuc = x[0]; _pimpl->fixvc = x[1]; }
979  if (_pimpl->fixgam) { _pimpl->fixg1 = x[2]; _pimpl->fixg2 = x[3]; }
980  if (_pimpl->fixmu) { _pimpl->fixm = x[4]; }
981 
982  _pimpl->x_short = _pimpl->U * x;
983 
984  return NLSolver::testJ(_pimpl->x_short,_pimpl->f_short,os,relerr);
985  }
double x
virtual bool testJ(const DVector &, DVector &, std::ostream *os=0, double relerr=0.) const
Definition: NLSolver.cc:1224
#define Assert(x)
Definition: dbg.h:73
void lsst::meas::algorithms::shapelet::EllipseSolver3::useNumericJ ( )

Member Data Documentation

ESImpl3* lsst::meas::algorithms::shapelet::EllipseSolver3::_pimpl
private

Definition at line 40 of file EllipseSolver.h.


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