DACE 2.0 API Manual
Differential Algebra Core Engine
Public Member Functions | Static Public Member Functions
DACE::AlgebraicVector< T > Class Template Reference

#include <dace/AlgebraicMatrix.h>

+ Inheritance diagram for DACE::AlgebraicVector< T >:
+ Collaboration diagram for DACE::AlgebraicVector< T >:

Public Member Functions

 AlgebraicVector ()
 Default constructor. More...
 
 AlgebraicVector (const size_t size)
 Constructor with size. More...
 
 AlgebraicVector (const size_t size, const T &d)
 Constructor with size and elements value. More...
 
 AlgebraicVector (const std::vector< T > &v)
 Copy constructor. More...
 
 AlgebraicVector (const std::vector< T > &v, const size_t first, const size_t last)
 Extraction constructor. More...
 
 AlgebraicVector (std::initializer_list< T > l)
 Constructor from braced initializer list. More...
 
AlgebraicVector< T > extract (const size_t first, const size_t last) const
 Return the subvector containing the elements between first and last, inclusively. More...
 
template<typename U >
AlgebraicVector< typename PromotionTrait< T, U >::returnType > concat (const std::vector< U > &obj) const
 Return a new vector containing the elements of this vector followed by those of obj. More...
 
AlgebraicVector< double > cons () const
 Return vector containing only the costant parts of each element. More...
 
std::vector< std::vector< double > > linear () const
 Return the linear parts in the form of a vector of vectors. More...
 
AlgebraicVector< T > operator- () const
 
template<typename U >
AlgebraicVector< T > & operator+= (const AlgebraicVector< U > &obj)
 
template<typename U >
AlgebraicVector< T > & operator+= (const U &obj)
 
template<typename U >
AlgebraicVector< T > & operator-= (const AlgebraicVector< U > &obj)
 
template<typename U >
AlgebraicVector< T > & operator-= (const U &obj)
 
template<typename U >
AlgebraicVector< T > & operator*= (const AlgebraicVector< U > &obj)
 
template<typename U >
AlgebraicVector< T > & operator*= (const U &obj)
 
template<typename U >
AlgebraicVector< T > & operator/= (const AlgebraicVector< U > &obj)
 
template<typename U >
AlgebraicVector< T > & operator/= (const U &obj)
 
template<typename U >
AlgebraicVector< T > & operator<< (const std::vector< U > &obj)
 Concatenation operator. More...
 
AlgebraicVector< T > pow (const int p) const
 Element-wise exponentiation to (integer) power. More...
 
AlgebraicVector< T > sqrt () const
 Element-wise square root. More...
 
AlgebraicVector< T > exp () const
 Element-wise exponential. More...
 
AlgebraicVector< T > log () const
 Element-wise natural logarithm. More...
 
AlgebraicVector< T > sin () const
 Element-wise sine. More...
 
AlgebraicVector< T > cos () const
 Element-wise cosine. More...
 
AlgebraicVector< T > tan () const
 Element-wise tangent. More...
 
AlgebraicVector< T > asin () const
 Element-wise arcsine. More...
 
AlgebraicVector< T > acos () const
 Element-wise arccosine. More...
 
AlgebraicVector< T > atan () const
 Element-wise arctangent. More...
 
AlgebraicVector< T > atan2 (const AlgebraicVector< T > &obj) const
 Element-wise arctangent in [-pi, pi]. More...
 
AlgebraicVector< T > sinh () const
 Element-wise hyperbolic sine. More...
 
AlgebraicVector< T > cosh () const
 Element-wise hyperbolic cosine. More...
 
AlgebraicVector< T > tanh () const
 Element-wise hyperbolic tangent. More...
 
AlgebraicVector< T > asinh () const
 Element-wise hyperbolic arcsine. More...
 
AlgebraicVector< T > acosh () const
 Element-wise hyperbolic arccosine. More...
 
AlgebraicVector< T > atanh () const
 Element-wise hyperbolic arctangent. More...
 
AlgebraicVector< T > logb (const double b=10.0) const
 Element-wise logarithm wrt a given base. More...
 
AlgebraicVector< T > isrt () const
 Element-wise inverse square root. More...
 
AlgebraicVector< T > sqr () const
 Element-wise square. More...
 
AlgebraicVector< T > minv () const
 Element-wise multiplicative inverse. More...
 
AlgebraicVector< T > root (const int p=2) const
 Element-wise p-th root. More...
 
