Limbo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
limbo::solvers::LinearTerm< T > Class Template Reference

Linear term. More...

#include <Solvers.h>

Public Types

typedef T coefficient_value_type
 coefficient type
 
typedef Variable
< coefficient_value_type
variable_type
 variable type
 

Public Member Functions

 LinearTerm (variable_type var=variable_type(), coefficient_value_type coef=1)
 constructor More...
 
 LinearTerm (LinearTerm const &rhs)
 copy constructor More...
 
LinearTermoperator= (LinearTerm const &rhs)
 assignment More...
 
 ~LinearTerm ()
 destructor
 
variable_type const & variable () const
 
void setVariable (variable_type const &var)
 
coefficient_value_type coefficient () const
 
void setCoefficient (coefficient_value_type coef)
 
LinearTerm operator- () const
 
LinearTermnegate ()
 
LinearTermoperator*= (coefficient_value_type coef)
 
LinearTermoperator/= (coefficient_value_type coef)
 
bool operator== (LinearTerm const &rhs) const
 

Protected Member Functions

void copy (LinearTerm const &rhs)
 copy object More...
 

Protected Attributes

variable_type m_var
 variable
 
coefficient_value_type m_coef
 coefficient
 

Friends

LinearTerm operator* (LinearTerm const &term, coefficient_value_type coef)
 
LinearTerm operator* (coefficient_value_type coef, LinearTerm const &term)
 
LinearTerm operator/ (LinearTerm const &term, coefficient_value_type coef)
 
LinearExpression
< coefficient_value_type
operator+ (LinearTerm const &term, coefficient_value_type constant)
 
LinearExpression
< coefficient_value_type
operator+ (LinearTerm const &term, variable_type const &var)
 
LinearExpression
< coefficient_value_type
operator+ (coefficient_value_type constant, LinearTerm const &term)
 
LinearExpression
< coefficient_value_type
operator+ (variable_type const &var, LinearTerm const &term)
 
LinearExpression
< coefficient_value_type
operator+ (LinearTerm const &term1, LinearTerm const &term2)
 
LinearExpression
< coefficient_value_type
operator- (LinearTerm const &term, coefficient_value_type constant)
 
LinearExpression
< coefficient_value_type
operator- (LinearTerm const &term, variable_type const &var)
 
LinearExpression
< coefficient_value_type
operator- (variable_type const &var, LinearTerm const &term)
 
LinearExpression
< coefficient_value_type
operator- (coefficient_value_type constant, LinearTerm const &term)
 
LinearExpression
< coefficient_value_type
operator- (LinearTerm const &term1, LinearTerm const &term2)
 
LinearConstraint
< coefficient_value_type
operator< (LinearTerm const &term, coefficient_value_type rhs)
 overload < More...
 
LinearConstraint
< coefficient_value_type
operator<= (LinearTerm const &term, coefficient_value_type rhs)
 overload <=, same as < More...
 
LinearConstraint
< coefficient_value_type
operator> (LinearTerm const &term, coefficient_value_type rhs)
 overload > More...
 
LinearConstraint
< coefficient_value_type
operator>= (LinearTerm const &term, coefficient_value_type rhs)
 overload >=, same as > More...
 
LinearConstraint
< coefficient_value_type
operator== (LinearTerm const &term, coefficient_value_type rhs)
 

Detailed Description

template<typename T>
class limbo::solvers::LinearTerm< T >

Linear term.

Template Parameters
Tcoefficient type

Definition at line 74 of file Solvers.h.

Constructor & Destructor Documentation

template<typename T>
limbo::solvers::LinearTerm< T >::LinearTerm ( variable_type  var = variable_type(),
coefficient_value_type  coef = 1 
)
inline

constructor

Parameters
varvariable
coefcoefficient

Definition at line 359 of file Solvers.h.

template<typename T>
limbo::solvers::LinearTerm< T >::LinearTerm ( LinearTerm< T > const &  rhs)
inline

copy constructor

Parameters
rhsright hand side

Definition at line 366 of file Solvers.h.

Member Function Documentation

template<typename T>
coefficient_value_type limbo::solvers::LinearTerm< T >::coefficient ( ) const
inline
Returns
coefficient

Definition at line 388 of file Solvers.h.

template<typename T>
void limbo::solvers::LinearTerm< T >::copy ( LinearTerm< T > const &  rhs)
inlineprotected

copy object

Parameters
rhsright hand side

Definition at line 579 of file Solvers.h.

template<typename T>
LinearTerm& limbo::solvers::LinearTerm< T >::negate ( )
inline

self-negation

Returns
the object

Definition at line 401 of file Solvers.h.

template<typename T>
LinearTerm& limbo::solvers::LinearTerm< T >::operator*= ( coefficient_value_type  coef)
inline

overload multiply and assignment

Parameters
coefcoefficient
Returns
reference to the object

Definition at line 427 of file Solvers.h.

template<typename T>
LinearTerm limbo::solvers::LinearTerm< T >::operator- ( ) const
inline

overload negation

Returns
a copy of new object

Definition at line 394 of file Solvers.h.

template<typename T>
LinearTerm& limbo::solvers::LinearTerm< T >::operator/= ( coefficient_value_type  coef)
inline

overload divide and assignment

Parameters
coefcoefficient
Returns
reference to the object

