1#ifndef CLASSIC_VpsMap_HH
2#define CLASSIC_VpsMap_HH
49 VpsMap(
int nDim,
int nVar);
158template <
class T>
inline
166template <
class T>
inline
172template <
class T>
inline
178template <
class T>
inline
184template <
class T>
inline
190template <
class T>
inline
196template <
class T>
inline
202template <
class T>
inline
208template <
class T>
inline
213template <
class T>
inline
220template <
class T>
inline
222 return substitute(y, this->getTruncOrder());
226template <
class T>
inline
234 if(this->getVariables() != y.
size()) {
235 throw SizeError(
"VpsMap::constantTerm()",
"Inconsistent dimensions.");
248 for(
int next = 1; next < table.
size();) {
252 for(
int v = 0; v < this->getDimension(); v++) {
253 if(this->data[v][s.
index] !=
T(0)) {
254 z[v] += this->data[v][s.
index] * product[s.
order];
258 next = (s.
order < this->getTopOrder()) ? next + 1 : s.
skip;
268 for(
int i = 0; i < this->getDimension(); i++) z[i] = this->data[i][0];
275 Matrix<T> z(this->getDimension(), this->getVariables());
277 for(
int i = 0; i < z.
nrows(); i++) {
278 for(
int j = 0; j < z.
ncols(); j++) {
279 z[i][j] = this->data[i].derivative(j).evaluate(y);
289 Matrix<T> M(this->getDimension(), this->getVariables());
291 for(
int i = 0; i < this->getDimension(); i++) {
292 for(
int j = 0; j < this->getVariables(); j++) {
293 M(i, j) = this->data[i][j+1];
303 VpsMap<T> z(this->getDimension(), this->getVariables());
305 for(
int i = 0; i < this->getDimension(); i++) {
315 VpsMap<T> z(this->getDimension(), this->getVariables());
317 for(
int i = 0; i < this->getDimension(); i++) {
332 throw SizeError(
"VpsMap::substitute()",
"Inconsistent dimensions.");
341 int topOrder = this->getTopOrder();
348 for(
int next = 1; next < table.
size();) {
352 for(
int v = 0; v < this->getDimension(); v++) {
353 int maxOrder = this->data[v].getMaxOrder();
354 int cutOrder =
std::min(this->data[v].getTruncOrder(), trunc);
356 if(s.
order <= maxOrder && this->data[v][s.
index] !=
T(0)) {
358 product[s.
order].truncate(cutOrder);
362 next = (s.
order < topOrder) ? next + 1 : s.
skip;
372 if(x.
ncols() != this->getDimension()) {
373 throw SizeError(
"VpsMap::substituteInto()",
"Inconsistent dimensions.");
378 for(
int i = 0; i < this->getDimension(); i++) {
379 for(
int j = 0; j < this->data.size(); j++) {
380 z[i] += this->data[j] * x(i, j);
391template <
class T>
inline
395template <
class T>
inline
399template <
class T>
inline
403template <
class T>
inline
407template <
class T>
inline
411template <
class T>
inline
416template <
class T>
inline
420template <
class T>
inline
424template <
class T>
inline
428template <
class T>
inline
432template <
class T>
inline
436template <
class T>
inline
440template <
class T>
inline
444template <
class T>
inline
VpsMap< T > operator+(const VpsMap< T > &x, const VpsMap< T > &y)
Add.
VpsMap< T > operator*(const VpsMap< T > &x, const Tps< T > &y)
Multiply.
std::ostream & operator<<(std::ostream &, const VpsMap< T > &x)
Insert to stream.
VpsMap< T > operator-(const VpsMap< T > &x, const VpsMap< T > &y)
Subtract.
VpsMap< T > operator/(const VpsMap< T > &x, const Tps< T > &y)
Divide.
std::istream & operator>>(std::istream &, VpsMap< T > &x)
Extract from stream.
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
int size() const
Get array size.
int nrows() const
Get number of rows.
int ncols() const
Get number of columns.
Truncate power series map.
VpsMap< T > derivative(int var) const
Derivative with respect to variable [b]var[/b].
Vector< T > constantTerm() const
Evaluate map at origin.
VpsMap< T > integral(int var) const
Integral with respect to variable [b]var[/b].
VpsMap< T > substituteInto(const Matrix< T > &x) const
Substitute.
VpsMap< T > & operator=(const VpsMap< T > &y)
Matrix< T > linearTerms() const
Extract linear terms at origin.
VpsMap< T > substitute(const VpsMap< T > &vv) const
Substitute.
static TpsData * getTpsData(int nOrd, int nVar)
const Array1D< TpsSubstitution > & getSubTable() const
Vector truncated power series.
std::ostream & put(std::ostream &os) const
Put a Vps<T> to stream os.
std::istream & get(std::istream &is)
Get a Vps<T> from stream is.
int getDimension() const
Get dimension (number of Tps<T> components).
Vps< T > & operator=(const Vps< T > &)
void check() const
Check consistency.