61 for(
int i = 0; i < x.
nrows(); i++) {
64 for(
int j = 0; j < x.
ncols(); j++) {
65 data[i][j+1] = x(i, j);
74 for(
int i = 0; i < getDimension(); i++) data[i] = Tps<T>(x[i]);
101 throw SizeError(
"Vps::setComponent()",
"Index out of range.");
112 if(
int var = p->getVariables()) {
115 "Vps has inconsistent number of variables.");
161 if(y == T(0))
throw DivideError(
"Vps::operator/()");
171 throw SizeError(
"Vps::operator+=()",
"Inconsistent dimensions.");
182 throw SizeError(
"Vps::operator-=()",
"Inconsistent dimensions.");
193 throw SizeError(
"Vps::operator+=()",
"Inconsistent dimensions.");
204 throw SizeError(
"Vps::operator-=()",
"Inconsistent dimensions.");
215 is.flags(std::ios::skipws);
218 if(std::strcmp(head,
"Vps") != 0) {
219 throw FormatError(
"Vps::get()",
"Flag word \"Vps\" missing.");
226 throw FormatError(
"Vps::get()",
"Zero Vps dimension");
230 for(
int i = 0; i < nDim; i++) is >>
data[i];
240 os <<
"Vps " << nDim << std::endl;
241 for(
int i = 0; i < nDim; i++) os <<
data[i];
257 while(++p <
data.end()) {
270 while(++p <
data.end()) {
291 z.
data[i] =
data[i].filter(lowOrder, highOrder);
304 z.
data[i] =
data[i].truncate(trunc);
int FTpsData< N >::topOrder
int size() const
Get array size.
int nrows() const
Get number of rows.
int ncols() const
Get number of columns.
int getVariables() const
Get number of variables.
static int getGlobalTruncOrder()
Get global truncation order.
Tps< T > inverse(int order=truncOrder) const
Reciprocal value.
int getTruncOrder() const
Get truncation order.
int getMaxOrder() const
Get maximal order.
void setComponent(int index, const Tps< T > &value)
Set component.
int getTopOrder() const
Get highest order contained in any component.
Vps< T > & operator-=(const Vps< T > &y)
Subtraction.
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 getVariables() const
Get number of variables (the same in all components).
int getTruncOrder() const
Get lowest truncation order in any component.
Vps(int nDim, int nVar=0)
Constructor.
Vps< T > operator+() const
Unary plus.
Vps< T > operator-() const
Unary minus.
Vps< T > truncate(int trunc)
Truncate, may also increase truncation order.
const Tps< T > & getComponent(int index) const
Get component.
int getDimension() const
Get dimension (number of Tps<T> components).
Vps< T > filter(int lowOrder, int highOrder) const
Extract range of orders, set others to zero.
Vps< T > & operator=(const Vps< T > &)
void check() const
Check consistency.
Vps< T > & operator*=(const Tps< T > &y)
Multiply by Tps<T> and assign.
Vps< T > & operator+=(const Vps< T > &y)
Addition.
Vps< T > & operator/=(const Tps< T > &y)
Divide by Tps<T> and assign.