template<typename V >
PromotionTrait< T, V >::returnType dot (const AlgebraicVector< V > &obj) const
 Dot product (scalar product, inner product) of two vectors. More...
 
template<typename V >
AlgebraicVector< typename PromotionTrait< T, V >::returnType > cross (const AlgebraicVector< V > &obj) const
 Cross product of two vectors of length 3. More...
 
vnorm () const
 Euclidean vector norm (length). More...
 
AlgebraicVector< T > normalize () const
 Normalized vector of unit length along this vector. More...
 
AlgebraicVector< T > deriv (const unsigned int p) const
 Derivative of each element with respect to given variable. DA only. More...
 
AlgebraicVector< T > integ (const unsigned int p) const
 Integration of each element with respect to given variable. DA only. More...
 
template<typename V >
eval (const V &args) const
 Generic evaluation of a AlgebraicVector<DA> with arguments. DA only. More...
 
template<typename U >
AlgebraicVector< U > eval (const std::initializer_list< U > l) const
 Generic evaluation of an AlgebraicVector<DA> with braced initializer list. DA only. More...
 
template<typename U >
AlgebraicVector< U > evalScalar (const U &arg) const
 Generic evaluation of a AlgebraicVector<DA> with single argument. DA only. More...
 
compiledDA compile () const
 Compile current DA for efficient repeated evaluation. DA only. More...
 
AlgebraicVector< T > plug (const unsigned int var, const double val=0.0) const
 Partial evaluation to replace given independent DA variable by value val. DA only. More...
 
AlgebraicVector< T > trim (const unsigned int min, const unsigned int max=DA::getMaxOrder()) const
 Trim the coefficients of each components to particular orders. DA only. More...
 
AlgebraicVector< T > invert () const
 Inverse function of the AlgebraicVector<DA>. DA only. More...
 
std::string toString () const
 Convert the vector into a human readable string. More...
 
template<>
std::vector< std::vector< double > > linear () const
 
template<>
AlgebraicVector< DAtrim (const unsigned int min, const unsigned int max) const
 
template<>
AlgebraicVector< DAderiv (const unsigned int p) const
 
template<>
AlgebraicVector< DAinteg (const unsigned int p) const
 
template<>
compiledDA compile () const
 
template<>
AlgebraicVector< DAplug (const unsigned int var, const double val) const
 
template<>
AlgebraicVector< DAinvert () const
 
template<>
AlgebraicVector< DAidentity (const size_t n)
 
template<>
DACE_API std::vector< std::vector< double > > linear () const
 
template<>
DACE_API AlgebraicVector< DAtrim (const unsigned int min, const unsigned int max) const
 
template<>
DACE_API AlgebraicVector< DAderiv (const unsigned int p) const
 
template<>
DACE_API AlgebraicVector< DAinteg (const unsigned int p) const
 
template<>
DACE_API compiledDA compile () const
 
template<>
DACE_API AlgebraicVector< DAplug (const unsigned int var, const double val) const
 
template<>
DACE_API AlgebraicVector< DAinvert () const
 
template<>
DACE_API AlgebraicVector< DAidentity (const size_t n)
 
template<typename V >
AlgebraicVector< typename PromotionTrait< T, V >::returnType > concat (const std::vector< V > &obj) const
 
template<>
eval (const V &args) const
 
template<>
AlgebraicVector< U > eval (const std::initializer_list< U > l) const
 
template<>
AlgebraicVector< U > evalScalar (const U &arg) const
 

Static Public Member Functions

static AlgebraicVector< DAidentity (const size_t n=DA::getMaxVariables())
 Create an AlgebraicVector<DA> containing the identity in n dimensions. DA only. More...
 

Detailed Description

template<typename T>
class DACE::AlgebraicVector< T >

Generic vector class to handle vectors of algebraic types and their algebraic operations.

Constructor & Destructor Documentation

