Public Member Functions |
| basic_fvector () |
| Default constructor.
|
| basic_fvector (size_t nSize) |
| Constructor.
|
| basic_fvector (const string_array &saInput) |
| Constructor.
|
| basic_fvector (const string_array &saVars, const string_array &saBodies, const string_array &saParameters, const string_array &saMeanings) |
| Constructor.
|
| basic_fvector (const basic_fvector &fv) |
| Copy Constructor.
|
| basic_fvector (basic_fvector &&fv) |
| Move Constructor.
|
basic_fvector & | operator= (const basic_fvector &fv) throw (cvmexception) |
| Assignment operator.
|
basic_fvector & | operator= (basic_fvector &&fv) throw (cvmexception) |
| Move sssignment operator.
|
bool | operator== (const basic_fvector &fv) const |
| Vectors of functions comparison.
|
bool | operator!= (const basic_fvector &fv) const |
| Vectors of functions comparison.
|
basic_fvector & | operator<< (const basic_fvector &fv) |
| Replacement operator.
|
basic_fvector | drv (size_t nVarNum) const |
| Partial derivative.
|
basic_fvector & | simp () |
| Simplifier.
|
basic_fvector | operator+ (const basic_fvector &fv) const throw (cvmexception) |
| Addition operator.
|
basic_fvector | operator- (const basic_fvector &fv) const throw (cvmexception) |
| Subtraction operator.
|
basic_fvector & | operator+= (const basic_fvector &fv) throw (cvmexception) |
| Increment operator.
|
basic_fvector & | operator-= (const basic_fvector &fv) throw (cvmexception) |
| Decrement operator.
|
basic_fvector | operator* (const BaseFunction &f) const |
| Multiplication operator.
|
basic_fvector | operator/ (const BaseFunction &f) const |
| Division operator.
|
basic_fvector | operator* (const T &d) const |
| Multiplication operator.
|
basic_fvector | operator/ (const T &d) const |
| Division operator.
|
basic_fvector & | operator*= (const BaseFunction &f) |
| Multiply and assign operator.
|
basic_fvector & | operator/= (const BaseFunction &f) |
| Divide and assign operator.
|
basic_fvector & | operator*= (const T &d) |
| Multiply and assign operator.
|
basic_fvector & | operator/= (const T &d) |
| Divide and assign operator.
|
BaseFunction | operator* (const basic_fvector &fv) const throw (cvmexception) |
| Scalar product.
|
basic_fvector | operator* (const basic_fmatrix< T > &fm) const throw (cvmexception) |
| Vector by matrix product.
|
basic_fvector & | mult (const basic_fvector &fv, const basic_fmatrix< T > &fm) throw (cvmexception) |
| Vector by matrix product.
|
basic_fvector & | mult (const basic_fmatrix< T > &fm, const basic_fvector &fv) throw (cvmexception) |
| Matrix by vector product
|
basic_fmatrix< T > | jacobian (size_t nfrom=0, size_t vars=0) const |
| Jacobi matrix.
|
void | jacobian (basic_fmatrix< T > &fmj, size_t nfrom=0, size_t vars=0) const |
| Jacobi matrix.
|
| FArray () |
| Default constructor.
|
| FArray (size_t nSize) |
| Constructor.
|
| FArray (const FArray &a) |
| Copy constructor.
|
| FArray (FArray &&a) |
| Move constructor.
|
| FArray (const string_array &saInput) |
| Constructor.
|
| FArray (const string_array &saVars, const string_array &saBodies, const string_array &saParameters, const string_array &saMeanings) |
| Constructor.
|
virtual | ~FArray () |
| Destructor.
|
std::vector< BaseFunction > & | impl () |
| Internal storage.
|
const std::vector< BaseFunction > & | impl () const |
| Internal storage.
|
size_t | size () const |
| Internal storage.
|
const BaseFunction & | operator[] (size_t n) const |
| Constant reference to element (not l-value, zero-based)
|
BaseFunction & | operator[] (size_t n) |
| Reference to element (l-value, zero-based)
|
void | value (T *pv) const |
| Numerical value.
|
void | value (T d, T *pv) const |
| Numerical value.
|
void | value (T d1, T d2, T *pv) const |
| Numerical value.
|
void | value (T d1, T d2, T d3, T *pv) const |
| Numerical value.
|
void | value (const T *pd, T *pv) const |
| Numerical value.
|
template<typename T>
class basic_fvector< T >
Vector of functions class.
T
type stands for treal or tcomplex. Please use rfvector and cfvector classes in your applications.
- See Also
- rfvector
-
cfvector
-
basic_fmatrix
Definition at line 7939 of file cfun.h.
Jacobi matrix.
Creates basic_fmatrix object as Jacobi matrix of calling vector of functions. First variable to compute partial derivatives is set by nfrom
index (0-based, 0 by default), the number of variables to use is set by vars
argument (0 for all, default). Number of rows of the Jacobi matrix built is equal to vector's size, number of columns is the number of variables used to compute it. Function throws cvmexception if the numbers are out of boundaries.
- Example:
using namespace cvm;
try{
funcs.push_back("{x,y} x+y+1");
funcs.push_back("{x,y} x*y");
funcs.push_back("{x,y} x^y");
std::cout << rfv.jacobian() << std::endl;
std::cout << cfv.jacobian() << std::endl;
std::cout << rfv.jacobian(0,1) << std::endl;
std::cout << cfv.jacobian(0,1) << std::endl;
std::cout << rfv.jacobian(1) << std::endl;
std::cout << cfv.jacobian(1) << std::endl;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints {x,y} 1 {x,y} 1
{x,y} y {x,y} x
{x,y} y*x^(y-1) {x,y} x^y*log(x)
{x,y} (1,0) {x,y} (1,0)
{x,y} y {x,y} x
{x,y} y*x^(y-(1,-0)) {x,y} x^y*log(x)
{x,y} 1
{x,y} y
{x,y} y*x^(y-1)
{x,y} (1,0)
{x,y} y
{x,y} y*x^(y-(1,-0))
{x,y} 1
{x,y} x
{x,y} x^y*log(x)
{x,y} (1,0)
{x,y} x
{x,y} x^y*log(x)
- Parameters
-
[in] | nfrom | 0-based index (0 by default) of variable to start with. |
[in] | vars | Number of variables to compute Jacobian metrix for (0 for all, default). |
- Returns
- basic_fmatrix Jacobi matrix object.
Definition at line 9103 of file cfun.h.
Jacobi matrix.
Computes Jacobi matrix of calling vector of functions and sets fmj
basic_fmatrix object to it. First variable to compute partial derivatives is set by nfrom
index (0-based, 0 by default), the number of variables to use is set by vars
argument (0 for all, default). Number of rows of the Jacobi matrix built must be equal to vector's size, number of columns is the number of variables used to compute it. Function throws cvmexception otherwise.
- Example:
using namespace cvm;
try{
funcs.push_back("{x,y} x+y+1");
funcs.push_back("{x,y} x*y");
funcs.push_back("{x,y} x^y");
rfv.jacobian(rm32);
std::cout << rm32 << std::endl;
cfv.jacobian(cm32);
std::cout << cm32 << std::endl;
rfv.jacobian(rm31,0,1);
std::cout << rm31 << std::endl;
cfv.jacobian(cm31,0,1);
std::cout << cm31 << std::endl;
rfv.jacobian(rm31,1);
std::cout << rm31 << std::endl;
cfv.jacobian(cm31,1);
std::cout << cm31 << std::endl;
}
catch (std::exception& e) {
std::cout << "Exception " << e.what () << std::endl;
}
prints {x,y} 1 {x,y} 1
{x,y} y {x,y} x
{x,y} y*x^(y-1) {x,y} x^y*log(x)
{x,y} (1,0) {x,y} (1,0)
{x,y} y {x,y} x
{x,y} y*x^(y-(1,-0)) {x,y} x^y*log(x)
{x,y} 1
{x,y} y
{x,y} y*x^(y-1)
{x,y} (1,0)
{x,y} y
{x,y} y*x^(y-(1,-0))
{x,y} 1
{x,y} x
{x,y} x^y*log(x)
{x,y} (1,0)
{x,y} x
{x,y} x^y*log(x)
- Parameters
-
[out] | fmj | Jacobi matrix to compute. |
[in] | nfrom | 0-based index (0 by default) of variable to start with. |
[in] | vars | Number of variables to compute Jacobian metrix for (0 for all, default). |
Definition at line 9190 of file cfun.h.