|
OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
|
Truncated power series. More...
#include <Tps.h>
Public Member Functions | |
| Tps (int maxOrder, int nVar) | |
| Constructor. | |
| Tps (const T &y) | |
| Conversion. | |
| Tps (int y) | |
| Conversion. | |
| Tps () | |
| Tps (const Tps< T > &x) | |
| ~Tps () | |
| Tps< T > & | operator= (const Tps< T > &y) |
| Tps< T > & | operator= (const T &y) |
| Convert and assign. | |
| Tps< T > | filter (int lowOrder, int highOrder) const |
| Extract orders. | |
| Tps< T > | truncate (int trunc) |
| Truncate. | |
| const T | getCoefficient (int index) const |
| Get coefficient. | |
| void | setCoefficient (int index, const T &value) |
| Set coefficient. | |
| const T | getCoefficient (const TpsMonomial &monomial) const |
| Get coefficient. | |
| void | setCoefficient (const TpsMonomial &monomial, const T &value) |
| Set coefficient. | |
| const T | operator[] (int index) const |
| Get coefficient. | |
| T & | operator[] (int index) |
| Get coefficient. | |
| const T | operator[] (const TpsMonomial &monomial) const |
| Get coefficient. | |
| T & | operator[] (const TpsMonomial &monomial) |
| Get coefficient. | |
| Tps< T > | operator+ () const |
| Unary plus. | |
| Tps< T > | operator- () const |
| Unary minus. | |
| Tps< T > & | operator+= (const Tps< T > &y) |
| Add and assign. | |
| Tps< T > & | operator-= (const Tps< T > &y) |
| Subtract and assign. | |
| Tps< T > & | operator*= (const Tps< T > &y) |
| Multiply and assign. | |
| Tps< T > & | operator/= (const Tps< T > &y) |
| Divide and assign. | |
| Tps< T > & | operator+= (const T &y) |
| Add constant and assign. | |
| Tps< T > & | operator-= (const T &y) |
| Subtract constant and assign. | |
| Tps< T > & | operator*= (const T &y) |
| Multiply by constant and assign. | |
| Tps< T > & | operator/= (const T &y) |
| Divide by constant and assign. | |
| bool | operator== (const Tps< T > &y) const |
| Equality operator. | |
| bool | operator== (const T &y) const |
| Equlatity with constant. | |
| bool | operator!= (const Tps< T > &y) const |
| Inequality operator. | |
| bool | operator!= (const T &y) const |
| Inequality with constant. | |
| Tps< T > | substitute (const Matrix< T > &M) const |
| Substitute. | |
| Tps< T > | substitute (const VpsMap< T > &m) const |
| Substitute. | |
| T | evaluate (const Vector< T > &v) const |
| Substitute. | |
| void | clear () |
| Set to zero. | |
| Tps< T > | inverse (int order=truncOrder) const |
| Reciprocal value. | |
| Tps< T > | multiply (const Tps< T > &y, int trunc) const |
| Truncated multiplication. | |
| Tps< T > | derivative (int var) const |
| Partial derivative. | |
| Tps< T > | integral (int var) const |
| Partial integral. | |
| Tps< T > | multiplyVariable (int var) const |
| Multiply by variable [b]var[/b]. | |
| Tps< T > | scaleMonomials (const Tps< T > &y) const |
| Multiply monomial-wise. | |
| Tps< T > | Taylor (const T series[], int n) const |
| Taylor series. | |
| int | getMaxOrder () const |
| Get maximal order. | |
| int | getTruncOrder () const |
| Get truncation order. | |
| int | getVariables () const |
| Get number of variables. | |
| int | getSize () const |
| Get number of coefficients. | |
| std::istream & | get (std::istream &is) |
| Get Tps from the stream is. | |
| std::ostream & | put (std::ostream &os) const |
| Put Tps to the stream is. | |
| const TpsMonomial & | getExponents (int index) const |
| Get exponents. | |
| int | getOrder (int index) const |
| Get order. | |
| int | getSize (int order) const |
| Size. | |
| bool | isConstant () const |
| Test for constant. | |
Static Public Member Functions | |
| static Tps< T > | makeVariable (int nVar, int var) |
| Make variable. | |
| static Tps< T > | makeVarPower (int nVar, int var, int power) |
| Make power. | |
| static Tps< T > | makeMonomial (const TpsMonomial &m, const T &t) |
| Make monomial. | |
| static int | getGlobalTruncOrder () |
| Get global truncation order. | |
| static void | setGlobalTruncOrder (int order) |
| Set global truncation order. | |
Static Public Attributes | |
| static const int | EXACT = INT_MAX |
| Representation of infinite precision. | |
Private Member Functions | |
| Tps (TpsRep< T > *) | |
| void | setMaxOrder (int) |
| void | unique () |
Private Attributes | |
| TpsRep< T > * | rep |
Static Private Attributes | |
| static int | truncOrder |
| Tps< T >::Tps | ( | int | maxOrder, |
| int | nVar ) |
Constructor.
Definition at line 227 of file Tps.hpp.
Referenced by derivative(), filter(), get(), integral(), inverse(), makeMonomial(), makeVariable(), makeVarPower(), multiply(), multiplyVariable(), operator!=(), operator*=(), operator*=(), operator+(), operator+=(), operator+=(), operator-(), operator-=(), operator-=(), operator/=(), operator/=(), operator=(), operator=(), operator==(), scaleMonomials(), substitute(), substitute(), Taylor(), Tps(), and truncate().
| Tps< T >::Tps | ( | const T & | y | ) |
| Tps< T >::Tps | ( | int | y | ) |
Definition at line 253 of file Tps.hpp.
References TpsRep< T >::release(), and rep.
| void Tps< T >::clear | ( | ) |
Set to zero.
Definition at line 714 of file Tps.hpp.
References TpsRep< T >::release(), rep, and TpsRep< T >::zero().
Partial derivative.
Definition at line 920 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getExponents(), getMaxOrder(), getSize(), getTruncOrder(), getVariables(), rep, Tps(), and TpsRep< T >::zero().
Substitute.
Definition at line 686 of file Tps.hpp.
References getMaxOrder(), getVariables(), TpsSubstitution::index, TpsSubstitution::order, rep, Array1D< T >::size(), TpsSubstitution::skip, and TpsSubstitution::variable.
Extract orders.
Definition at line 279 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getMaxOrder(), getSize(), getTruncOrder(), getVariables(), rep, and Tps().
Referenced by truncate().
| std::istream & Tps< T >::get | ( | std::istream & | is | ) |
Get Tps from the stream is.
Definition at line 721 of file Tps.hpp.
References TpsRep< T >::create(), TpsMonomial::getIndex(), setMaxOrder(), Tps(), and truncOrder.
Referenced by operator>>().
| const T Tps< T >::getCoefficient | ( | const TpsMonomial & | monomial | ) | const |
Get coefficient.
Definition at line 355 of file Tps.hpp.
References getCoefficient(), TpsMonomial::getIndex(), getVariables(), and TpsMonomial::getVariables().
| const T Tps< T >::getCoefficient | ( | int | index | ) | const |
Get coefficient.
Definition at line 327 of file Tps.hpp.
References rep.
Referenced by getCoefficient().
| const TpsMonomial & Tps< T >::getExponents | ( | int | index | ) | const |
Get exponents.
Definition at line 1073 of file Tps.hpp.
References rep.
Referenced by derivative(), integral(), and put().
|
static |
Get global truncation order.
Definition at line 1061 of file Tps.hpp.
References truncOrder.
Referenced by operator/(), and Vps< T >::operator/=().
| int Tps< T >::getMaxOrder | ( | ) | const |
Get maximal order.
Definition at line 1031 of file Tps.hpp.
References rep.
Referenced by derivative(), evaluate(), filter(), Vps< T >::getTopOrder(), multiply(), operator+=(), operator-(), operator-=(), operator==(), put(), scaleMonomials(), substitute(), and substitute().
| int Tps< T >::getOrder | ( | int | index | ) | const |
| int Tps< T >::getSize | ( | ) | const |
Get number of coefficients.
Definition at line 1049 of file Tps.hpp.
References rep.
Referenced by derivative(), filter(), integral(), multiply(), multiplyVariable(), operator+=(), operator-=(), operator==(), operator==(), and put().
| int Tps< T >::getSize | ( | int | order | ) | const |
| int Tps< T >::getTruncOrder | ( | ) | const |
Get truncation order.
Definition at line 1037 of file Tps.hpp.
References rep, and truncOrder.
Referenced by cos(), cosh(), derivative(), exp(), filter(), Vps< T >::getTruncOrder(), inverse(), log(), multiply(), operator+=(), operator-(), operator-=(), operator==(), put(), scaleMonomials(), sin(), sinh(), sqrt(), and substitute().
| int Tps< T >::getVariables | ( | ) | const |
Get number of variables.
Definition at line 1043 of file Tps.hpp.
References rep.
Referenced by derivative(), evaluate(), filter(), getCoefficient(), integral(), multiply(), multiplyVariable(), operator+=(), operator-(), operator-=(), operator==(), put(), scaleMonomials(), setCoefficient(), setCoefficient(), Vps< T >::setComponent(), substitute(), and substitute().
Partial integral.
Definition at line 946 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getExponents(), getSize(), getVariables(), rep, Tps(), and truncOrder.
| Tps< T > Tps< T >::inverse | ( | int | order = truncOrder | ) | const |
Reciprocal value.
Definition at line 897 of file Tps.hpp.
References getTruncOrder(), isConstant(), rep, Taylor(), and Tps().
Referenced by csc(), operator/(), operator/=(), Vps< T >::operator/=(), pow(), and sec().
| bool Tps< T >::isConstant | ( | ) | const |
|
static |
Make monomial.
Definition at line 401 of file Tps.hpp.
References TpsRep< T >::create(), EXACT, TpsMonomial::getOrder(), TpsMonomial::getVariables(), and Tps().
Make variable.
Definition at line 383 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), EXACT, and Tps().
Make power.
Definition at line 391 of file Tps.hpp.
References TpsRep< T >::create(), EXACT, and Tps().
Truncated multiplication.
Definition at line 823 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), EXACT, getMaxOrder(), getSize(), getTruncOrder(), getVariables(), prod(), rep, and Tps().
Referenced by operator*=(), operator/=(), and Taylor().
Multiply by variable [b]var[/b].
Definition at line 969 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getSize(), getVariables(), rep, Tps(), and truncOrder.
| bool Tps< T >::operator!= | ( | const T & | y | ) | const |
| bool Tps< T >::operator!= | ( | const Tps< T > & | y | ) | const |
Multiply and assign.
Definition at line 499 of file Tps.hpp.
References multiply(), Tps(), and truncOrder.
Add and assign.
Definition at line 427 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getMaxOrder(), getSize(), getTruncOrder(), getVariables(), TpsRep< T >::release(), rep, Tps(), and unique().
Unary minus.
Definition at line 417 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getMaxOrder(), getTruncOrder(), getVariables(), rep, and Tps().
Subtract and assign.
Definition at line 462 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getMaxOrder(), getSize(), getTruncOrder(), getVariables(), TpsRep< T >::release(), rep, Tps(), and unique().
Divide and assign.
Definition at line 505 of file Tps.hpp.
References inverse(), multiply(), Tps(), and truncOrder.
Convert and assign.
Definition at line 270 of file Tps.hpp.
References TpsRep< T >::release(), rep, Tps(), and TpsRep< T >::zero().
Definition at line 259 of file Tps.hpp.
References TpsRep< T >::release(), rep, and Tps().
| bool Tps< T >::operator== | ( | const T & | y | ) | const |
Equality operator.
Definition at line 545 of file Tps.hpp.
References getMaxOrder(), getSize(), getTruncOrder(), getVariables(), rep, and Tps().
| T & Tps< T >::operator[] | ( | const TpsMonomial & | monomial | ) |
Get coefficient.
Definition at line 320 of file Tps.hpp.
References TpsMonomial::getIndex(), rep, and unique().
| const T Tps< T >::operator[] | ( | const TpsMonomial & | monomial | ) | const |
Get coefficient.
Definition at line 314 of file Tps.hpp.
References TpsMonomial::getIndex(), and rep.
| T & Tps< T >::operator[] | ( | int | index | ) |
| const T Tps< T >::operator[] | ( | int | index | ) | const |
| std::ostream & Tps< T >::put | ( | std::ostream & | os | ) | const |
Put Tps to the stream is.
Definition at line 784 of file Tps.hpp.
References getExponents(), getMaxOrder(), getSize(), getTruncOrder(), getVariables(), and rep.
Referenced by operator<<().
Multiply monomial-wise.
Definition at line 992 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getMaxOrder(), getTruncOrder(), getVariables(), TpsRep< T >::len, rep, and Tps().
| void Tps< T >::setCoefficient | ( | const TpsMonomial & | monomial, |
| const T & | value ) |
Set coefficient.
Definition at line 369 of file Tps.hpp.
References TpsMonomial::getIndex(), getVariables(), TpsMonomial::getVariables(), and setCoefficient().
| void Tps< T >::setCoefficient | ( | int | index, |
| const T & | value ) |
Set coefficient.
Definition at line 337 of file Tps.hpp.
References TpsRep< T >::create(), TpsRep< T >::data(), getOrder(), getVariables(), TpsRep< T >::release(), rep, and unique().
Referenced by setCoefficient().
|
static |
|
inlineprivate |
Substitute.
Definition at line 614 of file Tps.hpp.
References getMaxOrder(), getVariables(), TpsSubstitution::index, Array2D< T >::ncols(), Array2D< T >::nrows(), TpsSubstitution::order, rep, Array1D< T >::size(), TpsSubstitution::skip, Tps(), and TpsSubstitution::variable.
Substitute.
Definition at line 657 of file Tps.hpp.
References Vps< T >::getDimension(), getMaxOrder(), getTruncOrder(), getVariables(), TpsSubstitution::index, TpsSubstitution::order, rep, Array1D< T >::size(), TpsSubstitution::skip, Tps(), and TpsSubstitution::variable.
|
inlineprivate |
Definition at line 55 of file Tps.hpp.
References rep.
Referenced by operator*=(), operator+=(), operator+=(), operator-=(), operator-=(), operator[](), operator[](), and setCoefficient().
|
static |
Representation of infinite precision.
Definition at line 260 of file Tps.h.
Referenced by makeMonomial(), makeVariable(), makeVarPower(), multiply(), Tps(), and TpsRep< T >::zero().
Definition at line 274 of file Tps.h.
Referenced by clear(), derivative(), evaluate(), filter(), getCoefficient(), getExponents(), getMaxOrder(), getOrder(), getSize(), getSize(), getTruncOrder(), getVariables(), integral(), inverse(), isConstant(), multiply(), multiplyVariable(), operator*=(), operator+=(), operator+=(), operator-(), operator-=(), operator-=(), operator/=(), operator=(), operator=(), operator==(), operator==(), operator[](), operator[](), operator[](), operator[](), put(), scaleMonomials(), setCoefficient(), setMaxOrder(), substitute(), substitute(), Tps(), Tps(), Tps(), Tps(), Tps(), Tps(), unique(), and ~Tps().
|
staticprivate |
Definition at line 277 of file Tps.h.
Referenced by get(), getGlobalTruncOrder(), getTruncOrder(), integral(), multiplyVariable(), operator*=(), operator/=(), and setGlobalTruncOrder().