1 #ifndef CLASSIC_VpsMap_HH
2 #define CLASSIC_VpsMap_HH
49 VpsMap(
int nDim,
int nVar);
155 template <
class T> std::ostream &operator<<(std::ostream &, const VpsMap<T> &x);
158 template <
class T>
inline
166 template <
class T>
inline
172 template <
class T>
inline
178 template <
class T>
inline
184 template <
class T>
inline
190 template <
class T>
inline
196 template <
class T>
inline
202 template <
class T>
inline
208 template <
class T>
inline
213 template <
class T>
inline
220 template <
class T>
inline
222 return substitute(y, this->getTruncOrder());
226 template <
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);
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);
391 template <
class T>
inline
395 template <
class T>
inline
399 template <
class T>
inline
403 template <
class T>
inline
407 template <
class T>
inline
411 template <
class T>
inline
416 template <
class T>
inline
420 template <
class T>
inline
424 template <
class T>
inline
428 template <
class T>
inline
432 template <
class T>
inline
436 template <
class T>
inline
440 template <
class T>
inline
442 {
return x.
get(is); }
444 template <
class T>
inline
445 std::ostream &operator<<(std::ostream &os, const VpsMap<T> &x)
446 {
return x.put(os); }
448 #endif // CLASSIC_VpsMap_HH
Substitution for Tps<T>.
VpsMap< T > & operator=(const VpsMap< T > &y)
VpsMap< T > substituteInto(const Matrix< T > &x) const
Substitute.
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent this
const Array1D< TpsSubstitution > & getSubTable() const
Matrix< T > operator-(const Matrix< T > &, const Matrix< T > &)
Matrix subtraction.
int size() const
Get array size.
int ncols() const
Get number of columns.
int nrows() const
Get number of rows.
std::istream & get(std::istream &is)
Get a Vps<T> from stream is.
Matrix< T > operator*(const Matrix< T > &, const Matrix< T > &)
Matrix multiply.
T::PETE_Expr_t::PETE_Return_t min(const PETE_Expr< T > &expr, NDIndex< D > &loc)
Vps< T > & operator=(const Vps< T > &)
Vector truncated power series.
VpsMap< T > derivative(int var) const
Derivative with respect to variable [b]var[/b].
void check() const
Check consistency.
Matrix< T > operator+(const Matrix< T > &, const Matrix< T > &)
Matrix addition.
Truncate power series map.
Matrix< T > linearTerms() const
Extract linear terms at origin.
b mention the algorithm in the References section The appropriate citation is
std::istream & operator>>(std::istream &, Tps< T > &x)
Extract from stream.
VpsMap< T > substitute(const VpsMap< T > &vv) const
Substitute.
Matrix< T > operator/(const Matrix< T > &, const T &)
Matrix divided by scalar.
VpsMap< T > integral(int var) const
Integral with respect to variable [b]var[/b].
static TpsData * getTpsData(int nOrd, int nVar)
Vector< T > constantTerm() const
Evaluate map at origin.
int getDimension() const
Get dimension (number of Tps<T> components).