DACE 2.0 API Manual
Differential Algebra Core Engine
Public Member Functions | Static Public Member Functions | Friends
DACE::DA Class Reference

#include <dace/DA.h>

Public Member Functions

 DA ()
 Default constructor. More...
 
 DA (const DA &da)
 Copy constructor. More...
 
 DA (DA &&da)
 Move constructor. More...
 
 DA (const int i, const double c=1.0)
 Constructor for DA identities. More...
 
 DA (const unsigned int i, const double c=1.0)
 Constructor for DA identities. More...
 
 DA (const double c)
 Constructor for DA constants. More...
 
 ~DA () throw ()
 Destructor. More...
 
int isnan () const
 
int isinf () const
 
double cons () const
 Get constant part of a DA. More...
 
AlgebraicVector< double > linear () const
 Get linear part of a DA. More...
 
AlgebraicVector< DAgradient () const
 Gradient vector with respect to all independent DA variables. More...
 
double getCoefficient (const std::vector< unsigned int > &jj) const
 Get specific coefficient. More...
 
void setCoefficient (const std::vector< unsigned int > &jj, const double coeff)
 Set specific coefficient. More...
 
Monomial getMonomial (const unsigned int npos) const
 Get the Monomial at given position. More...
 
void getMonomial (const unsigned int npos, Monomial &m) const
 Extract the Monomial at given position. More...
 
std::vector< MonomialgetMonomials () const
 Get std::vector of all non-zero Monomials. More...
 
DAoperator= (DA &&da)
 Move assignment from existing DA. More...
 
DAoperator= (const DA &da)
 Assignment from existing DA. More...
 
DAoperator= (const double c)
 Assignment from existing double. More...
 
DAoperator+= (const DA &da)
 Add another DA to this DA. More...
 
DAoperator+= (const double c)
 Add another double to this DA. More...
 
DAoperator-= (const DA &da)
 Subtract another DA from this DA. More...
 
DAoperator-= (const double c)
 Subtract another double from this DA. More...
 
DAoperator*= (const DA &da)
 Multiply this DA by another DA. More...
 
DAoperator*= (const double c)
 Multiply this DA by another double. More...
 
DAoperator/= (const DA &da)
 Divide this DA by another DA. More...
 
DAoperator/= (const double c)
 Divide this DA by another double. More...
 
DA operator- () const
 Negate this DA. More...
 
DA multiplyMonomials (const DA &da) const
 Multiply the DA with the argument da monomial by monomial (i.e. coefficient-wise) More...
 
DA divide (const unsigned int var, const unsigned int p=1) const
 Divide by an independent variable to some power. More...
 
DA deriv (const unsigned int i) const
 Derivative with respect to given variable. More...
 
DA deriv (const std::vector< unsigned int > ind) const
 Derivative with respect to given variables. More...
 
DA integ (const unsigned int i) const
 Integral with respect to given variable. More...
 
DA integ (const std::vector< unsigned int > ind) const
 Integral with respect to given variables. More...
 
DA trim (const unsigned int min, const unsigned int max=DA::getMaxOrder()) const
 Trim the coefficients only include orders between min and max, inclusively. More...
 
DA trunc () const
 Truncate the constant part to an integer. More...
 
DA round () const
 Round the constant part to an integer. More...
 
DA mod (const double p) const
 Modulo of the constant part. More...
 
DA pow (const int p) const
 Exponentiation to given (integer) power. More...
 
DA pow (const double p) const
 Exponentiation to given double power. More...
 
DA root (const int p=2) const
 p-th root More...
 
DA minv () const
 multiplicative inverse More...
 
DA sqr () const
 square More...
 
DA sqrt () const
 square root More...
 
DA isrt () const
 inverse square root More...
 
DA cbrt () const
 cubic root More...
 
DA icrt () const
 inverse cubic root More...
 
DA hypot (const DA &da) const
 hypotenuse More...
 
DA exp () const
 exponential More...
 
DA log () const
 natural logarithm More...
 
DA logb (const double b=10.0) const
 logarithm with respect to given base More...
 
DA log10 () const
 10 based logarithm More...
 
DA log2 () const
 2 based logarithm More...
 
DA sin () const
 sine More...
 
DA cos () const
 cosine More...
 
DA tan () const
 tangent More...
 
DA asin () const
 arcsine More...
 
DA acos () const
 arccosine More...
 
DA atan () const
 arctangent More...
 
DA atan2 (const DA &da) const
 arctangent in [-pi, pi] More...
 
DA sinh () const
 hyperbolic sine More...
 
DA cosh () const
 hyperbolic cosine More...
 
DA tanh () const
 hyperbolic tangent More...
 
DA asinh () const
 hyperbolic arcsine More...
 
DA acosh () const
 hyperbolic arccosine More...
 
DA atanh () const
 hyperbolic arctangent More...
 
DA erf () const
 error function More...
 
DA erfc () const
 complementary error function More...
 
DA BesselJFunction (const int n) const
 Bessel function J_n. More...
 
DA BesselYFunction (const int n) const
 Bessel function Y_n. More...
 
DA BesselIFunction (const int n, const bool scaled=false) const
 Bessel function I_n. More...
 
DA BesselKFunction (const int n, const bool scaled=false) const
 Bessel function K_n. More...
 
DA GammaFunction () const
 Gamma function. More...
 
DA LogGammaFunction () const
 Logartihmic Gamma function. More...
 
DA PsiFunction (const unsigned int n) const
 Psi function. More...
 
unsigned int size () const
 Number of non-zero coefficients. More...
 
double abs () const
 Maximum absolute value of all coefficients. More...
 
double norm (const unsigned int type=0) const
 Different types of norms over all coefficients. More...
 
std::vector< double > orderNorm (const unsigned int var=0, const unsigned int type=0) const
 Different types of norms over coefficients of each order separately. More...
 
std::vector< double > estimNorm (const unsigned int var=0, const unsigned int type=0, const unsigned int nc=DA::getMaxOrder()) const
 Estimate of different types of order sorted norms. More...
 
std::vector< double > estimNorm (std::vector< double > &err, const unsigned int var=0, const unsigned int type=0, const unsigned int nc=DA::getMaxOrder()) const
 Estimate of different types of order sorted norms with error of the estimate. More...
 
Interval bound () const
 Estimate range bound over [-1,1] for each independent variable. More...
 
double convRadius (const double eps, const unsigned int type=1) const
 Estimate the convergence radius of the current DA. More...
 
