21 #ifndef __LP_INTERFACE__H__ 22 #define __LP_INTERFACE__H__ 46 template <
typename GUM_SCALAR >
68 explicit LpCol(
unsigned int id);
85 unsigned int id()
const;
210 template <
typename GUM_SCALAR >
239 LpExpr(
const LpExpr& expr,
bool copyLeft,
bool copyMiddle,
bool copyRight);
270 LpExpr(
LpExpr&& expr,
bool copyLeft,
bool copyMiddle,
bool copyRight);
310 template <
typename SCALAR >
351 template <
typename T >
352 LpExpr& operator+=(
const T& rhs);
384 template <
typename T >
385 LpExpr& operator-=(
const T& rhs);
402 template <
typename T1,
typename T2 >
403 static LpExpr lessThan(T1&& lhs, T2&& rhs);
404 template <
typename SCALAR >
405 static LpExpr multiply(
const SCALAR& lhs,
const LpCol& rhs);
455 inline void __addSide(
const LpCol& from);
465 inline void __addSide(
const LpExpr& from);
475 inline void __addSide(
LpExpr&& from);
486 template <
typename SCALAR >
487 inline void __addSide(
const SCALAR& from);
500 template <
typename GUM_SCALAR >
516 LpRow(
const LpExpr& expr,
const std::vector< LpCol >& cols);
527 LpRow(
LpExpr&& expr,
const std::vector< LpCol >& cols);
601 template <
typename GUM_SCALAR >
654 template <
typename T >
672 std::vector< LpCol > addCols(
const unsigned int& cols);
681 void addRow(
const LpExpr& expr);
689 void addRow(
LpExpr&& expr);
694 void addPositivity();
721 std::vector< std::vector< GUM_SCALAR > > solve();
727 std::vector< LpCol > getCols()
const;
798 template <
typename T2 >
800 template <
typename T2 >
832 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
834 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
840 template <
typename T2, forb
idden_type< T2, LpExpr > = 0 >
846 template <
typename T1,
872 template <
typename T2 >
874 template <
typename T2 >
906 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
908 template <
typename T1, forb
idden_type< T1, LpExpr > = 0 >
921 template <
typename T2, forb
idden_type< T2, LpExpr > = 0 >
934 template <
typename T1,
935 forbidden_type< T1, LpExpr > = 0,
954 template <
typename SCALAR >
968 template <
typename SCALAR >
997 template <
typename T2 >
999 template <
typename T2 >
1001 template <
typename T1,
1005 template <
typename T1,
1006 forbidden_type< T1, LpExpr& > = 0,
1010 template <
typename T2 >
1012 template <
typename T2 >
1014 template <
typename T1,
1015 forbidden_type< T1, LpExpr > = 0,
1018 template <
typename T1,
1019 forbidden_type< T1, LpExpr > = 0,
1033 #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.
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.
Classes providing basic hash functions for hash tables.
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.
gum is the global namespace for all aGrUM entities
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.
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.
Class to include at least once this header.
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.
Class hash tables iterators.
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.