28#ifndef SquarePolynomialVector_hh
29#define SquarePolynomialVector_hh 1
132 void F(
const double* point,
double* value)
const;
184 double*
MakePolyVector(
const double* point,
double* polyVector)
const;
192 static std::vector<int>
IndexByPower (
int index,
int nInputVariables);
200 static std::vector<int>
IndexByVector(
int index,
int nInputVariables);
221 char int_separator=
'.',
222 char str_separator=
' ',
224 bool pad_at_start=
true)
const;
234 template <
class Container >
236 const Container& container,
244 std::vector<int> check,
247 std::vector<std::vector<int> >& nearby_points);
std::ostream & operator<<(std::ostream &out, const Mesh::Iterator &it)
Output iterator to a std ostream object.
size_t num_row() const
returns number of rows in the matrix
SquarePolynomialVector, an arbitrary order polynomial vector class.
unsigned int PointDimension() const
Length of the input point (x) vector.
~SquarePolynomialVector()
Destructor - no memory allocated so doesn't do anything.
static std::vector< std::vector< std::vector< int > > > _polyKeyByVector
static unsigned int NumberOfPolynomialCoefficients(int pointDimension, int order)
Returns the number of coefficients required for an arbitrary dimension, order polynomial e....
void SetCoefficients(int pointDim, MMatrix< double > coeff)
Reinitialise the polynomial vector with new point (x) dimension and coefficients.
MVector< double > & MakePolyVector(const MVector< double > &point, MVector< double > &polyVector) const
Make a vector like .
static std::vector< std::vector< std::vector< int > > > _polyKeyByPower
SquarePolynomialVector * Clone() const
Polymorphic copy constructor.
unsigned int PolynomialOrder() const
Index of highest power - 0 is const, 1 is linear, 2 is quadratic etc...
static std::vector< int > IndexByPower(int index, int nInputVariables)
Transforms from a 1d index of polynomial coefficients to an nd index.
static void PrintContainer(std::ostream &out, const Container &container, char T_separator, char str_separator, int length, bool pad_at_start)
Print a sequence: with some string that separates elements of index and some character that pads.
unsigned int ValueDimension() const
Length of the output value (y) vector.
MMatrix< double > GetCoefficientsAsMatrix() const
Return the coefficients as a matrix of doubles.
static bool _printHeaders
static void PrintHeaders(bool willPrintHeaders)
Control the formatting of the polynomial vector.
MMatrix< double > _polyCoeffs
SquarePolynomialVector Deriv(const int *derivPower) const
Generate polynomial corresponding to the partial derivative of y.
SquarePolynomialVector & operator=(const SquarePolynomialVector &)=default
void PrintHeader(std::ostream &out, char int_separator='.', char str_separator=' ', int length=14, bool pad_at_start=true) const
Write out the header (PolynomialByPower index for each element).
void F(const double *point, double *value) const
Fill value with at some set of (point).
static std::vector< int > IndexByVector(int index, int nInputVariables)
Transforms from a 1d index of polynomial coefficients to an nd index.
friend std::ostream & operator<<(std::ostream &, const SquarePolynomialVector &)
Write out the PolynomialVector (effectively just polyCoeffs).
static void IndexByPowerRecursive(std::vector< int > check, size_t check_index, size_t poly_power, std::vector< std::vector< int > > &nearby_points)
SquarePolynomialVector()
Default constructor.