aGrUM  0.16.0
gum::credal::lp::LpInterface< GUM_SCALAR > Class Template Reference

Class representing a linear program. More...

#include <agrum/CN/LpInterface.h>

+ Collaboration diagram for gum::credal::lp::LpInterface< GUM_SCALAR >:

Public Member Functions

LpCol addCol ()
 Insert a new column, i.e. More...
 
std::vector< LpColaddCols (const unsigned int &cols)
 Insert new columns, i.e. More...
 
void addRow (const LpExpr &expr)
 Add rows to the linear program according to a given expression ( which must be at least an inequality ). More...
 
void addRow (LpExpr &&expr)
 Add rows to the linear program according to a given expression ( which must be at least an inequality ). More...
 
void addPositivity ()
 Add positivity constraints for all variables. More...
 
void addSumIsOne ()
 Add sum of variables is 1 constraints. More...
 
void addProba ()
 Add positivity constraints and sum of variables is 1 ( probability constraints ) More...
 
std::vector< std::vector< GUM_SCALAR > > solve ()
 Solve the linear program (H-representation of the polytope) by enumeration (of the polytope vertices) using lexicographic reverse search (lrs). More...
 
std::vector< LpColgetCols () const
 Get the variables of the LP. More...
 
std::string toString () const
 Get the string representation of a calling linear program. More...
 
void clear ()
 Reset the rows (inequalities) and columns (variables) of the LP as if it was created. More...
 
void clearRows ()
 Reset the rows (inequalities) of the LP but not the columns (variables are kept). More...
 
Constructor / Destructor
 LpInterface ()
 Default constructor, empty problem. More...
 
 LpInterface (const LpInterface< GUM_SCALAR > &from)
 Copy constructor. More...
 
 LpInterface (LpInterface< GUM_SCALAR > &&from)
 Move copy constructor. More...
 
 ~LpInterface ()
 Default destructor. More...
 
Compound assignment operator
LpInterface< GUM_SCALAR > & operator= (const LpInterface< GUM_SCALAR > &from)
 Copy compound assignment. More...
 
LpInterface< GUM_SCALAR > & operator= (LpInterface< GUM_SCALAR > &&from)
 Move coumpound assignment. More...
 

Friends

template<typename T >
std::ostream & operator<< (std::ostream &out, const LpInterface< T > &lpi)
 Overload of << to use with output streams ( such as std::cout << ). More...
 

Detailed Description

template<typename GUM_SCALAR>
class gum::credal::lp::LpInterface< GUM_SCALAR >

Class representing a linear program.

Author
Matthieu HOURBRACQ and Pierre-Henri WUILLEMIN

Definition at line 49 of file LpInterface.h.

Constructor & Destructor Documentation

◆ LpInterface() [1/3]

template<typename GUM_SCALAR >
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface ( )

Default constructor, empty problem.

class LpInterface

Definition at line 750 of file LpInterface_tpl.h.

750  {
751  __positivity = false;
752  __sumIsOne = false;
753  GUM_CONSTRUCTOR(LpInterface);
754  }
LpInterface()
Default constructor, empty problem.
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758

◆ LpInterface() [2/3]

template<typename GUM_SCALAR >
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface ( const LpInterface< GUM_SCALAR > &  from)

Copy constructor.

Parameters
fromThe LpInterface to be copied.

Definition at line 757 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__rows.

758  :
759  __cols(from.__cols),
760  __positivity(from.__positivity), __sumIsOne(from.__sumIsOne) {
761  __rows.resize(from.__rows.size());
762 
763  for (unsigned int i = 0, end = from.__rows.size(); i < end; i++)
764  __rows[i] = new LpRow(*from.__rows[i]);
765 
766  GUM_CONS_CPY(LpInterface);
767  }
LpInterface()
Default constructor, empty problem.
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ LpInterface() [3/3]

template<typename GUM_SCALAR >
gum::credal::lp::LpInterface< GUM_SCALAR >::LpInterface ( LpInterface< GUM_SCALAR > &&  from)

Move copy constructor.

Parameters
fromThe temporary LpInterface to be moved.

Definition at line 770 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, and gum::credal::lp::LpInterface< GUM_SCALAR >::__rows.

770  :
771  __positivity(from.__positivity), __sumIsOne(from.__sumIsOne) {
772  __rows.swap(from.__rows);
773  __cols.swap(from.__cols);
774  GUM_CONS_CPY(LpInterface);
775  }
LpInterface()
Default constructor, empty problem.
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ ~LpInterface()

