util::LinearSystem Class Reference

Models a linear system Ax <= b. More...

#include <util.h>

Inheritance diagram for util::LinearSystem:

Inheritance graph
[legend]
Collaboration diagram for util::LinearSystem:

Collaboration graph
[legend]

List of all members.

Public Types

enum  RowType { MAT_EQ = 0, MAT_LT, MAT_LE }
 Row types: equality, strict inequality, inequality. More...

Public Member Functions

void add (const string &constraints)
 Add new constraints.
size_t add_column (const string &name)
 Add a new column.
LinearSystemclone (bool content=true) const
 Return a clone object.
void freeze ()
double get (size_t row, size_t col) const
 Get matrix value.
const string & getColName (size_t i) const
 Column name.
size_t getColPos (const string &name) const
 Column position.
size_t getNcols () const
 Number of columns.
size_t getNrows () const
 Number of rows.
RowType getRowType (size_t r) const
 Row type.
string getVarList () const
 Get the list of variables.
bool isHomo ()
 True if system is homogeneous.
bool isStrict () const
 Is there a strict inequality?
 LinearSystem (const string &constraints="")
 Constructor.
void renameColName (size_t i, const string &name)
 Column name.
void swap_col (size_t col1, size_t col2)
 Swap two columns.
void toPolylib (size_t i,::Value *row)
 Transform a row of the linear system into a row of the Polylib matrix.
Matrix * toPolylib ()
 Transform the linear system into Polylib matrix.
Matrix * toPolylibHomo ()
 Transform the homogeneous version of the linear system into Polylib matrix.
void unfreeze ()
virtual ~LinearSystem ()
 Destructor.

Private Member Functions

size_t add_col (const char *name=NULL)
 Add a new column.
void add_rows (size_t newrows)
 Add new rows.
 LinearSystem (int _dummy)
 Constructor.
void parse (const char *c, size_t row)
 Parse a primitive constraint.
void parse_expr (const char *c, size_t row, int factor)
 Parse an expression.
void parse_mult (const char *c, size_t row, int factor)
 Parse a multiplicative expression.
size_t search_add_col (const char *name)
 Search and possibly add a column.

Private Attributes

bool frozen
 No more variables?
vector< string > matcolnames
 Column names.
vector< double * > matcols
 Matrix stored by columns.
vector< RowTypematrowtype
 Row types.
size_t n_cols
 Number of columns.
size_t n_rows
 Number of rows.

Friends

ostream & operator<< (ostream &o, LinearSystem &m)
 Print the linear system.


Detailed Description

Models a linear system Ax <= b.


Member Enumeration Documentation

enum util::LinearSystem::RowType

Row types: equality, strict inequality, inequality.

Enumerator:
MAT_EQ 
MAT_LT 
MAT_LE 


Constructor & Destructor Documentation

util::LinearSystem::LinearSystem ( const string &  constraints = ""  )  [inline]

Constructor.

virtual util::LinearSystem::~LinearSystem (  )  [inline, virtual]

Destructor.

util::LinearSystem::LinearSystem ( int  _dummy  )  [inline, private]

Constructor.


Member Function Documentation

void util::LinearSystem::add ( const string &  constraints  )  [inline]

Add new constraints.

size_t util::LinearSystem::add_col ( const char *  name = NULL  )  [inline, private]

Add a new column.

size_t util::LinearSystem::add_column ( const string &  name  )  [inline]

Add a new column.

void util::LinearSystem::add_rows ( size_t  newrows  )  [inline, private]

Add new rows.

LinearSystem* util::LinearSystem::clone ( bool  content = true  )  const [inline]

Return a clone object.

void util::LinearSystem::freeze (  )  [inline]

double util::LinearSystem::get ( size_t  row,
size_t  col 
) const [inline]

Get matrix value.

const string& util::LinearSystem::getColName ( size_t  i  )  const [inline]

Column name.

size_t util::LinearSystem::getColPos ( const string &  name  )  const [inline]

Column position.

size_t util::LinearSystem::getNcols (  )  const [inline]

Number of columns.

size_t util::LinearSystem::getNrows (  )  const [inline]

Number of rows.

RowType util::LinearSystem::getRowType ( size_t  r  )  const [inline]

Row type.

string util::LinearSystem::getVarList (  )  const [inline]

Get the list of variables.

bool util::LinearSystem::isHomo (  )  [inline]

True if system is homogeneous.

bool util::LinearSystem::isStrict (  )  const [inline]

Is there a strict inequality?

void util::LinearSystem::parse ( const char *  c,
size_t  row 
) [inline, private]

Parse a primitive constraint.

void util::LinearSystem::parse_expr ( const char *  c,
size_t  row,
int  factor 
) [inline, private]

Parse an expression.

void util::LinearSystem::parse_mult ( const char *  c,
size_t  row,
int  factor 
) [inline, private]

Parse a multiplicative expression.

void util::LinearSystem::renameColName ( size_t  i,
const string &  name 
) [inline]

Column name.

size_t util::LinearSystem::search_add_col ( const char *  name  )  [inline, private]

Search and possibly add a column.

void util::LinearSystem::swap_col ( size_t  col1,
size_t  col2 
) [inline]

Swap two columns.

void util::LinearSystem::toPolylib ( size_t  i,
::Value *  row 
) [inline]

Transform a row of the linear system into a row of the Polylib matrix.

Strict inequalities are transformed into non-strict ones.

Matrix* util::LinearSystem::toPolylib (  )  [inline]

Transform the linear system into Polylib matrix.

Strict inequalities are transformed into non-strict ones.

Matrix* util::LinearSystem::toPolylibHomo (  )  [inline]

Transform the homogeneous version of the linear system into Polylib matrix.

Strict inequalities are transformed into non-strict ones.

void util::LinearSystem::unfreeze (  )  [inline]


Friends And Related Function Documentation

ostream& operator<< ( ostream &  o,
LinearSystem m 
) [friend]

Print the linear system.


Member Data Documentation

bool util::LinearSystem::frozen [private]

No more variables?

vector<string> util::LinearSystem::matcolnames [private]

Column names.

vector<double *> util::LinearSystem::matcols [private]

Matrix stored by columns.

vector<RowType> util::LinearSystem::matrowtype [private]

Row types.

size_t util::LinearSystem::n_cols [private]

Number of columns.

size_t util::LinearSystem::n_rows [private]

Number of rows.


The documentation for this class was generated from the following file:
Generated on Sun Nov 23 14:52:47 2008 for Typing linear constraints by  doxygen 1.5.4