53 os <<
"this is a " <<
getClassName() <<
", which is not a PolyMap";
61 const int nin = coeff_f.getSize<1>() - 2;
62 const int ncoeff_f = coeff_f.getSize<0>();
63 const int nout = coeff_i.getSize<1>() - 2;
64 const int ncoeff_i = coeff_i.getSize<0>();
66 if ((ncoeff_f == 0) && (ncoeff_i == 0)) {
68 "Must specify forward or inverse transform (coeff_f and coeff_i both empty)");
72 os <<
"coeff_f row length = " << nin + 2
73 <<
", which is too short; length = nin + 2 and nin must be > 0";
78 os <<
"coeff_i row length " << nout + 2
79 <<
", which is too short; length = nout + 2 and nout must be > 0";
83 auto result = astPolyMap(nin, nout, ncoeff_f, coeff_f.getData(), ncoeff_i, coeff_i.getData(),
"%s",
90 AstPolyMap *PolyMap::_makeRawPolyMap(
ConstArray2D const &coeff_f,
int nout,
92 const int nin = coeff_f.getSize<1>() - 2;
93 const int ncoeff_f = coeff_f.getSize<0>();
99 os <<
"coeff_f row length = " << nin + 2
100 <<
", which is too short; length = nin + 2 and nin must be > 0";
105 os <<
"nout = " << nout <<
" <0 =";
109 auto result = astPolyMap(nin, nout, ncoeff_f, coeff_f.getData(), 0,
nullptr,
"%s", options.
c_str());
ndarray::Array< const double, 2, 2 > ConstArray2D
2D array of const double; typically used for lists of const points
AstObject const * getRawPtr() const
Get the raw AST pointer.
PolyMap polyTran(bool forward, double acc, double maxacc, int maxorder, std::vector< double > const &lbnd, std::vector< double > const &ubnd) const
This function creates a new PolyMap which is a copy of this one, in which a specified transformation ...
AST wrapper classes and functions.
std::string getClassName() const
Get Class: the name of the class (e.g.
void assertOK(AstObject *rawPtr1=nullptr, AstObject *rawPtr2=nullptr)
Throw std::runtime_error if AST's state is bad.
bool isInverted() const
Is this an inverted mapping?
An abstract base class for objects which transform one set of coordinates to another.
bool getIterInverse() const
Get IterInverse: does this provide an iterative inverse transformation?
template AstPolyMap * polyTranImpl< AstPolyMap >(PolyMap const &, bool, double, double, int, std::vector< double > const &, std::vector< double > const &)
PolyMap is a Mapping which performs a general polynomial transformation.
PolyMap(ConstArray2D const &coeff_f, ConstArray2D const &coeff_i, std::string const &options="IterInverse=0")
Construct a PolyMap with specified forward and/or inverse transforms.