curves::linear_variable< Numeric, Safe > Struct Template Reference

#include <curves/fwd.h>

Inheritance diagram for curves::linear_variable< Numeric, Safe >:
Collaboration diagram for curves::linear_variable< Numeric, Safe >:

Public Types

typedef Eigen::Matrix< Numeric, Eigen::Dynamic, 1 > vector_x_t
 
typedef Eigen::Matrix< Numeric, Eigen::Dynamic, Eigen::Dynamic > matrix_x_t
 
typedef linear_variable< Numeric > linear_variable_t
 

Public Member Functions

 linear_variable ()
 
 linear_variable (const vector_x_t &c)
 
 linear_variable (const matrix_x_t &B, const vector_x_t &c)
 
vector_x_t operator() (const Eigen::Ref< const vector_x_t > &val) const
 Linear evaluation for vector x. More...
 
linear_variable_toperator+= (const linear_variable_t &w1)
 Add another linear variable. More...
 
linear_variable_toperator-= (const linear_variable_t &w1)
 Substract another linear variable. More...
 
linear_variable_toperator/= (const double d)
 Divide by a constant : p_i / d = B_i*x/d + c_i/d. More...
 
linear_variable_toperator*= (const double d)
 Multiply by a constant : p_i / d = B_i*x*d + c_i*d. More...
 
std::size_t size () const
 Get dimension of linear variable. More...
 
Numeric norm () const
 Get norm of linear variable (Norm of B plus norm of C). More...
 
bool isApprox (const linear_variable_t &other, const double prec=Eigen::NumTraits< Numeric >::dummy_precision()) const
 Check if actual linear variable and other are approximately equal given a precision treshold. Only two curves of the same class can be approximately equal,. More...
 
const matrix_x_tB () const
 
const vector_x_tc () const
 
bool isZero () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Public Member Functions

static linear_variable_t Zero (size_t dim=0)
 Get a linear variable equal to zero. More...
 

Friends

class boost::serialization::access
 

Member Typedef Documentation

◆ linear_variable_t

template<typename Numeric = double, bool Safe = true>
typedef linear_variable<Numeric> curves::linear_variable< Numeric, Safe >::linear_variable_t

◆ matrix_x_t

template<typename Numeric = double, bool Safe = true>
typedef Eigen::Matrix<Numeric, Eigen::Dynamic, Eigen::Dynamic> curves::linear_variable< Numeric, Safe >::matrix_x_t

◆ vector_x_t

template<typename Numeric = double, bool Safe = true>
typedef Eigen::Matrix<Numeric, Eigen::Dynamic, 1> curves::linear_variable< Numeric, Safe >::vector_x_t

Constructor & Destructor Documentation

◆ linear_variable() [1/3]

template<typename Numeric = double, bool Safe = true>
curves::linear_variable< Numeric, Safe >::linear_variable ( )
inline

◆ linear_variable() [2/3]

template<typename Numeric = double, bool Safe = true>
curves::linear_variable< Numeric, Safe >::linear_variable ( const vector_x_t c)
inline

◆ linear_variable() [3/3]

template<typename Numeric = double, bool Safe = true>
curves::linear_variable< Numeric, Safe >::linear_variable ( const matrix_x_t B,
const vector_x_t c 
)
inline

Member Function Documentation

◆ B()

template<typename Numeric = double, bool Safe = true>
const matrix_x_t& curves::linear_variable< Numeric, Safe >::B ( ) const
inline

◆ c()

template<typename Numeric = double, bool Safe = true>
const vector_x_t& curves::linear_variable< Numeric, Safe >::c ( ) const
inline

◆ isApprox()

template<typename Numeric = double, bool Safe = true>
bool curves::linear_variable< Numeric, Safe >::isApprox ( const linear_variable_t other,
const double  prec = Eigen::NumTraits<Numeric>::dummy_precision() 
) const
inline

Check if actual linear variable and other are approximately equal given a precision treshold. Only two curves of the same class can be approximately equal,.

Parameters
prec: the precision treshold, default Eigen::NumTraits<Numeric>::dummy_precision()
Returns
true if the two linear variables are approximately equal.

◆ isZero()

template<typename Numeric = double, bool Safe = true>
bool curves::linear_variable< Numeric, Safe >::isZero ( ) const
inline

◆ norm()

template<typename Numeric = double, bool Safe = true>
Numeric curves::linear_variable< Numeric, Safe >::norm ( ) const
inline

Get norm of linear variable (Norm of B plus norm of C).

Returns
Norm of linear variable.

◆ operator()()

template<typename Numeric = double, bool Safe = true>
vector_x_t curves::linear_variable< Numeric, Safe >::operator() ( const Eigen::Ref< const vector_x_t > &  val) const
inline

Linear evaluation for vector x.

Parameters
val: vector to evaluate the linear variable.
Returns
Evaluation of linear variable for vector x.

◆ operator*=()

template<typename Numeric = double, bool Safe = true>
linear_variable_t& curves::linear_variable< Numeric, Safe >::operator*= ( const double  d)
inline

Multiply by a constant : p_i / d = B_i*x*d + c_i*d.

Parameters
d: constant.
Returns
Linear variable after operation.

◆ operator+=()

template<typename Numeric = double, bool Safe = true>
linear_variable_t& curves::linear_variable< Numeric, Safe >::operator+= ( const linear_variable_t w1)
inline

Add another linear variable.

Parameters
w1: linear variable to add.
Returns
Linear variable after operation.

◆ operator-=()

template<typename Numeric = double, bool Safe = true>
linear_variable_t& curves::linear_variable< Numeric, Safe >::operator-= ( const linear_variable_t w1)
inline

Substract another linear variable.

Parameters
w1: linear variable to substract.
Returns
Linear variable after operation.

◆ operator/=()

template<typename Numeric = double, bool Safe = true>
linear_variable_t& curves::linear_variable< Numeric, Safe >::operator/= ( const double  d)
inline

Divide by a constant : p_i / d = B_i*x/d + c_i/d.

Parameters
d: constant.
Returns
Linear variable after operation.

◆ serialize()

template<typename Numeric = double, bool Safe = true>
template<class Archive >
void curves::linear_variable< Numeric, Safe >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

◆ size()

template<typename Numeric = double, bool Safe = true>
std::size_t curves::linear_variable< Numeric, Safe >::size ( ) const
inline

Get dimension of linear variable.

Returns
Dimension of linear variable.

◆ Zero()

template<typename Numeric = double, bool Safe = true>
static linear_variable_t curves::linear_variable< Numeric, Safe >::Zero ( size_t  dim = 0)
inlinestatic

Get a linear variable equal to zero.

Parameters
dim: Dimension of linear variable.
Returns
Linear variable equal to zero.

Friends And Related Function Documentation

◆ boost::serialization::access

template<typename Numeric = double, bool Safe = true>
friend class boost::serialization::access
friend

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