python API interface to legacy PolynomailMap class
Added by Rogers, Chris almost 8 years ago.
Updated almost 8 years ago.
14 August 2015
As part of the alignment analysis, it would be useful to provide an interface to the legacy PolynomialMap class.
Would like to make an interface to the following functions:
Matrix<double> GetCoefficientsAsMatrix() const: return a list of lists instead of matrix
- SetCoefficients(int point_dim): use a list of lists
void F(const double * point, double * value) const; should take a list as argument (point) and return a list (value)
int PointDimension() const
int ValueDimension() const
std::ostream& operator<<(std::ostream&, const PolynomialMap&): should be used to make a str function
static PolynomialMap* PolynomialLeastSquaresFit(
const std::vector< std::vector<double> >& points,
const std::vector< std::vector<double> >& values,
unsigned int polynomialOrder,
const std::vector<double>& weights = std::vector<double>());
vectors should be lists or lists of lists
Nb the class is not in legacy, it is in
So I have a pretty good first pass at
I have implemented and tested
- evaluate (was F)
I found that SetCoefficients throws an exception; I might have a look at that later on. But basically this is done and working.
- Status changed from Open to Closed
- % Done changed from 0 to 100
Closed at r914
I could at some stage add point_dimension, value_dimension str() interfaces; these can be got at by doing
len(p_map.get_coefficients_as_matrix()) # value_dimension
len(p_map.get_coefficients_as_matrix()) # point_dimension
str(p_map.get_coefficients_as_matrix()) # string representation
so it would be more a convenience than anything else... and hence low priority
Also available in: Atom