template<class T >
eval (const std::vector< T > &args) const
 Evaluation with a vector of arguments (not efficient for repeated evaluation!) More...
 
template<class T >
eval (const T args[], const unsigned int length) const
 Evaluation with an array of arguments (not efficient for repeated evaluation!) More...
 
template<class T >
evalScalar (const T &arg) const
 Evaluation with a single arithmetic type T argument (not efficient for repeated evaluation!) More...
 
compiledDA compile () const
 Compile current DA for efficient repeated evaluation. More...
 
DA plug (const unsigned int var, const double val=0.0) const
 Partial evaluation to replace given independent DA variable by value val. More...
 
double evalMonomials (const DA &values) const
 evaluate the DA providing the value of every monomial in da More...
 
DA replaceVariable (const unsigned int from=0, const unsigned int to=0, const double val=1.0) const
 Replace variable number from by val times variable number to. More...
 
DA scaleVariable (const unsigned int var=0, const double val=1.0) const
 Scale variable number var by val. More...
 
DA translateVariable (const unsigned int var=0, const double a=1.0, const double c=0.0) const
 Translate variable number var to a*var + c. More...
 
std::string toString () const
 Convert to string representation. More...
 
void write (std::ostream &os) const
 Write binary representation of DA to stream. More...
 

Static Public Member Functions

static void init (const unsigned int ord, const unsigned int nvar)
 DACE initialization. More...
 
static bool isInitialized ()
 Get DACE initialization status. More...
 
static void version (int &maj, int &min, int &patch)
 DACE core routines version. More...
 
static void checkVersion ()
 Check DACE C++ interface and core routines version for compatibility. More...
 
static double setEps (const double eps)
 Set truncation epsilon. More...
 
static double getEps ()
 Get truncation epsilon. More...
 
static double getEpsMac ()
 Get the machine epsilon. More...
 
static unsigned int getMaxOrder ()
 Get the maximum order. More...
 
static unsigned int getMaxVariables ()
 Get the maximum number of variables. More...
 
static unsigned int getMaxMonomials ()
 Get the maximum monomials. More...
 
static unsigned int getTO ()
 Get truncation order. More...
 
static unsigned int setTO (const unsigned int ot=DA::getMaxOrder())
 Set truncation order. More...
 
static void pushTO (const unsigned int ot=DA::getMaxOrder())
 Set truncation order and save previous value. More...
 
static void popTO ()
 Restore truncation order to value before last DA::pushTO() More...
 
static DA random (const double cm)
 Create new DA filled with random coefficients. More...
 
static DA identity (const unsigned int var)
 Create the DA identity for independent DA variable var. More...
 
static DA fromString (const std::string &str)
 Create new DA from string. More...
 
static DA fromString (const std::vector< std::string > &str)
 Create new DA from vector of strings. More...
 
static DA read (std::istream &is)
 Create new DA from blob read from binary file. More...
 
static void memdump ()
 Dump memory status to screen (for debugging purposes only) More...
 

Friends

class compiledDA
 
class storedDA
 
DA DACE_API operator+ (const DA &da1, const DA &da2)
 Addition between two DAs. More...
 
DA DACE_API operator+ (const DA &da, const double c)
 Addition between a DA and a constant. More...
 
DA DACE_API operator+ (const double c, const DA &da)
 Addition between a constant and a DA. More...
 
DA DACE_API operator- (const DA &da1, const DA &da2)
 Subtraction between two DAs. More...
 
DA DACE_API operator- (const DA &da, const double c)
 Subtraction between a DA and a constant. More...
 
DA DACE_API operator- (const double c, const DA &da)
 Subtraction between a constant and a DA. More...
 
DA DACE_API operator* (const DA &da1, const DA &da2)
 Multiplication between two DAs. More...
 
DA DACE_API operator* (const DA &da, const double c)
 Multiplication between a DA and a constant. More...
 
DA DACE_API operator* (const double c, const DA &da)
 Multiplication between a constant and a DA. More...
 
DA DACE_API operator/ (const DA &da1, const DA &da2)
 Division between two DAs. More...
 
DA DACE_API operator/ (const DA &da, const double c)
 Division between a DA and a constant. More...
 
DA DACE_API operator/ (const double c, const DA &da)
 Division between a constant and a DA. More...
 
DACE_API std::ostream & operator<< (std::ostream &out, const DA &da)
 Output to C++ stream in text form. More...
 
DACE_API std::istream & operator>> (std::istream &in, DA &da)
 Input from C++ stream in text form. More...
 

Detailed Description

Basic DA class representing a single polynomial.

Constructor & Destructor Documentation

◆ DA() [1/6]

DACE::DA::DA ( )

Default constructor.

Create an empty DA object representing the constant zero function.

Exceptions
DACE::DACEException

◆ DA() [2/6]

DACE::DA::DA ( const DA da)

Copy constructor.

Create a copy of a DA object.

Parameters
[in]daobject to be copied.
Exceptions
DACE::DACEException

◆ DA() [3/6]

DACE::DA::DA ( DA &&  da)

Move constructor.

Move all resources from a DA object to us without copying.

Parameters
[in]daobject to be moved.
Exceptions
DACE::DACEException

◆ DA() [4/6]

DACE::DA::DA ( const int  i,
const double  c = 1.0 
)
explicit

Constructor for DA identities.

Create a DA object as c times the independent variable number i.

Note
When used in its one argument form (with the default argument 1.0 for c), this routine MUST be called with an integer type as the first argument, e.g. DA(1). Expressions involving floating point data types such as DA(1.0) will be interpreted as the constant DA object of the given value instead of the first independent DA variable.
Parameters
[in]iindependent variable number (i=0 means the constant part).
[in]ccoefficient corresponding to the given independent variable. By default, this value is assumed to be 1.0.
Exceptions
DACE::DACEException

◆ DA() [5/6]

DACE::DA::DA ( const unsigned int  i,
const double  c = 1.0 
)
explicit

Constructor for DA identities.

Create a DA object as c times the independent variable number i.

Note
When used in its one argument form (with the default argument 1.0 for c), this routine MUST be called with an integer type as the first argument, e.g. DA(1). Expressions involving floating point data types such as DA(1.0) will be interpreted as the constant DA of the given value instead of the first independent variable.
Parameters
[in]iindependent variable number (i=0 means the constant part).
[in]ccoefficient corresponding to the given independent variable. By default, this value is assumed to be 1.0.
Exceptions
DACE::DACEException

