CVM Class Library
8.1
This C++ class library encapsulates concepts of vector and different matrices including square, band, symmetric and hermitian ones in Euclidean space of real and complex numbers.
|
Vector of functions class. More...
#include <cfun.h>
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. |
Protected Types | |
typedef FArray< T > | BaseFArray |
Base class. | |
typedef BaseFArray::BaseFunction | BaseFunction |
Vector element, i.e. rfunction or cfunction. | |
![]() | |
typedef basic_function< T > | BaseFunction |
Vector element, i.e. rfunction or cfunction. |
Friends | |
class | basic_fmatrix< T > |
std::ostream & | operator<< (std::ostream &os, const basic_fvector< T > &fv) |
Output operator. |
Additional Inherited Members | |
![]() | |
std::vector< BaseFunction > | mv |
Internal storage. |
Vector of functions class.
T
type stands for treal or tcomplex. Please use rfvector and cfvector classes in your applications.
|
protected |
|
protected |
|
inline |
|
inlineexplicit |
|
inlineexplicit |
Constructor.
Creates vector of functions of saInput.size()
size. Each function element is ininialized using appropriate string as parameterless input in Wolfram's Mathemaca syntax {var1[,var2,...]} expr
[in] | saInput | Array of strings. |
|
inline |
Constructor.
Creates vector of parameterized functions of one or more variables. Throws cvmexception in case of syntax or memory allocation error.
[in] | saVars | String array with variables (may be empty). |
[in] | saBodies | String array with functions' expressions. For expression syntax look at basic_function description. |
[in] | saParameters | String array with parameters (may be empty). |
[in] | saMeanings | String array with parameters' meanings (may be empty, must have the same size as saParameters). |
|
inline |
|
inline |
|
inline |
Assignment operator.
Assigns basic_fvector object to calling one or throws cvmexception if objects have different sizes.
[in] | fv | Const reference to vector of functions to assign. |
|
inline |
|
inline |
Vectors of functions comparison.
Returns true if vectors of functions are equal and false otherwise.
[in] | fv | Const reference to vector of functions to compare with. |
|
inline |
Vectors of functions comparison.
Returns true if vectors of functions are not equal and false otherwise.
[in] | fv | Const reference to vector of functions to compare with. |
|
inline |
Replacement operator.
Assigns basic_fvector object to calling one without checking anything.
[in] | fv | Const reference to vector of functions to replace by. |
|
inline |
Partial derivative.
Creates basic_fvector object as a partial derivative of calling vector. Variables set remains the same even if the derivative doesn't depend on some of them. Partial derivative is computed by nVarNum
's variable (0-based, 0 by default).
[in] | nVarNum | Variable's index (0-based, 0 by default). |
|
inline |
Simplifier.
Simplifies basic_fvector for fatsest numerical computation possible and returns reference to the object changed.
|
inline |
Addition operator.
Creates basic_fvector object as sum of calling vector and vector referred by fv
. Operator throws cvmexception if sizes of vectors or lists of variables don't match.
[in] | fv | Const reference to vector to add. |
|
inline |
Subtraction operator.
Creates basic_fvector object as difference of calling vector and vector referred by fv
. Operator throws cvmexception if sizes of vectors or lists of variables don't match.
[in] | fv | Const reference to vector to subtract. |
|
inline |
Increment operator.
Adds to calling basic_fvector vector of functions referred by fv
and returns reference to the object changed. Operator throws cvmexception if sizes of vectors or lists of variables don't match.
[in] | fv | Const reference to vector to add. |
|
inline |
Decrement operator.
Subtracts from calling basic_fvector vector of functions referred by fv
and returns reference to the object changed. Operator throws cvmexception if sizes of vectors or lists of variables don't match.
[in] | fv | Const reference to vector to add. |
|
inline |
Multiplication operator.
Creates basic_fvector object as product of calling vector and function referred by f
. Operator throws cvmexception if lists of variables don't match.
[in] | f | Const reference to function to multiply by. |
|
inline |
Division operator.
Creates basic_fvector object as division of calling vector by function referred by f
. Operator throws cvmexception if lists of variables don't match.
[in] | f | Const reference to function to divide by. |
|
inline |
Multiplication operator.
Creates basic_fvector object as product of calling vector and real or complex number referred by d
.
[in] | d | Number to multiply by. |
|
inline |
Division operator.
Creates basic_fvector object as division of calling vector by real or complex number referred by d
.
[in] | d | Number to divide by. |
|
inline |
Multiply and assign operator.
Multiplies calling vector of functions by function referred by f
and returns reference to the object changed. Operator throws cvmexception if lists of variables don't match.
[in] | f | Const reference to function to multiply by. |
|
inline |
Divide and assign operator.
Divides calling vector of functions by function referred by f
and returns reference to the object changed. Operator throws cvmexception if lists of variables don't match.
[in] | f | Const reference to function to divide by. |
|
inline |
Multiply and assign operator.
Multiplies calling vector of functions by real or complex number referred by d
and returns reference to the object changed.
[in] | d | Number to multiply by. |
|
inline |
Divide and assign operator.
Divides calling vector of functions by real or complex number referred by d
and returns reference to the object changed.
[in] | d | Number to divide by. |
|
inline |
Scalar product.
Creates basic_function object as scalar product of calling vector and vector referred by fv
. Operator throws cvmexception if sizes of vectors or lists of variables don't match.
[in] | fv | Vector of functions to multiply by. |
|
inline |
Vector by matrix product.
Creates basic_fvector object as product of calling vector and matrix of functions referred by fm
. Operator throws cvmexception if sizes of objects or lists of variables don't match.
[in] | fm | Matrix of functions to multiply by. |
|
inline |
Vector by matrix product.
Sets basic_fvector object to be equal to product of vector of functions referred by fv
and matrix of functions referred by fm
and returns reference to the object changed. Function throws cvmexception if sizes of objects or lists of variables don't match.
[in] | fv | Vector of functions to multiply. |
[in] | fm | Matrix of functions to multiply by. |
|
inline |
Matrix by vector product
Sets basic_fvector object to be equal to product of matrix of functions referred by fm
and vector of functions referred by fv
and returns reference to the object changed. FUnction throws cvmexception if sizes of objects or lists of variables don't match.
[in] | fm | Matrix of functions to multiply. |
[in] | fv | Vector of functions to multiply by. |
|
inline |
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.
[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). |
|
inline |
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.
[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). |
|
friend |
|
friend |
Output operator.
Prints vector of functions referred by fv
to output stream referred by os
using Wolfram's Mathemaca syntax {var1[,var2,...]} expr
for each element.
[in] | os | Reference to output stream. |
[in] | fv | Const reference to vector of functions to print. |