#include <ndcurves/linear_variable.h>
Public Types | |
typedef Eigen::Matrix< Numeric, Eigen::Dynamic, 1 > | vector_x_t |
typedef Eigen::Matrix< Numeric, Eigen::Dynamic, Eigen::Dynamic > | matrix_x_t |
typedef Eigen::Matrix< Numeric, 3, 1 > | vector_3_t |
typedef Eigen::Matrix< Numeric, 3, 3 > | matrix_3_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) | |
linear_variable (const linear_variable_t &other) | |
~linear_variable () | |
vector_x_t | operator() (const Eigen::Ref< const vector_x_t > &val) const |
Linear evaluation for vector x. | |
linear_variable_t & | operator+= (const linear_variable_t &w1) |
Add another linear variable. | |
linear_variable_t & | operator-= (const linear_variable_t &w1) |
Substract another linear variable. | |
linear_variable_t & | operator/= (const double d) |
Divide by a constant : p_i / d = B_i*x/d + c_i/d. | |
linear_variable_t & | operator*= (const double d) |
Multiply by a constant : p_i / d = B_i*x*d + c_i*d. | |
linear_variable_t | cross (const linear_variable_t &other) const |
Compute the cross product of the current linear_variable and the other. This method of course only makes sense for dimension 3 curves and dimension 3 unknown, since otherwise the result is non-linear. It assumes that a method point_t cross(const point_t&, const point_t&) has been defined. | |
std::size_t | size () const |
Get dimension of linear variable. | |
Numeric | norm () const |
Get norm of linear variable (Norm of B plus norm of C). | |
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 threshold. Only two curves of the same class can be approximately equal,. | |
virtual bool | operator== (const linear_variable &other) const |
Check if actual linear variable and other are equal. | |
virtual bool | operator!= (const linear_variable &other) const |
Check if actual linear variable and other are different. | |
const matrix_x_t & | B () const |
const vector_x_t & | c () const |
bool | isZero () const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
linear_variable & | operator= (const linear_variable &other) |
![]() | |
template<class Derived > | |
void | loadFromText (const std::string &filename) |
Loads a Derived object from a text file. | |
template<class Derived > | |
void | saveAsText (const std::string &filename) const |
Saved a Derived object as a text file. | |
template<class Derived > | |
void | loadFromXML (const std::string &filename, const std::string &tag_name) |
Loads a Derived object from an XML file. | |
template<class Derived > | |
void | saveAsXML (const std::string &filename, const std::string &tag_name) const |
Saved a Derived object as an XML file. | |
template<class Derived > | |
void | loadFromBinary (const std::string &filename) |
Loads a Derived object from an binary file. | |
template<class Derived > | |
void | saveAsBinary (const std::string &filename) const |
Saved a Derived object as an binary file. | |
Static Public Member Functions | |
static linear_variable_t | Zero (size_t dim=0) |
Get a linear variable equal to zero. | |
static linear_variable_t | X (size_t dim=0) |
Get a linear variable equal to the variable. | |
Friends | |
class | boost::serialization::access |
typedef linear_variable<Numeric> ndcurves::linear_variable< Numeric, Safe >::linear_variable_t |
typedef Eigen::Matrix<Numeric, 3, 3> ndcurves::linear_variable< Numeric, Safe >::matrix_3_t |
typedef Eigen::Matrix<Numeric, Eigen::Dynamic, Eigen::Dynamic> ndcurves::linear_variable< Numeric, Safe >::matrix_x_t |
typedef Eigen::Matrix<Numeric, 3, 1> ndcurves::linear_variable< Numeric, Safe >::vector_3_t |
typedef Eigen::Matrix<Numeric, Eigen::Dynamic, 1> ndcurves::linear_variable< Numeric, Safe >::vector_x_t |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Compute the cross product of the current linear_variable and the other. This method of course only makes sense for dimension 3 curves and dimension 3 unknown, since otherwise the result is non-linear. It assumes that a method point_t cross(const point_t&, const point_t&) has been defined.
pOther | other polynomial to compute the cross product with. |
|
inline |
Check if actual linear variable and other are approximately equal given a precision threshold. Only two curves of the same class can be approximately equal,.
prec | : the precision threshold, default Eigen::NumTraits<Numeric>::dummy_precision() |
|
inline |
|
inline |
Get norm of linear variable (Norm of B plus norm of C).
|
inlinevirtual |
Check if actual linear variable and other are different.
other | : the other linear_variable to check. |
|
inline |
Linear evaluation for vector x.
val | : vector to evaluate the linear variable. |
|
inline |
Multiply by a constant : p_i / d = B_i*x*d + c_i*d.
d | : constant. |
|
inline |
Add another linear variable.
w1 | : linear variable to add. |
|
inline |
Substract another linear variable.
w1 | : linear variable to substract. |
|
inline |
Divide by a constant : p_i / d = B_i*x/d + c_i/d.
d | : constant. |
|
inline |
|
inlinevirtual |
Check if actual linear variable and other are equal.
other | : the other linear_variable to check. |
|
inline |
|
inline |
Get dimension of linear variable.
|
inlinestatic |
Get a linear variable equal to the variable.
dim | : Dimension of linear variable. |
|
inlinestatic |
Get a linear variable equal to zero.
dim | : Dimension of linear variable. |