23 #ifndef __LP_INTERFACE__H__ 24 #define __LP_INTERFACE__H__ 48 template <
typename GUM_SCALAR >
70 explicit LpCol(
unsigned int id);
87 unsigned int id()
const;
212 template <
typename GUM_SCALAR >
241 LpExpr(
const LpExpr& expr,
bool copyLeft,
bool copyMiddle,
bool copyRight);
272 LpExpr(
LpExpr&& expr,
bool copyLeft,
bool copyMiddle,
bool copyRight);
312 template <
typename SCALAR >
353 template <
typename T >
354 LpExpr& operator+=(
const T& rhs);
386 template <
typename T >
387 LpExpr& operator-=(
const T& rhs);
404 template <
typename T1,
typename T2 >
405 static LpExpr lessThan(T1&& lhs, T2&& rhs);
406 template <
typename SCALAR >
407 static LpExpr multiply(
const SCALAR& lhs,
const LpCol& rhs);
457 inline void __addSide(
const LpCol& from);
467 inline void __addSide(
const LpExpr& from);
477 inline void __addSide(
LpExpr&& from);
488 template <
typename SCALAR >
489 inline void __addSide(
const SCALAR& from);
502 template <
typename GUM_SCALAR >
518 LpRow(
const LpExpr& expr,
const std::vector< LpCol >& cols);
529 LpRow(
LpExpr&& expr,
const std::vector< LpCol >& cols);
603 template <
typename GUM_SCALAR >
656 template <
typename T >
674 std::vector< LpCol > addCols(
const unsigned int& cols);
683 void addRow(
const LpExpr& expr);
691 void addRow(
LpExpr&& expr);
696 void addPositivity();
723 std::vector< std::vector< GUM_SCALAR > > solve();
729 std::vector< LpCol > getCols()
const;
800 template <
typename T2 >
802 template <
typename T2 >
834 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
836 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
842 template <
typename T2, forb
idden_type< T2, LpExpr > = 0 >
848 template <
typename T1,
874 template <
typename T2 >
876 template <
typename T2 >
908 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
910 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
923 template <
typename T2, forb
idden_type< T2, LpExpr > = 0 >
936 template <
typename T1,
937 forbidden_type< T1, LpExpr > = 0,
956 template <
typename SCALAR >
970 template <
typename SCALAR >
999 template <
typename T2 >
1001 template <
typename T2 >
1003 template <
typename T1,
1007 template <
typename T1,
1008 forbidden_type< T1, LpExpr& > = 0,
1012 template <
typename T2 >
1014 template <
typename T2 >
1016 template <
typename T1,
1017 forbidden_type< T1, LpExpr > = 0,
1020 template <
typename T1,
1021 forbidden_type< T1, LpExpr > = 0,
1035 #ifndef GUM_NO_INLINE bool __ileft
True if this expression has a non-empty left side L : L <= M <= R .
HashTable< LpCol, double > * __coeffs
The coefficients of the variables of the linear inequality.
std::string toString() const
Get the string representation of a calling variable.
bool operator==(const LpCol &col) const
Test of equality == between two variables.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double __cste
The constant of the linear inequality.
bool __iright
True if this expression has a non-empty right side R : L <= M <= R .
HashTable< LpCol, double > * __mCoeffs
The coefficients of each variable on the middle side L : L <= M <= R.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
void swap(HashTable< LpCol, double > *&a, HashTable< LpCol, double > *&b)
Swap the addresses of two pointers to hashTables.
LpCol(unsigned int id)
Default constructor.
LpExpr operator<=(const LpExpr &lhs, T2 &&rhs)
Overload of operator <= between anything and anything.
Class template representing hashing function of LpCol.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double __mValue
The constant on the middle side L : L <= M <= R.
The class for generic Hash Tables.
Class representing a variable ( a column ) of a linear program, i.e.
Class representing a linear expression.
double __rValue
The constant on the right side L : L <= M <= R.
Class representing a row of the linear program, i.e.
HashTable< LpCol, double > * __rCoeffs
The coefficients of each variable on the right side L : L <= M <= R.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
double __lValue
The constant on the left side L : L <= M <= R.
Class representing a linear program.
~LpCol()
Default destructor.
LpExpr operator+(LpExpr &&lhs, const T2 &rhs)
Overload of operator + between anything ( a scalar, a variable or an expression ) and anything except...
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
unsigned int __id
Variable id.
bool __positivity
true if addPositivity() has been called, false otherwise.
friend std::ostream & operator<<(std::ostream &out, const LpCol &col)
Overload of << to use with output streams ( such as std::cout << ).
HashTable< LpCol, double > * __lCoeffs
The coefficients of each variable on the left side L : L <= M <= R.
typename std::enable_if< !std::is_same< T1, T2 >::value, int >::type forbidden_type
Forbidden_type<T1,T2> return the "int" type if T1 and T2 are of the same type, else nothing...
LpExpr operator*(const SCALAR &lhs, const LpCol &rhs)
Overload of operator * between a scalar and a variable.
std::vector< LpRow *> __rows
Rows of the problem.
All hash functions should inherit from this class.
bool operator!=(const LpCol &col) const
Opposite of equality != test between two variables.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
std::size_t Size
In aGrUM, hashed values are unsigned long int.
LpCol & operator=(const LpCol &col)
Assignment operator = by copy.
LpExpr operator-(LpExpr &&lhs, const T2 &rhs)
Overload of operator - between anything ( a scalar, a variable or an expression ) and anything except...
std::vector< LpCol > __cols
Variables of the problem.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
bool __imiddle
True if this expression has a non-empty middle side M ( the default ) : L <= M <= R ...
unsigned int id() const
Variable id accessor.
bool operator<(const LpCol &col) const
Test of ordering < between two variables.