◆ DA() [6/6]

DACE::DA::DA ( const double  c)

Constructor for DA constants.

Create a DA object with the constant part equal to c.

Note
This routine MUST be called with a floating point type as the first argument, e.g. DA(1.0). Expressions involving integer data types such as DA(1) will be interpreted as the first independent DA variable instead of the constant DA object of the given value.
Parameters
[in]cA double value set as constant part of the DA object.
Exceptions
DACE::DACEException

◆ ~DA()

DACE::DA::~DA ( )
throw (
)

Destructor.

Destroy a DA object and free the associated object in the DACE core.

Member Function Documentation

◆ abs()

double DACE::DA::abs ( ) const

Maximum absolute value of all coefficients.

Compute the max norm of a DA object.

Returns
A double corresponding to the result of the operation.
Exceptions
DACE::DACEException

◆ acos()

DA DACE::DA::acos ( ) const

arccosine

Compute the arccosine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ acosh()

DA DACE::DA::acosh ( ) const

hyperbolic arccosine

Compute the hyperbolic arccosine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ asin()

DA DACE::DA::asin ( ) const

arcsine

Compute the arcsine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ asinh()

DA DACE::DA::asinh ( ) const

hyperbolic arcsine

Compute the hyperbolic arcsine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ atan()

DA DACE::DA::atan ( ) const

arctangent

Compute the arctangent of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ atan2()

DA DACE::DA::atan2 ( const DA da) const

arctangent in [-pi, pi]

Compute the four-quadrant arctangent of Y/X. Y is the current DA object, whereas X is the given da. The result is copied in a new DA object.

Parameters
[in]daDA object
Returns
A new DA object containing the result of the operation Y/X in [-pi, pi].
Exceptions
DACE::DACEException

◆ atanh()

DA DACE::DA::atanh ( ) const

hyperbolic arctangent

Compute the hyperbolic arctangent of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ BesselIFunction()

DA DACE::DA::BesselIFunction ( const int  n,
const bool  scaled = false 
) const

Bessel function I_n.

Compute the n-th modified Bessel function of first type I_n of a DA object. The result is copied in a new DA object.

Parameters
[in]norder of the Bessel function
[in]scaledif true, the modified Bessel function is scaled by a factor exp(-x), i.e. exp(-x)I_n(x) is returned.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException
Note
The DA must have non-negative constant part while the order is allowed to be negative.
This function fails if the result is too large to be represented in double precision.

◆ BesselJFunction()

DA DACE::DA::BesselJFunction ( const int  n) const

Bessel function J_n.

Compute the n-th Bessel function of first type J_n of a DA object. The result is copied in a new DA object.

Parameters
[in]norder of the Bessel function
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException
Note
The DA must have non-negative constant part while the order is allowed to be negative.
This function fails if the result is too large to be represented in double precision.

◆ BesselKFunction()

DA DACE::DA::BesselKFunction ( const int  n,
const bool  scaled = false 
) const

Bessel function K_n.

Compute the n-th modified Bessel function of second type K_n of a DA object. The result is copied in a new DA object.

Parameters
[in]norder of the Bessel function
[in]scaledif true, the modified Bessel function is scaled by a factor exp(x), i.e. exp(x)K_n(x) is returned.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException
Note
The DA must have non-negative constant part while the order is allowed to be negative.
This function fails if the result is too large to be represented in double precision.

◆ BesselYFunction()

DA DACE::DA::BesselYFunction ( const int  n) const

Bessel function Y_n.

Compute the n-th Bessel function of second type Y_n of a DA object. The result is copied in a new DA object.

Parameters
[in]norder of the Bessel function
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException
Note
The DA must have non-negative constant part while the order is allowed to be negative.
This function fails if the result is too large to be represented in double precision.

◆ bound()

Interval DACE::DA::bound ( ) const

Estimate range bound over [-1,1] for each independent variable.

Compute lower and upper bounds of a DA object.

Returns
An Interval object containing both the lower and the upper bound of the DA object.
Exceptions
DACE::DACEException
See also
Interval

◆ cbrt()

DA DACE::DA::cbrt ( ) const

cubic root

Compute the cubic root of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ checkVersion()

void DACE::DA::checkVersion ( )
static

Check DACE C++ interface and core routines version for compatibility.

Check the DACE core library version linked to this C++ interface against the interface version and throw an exception if the versions don't match.

Exceptions
DACE::DACEException
Note
This routine is called automatically by DA::init to ensure compatibility with the current runtime environment.

◆ compile()

compiledDA DACE::DA::compile ( ) const

Compile current DA for efficient repeated evaluation.

Compile current DA object and create a compiledDA object.

Returns
The compiled DA object.
Exceptions
DACE::DACEException

◆ cons()

double DACE::DA::cons ( ) const

Get constant part of a DA.

Return the constant part of a DA object.

Returns
A double corresponding to the constant part of the DA object.
Exceptions
DACE::DACEException

◆ convRadius()

double DACE::DA::convRadius ( const double  eps,
const unsigned int  type = 1 
) const

Estimate the convergence radius of the current DA.

Estimate the convergence radius of the DA object.

Parameters
[in]epsrequested tolerance.
[in]typetype of norm (sum norm is used as default)
Returns
A double corresponding to the estimated convergence radius.
Exceptions
DACE::DACEException

◆ cos()

DA DACE::DA::cos ( ) const

cosine

Compute the cosine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ cosh()

DA DACE::DA::cosh ( ) const

hyperbolic cosine

Compute the hyperbolic cosine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ deriv() [1/2]

DA DACE::DA::deriv ( const unsigned int  i) const

Derivative with respect to given variable.

Compute the derivative of a DA object with respect to variable i. The result is copied in a new DA object.

Parameters
[in]ivariable with respect to which the derivative is calculated.
Returns
A new DA object containing the result of the derivation.
Exceptions
DACE::DACEException

◆ deriv() [2/2]

DA DACE::DA::deriv ( const std::vector< unsigned int >  ind) const

Derivative with respect to given variables.

Compute the derivative of a DA object with respect to variables ind. The result is copied in a new DA object.

Parameters
[in]indvector containing the number of derivatives to take for each independent variable. If ind has fewer entries than there are independent variables, the missing entries are assumed to be zero. If ind has more entries than there are independent variables, extra values are ignored.
Returns
A new DA object containing the result of the derivation.
Exceptions
DACE::DACEException