template<typename GUM_SCALAR >
gum::credal::lp::LpInterface< GUM_SCALAR >::~LpInterface ( )

Default destructor.

Definition at line 778 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and gum::credal::lp::LpInterface< GUM_SCALAR >::operator=().

778  {
779  for (const auto row : __rows)
780  delete row;
781 
782  GUM_DESTRUCTOR(LpInterface);
783  }
LpInterface()
Default constructor, empty problem.
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
+ Here is the call graph for this function:

Member Function Documentation

◆ addCol()

template<typename GUM_SCALAR >
LpCol gum::credal::lp::LpInterface< GUM_SCALAR >::addCol ( )

Insert a new column, i.e.

a new variable.

Returns
A copy of the variable.

Definition at line 826 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols.

826  {
827  LpCol col((unsigned int)__cols.size());
828 
829  __cols.push_back(col);
830 
831  return col;
832  }
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ addCols()

template<typename GUM_SCALAR >
std::vector< LpCol > gum::credal::lp::LpInterface< GUM_SCALAR >::addCols ( const unsigned int &  cols)

Insert new columns, i.e.

new variables.

Parameters
colsthe constant reference to the number of variables we want.
Returns
The copy of the vector of all variables of the problem.

Definition at line 836 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, and GUM_ERROR.

836  {
837  if (cols < 1)
838  GUM_ERROR(OperationNotAllowed,
839  "LpInterface::addCols ( cols ) : cols "
840  "needs must be equal or greater than 1 : "
841  << cols << " < 1");
842 
843  for (unsigned int i = 0; i < cols; i++) {
844  __cols.push_back(LpCol((unsigned int)__cols.size()));
845  }
846 
847  return __cols;
848  }
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ addPositivity()

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::addPositivity ( )

Add positivity constraints for all variables.

Definition at line 903 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, and gum::credal::lp::LpInterface< GUM_SCALAR >::addRow().

Referenced by gum::credal::lp::LpInterface< GUM_SCALAR >::addProba().

903  {
904  if (__positivity) return;
905 
906  for (const auto& col : __cols)
907  addRow(0 <= col);
908 
909  __positivity = true;
910  }
void addRow(const LpExpr &expr)
Add rows to the linear program according to a given expression ( which must be at least an inequality...
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addProba()

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::addProba ( )

Add positivity constraints and sum of variables is 1 ( probability constraints )

Definition at line 927 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne, gum::credal::lp::LpInterface< GUM_SCALAR >::addPositivity(), gum::credal::lp::LpInterface< GUM_SCALAR >::addRow(), and gum::credal::lp::LpInterface< GUM_SCALAR >::addSumIsOne().

927  {
928  if (__positivity && __sumIsOne) {
929  return;
930  } else if (__positivity && !__sumIsOne) {
931  addSumIsOne();
932  return;
933  } else if (!__positivity && __sumIsOne) {
934  addPositivity();
935  return;
936  }
937 
938  // we can do both with one loop, don't call the above functions.
939  // addPositivity();
940  // addSumIsOne();
941  LpExpr expr;
942 
943  for (const auto& col : __cols) {
944  addRow(0 <= col);
945  expr += col;
946  }
947 
948  addRow(1 <= std::move(expr) <= 1);
949 
950  __sumIsOne = true;
951  __positivity = true;
952  }
void addRow(const LpExpr &expr)
Add rows to the linear program according to a given expression ( which must be at least an inequality...
void addPositivity()
Add positivity constraints for all variables.
void addSumIsOne()
Add sum of variables is 1 constraints.
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
+ Here is the call graph for this function:

◆ addRow() [1/2]

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::addRow ( const LpExpr expr)

Add rows to the linear program according to a given expression ( which must be at least an inequality ).

Parameters
exprthe constant reference to the expression to convert to rows.

Definition at line 851 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpExpr::__ileft, gum::credal::lp::LpExpr::__iright, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, GUM_ERROR, and gum::credal::lp::LpExpr::toString().

Referenced by gum::credal::lp::LpInterface< GUM_SCALAR >::addPositivity(), gum::credal::lp::LpInterface< GUM_SCALAR >::addProba(), and gum::credal::lp::LpInterface< GUM_SCALAR >::addSumIsOne().

851  {
852  if (!expr.__ileft && !expr.__iright)
853  GUM_ERROR(OperationNotAllowed,
854  "addRow ( const LpExpr & expr ) : expr : "
855  << expr.toString() << "is not an inequality.");
856 
857  if ((expr.__ileft && !expr.__iright) || (!expr.__ileft && expr.__iright)) {
858  __rows.push_back(new LpRow(expr, __cols));
859  } else {
860  LpExpr lexpr(expr, true, true, false);
861  LpExpr rexpr(expr, false, true, true);
862 
863  __rows.push_back(
864  new LpRow(std::move(lexpr),
865  __cols));
866  __rows.push_back(
867  new LpRow(std::move(rexpr),
868  __cols));
869  }
870  }
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addRow() [2/2]

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::addRow ( LpExpr &&  expr)

Add rows to the linear program according to a given expression ( which must be at least an inequality ).

Parameters
exprthe temporary expression to move to rows.

Definition at line 873 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpExpr::__imiddle, gum::credal::lp::LpExpr::__mCoeffs, gum::credal::lp::LpExpr::__mValue, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and GUM_ERROR.

873  {
874  if (!expr.__ileft && !expr.__iright)
875  GUM_ERROR(OperationNotAllowed,
876  "addRow ( const LpExpr & expr ) : expr : "
877  << expr.toString() << "is not an inequality.");
878 
879  if ((expr.__ileft && !expr.__iright) || (!expr.__ileft && expr.__iright)) {
880  __rows.push_back(new LpRow(std::move(expr), __cols));
881  } else {
882  LpExpr lexpr(std::move(expr), true, true, false);
883 
885  LpExpr rexpr(std::move(expr), false, false, true);
886 
888 
889  *rexpr.__mCoeffs = *lexpr.__mCoeffs;
890  rexpr.__mValue = lexpr.__mValue;
891  rexpr.__imiddle = true;
892 
893  __rows.push_back(
894  new LpRow(std::move(lexpr),
895  __cols));
896  __rows.push_back(
897  new LpRow(std::move(rexpr),
898  __cols));
899  }
900  }
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55

◆ addSumIsOne()

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::addSumIsOne ( )

Add sum of variables is 1 constraints.

Definition at line 913 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne, and gum::credal::lp::LpInterface< GUM_SCALAR >::addRow().

Referenced by gum::credal::lp::LpInterface< GUM_SCALAR >::addProba().

913  {
914  if (__sumIsOne) return;
915 
916  LpExpr expr;
917 
918  for (const auto& col : __cols)
919  expr += col;
920 
921  addRow(1 <= std::move(expr) <= 1);
922 
923  __sumIsOne = true;
924  }
void addRow(const LpExpr &expr)
Add rows to the linear program according to a given expression ( which must be at least an inequality...
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::clear ( )

Reset the rows (inequalities) and columns (variables) of the LP as if it was created.

Definition at line 1005 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne.

1005  {
1006  for (const auto& row : __rows)
1007  delete row;
1008 
1009  __rows.clear();
1010  __rows.shrink_to_fit();
1011 
1015  __cols.clear();
1016  __cols.shrink_to_fit();
1017 
1018  __positivity = false;
1019  __sumIsOne = false;
1020  }
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ clearRows()

template<typename GUM_SCALAR >
void gum::credal::lp::LpInterface< GUM_SCALAR >::clearRows ( )

Reset the rows (inequalities) of the LP but not the columns (variables are kept).

Definition at line 1023 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne.

1023  {
1024  for (const auto& row : __rows)
1025  delete row;
1026 
1027  __rows.clear();
1028  __rows.shrink_to_fit();
1029 
1030  __positivity = false;
1031  __sumIsOne = false;
1032  }
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752

◆ getCols()

template<typename GUM_SCALAR >
std::vector< LpCol > gum::credal::lp::LpInterface< GUM_SCALAR >::getCols ( ) const

Get the variables of the LP.

Returns
A copy of the variables as a vector of variables.

Definition at line 981 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols.

981  {
982  return __cols;
983  }
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ operator=() [1/2]

template<typename GUM_SCALAR >
LpInterface< GUM_SCALAR > & gum::credal::lp::LpInterface< GUM_SCALAR >::operator= ( const LpInterface< GUM_SCALAR > &  from)

Copy compound assignment.

Parameters
fromThe LpInterface to be copied.

Definition at line 787 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne.

Referenced by gum::credal::lp::LpInterface< GUM_SCALAR >::~LpInterface().

787  {
789  for (const auto& row : __rows)
790  delete row;
791 
792  __rows.clear();
793  __rows.shrink_to_fit();
794 
795  __rows.resize(from.__rows.size());
796 
797  for (unsigned int i = 0, end = from.__rows.size(); i < end; i++)
798  __rows[i] = new LpRow(*from.__rows[i]);
799 
800  __cols = from.__cols;
801  __positivity = from.__positivity;
802  __sumIsOne = from.__sumIsOne;
803 
804  return *this;
805  }
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
+ Here is the caller graph for this function:

◆ operator=() [2/2]

template<typename GUM_SCALAR >
LpInterface< GUM_SCALAR > & gum::credal::lp::LpInterface< GUM_SCALAR >::operator= ( LpInterface< GUM_SCALAR > &&  from)

Move coumpound assignment.

Parameters
fromThe temporary LpInterface to be moved.

Definition at line 809 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__positivity, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, and gum::credal::lp::LpInterface< GUM_SCALAR >::__sumIsOne.

809  {
810  __rows.swap(from.__rows);
811  __cols.swap(from.__cols);
812 
813  __positivity = from.__positivity;
814  __sumIsOne = from.__sumIsOne;
815 
816  return *this;
817  }
bool __sumIsOne
true if addSumIsOne() has been called, false otherwise.
Definition: LpInterface.h:761
bool __positivity
true if addPositivity() has been called, false otherwise.
Definition: LpInterface.h:758
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

◆ solve()

template<typename GUM_SCALAR >
std::vector< std::vector< GUM_SCALAR > > gum::credal::lp::LpInterface< GUM_SCALAR >::solve ( )

Solve the linear program (H-representation of the polytope) by enumeration (of the polytope vertices) using lexicographic reverse search (lrs).

Only works with bounded polyhedron (polytopes) and not unbounded ones (i.e. defined by vertices and rays).

Returns
The V-representation (vertices) of the polytope as a vector of vectors (vector of vertices).

Definition at line 955 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, gum::credal::lp::LpInterface< GUM_SCALAR >::__rows, gum::credal::LRSWrapper< GUM_SCALAR >::fillMatrix(), gum::credal::LRSWrapper< GUM_SCALAR >::getOutput(), gum::credal::LRSWrapper< GUM_SCALAR >::H2V(), and gum::credal::LRSWrapper< GUM_SCALAR >::setUpH().

955  {
956  LRSWrapper< GUM_SCALAR > lrs;
957 
958  lrs.setUpH((unsigned int)__cols.size());
959 
960  std::vector< std::vector< GUM_SCALAR > > lrsMatrix;
961 
962  for (const auto& row : __rows) {
963  std::vector< GUM_SCALAR > expandedRow(__cols.size() + 1, 0);
964 
965  expandedRow[0] = row->__cste;
966 
967  for (const auto& elt : *row->__coeffs)
968  expandedRow[elt.first.id() + 1] = elt.second;
969 
970  lrsMatrix.push_back(expandedRow);
971  }
972 
973  lrs.fillMatrix(lrsMatrix);
974 
975  lrs.H2V();
976 
977  return lrs.getOutput();
978  }
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754
+ Here is the call graph for this function:

◆ toString()

template<typename GUM_SCALAR >
std::string gum::credal::lp::LpInterface< GUM_SCALAR >::toString ( ) const

Get the string representation of a calling linear program.

Returns
The string representation of the calling linear program.

Definition at line 986 of file LpInterface_tpl.h.

References gum::credal::lp::LpInterface< GUM_SCALAR >::__cols, and gum::credal::lp::LpInterface< GUM_SCALAR >::__rows.

986  {
987  std::ostringstream s;
988 
989  s << std::endl << std::endl << "Variables : " << std::endl;
990 
991  for (const auto& col : __cols)
992  s << " " << col.toString();
993 
994  s << std::endl;
995 
996  for (const auto& row : __rows)
997  s << std::endl << row->toString();
998 
999  s << std::endl << std::endl;
1000 
1001  return s.str();
1002  }
std::vector< LpRow *> __rows
Rows of the problem.
Definition: LpInterface.h:752
std::vector< LpCol > __cols
Variables of the problem.
Definition: LpInterface.h:754

Friends And Related Function Documentation

◆ operator<<

template<typename GUM_SCALAR>
template<typename T >
std::ostream& operator<< ( std::ostream &  out,
const LpInterface< T > &  lpi 
)
friend

Overload of << to use with output streams ( such as std::cout << ).

Parameters
outthe reference to the caller, i.e. left side of <<.
lpithe constant reference to the linear program whose representation we want.
Returns
The address of the caller.

Definition at line 820 of file LpInterface_tpl.h.

820  {
821  out << lpi.toString();
822  return out;
823  }

Member Data Documentation

◆ __cols

◆ __positivity

◆ __rows

◆ __sumIsOne


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