1 #ifndef MeasAlgoShapeletFunction2D_H
2 #define MeasAlgoShapeletFunction2D_H
13 namespace algorithms {
36 { (*_coeffs)(0,0) = 0.0; }
51 virtual void write(std::ostream& fout)
const =0;
53 static std::auto_ptr<Function2D>
read(std::istream& fin);
55 virtual std::auto_ptr<Function2D>
copy()
const =0;
58 virtual void addLinear(
double a,
double b,
double c) = 0;
62 double a,
double b,
double c,
double d,
double e,
double f) = 0;
65 virtual std::auto_ptr<Function2D>
dFdX()
const = 0;
68 virtual std::auto_ptr<Function2D>
dFdY()
const = 0;
70 virtual std::auto_ptr<Function2D>
conj()
const;
80 virtual void setTo(
double value)
86 (*_coeffs)(0,0) = value;
101 int order,
const std::vector<Position>& pos,
102 const std::vector<double>& v,
const std::vector<bool>& shouldUse,
103 const std::vector<double>* sigList=0,
104 double* chisqOut = 0,
int* dofOut=0,
DMatrix* cov=0);
109 int order,
double nsig,
110 const std::vector<Position>& pos,
const std::vector<double>& v,
111 std::vector<bool>* shouldUse,
112 const std::vector<double>* sigList=0,
113 double* chisqout = 0,
int* dofout = 0,
DMatrix* cov=0);
121 int maxOrder,
double equivProb,
122 const std::vector<Position>& pos,
const std::vector<double>& v,
123 const std::vector<bool>& shouldUse,
const std::vector<double>* sigList=0,
124 double *chisqout = 0,
int *dofout = 0,
DMatrix* cov=0);
128 double a,
double b,
double c,
151 int xOrder,
int yOrder,
152 const std::vector<Position>& pos,
const std::vector<double>& v,
153 const std::vector<bool>& shouldUse,
DVector *f,
154 const std::vector<double>* sigList=0,
int *dof=0,
159 { f.
write(fout);
return fout; }
162 std::istream& fin, std::auto_ptr<Function2D>& f)
182 {
return (*this->
_coeffs)(0,0); }
184 virtual void write(std::ostream& fout)
const;
186 virtual std::auto_ptr<Function2D>
dFdX()
const
187 {
return std::auto_ptr<Function2D>(
new Constant2D()); }
189 virtual std::auto_ptr<Function2D>
dFdY()
const
190 {
return std::auto_ptr<Function2D>(
new Constant2D()); }
192 std::auto_ptr<Function2D>
copy()
const
193 {
return std::auto_ptr<Function2D>(
new Constant2D(*
this)); }
203 double ,
double ,
double ,
double ,
double ,
double )
209 int ,
int ,
const DVector& fVect)
214 (*this->
_coeffs)(0,0) = fVect(0);
254 virtual void write(std::ostream& fout)
const;
256 virtual std::auto_ptr<Function2D>
dFdX()
const;
258 virtual std::auto_ptr<Function2D>
dFdY()
const;
260 std::auto_ptr<Function2D>
copy()
const
261 {
return std::auto_ptr<Function2D>(
new Polynomial2D(*
this)); }
263 virtual void addLinear(
double a,
double b,
double c);
266 double a,
double b,
double c,
double d,
double e,
double f);
273 int xOrder,
int yOrder,
const DVector& fVect);
283 for(
int i=1;i<=order;++i) temp(i) = temp(i-1)*x/
_scale;
virtual void setTo(double value)
virtual std::auto_ptr< Function2D > dFdX() const
virtual std::auto_ptr< Function2D > dFdY() const =0
virtual double operator()(double, double) const
virtual DVector definePY(int order, double y) const =0
const Bounds & getBounds() const
Polynomial2D(const DMatrix &a, double scale=1.)
virtual DVector definePX(int order, double x) const =0
std::auto_ptr< Function2D > copy() const
std::auto_ptr< Function2D > copy() const
virtual std::auto_ptr< Function2D > conj() const
virtual DVector definePX(int order, double) const
Constant2D(const Constant2D &rhs)
virtual void linearTransform(double a, double b, const Function2D &f)
std::auto_ptr< DMatrix > _coeffs
Polynomial2D(const Polynomial2D &rhs)
virtual void addLinear(double a, double b, double c)=0
virtual void setFunction(int _xOrder, int _yOrder, const DVector &fVect)=0
virtual void operator+=(const Function2D &rhs)=0
std::ostream & operator<<(std::ostream &os, const Position &pos)
const DMatrix & getCoeffs() const
virtual void outlierFit(int order, double nsig, const std::vector< Position > &pos, const std::vector< double > &v, std::vector< bool > *shouldUse, const std::vector< double > *sigList=0, double *chisqout=0, int *dofout=0, DMatrix *cov=0)
Function2D(const Function2D &rhs)
virtual void linearPreTransform(double, double, double, double, double, double)
virtual void write(std::ostream &fout) const
virtual void linearPreTransform(double a, double b, double c, double d, double e, double f)
Function2D(int xo, int yo)
Function2D(int xo, int yo, const DMatrix &c)
virtual std::auto_ptr< Function2D > dFdY() const
virtual std::auto_ptr< Function2D > dFdX() const =0
virtual void operator+=(const Function2D &rhs)
virtual void write(std::ostream &fout) const
virtual DVector definePY(int order, double y) const
virtual std::auto_ptr< Function2D > dFdX() const
virtual void operator*=(double scale)
double operator()(const Position &p) const
virtual void addLinear(double a, double b, double c)
std::istream & operator>>(std::istream &os, Position &pos)
void makeProductOf(const Polynomial2D &f, const Polynomial2D &g)
virtual void linearTransform(double a, double b, double c, const Function2D &f, const Function2D &g)
virtual double operator()(double x, double y) const
afw::table::Key< double > b
virtual std::auto_ptr< Function2D > dFdY() const
virtual void linearPreTransform(double a, double b, double c, double d, double e, double f)=0
virtual void simpleFit(int order, const std::vector< Position > &pos, const std::vector< double > &v, const std::vector< bool > &shouldUse, const std::vector< double > *sigList=0, double *chisqOut=0, int *dofOut=0, DMatrix *cov=0)
virtual void setFunction(int xOrder, int yOrder, const DVector &fVect)
void doSimpleFit(int xOrder, int yOrder, const std::vector< Position > &pos, const std::vector< double > &v, const std::vector< bool > &shouldUse, DVector *f, const std::vector< double > *sigList=0, int *dof=0, DVector *diff=0, DMatrix *cov=0)
const Position & getPosition() const
Polynomial2D(double scale=1.)
RangeException(const Position &p, const Bounds &b)
virtual void setFunction(int, int, const DVector &fVect)
virtual void addLinear(double a, double b, double c)
virtual void write(std::ostream &fout) const =0
virtual std::auto_ptr< Function2D > copy() const =0
virtual void operator+=(const Function2D &rhs)
virtual DVector definePX(int order, double x) const
Polynomial2D(int xo, int yo, double scale=1.)
static std::auto_ptr< Function2D > read(std::istream &fin)
virtual void orderFit(int maxOrder, double equivProb, const std::vector< Position > &pos, const std::vector< double > &v, const std::vector< bool > &shouldUse, const std::vector< double > *sigList=0, double *chisqout=0, int *dofout=0, DMatrix *cov=0)
virtual DVector definePY(int order, double y) const