◆ divide()

DA DACE::DA::divide ( const unsigned int  var,
const unsigned int  p = 1 
) const

Divide by an independent variable to some power.

Divide by independent variable var raised to power p. The result is copied in a new DA object.

Parameters
[in]varindependente variable number to divide by.
[in]ppower of the independent variable.
Returns
A new DA object containing the result.
Exceptions
DACE::DACEException

◆ erf()

DA DACE::DA::erf ( ) const

error function

Compute the error function of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ erfc()

DA DACE::DA::erfc ( ) const

complementary error function

Compute the complementary error function of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ estimNorm() [1/2]

std::vector< double > DACE::DA::estimNorm ( const unsigned int  var = 0,
const unsigned int  type = 0,
const unsigned int  nc = DA::getMaxOrder() 
) const

Estimate of different types of order sorted norms.

Estimate different types of order sorted norms for terms of a DA object up to a specified order.

Parameters
[in]varorder
0: Terms are sorted by their order (Default)
>0: Terms are sorted by the exponent of variable var
[in]typetype of norm to be computed. Possible norms are:
0: Max norm (Default)
1: Sum norm
>1: Vector norm of given type
[in]ncmaximum order to be estimated (Default order = Max order)
Returns
A double corresponding to the result of the operation.
Exceptions
DACE::DACEException
Note
If estimation is not possible, zero is returned for all requested orders.

◆ estimNorm() [2/2]

std::vector< double > DACE::DA::estimNorm ( std::vector< double > &  err,
const unsigned int  var = 0,
const unsigned int  type = 0,
const unsigned int  nc = DA::getMaxOrder() 
) const

Estimate of different types of order sorted norms with error of the estimate.

Estimate different types of order sorted norms for terms of a DA object up to a specified order with error estimates.

Parameters
[out]errreturns the amount by which the estimate underestimates the actual ordered norm of the terms in the polynomial up to the minimum of nc or the maximum computation order.
[in]varorder
0: Terms are sorted by their order (Default)
>0: Terms are sorted by the exponent of variable var
[in]typetype of norm to be computed. Possible norms are:
0: Max norm (Default)
1: Sum norm
>1: Vector norm of given type
[in]ncmaximum order to be estimated (Default order = Max order)
Returns
A double corresponding to the result of the operation.
Exceptions
DACE::DACEException
Note
If estimation is not possible, zero is returned for all requested orders.

◆ eval() [1/2]

template<class T >
T DACE::DA::eval ( const std::vector< T > &  args) const

Evaluation with a vector of arguments (not efficient for repeated evaluation!)

Generic evaluation of the DA with a vector of arithmetic type T arguments.

Parameters
[in]argsstd::vector<T> of arithmetic type T with which the DA vector is evaluated
Returns
The result of the evaluation
Exceptions
DACE::DACEException
Note
To be used only for single polynomial evaluation. For multiple evaluations of the same polynomial use the corresponding method in class compiledDA.
This function can be called with a braced initializer list. However, 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.
See also
compiledDA::eval

◆ eval() [2/2]

template<class T >
T DACE::DA::eval ( const T  args[],
const unsigned int  length 
) const

Evaluation with an array of arguments (not efficient for repeated evaluation!)

Generic evaluation of the DA with an array of arithmetic type T arguments.

Parameters
[in]argsarray of arithmetic type T with which the DA vector is evaluated.
[in]lengthnumber of elements in the array args.
Returns
The result of the evaluation.
Exceptions
DACE::DACEException
Note
To be used only for single polynomial evaluation. For multiple evaluations of the same polynomial use the corresponding method in class compiledDA.
See also
compiledDA::eval

◆ evalMonomials()

double DACE::DA::evalMonomials ( const DA values) const

evaluate the DA providing the value of every monomial in da

Evaluates the DA vector using the coefficients in argument values as the values for each monomial. This is equivalent to a monomial-wise dot product of two DA vectors.

Parameters
[in]valuesDA vector containing the values of each monomial
Returns
The result of the evaluation.
Exceptions
DACE::DACEException
See also
DA::multiplyMonomial

◆ evalScalar()

template<class T >
T DACE::DA::evalScalar ( const T &  arg) const

Evaluation with a single arithmetic type T argument (not efficient for repeated evaluation!)

Generic evaluation of the DA with a single arithmetic type T argument.

Parameters
[in]argsingle variable of arithmetic type T of the first independent DA variable.
Returns
The result of the evaluation.
Note
To be used only for single polynomial evaluation. For multiple evaluations of the same polynomial use the corresponding method in class compiledDA.
See also
compiledDA::evalScalar

◆ exp()

DA DACE::DA::exp ( ) const

exponential

Compute the exponential of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ fromString() [1/2]

DA DACE::DA::fromString ( const std::string &  str)
static

Create new DA from string.

Convert a string to DA object.

Parameters
[in]strstring.
Returns
A DA object.
Exceptions
DACE::DACEException

◆ fromString() [2/2]

DA DACE::DA::fromString ( const std::vector< std::string > &  str)
static

Create new DA from vector of strings.

Convert a vector of strings to DA object.

Parameters
[in]strvector of strings, each representing one line of the input.
Returns
A DA object.
Exceptions
DACE::DACEException

◆ GammaFunction()

DA DACE::DA::GammaFunction ( ) const

Gamma function.

Compute the Gamma function of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ getCoefficient()

double DACE::DA::getCoefficient ( const std::vector< unsigned int > &  jj) const

Get specific coefficient.

Return a specific coefficient of a DA object.

Parameters
[in]jjvector of the exponents of the coefficient to retrieve.
Returns
The coefficient of DA object corresponding to the given vector of exponents.
Exceptions
DACE::DACEException

◆ getEps()

double DACE::DA::getEps ( )
static

Get truncation epsilon.

Return the cutoff value eps currently set for the computations.

Returns
The cutoff value of eps, or zero if undefined.
Exceptions
DACE::DACEException

◆ getEpsMac()

double DACE::DA::getEpsMac ( )
static

Get the machine epsilon.

Return the machine epsilon (pessimistic estimate).

Returns
The machine epsilon, or zero if undefined.
Exceptions
DACE::DACEException

◆ getMaxMonomials()

unsigned int DACE::DA::getMaxMonomials ( )
static

Get the maximum monomials.