◆ AlgebraicVector() [1/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( )

Default constructor.

Default Constructor to create empty AlgebraicVector

◆ AlgebraicVector() [2/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( const size_t  size)
explicit

Constructor with size.

Constructor with size to allocate a vector of the given size with elements initialized using their default constructor.

Parameters
[in]sizelength of AlgebraicVector.

◆ AlgebraicVector() [3/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( const size_t  size,
const T &  d 
)

Constructor with size and elements value.

Constructor with size and elements value to allocate a vector of the given size with elements initialized as copies of d.

Parameters
[in]sizelength of AlgebraicVector
[in]dinitial value for the elements

◆ AlgebraicVector() [4/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( const std::vector< T > &  v)

Copy constructor.

Copy constructor to create a copy of any existing vector.

Parameters
[in]vvector to be copied into AlgebraicVector

◆ AlgebraicVector() [5/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( const std::vector< T > &  v,
const size_t  first,
const size_t  last 
)

Extraction constructor.

Extraction constructor to copy only a given range of elements from vector v.

Parameters
[in]vvector to be copied into AlgebraicVector
[in]firstindex of the first element to be copied
[in]lastindex of the last element to be copied
Note
The constructor does not perform any range checking for the extraction.
See also
AlgebraicVector<T>::extract

◆ AlgebraicVector() [6/6]

template<typename T >
DACE::AlgebraicVector< T >::AlgebraicVector ( std::initializer_list< T >  l)

Constructor from braced initializer list.

Constructor to create a vector from an initializer list.

Parameters
[in]lbraced initializer list to be copied into the AlgebraicVector

Member Function Documentation

◆ acos()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::acos ( ) const

Element-wise arccosine.

Compute the arccosine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ acosh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::acosh ( ) const

Element-wise hyperbolic arccosine.

Compute the hyperbolic arccosine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>. Currently not defined for double.

Returns
A new AlgebraicVector<T> containing the result of the operation.

◆ asin()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::asin ( ) const

Element-wise arcsine.

Compute the arcsine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ asinh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::asinh ( ) const

Element-wise hyperbolic arcsine.

Compute the hyperbolic arcsine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T> containing the result of the operation.

◆ atan()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::atan ( ) const

Element-wise arctangent.

Compute the arctangent of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ atan2()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::atan2 ( const AlgebraicVector< T > &  obj) const

Element-wise arctangent in [-pi, pi].

Compute the four-quadrant arctangent of Y/X. Y is the current vector, whereas X is the AlgebraicVector<T> in input. The result is copied in a new AlgebraicVector<T>.

Parameters
[in]objAlgebraicVector<T>
Returns
A new AlgebraicVector<T> containing the result of the operation Y/X in [-pi, pi].
Exceptions
std::runtime_error

◆ atanh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::atanh ( ) const

Element-wise hyperbolic arctangent.

Compute the hyperbolic arctangent of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>. Currently not defined for double.

Returns
A new AlgebraicVector<T> containing the result of the operation.

◆ compile() [1/3]

template<typename T>
compiledDA DACE::AlgebraicVector< T >::compile ( ) const

Compile current DA for efficient repeated evaluation. DA only.

◆ compile() [2/3]

template<>
compiledDA DACE::AlgebraicVector< DA >::compile ( ) const

Compile vector of polynomials and create a compiledDA object.

Returns
The compiled DA object.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ compile() [3/3]

template<>
DACE_API compiledDA DACE::AlgebraicVector< DA >::compile ( ) const

◆ concat() [1/2]

template<typename T>
template<typename U >
AlgebraicVector<typename PromotionTrait<T,U>::returnType> DACE::AlgebraicVector< T >::concat ( const std::vector< U > &  obj) const

Return a new vector containing the elements of this vector followed by those of obj.

◆ concat() [2/2]

template<typename T>
template<typename V >
AlgebraicVector<typename PromotionTrait< T, V >::returnType> DACE::AlgebraicVector< T >::concat ( const std::vector< V > &  obj) const

Append an AlgebraicVector to the end of the current one and return the new vector.

Parameters
[in]objThe AlgebraicVector to be appended.
Returns
A new AlgebraicVector containing the elements of both vectors, cast upwards if necessary.

◆ cons()

template<typename T >
AlgebraicVector< double > DACE::AlgebraicVector< T >::cons ( ) const

Return vector containing only the costant parts of each element.

Return the constant part of a AlgebraicVector<T>.

Returns
A AlgebraicVector<double> of dimension 1 by size, where size is the size of the AlgebraicVector<T>. Each element contains the constant part of the corresponding value included in the original AlgebraicVector<T>.

◆ cos()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::cos ( ) const

Element-wise cosine.

Compute the cosine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ cosh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::cosh ( ) const

Element-wise hyperbolic cosine.

Compute the hyperbolic cosine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ cross()

template<typename T >
template<typename V >
AlgebraicVector< typename PromotionTrait< T, V >::returnType > DACE::AlgebraicVector< T >::cross ( const AlgebraicVector< V > &  obj) const

Cross product of two vectors of length 3.

Compute the cross product with another 3D AlgebraicVector.

Parameters
[in]objThe other AlgebraicVector.
Returns
A new AlgebraicVector, containing the result of the operation.
Exceptions
std::runtime_error

◆ deriv() [1/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::deriv ( const unsigned int  p) const

Compute the derivative of a AlgebraicVector<T> with respect to variable p. The result is copied in a new AlgebraicVector<T>. NOT DEFINED FOR TYPES OTHER THAN DA.

Parameters
[in]pvariable with respect to which the derivative is calculated.
Returns
A new AlgebraicVector<T> containing the result of the derivation.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ deriv() [2/3]

template<typename T>
AlgebraicVector<T> DACE::AlgebraicVector< T >::deriv ( const unsigned int  p) const

Derivative of each element with respect to given variable. DA only.

◆ deriv() [3/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::deriv ( const unsigned int  p) const

◆ dot()

template<typename T >
template<typename V >
PromotionTrait< T, V >::returnType DACE::AlgebraicVector< T >::dot ( const AlgebraicVector< V > &  obj) const

Dot product (scalar product, inner product) of two vectors.

Compute the dot product with another AlgebraicVector.

Parameters
[in]objthe other AlgebraicVector.
Returns
A scalar value, containing the result of the operation.
Exceptions
std::runtime_error

◆ eval() [1/4]

template<typename T>
template<typename V >
V DACE::AlgebraicVector< T >::eval ( const V &  args) const

Generic evaluation of a AlgebraicVector<DA> with arguments. DA only.

◆ eval() [2/4]

template<typename T>
template<typename U >
AlgebraicVector<U> DACE::AlgebraicVector< T >::eval ( const std::initializer_list< U >  l) const

Generic evaluation of an AlgebraicVector<DA> with braced initializer list. DA only.

◆ eval() [3/4]

template<>
V DACE::AlgebraicVector< DA >::eval ( const V &  args) const

Evaluate a vector of polynomials with any vector type V with arguments and return a vector of results of the same type V.

Parameters
[in]argsvector (e.g. AlgebraicVector<>) of arguments
Returns
A new vector of same type as argument args containing the results of the evaluation.
Note
This DA specific function is only available in AlgebraicVector<DA>, when called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ eval() [4/4]

template<>
AlgebraicVector< U > DACE::AlgebraicVector< DA >::eval ( const std::initializer_list< U >  l) const

Evaluate a vector of polynomials with an braced initializer list of type U and return an AlgebraicVector of type U with the results.

Parameters
[in]lBraced initializer list containing the arguments.
Returns
A new AlgebraicVector of type U containing the results of the evaluation.
Note
C++ is not able to derive the type of elements of an initializer list automatically. That means eval() must be called explicitly as e.g. eval<double>({1.0, 2.0, 3.0}) when used with initializer lists.

◆ evalScalar() [1/2]

template<typename T>
template<typename U >
AlgebraicVector<U> DACE::AlgebraicVector< T >::evalScalar ( const U &  arg) const

Generic evaluation of a AlgebraicVector<DA> with single argument. DA only.

◆ evalScalar() [2/2]

template<>
AlgebraicVector< U > DACE::AlgebraicVector< DA >::evalScalar ( const U &  arg) const

Evaluate a vector of polynomials with a single arithmetic type U argument.

Parameters
[in]argsingle variable of arithmetic type T of the first independent DA variable.
Returns
The result of the evaluation.
Note
This DA specific function is only available in AlgebraicVector<DA>, when called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.
To be used only for single polynomial evaluation. For multiple evaluations of the same vector of polynomials use the corresponding method in class compiledDA.
See also
compiledDA
AlgebraicVector::compile()

◆ exp()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::exp ( ) const

Element-wise exponential.

Compute the exponent of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ extract()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::extract ( const size_t  first,
const size_t  last 
) const

Return the subvector containing the elements between first and last, inclusively.

Extracts elements from AlgebraicVector.

Parameters
[in]firstindex of first element to be extracted
[in]lastindex of last element to be extracted
Returns
A new AlgebraicVector<T> with elements from position first to last.
Exceptions
std::runtime_error
Note
This routine performs range checking and throws an error if the indices are out of range.

◆ identity() [1/3]

template<typename T>
static AlgebraicVector<DA> DACE::AlgebraicVector< T >::identity ( const size_t  n = DA::getMaxVariables())
static

Create an AlgebraicVector<DA> containing the identity in n dimensions. DA only.

◆ identity() [2/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::identity ( const size_t  n)

◆ identity() [3/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::identity ( const size_t  n)

Return the DA identity of dimension n.

Parameters
[in]nThe dimendion of the identity.
Returns
AlgebraicVector<DA> containing the DA identity in n dimensions
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ integ() [1/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::integ ( const unsigned int  p) const

Compute the integral of a AlgebraicVector<T> with respect to variable p. The result is copied in a new AlgebraicVector<T>. NOT DEFINED FOR TYPES OTHER THAN DA.

Parameters
[in]pvariable with respect to which the integral is calculated.
Returns
A new AlgebraicVector<T> containing the result of the integration.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ integ() [2/3]

template<typename T>
AlgebraicVector<T> DACE::AlgebraicVector< T >::integ ( const unsigned int  p) const

Integration of each element with respect to given variable. DA only.

◆ integ() [3/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::integ ( const unsigned int  p) const

◆ invert() [1/3]

template<typename T>
AlgebraicVector<T> DACE::AlgebraicVector< T >::invert ( ) const

Inverse function of the AlgebraicVector<DA>. DA only.

◆ invert() [2/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::invert ( ) const

Invert the polynomials map given by the AlgebraicVector<DA>.

Returns
the inverted polynomials
Exceptions
std::runtime_error
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ invert() [3/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::invert ( ) const

◆ isrt()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::isrt ( ) const

Element-wise inverse square root.

Compute the inverse square root of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ linear() [1/3]

template<>
std::vector< std::vector< double > > DACE::AlgebraicVector< DA >::linear ( ) const

Return the linear part of a AlgebraicVector<T>. NOT DEFINED FOR TYPES OTHER THAN DA.

Returns
A std::vector< std::vector<double> >, where each std::vector<double> contains the linear part of the corresponding DA included in the original AlgebraicVector<T>.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ linear() [2/3]

template<typename T>
std::vector< std::vector<double> > DACE::AlgebraicVector< T >::linear ( ) const

Return the linear parts in the form of a vector of vectors.

◆ linear() [3/3]

template<>
DACE_API std::vector< std::vector< double > > DACE::AlgebraicVector< DA >::linear ( ) const

◆ log()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::log ( ) const

Element-wise natural logarithm.

Compute the natural logarithm of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ logb()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::logb ( const double  b = 10.0) const

Element-wise logarithm wrt a given base.

Compute the logarithm of a AlgebraicVector<T> with respect to a given base. The result is copied in a new AlgebraicVector<T>.

Parameters
[in]bbase with respect to which the logarithm is computed (default = 10).
Returns
A new AlgebraicVector<T>.

◆ minv()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::minv ( ) const

Element-wise multiplicative inverse.

Compute the multiplicative inverse of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ normalize()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::normalize ( ) const

Normalized vector of unit length along this vector.

Normalize the vector.

Returns
An AlgebraicVector<T> of unit length.

◆ operator*=() [1/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator*= ( const AlgebraicVector< U > &  obj)

Multiply the given AlgebraicVector with ourselves componentwise.

Parameters
[in]objAn AlgebraicVector.
Returns
A reference to ourselves.

◆ operator*=() [2/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator*= ( const U &  obj)

Multiply the given scalar with ourselves.

Parameters
[in]objA scalar value.
Returns
A reference to ourselves.

◆ operator+=() [1/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator+= ( const AlgebraicVector< U > &  obj)

Add the given AlgebraicVector to ourselves.

Parameters
[in]objAn AlgebraicVector.
Returns
A reference to ourselves.
Exceptions
std::runtime_error

◆ operator+=() [2/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator+= ( const U &  obj)

Add the given scalar to ourselves componentwise.

Parameters
[in]objA scalar value.
Returns
A reference to ourselves.

◆ operator-()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::operator- ( ) const

Returns the additive inverse of the vector.

Returns
A new AlgebraicVector, with the opposite sign.

◆ operator-=() [1/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator-= ( const AlgebraicVector< U > &  obj)

Subtract the given AlgebraicVector from ourselves.

Parameters
[in]objAn AlgebraicVector.
Returns
A reference to ourselves.
Exceptions
std::runtime_error

◆ operator-=() [2/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator-= ( const U &  obj)

Subtract the given scalar from ourselves componentwise.

Parameters
[in]objA scalar value.
Returns
A reference to ourselves.

◆ operator/=() [1/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator/= ( const AlgebraicVector< U > &  obj)

Divide ourselves by the given AlgebraicVector componentwise.

Parameters
[in]objAn AlgebraicVector.
Returns
A reference to ourselves.
Exceptions
std::runtime_error

◆ operator/=() [2/2]

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator/= ( const U &  obj)

Divide ourselves by the given scalar.

Parameters
[in]objA scalar value.
Returns
A reference to ourselves.

◆ operator<<()

template<typename T >
template<typename U >
AlgebraicVector< T > & DACE::AlgebraicVector< T >::operator<< ( const std::vector< U > &  obj)

Concatenation operator.

Append elements of vector obj to the end of ourself, converting the type to match ours if necessary.

Parameters
[in]objVector of elements to append.
Returns
A reference to ourselves.

◆ plug() [1/3]

template<typename T>
AlgebraicVector<T> DACE::AlgebraicVector< T >::plug ( const unsigned int  var,
const double  val = 0.0 
) const

Partial evaluation to replace given independent DA variable by value val. DA only.

◆ plug() [2/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::plug ( const unsigned int  var,
const double  val 
) const

Partial evaluation of vector of polynomials. In each element of the vector, variable var is replaced by the value val. The resulting vector of DAs is returned.

Parameters
[in]varvariable number to be replaced
[in]valvalue by which to replace the variable
Returns
A new DA object containing the resulting DA object.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ plug() [3/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::plug ( const unsigned int  var,
const double  val 
) const

◆ pow()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::pow ( const int  p) const

Element-wise exponentiation to (integer) power.

Elevate a AlgebraicVector<T> to a given integer power. The result is copied in a new AlgebraicVector<T>.

Parameters
[in]ppower at which the AlgebraicVector<T> is elevated.
Returns
A new AlgebraicVector<T>.

◆ root()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::root ( const int  p = 2) const

Element-wise p-th root.

Compute the p-th root of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Parameters
[in]proot to be computed (default = 2).
Returns
A new AlgebraicVector<T>.

◆ sin()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::sin ( ) const

Element-wise sine.

Compute the sine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ sinh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::sinh ( ) const

Element-wise hyperbolic sine.

Compute the hyperbolic sine of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ sqr()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::sqr ( ) const

Element-wise square.

Compute the square of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ sqrt()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::sqrt ( ) const

Element-wise square root.

Compute the square root of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ tan()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::tan ( ) const

Element-wise tangent.

Compute the tangent of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ tanh()

template<typename T >
AlgebraicVector< T > DACE::AlgebraicVector< T >::tanh ( ) const

Element-wise hyperbolic tangent.

Compute the hyperbolic tangent of a AlgebraicVector<T>. The result is copied in a new AlgebraicVector<T>.

Returns
A new AlgebraicVector<T>.

◆ toString()

template<typename T >
std::string DACE::AlgebraicVector< T >::toString ( ) const

Convert the vector into a human readable string.

Convert the current AlgebraicVector<T> to string.

Returns
A string.

◆ trim() [1/3]

template<>
AlgebraicVector< DA > DACE::AlgebraicVector< DA >::trim ( const unsigned int  min,
const unsigned int  max 
) const

Returns an AlgebraicVector<DA> with all monomials of order less than min and greater than max removed (trimmed). The result is copied in a new AlgebraicVector<DA>.

Parameters
[in]minminimum order to be preserved.
[in]maxmaximum order to be preserved.
Returns
A new AlgebraicVector<DA> containing the result of the trimming.
Note
This DA specific function is only available in AlgebraicVector<DA>. When called on AlgebraicVectors of other types (e.g. double), a compiler error will be the result.

◆ trim() [2/3]

template<typename T>
AlgebraicVector<T> DACE::AlgebraicVector< T >::trim ( const unsigned int  min,
const unsigned int  max = DA::getMaxOrder() 
) const

Trim the coefficients of each components to particular orders. DA only.

◆ trim() [3/3]

template<>
DACE_API AlgebraicVector< DA > DACE::AlgebraicVector< DA >::trim ( const unsigned int  min,
const unsigned int  max 
) const

◆ vnorm()

template<typename T >
T DACE::AlgebraicVector< T >::vnorm ( ) const

Euclidean vector norm (length).

Compute the Euclidean vector norm (length) for a AlgebraicVector<T>.

Returns
A scalar value corresponding to the result of the operation.

The documentation for this class was generated from the following files: