aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
gum::credal::lp::LpCol Class Reference

Class representing a variable ( a column ) of a linear program, i.e. More...

#include <agrum/CN/LpInterface.h>

Public Member Functions

unsigned int id () const
 Variable id accessor. More...
 
std::string toString () const
 Get the string representation of a calling variable. More...
 
Constructor / Destructor
 LpCol (unsigned int id)
 Default constructor. More...
 
 LpCol (const LpCol &col)
 Default copy constructor. More...
 
 ~LpCol ()
 Default destructor. More...
 

Operators overload

bool operator< (const LpCol &col) const
 Test of ordering < between two variables. More...
 
bool operator== (const LpCol &col) const
 Test of equality == between two variables. More...
 
bool operator!= (const LpCol &col) const
 Opposite of equality != test between two variables. More...
 
LpColoperator= (const LpCol &col)
 Assignment operator = by copy. More...
 
std::ostream & operator<< (std::ostream &out, const LpCol &col)
 Overload of << to use with output streams ( such as std::cout << ). More...
 

Detailed Description

Class representing a variable ( a column ) of a linear program, i.e.

a dimension of the problem.

Author
Matthieu HOURBRACQ and Pierre-Henri WUILLEMIN()

Definition at line 60 of file LpInterface.h.

Constructor & Destructor Documentation

◆ LpCol() [1/2]

gum::credal::lp::LpCol::LpCol ( unsigned int  id)
explicit

Default constructor.

class LpCol

Parameters
idThe id of the variable.

Definition at line 44 of file LpInterface.cpp.

44  : _id_(id) {
45  GUM_CONSTRUCTOR(LpCol);
46  ;
47  }
LpCol(unsigned int id)
Default constructor.
Definition: LpInterface.cpp:44
unsigned int _id_
Variable id.
Definition: LpInterface.h:161

◆ LpCol() [2/2]

gum::credal::lp::LpCol::LpCol ( const LpCol col)

Default copy constructor.

Parameters
colThe constant reference to the variable to copy.

Definition at line 49 of file LpInterface.cpp.

49  : _id_(col._id_) {
50  GUM_CONS_CPY(LpCol);
51  ;
52  }
LpCol(unsigned int id)
Default constructor.
Definition: LpInterface.cpp:44
unsigned int _id_
Variable id.
Definition: LpInterface.h:161

◆ ~LpCol()

gum::credal::lp::LpCol::~LpCol ( )

Default destructor.

Definition at line 54 of file LpInterface.cpp.

54  {
55  GUM_DESTRUCTOR(LpCol);
56  ;
57  }
LpCol(unsigned int id)
Default constructor.
Definition: LpInterface.cpp:44

Member Function Documentation

◆ id()

unsigned int gum::credal::lp::LpCol::id ( ) const

Variable id accessor.

Returns
The id of the variable.

◆ operator!=()

bool gum::credal::lp::LpCol::operator!= ( const LpCol col) const

Opposite of equality != test between two variables.

For use with maps, hashTable etc

Parameters
colThe constant reference to the variable to compare to this ( the caller ).
Returns
True if this id is not the same than col id, false otherwise.

◆ operator<()

bool gum::credal::lp::LpCol::operator< ( const LpCol col) const

Test of ordering < between two variables.

For use with maps, hashTable etc

Parameters
colThe constant reference to the variable to compare to this ( the caller ).
Returns
True if this id is smaller than col id, false otherwise.

◆ operator=()

LpCol& gum::credal::lp::LpCol::operator= ( const LpCol col)

Assignment operator = by copy.

Parameters
colThe constant reference to the variable to copy in this ( the caller ).
Returns
The address of the caller.

◆ operator==()

bool gum::credal::lp::LpCol::operator== ( const LpCol col) const

Test of equality == between two variables.

For use with maps, hashTable etc

Parameters
colThe constant reference to the variable to compare to this ( the caller ).
Returns
True if this id is equals to col id, false otherwise.

◆ toString()

std::string gum::credal::lp::LpCol::toString ( ) const

Get the string representation of a calling variable.

Returns
The string representation of the calling variable.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  out,
const LpCol col 
)
friend

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

Parameters
outThe reference to the caller, i.e. left side of <<.
colThe constant reference to the variable whose representation we want.
Returns
The address of the caller.

Member Data Documentation

◆ _id_

unsigned int gum::credal::lp::LpCol::_id_
private

Variable id.

Definition at line 161 of file LpInterface.h.


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