Return the maximum number of monomials available with the order and number of variables specified.

Returns
The maximum number of monomials, or zero if undefined.
Exceptions
DACE::DACEException

◆ getMaxOrder()

unsigned int DACE::DA::getMaxOrder ( )
static

Get the maximum order.

Return the maximum order currently set for the computations.

Returns
The maximum order, or zero if undefined.
Exceptions
DACE::DACEException

◆ getMaxVariables()

unsigned int DACE::DA::getMaxVariables ( )
static

Get the maximum number of variables.

Return the maximum number of variables set for the computations.

Returns
The maximum number of variables, or zero if undefined.
Exceptions
DACE::DACEException

◆ getMonomial() [1/2]

Monomial DACE::DA::getMonomial ( const unsigned int  npos) const

Get the Monomial at given position.

Return the Monomial corresponding to the non-zero coefficient at the given position in the DA object (monomials use one based indexing!).

Parameters
[in]nposposition within the DA object. The ordering of the Monomials within a DA object is implementation dependent and does not correspond to the order in which Monomials are listed in the ASCII output routines.
Returns
A Monomial object containing both the coefficient and the vector of exponents corresponding to the given position. If the requested monomial is not present in the DA object, a Monomial with coefficient set to 0.0 is returned.
Exceptions
DACE::DACEException
See also
Monomial
DA::getMonomial
DA::getMonomials

◆ getMonomial() [2/2]

void DACE::DA::getMonomial ( const unsigned int  npos,
Monomial m 
) const

Extract the Monomial at given position.

Return the Monomial corresponding to the non-zero coefficient at the given position in the DA object (monomials use one based indexing!).

Parameters
[in]nposposition within the DA object. The ordering of the Monomials within a DA object is implementation dependent and does not correspond to the order in which Monomials are listed in the ASCII output routines.
[out]mthe monomial object in which to store the corresponding monomial.
Exceptions
DACE::DACEException
See also
Monomial
DA::getMonomial
DA::getMonomials

◆ getMonomials()

std::vector< Monomial > DACE::DA::getMonomials ( ) const

Get std::vector of all non-zero Monomials.

Return a vector of all Monomials in the DA object (differently from getMonomial() where only a single Monomial, corresponding to a specified position in the DA object, is returned).

Returns
A vector of Monomial objects containing both the coefficient and the exponents corresponding to each monomial in the DA object. The monomials are returned in the same order as in the DACE ASCII output (that is, they are sorted by order).
Exceptions
DACE::DACEException
See also
Monomial
DA::getMonomial

◆ getTO()

unsigned int DACE::DA::getTO ( )
static

Get truncation order.

Return the truncation order currently set for the computations. All terms larger than the truncation order are discarded in subsequent operations.

Returns
current truncation order, or zero if undefined.
Exceptions
DACE::DACEException
See also
DA::setTO
DA::pushTO
DA::popTO

◆ gradient()

AlgebraicVector< DA > DACE::DA::gradient ( ) const

Gradient vector with respect to all independent DA variables.

Compute the gradient of the DA object.

Returns
An AlgebraicVector<DA> containing the derivatives of the DA object with respect to all independent DA variables.
Exceptions
DACE::DACEException

◆ hypot()

DA DACE::DA::hypot ( const DA da) const

hypotenuse

Compute the hypotenuse (sqrt(a*a+b*b)) of a DA object and the given DA argument. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ icrt()

DA DACE::DA::icrt ( ) const

inverse cubic root

Compute the inverse cubic root of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ identity()

DA DACE::DA::identity ( const unsigned int  var)
static

Create the DA identity for independent DA variable var.

Create a DA object representing the identity function in independent DA variable number var. This is just an alias for DA::DA(var).

Parameters
[in]varThe independent DA variable number
Exceptions
DACE::DACEException
See also
DA::DA

◆ init()

void DACE::DA::init ( const unsigned int  ord,
const unsigned int  nvar 
)
static

DACE initialization.

Initialize the DACE control arrays and set the maximum order and the maximum number of variables.

Note
MUST BE CALLED BEFORE ANY OTHER DA ROUTINE CAN BE USED.
This routine performs a mandatory version check to compare the version of the C++ interface used to compile the program to the version of the DACE library that is linked dynamically at runtime.
Parameters
[in]ordorder of the Taylor polynomials;
[in]nvarnumber of variables considered.
See also
DA::checkVersion

◆ integ() [1/2]

DA DACE::DA::integ ( const unsigned int  i) const

Integral with respect to given variable.

Compute the integral of a DA object with respect to variable i. The result is copied in a new DA object.

Parameters
[in]ivariable with respect to which the integral is calculated.
Returns
A new DA object containing the result of the integration.
Exceptions
DACE::DACEException

◆ integ() [2/2]

DA DACE::DA::integ ( const std::vector< unsigned int >  ind) const

Integral with respect to given variables.

Compute the integral of a DA object with respect to variables i. The result is copied in a new DA object.

Parameters
[in]indvector containing the number of integrals to take for each independent variable. If ind has fewer entries than there are independent variables, the missing entries are assumed to be zero. If ind has more than there are independent variables, extra values are ignored.
Returns
A new DA object containing the result of the integration.
Exceptions
DACE::DACEException

◆ isinf()

int DACE::DA::isinf ( ) const

Check if a DA object has any INF coefficients.

Returns
True is any coefficients of the DA object are INF.
Exceptions
DACE::DACEException

◆ isInitialized()

bool DACE::DA::isInitialized ( )
static

Get DACE initialization status.

Returns the inizialisation status of the DACE.

Returns
Returns true if the DACE has previously been initialized by a call to DA::init, or false otherwise.
See also
DA::init

◆ isnan()

int DACE::DA::isnan ( ) const

Check if a DA object has any NAN coefficients.

Returns
True is any coefficients of the DA object are NAN.
Exceptions
DACE::DACEException

◆ isrt()

DA DACE::DA::isrt ( ) const

inverse square root

Compute the inverse square root of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ linear()

AlgebraicVector< double > DACE::DA::linear ( ) const

Get linear part of a DA.

Return the linear part of a DA object.

Returns
An AlgebraicVector<dobule> containing the linear coefficients of each independent DA variable in the DA object.
Exceptions
DACE::DACEException

◆ log()

DA DACE::DA::log ( ) const

natural logarithm

Compute the natural logarithm of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ log10()

DA DACE::DA::log10 ( ) const

10 based logarithm

Compute the 10 based logarithm of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ log2()

DA DACE::DA::log2 ( ) const

2 based logarithm

Compute the 2 based logarithm of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ logb()

DA DACE::DA::logb ( const double  b = 10.0) const

logarithm with respect to given base

Compute the logarithm of a DA object with respect to a given base. The result is copied in a new DA object.

Parameters
[in]bbase with respect to which the logarithm is computed (base 10 set as default base).
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ LogGammaFunction()

DA DACE::DA::LogGammaFunction ( ) const

Logartihmic Gamma function.

Compute the Logarithmic Gamma function (i.e. the natural logarithm of Gamma) of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ memdump()

void DACE::DA::memdump ( )
static

Dump memory status to screen (for debugging purposes only)

◆ minv()

DA DACE::DA::minv ( ) const

multiplicative inverse

Compute the multiplicative inverse of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ mod()

DA DACE::DA::mod ( const double  p) const

Modulo of the constant part.

Compute the floating-point remainder of c/p (c modulo p), where c is the constant part of the current DA object. The result is copied in a new DA object.

Parameters
[in]pcostant with respect to which the modulo function is computed.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ multiplyMonomials()

DA DACE::DA::multiplyMonomials ( const DA da) const

Multiply the DA with the argument da monomial by monomial (i.e. coefficient-wise)

Multiply the DA vector with another DA vector da monomial by monomial. This is the equivalent of coefficient-wise multiplication (like in DA addition).

Parameters
[in]daDA vector to multiply with coefficient-wise
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException
See also
DA::evalMonomial

◆ norm()

double DACE::DA::norm ( const unsigned int  type = 0) const

Different types of norms over all coefficients.

Compute different types of norms for a DA object.

Parameters
[in]typetype of norm to be computed. Possible norms are:
0: Max norm (Default)
1: Sum norm
>1: Vector norm of given type
Returns
A double corresponding to the result of the operation.
Exceptions
DACE::DACEException

◆ operator*=() [1/2]

DA & DACE::DA::operator*= ( const DA da)

Multiply this DA by another DA.

Compute the product between the current DA object and the given one. The result is directly copied into the current DA object.

Parameters
[in]daDA object to be multiplied.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator*=() [2/2]

DA & DACE::DA::operator*= ( const double  c)

Multiply this DA by another double.

Compute the product between the current DA object and a given constant. The result is directly copied into the current DA object.

Parameters
[in]cconstant value to be multiplied.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator+=() [1/2]

DA & DACE::DA::operator+= ( const DA da)

Add another DA to this DA.

Compute the sum between the DA object and the given one. The result is directly copied into the current DA object.

Parameters
[in]daDA object to be added.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator+=() [2/2]

DA & DACE::DA::operator+= ( const double  c)

Add another double to this DA.

Compute the sum between the current DA object and a given constant. The result is directly copied into the current DA object.

Parameters
[in]cconstant value to be added.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator-()

DA DACE::DA::operator- ( ) const

Negate this DA.

Compute the additive inverse of the given DA object. The result is copied in a new DA vector.

Returns
A new DA object with the opposite sign.
Exceptions
DACE::DACEException

◆ operator-=() [1/2]

DA & DACE::DA::operator-= ( const DA da)

Subtract another DA from this DA.

Compute the difference between the current DA object and the given one. The result is directly copied into the current DA object.

Parameters
[in]daDA object to be subtracted.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator-=() [2/2]

DA & DACE::DA::operator-= ( const double  c)

Subtract another double from this DA.

Compute the difference between the current DA object and a given constant. The result is directly copied into the current DA object.

Parameters
[in]cconstant value to be subtracted.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator/=() [1/2]

DA & DACE::DA::operator/= ( const DA da)

Divide this DA by another DA.

Compute the division between the current DA object and the given one. The result is directly copied into the current DA object.

Parameters
[in]daDA object through which the current DA is divided by.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator/=() [2/2]

DA & DACE::DA::operator/= ( const double  c)

Divide this DA by another double.

Compute the division between the current DA object and a given constant. The result is directly copied into the current DA object.

Parameters
[in]cconstant value through which the current DA is divided by.
Returns
The current DA object with modified contents.
Exceptions
DACE::DACEException

◆ operator=() [1/3]

DA & DACE::DA::operator= ( DA &&  da)

Move assignment from existing DA.

Move all resources from a DA object to us without copying.

Parameters
[in]daobject to be moved.
Exceptions
DACE::DACEException

◆ operator=() [2/3]

DA & DACE::DA::operator= ( const DA da)

Assignment from existing DA.

Copy the content of a given DA object da into the DA object.

Parameters
[in]daDA object to be copied.
Returns
The DA object with the same content of the given DA object.
Exceptions
DACE::DACEException

◆ operator=() [3/3]

DA & DACE::DA::operator= ( const double  c)

Assignment from existing double.

Copy a constant polynomial of value c into the DA.

Parameters
[in]cConstant value to be copied.
Returns
The DA object representing the constant function with value c.
Exceptions
DACE::DACEException

◆ orderNorm()

std::vector< double > DACE::DA::orderNorm ( const unsigned int  var = 0,
const unsigned int  type = 0 
) const

Different types of norms over coefficients of each order separately.

Extract different types of order sorted norms from a DA object.

Parameters
[in]varorder
0: Terms are sorted by their order (Default)
>0: Terms are sorted by the exponent of variable var
[in]typetype of norm to be computed. Possible norms are:
0: Max norm (Default)
1: Sum norm
>1: Vector norm of given type
Returns
A double corresponding to the result of the operation.
Exceptions
DACE::DACEException

◆ plug()

DA DACE::DA::plug ( const unsigned int  var,
const double  val = 0.0 
) const

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

Partial evaluation of a DA object. In the DA object, variable var is replaced by the value val. The resulting DA object 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.
Exceptions
DACE::DACEException

◆ popTO()

void DACE::DA::popTO ( )
static

Restore truncation order to value before last DA::pushTO()

Restore the previous truncation order from the truncation order stack. All terms larger than the truncation order are discarded in subsequent operations.

Exceptions
DACE::DACEException
See also
DA::getTO
DA::setTO
DA::pushTO

◆ pow() [1/2]

DA DACE::DA::pow ( const int  p) const

Exponentiation to given (integer) power.

Elevate a DA object to a given integer power. The result is copied in a new DA object.

Parameters
[in]ppower to which the DA object is raised.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ pow() [2/2]

DA DACE::DA::pow ( const double  p) const

Exponentiation to given double power.

Elevate a DA object to a given real power. The constant part must be positive. The result is copied in a new DA object.

Parameters
[in]ppower to which the DA object is raised.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ PsiFunction()

DA DACE::DA::PsiFunction ( const unsigned int  n) const

Psi function.

Compute the n-th order Psi function, i.e. the (n+1)st derivative of the Logarithmic Gamma function, of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ pushTO()

void DACE::DA::pushTO ( const unsigned int  ot = DA::getMaxOrder())
static

Set truncation order and save previous value.

Set a new truncation order, saving the previous one on the truncation order stack. All terms larger than the truncation order are discarded in subsequent operations.

Parameters
[in]otnew truncation order.
Exceptions
DACE::DACEException
See also
DA::getTO
DA::setTO
DA::popTO

◆ random()

DA DACE::DA::random ( const double  cm)
static

Create new DA filled with random coefficients.

Create a DA object and fill with random entries.

Parameters
[in]cmfilling factor (for cm < 0, the DA object is filled with random numbers; for cm > 0, the DA object is filled with weighted decaying numbers).
Exceptions
DACE::DACEException

◆ read()

DA DACE::DA::read ( std::istream &  is)
static

Create new DA from blob read from binary file.

Read a binary representation of a DA from is.

Exceptions
DACE::DACEException
Note
When using binary IO operations, make sure the stream is opened in ios_base::binary mode! Some C++ libraries are known to mangle the input otherwise which will break the ability to read binary DA objects. Setting the binary flag for all IO (also text based) does not affect the output and is recommended.

◆ replaceVariable()

DA DACE::DA::replaceVariable ( const unsigned int  from = 0,
const unsigned int  to = 0,
const double  val = 1.0 
) const

Replace variable number from by val times variable number to.

Partial evaluation of a DA object. In the DA object, variable from is replaced by the value val times variable to. The resulting DA object is returned.

Parameters
[in]fromvariable number to be replaced
[in]tovariable number to be inserted instead
[in]valvalue by which to scale the inserted variable
Returns
A new DA object containing the resulting DA object.
Exceptions
DACE::DACEException
See also
DA::replaceVariable

◆ root()

DA DACE::DA::root ( const int  p = 2) const

p-th root

Compute the p-th root of a DA object. The result is copied in a new DA object.

Parameters
[in]proot to be computed.
Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ round()

DA DACE::DA::round ( ) const

Round the constant part to an integer.

Round the constant part of a DA object to an integer. The result is copied in a new DA object.

Returns
A new DA object with a rounded constant part.
Exceptions
DACE::DACEException

◆ scaleVariable()

DA DACE::DA::scaleVariable ( const unsigned int  var = 0,
const double  val = 1.0 
) const

Scale variable number var by val.

Scaling of an independent variable. In the DA object, variable var is replaced by the value val times var. The resulting DA object is returned.

Parameters
[in]varvariable number to be scaled
[in]valvalue by which to scale the variable
Returns
A new DA object containing the resulting DA object.
Exceptions
DACE::DACEException
See also
DA::scaleVariable

◆ setCoefficient()

void DACE::DA::setCoefficient ( const std::vector< unsigned int > &  jj,
const double  coeff 
)

Set specific coefficient.

Set a specific coefficient into a DA object.

Parameters
[in]jjvector of the exponents of the coefficient to be set.
[in]coeffvalue to be set as coefficient.
Exceptions
DACE::DACEException

◆ setEps()

double DACE::DA::setEps ( const double  eps)
static

Set truncation epsilon.

Set the cutoff value eps to a new value and return the previous value.

Parameters
[in]epsnew cutoff value.
Returns
The previous cutoff value of eps, or zero if undefined.
Exceptions
DACE::DACEException

◆ setTO()

unsigned int DACE::DA::setTO ( const unsigned int  ot = DA::getMaxOrder())
static

Set truncation order.

Set the truncation order ot to a new value and return the previous value. All terms larger than the truncation order are discarded in subsequent operations.

Parameters
[in]otnew truncation order.
Returns
previous truncation order, or zero if undefined.
Exceptions
DACE::DACEException
See also
DA::getTO
DA::pushTO
DA::popTO

◆ sin()

DA DACE::DA::sin ( ) const

sine

Compute the sine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ sinh()

DA DACE::DA::sinh ( ) const

hyperbolic sine

Compute the hyperbolic sine of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ size()

unsigned int DACE::DA::size ( ) const

Number of non-zero coefficients.

Return the number of non-zero coefficients of a DA object.

Returns
The number of non-zero coefficients stored in the DA object.
Exceptions
DACE::DACEException

◆ sqr()

DA DACE::DA::sqr ( ) const

square

Compute the square of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ sqrt()

DA DACE::DA::sqrt ( ) const

square root

Compute the square root of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ tan()

DA DACE::DA::tan ( ) const

tangent

Compute the tangent of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ tanh()

DA DACE::DA::tanh ( ) const

hyperbolic tangent

Compute the hyperbolic tangent of a DA object. The result is copied in a new DA object.

Returns
A new DA object containing the result of the operation.
Exceptions
DACE::DACEException

◆ toString()

std::string DACE::DA::toString ( ) const

Convert to string representation.

Convert DA object to string.

Returns
A string.
Exceptions
DACE::DACEException

◆ translateVariable()

DA DACE::DA::translateVariable ( const unsigned int  var = 0,
const double  a = 1.0,
const double  c = 0.0 
) const

Translate variable number var to a*var + c.

Affine translation of an independent variable. In the DA object, variable var is replaced by a*var + c. The resulting DA object is returned.

Parameters
[in]varvariable number to be translated
[in]avalue by which to scale the variable
[in]cvalue by which to shift the variable
Returns
A new DA object containing the resulting DA object.
Exceptions
DACE::DACEException
See also
DA::translateVariable

◆ trim()

DA DACE::DA::trim ( const unsigned int  min,
const unsigned int  max = DA::getMaxOrder() 
) const

Trim the coefficients only include orders between min and max, inclusively.

Returns a DA object with all monomials of order less than min and greater than max removed. The result is copied in a new DA object.

Parameters
[in]minThe minimum order to keep in the DA object.
[in]maxThe maximum order to keep in the DA object.
Returns
A new DA object containing the result of the trimming.
Exceptions
DACE::DACEException

◆ trunc()

DA DACE::DA::trunc ( ) const

Truncate the constant part to an integer.

Truncate the constant part of a DA object to an integer. The result is copied in a new DA object.

Returns
A new DA object with a truncated constant part.
Exceptions
DACE::DACEException

◆ version()

void DACE::DA::version ( int &  maj,
int &  min,
int &  patch 
)
static

DACE core routines version.

Return the major and minor version number of the DACE along with the patch level of the library.

Parameters
[out]majmajor DACE version number;
[out]minminor DACE version number;
[out]patchpatch level of DACE version.
See also
DA::checkVersion

◆ write()

void DACE::DA::write ( std::ostream &  os) const

Write binary representation of DA to stream.

Write a binary representation of the DA as a blob to os.

Exceptions
DACE::DACEException

Friends And Related Function Documentation

◆ compiledDA

friend class compiledDA
friend

◆ operator* [1/3]

DA DACE_API operator* ( const DA da1,
const DA da2 
)
friend

Multiplication between two DAs.

Compute the multiplication between two DA objects. The result is copied in a new DA object.

Parameters
[in]da1first DA object.
[in]da2second DA object.
Returns
A new DA object containing the result of the operation (da1*da2).
Exceptions
DACE::DACEException

◆ operator* [2/3]

DA DACE_API operator* ( const DA da,
const double  c 
)
friend

Multiplication between a DA and a constant.

Compute the multiplication between a DA object and a given constant. The result is copied in a new DA object.

Parameters
[in]daDA object.
[in]cgiven constant.
Returns
A new DA object containing the result of the operation (da*c).
Exceptions
DACE::DACEException

◆ operator* [3/3]

DA DACE_API operator* ( const double  c,
const DA da 
)
friend

Multiplication between a constant and a DA.

Compute the multiplication between a given constant and a DA object. The result is copied in a new DA object.

Parameters
[in]cgiven constant.
[in]daDA object.
Returns
A new DA object containing the result of the operation (c*da).
Exceptions
DACE::DACEException

◆ operator+ [1/3]

DA DACE_API operator+ ( const DA da1,
const DA da2 
)
friend

Addition between two DAs.

Compute the addition between two DA objects. The result is copied in a new DA object.

Parameters
[in]da1first DA object.
[in]da2second DA object.
Returns
A new DA object containing the result of the operation (da1+da2).
Exceptions
DACE::DACEException

◆ operator+ [2/3]

DA DACE_API operator+ ( const DA da,
const double  c 
)
friend

Addition between a DA and a constant.

Compute the addition between a DA object and a given constant. The result is copied in a new DA object.

Parameters
[in]daDA object.
[in]cgiven constant.
Returns
A new DA object containing the result of the operation (da+c).
Exceptions
DACE::DACEException

◆ operator+ [3/3]

DA DACE_API operator+ ( const double  c,
const DA da 
)
friend

Addition between a constant and a DA.

Compute the addition between a given constant and a DA object. The result is copied in a new DA object.

Parameters
[in]cgiven constant.
[in]daDA object.
Returns
A new DA object containing the result of the operation (c+da).
Exceptions
DACE::DACEException

◆ operator- [1/3]

DA DACE_API operator- ( const DA da1,
const DA da2 
)
friend

Subtraction between two DAs.

Compute the subtraction between two DA objects. The result is copied in a new DA object.

Parameters
[in]da1first DA object.
[in]da2second DA object.
Returns
A new DA object containing the result of the operation (da1-da2).
Exceptions
DACE::DACEException

◆ operator- [2/3]

DA DACE_API operator- ( const DA da,
const double  c 
)
friend

Subtraction between a DA and a constant.

Compute the subtraction between a DA object and a given constant. The result is copied in a new DA object.

Parameters
[in]daDA object.
[in]cgiven constant.
Returns
A new DA object containing the result of the operation (da-c).
Exceptions
DACE::DACEException

◆ operator- [3/3]

DA DACE_API operator- ( const double  c,
const DA da 
)
friend

Subtraction between a constant and a DA.

Compute the subtraction between a given constant and a DA object. The result is copied in a new DA object.

Parameters
[in]cgiven constant.
[in]daDA object.
Returns
A new DA object containing the result of the operation (c-da).
Exceptions
DACE::DACEException

◆ operator/ [1/3]

DA DACE_API operator/ ( const DA da1,
const DA da2 
)
friend

Division between two DAs.

Compute the division between two DA objects. The result is copied in a new DA object.

Parameters
[in]da1first DA object.
[in]da2second DA object.
Returns
A new DA object containing the result of the operation (da1/da2).
Exceptions
DACE::DACEException

◆ operator/ [2/3]

DA DACE_API operator/ ( const DA da,
const double  c 
)
friend

Division between a DA and a constant.

Compute the division between a DA object and a given constant. The result is copied in a new DA object.

Parameters
[in]daDA object.
[in]cgiven constant.
Returns
A new DA object containing the result of the operation (da/c).
Exceptions
DACE::DACEException

◆ operator/ [3/3]

DA DACE_API operator/ ( const double  c,
const DA da 
)
friend

Division between a constant and a DA.

Compute the division between a given constant and a DA object. The result is copied in a new DA object.

Parameters
[in]cgiven constant.
[in]daDA object.
Returns
A new DA object containing the result of the operation (c/da).
Exceptions
DACE::DACEException

◆ operator<<

DACE_API std::ostream& operator<< ( std::ostream &  out,
const DA da 
)
friend

Output to C++ stream in text form.

Overload of std::operator<< in iostream.

Parameters
[in]outstandard output stream.
[in]daDA object to be printed in the stream
Returns
Standard output stream.
Exceptions
DACE::DACEException
See also
DA::toString

◆ operator>>

DACE_API std::istream& operator>> ( std::istream &  in,
DA da 
)
friend

Input from C++ stream in text form.

Overload of std::operator>> in iostream. Reads both string and binary DA representations from a file.

Parameters
[in]instandard input stream.
[in]daDA object to be created from the stream
Returns
Standard input stream.
Exceptions
DACE::DACEException
Note
When using binary IO operations, make sure the stream is opened in ios_base::binary mode! Some C++ libraries are known to mangle the input otherwise which will break the ability to read binary DA objects. Setting the binary flag for all IO (also text based) does not affect the output and is recommended.
See also
DA::fromString

◆ storedDA

friend class storedDA
friend

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