Definition at line 445 of file Solvers.h.

template<typename T>
LinearTerm& limbo::solvers::LinearTerm< T >::operator= ( LinearTerm< T > const &  rhs)
inline

assignment

Parameters
rhsright hand side

Definition at line 372 of file Solvers.h.

template<typename T>
bool limbo::solvers::LinearTerm< T >::operator== ( LinearTerm< T > const &  rhs) const
inline

overload equal

Parameters
rhsright hand side
Returns
true if two terms are equal

Definition at line 572 of file Solvers.h.

template<typename T>
void limbo::solvers::LinearTerm< T >::setCoefficient ( coefficient_value_type  coef)
inline
Parameters
coefcoefficient

Definition at line 390 of file Solvers.h.

template<typename T>
void limbo::solvers::LinearTerm< T >::setVariable ( variable_type const &  var)
inline
Parameters
varvariable

Definition at line 386 of file Solvers.h.

template<typename T>
variable_type const& limbo::solvers::LinearTerm< T >::variable ( ) const
inline
Returns
variable

Definition at line 384 of file Solvers.h.

Friends And Related Function Documentation

template<typename T>
LinearTerm operator* ( LinearTerm< T > const &  term,
coefficient_value_type  coef 
)
friend

overload multiply by a value

Parameters
termterm
coefcoefficient
Returns
result object

Definition at line 410 of file Solvers.h.

template<typename T>
LinearTerm operator* ( coefficient_value_type  coef,
LinearTerm< T > const &  term 
)
friend

overload a value multiply a term

Parameters
coefcoefficient
termterm
Returns
result object

Definition at line 420 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator+ ( LinearTerm< T > const &  term,
coefficient_value_type  constant 
)
friend

overload plus term+constant

Parameters
termterm
constantconstant
Returns
expression

Definition at line 454 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator+ ( LinearTerm< T > const &  term,
variable_type const &  var 
)
friend

overload plus term+var

Parameters
termterm
varvariable
Returns
expression

Definition at line 462 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator+ ( coefficient_value_type  constant,
LinearTerm< T > const &  term 
)
friend

overload plus constant+term

Parameters
constantconstant
termterm
Returns
expression

Definition at line 470 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator+ ( variable_type const &  var,
LinearTerm< T > const &  term 
)
friend

overload plus term+var

Parameters
termterm
varvariable
Returns
expression

Definition at line 478 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator+ ( LinearTerm< T > const &  term1,
LinearTerm< T > const &  term2 
)
friend

overload plus for two terms

Parameters
term1term
term2term
Returns
result expression

Definition at line 486 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator- ( LinearTerm< T > const &  term,
coefficient_value_type  constant 
)
friend

overload minus term-constant

Parameters
termterm
constantconstant
Returns
expression

Definition at line 496 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator- ( LinearTerm< T > const &  term,
variable_type const &  var 
)
friend

overload minus term-var

Parameters
termterm
varvariable
Returns
expression

Definition at line 504 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator- ( variable_type const &  var,
LinearTerm< T > const &  term 
)
friend

overload minus var-term

Parameters
varvariable
termterm
Returns
expression

Definition at line 512 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator- ( coefficient_value_type  constant,
LinearTerm< T > const &  term 
)
friend

overload minus constant-term

Parameters
constantconstant
termterm
Returns
expression

Definition at line 520 of file Solvers.h.

template<typename T>
LinearExpression<coefficient_value_type> operator- ( LinearTerm< T > const &  term1,
LinearTerm< T > const &  term2 
)
friend

overload minus for two terms

Parameters
term1term
term2term
Returns
result expression

Definition at line 528 of file Solvers.h.

template<typename T>
LinearTerm operator/ ( LinearTerm< T > const &  term,
coefficient_value_type  coef 
)
friend

overload divide by a value

Parameters
termterm
coefcoefficient
Returns
reference to the object

Definition at line 436 of file Solvers.h.

template<typename T>
LinearConstraint<coefficient_value_type> operator< ( LinearTerm< T > const &  term,
coefficient_value_type  rhs 
)
friend

overload <

Parameters
termlinear term
rhsright hand side constant

Definition at line 537 of file Solvers.h.

template<typename T>
LinearConstraint<coefficient_value_type> operator<= ( LinearTerm< T > const &  term,
coefficient_value_type  rhs 
)
friend

overload <=, same as <

Parameters
termlinear term
rhsright hand side constant

Definition at line 544 of file Solvers.h.

template<typename T>
LinearConstraint<coefficient_value_type> operator== ( LinearTerm< T > const &  term,
coefficient_value_type  rhs 
)
friend

overload ==

Parameters
termlinear term
rhsright hand side constant

Definition at line 565 of file Solvers.h.

template<typename T>
LinearConstraint<coefficient_value_type> operator> ( LinearTerm< T > const &  term,
coefficient_value_type  rhs 
)
friend

overload >

Parameters
termlinear term
rhsright hand side constant

Definition at line 551 of file Solvers.h.

template<typename T>
LinearConstraint<coefficient_value_type> operator>= ( LinearTerm< T > const &  term,
coefficient_value_type  rhs 
)
friend

overload >=, same as >

Parameters
termlinear term
rhsright hand side constant

Definition at line 558 of file Solvers.h.


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