#include <hyb_parameter.h>

Public Member Functions

 Polyhedron (void)
 
 Polyhedron (int dim)
 
 Polyhedron (const Polyhedron &rSrc)
 
 Polyhedron (const std::string &rFileName)
 
virtual ~Polyhedron (void)
 
virtual const std::string & Name (void) const
 
virtual void Name (const std::string &name)
 
void Clear (void)
 
Idx Size (void) const
 
int Dimension (void) const
 
void Dimension (int dim)
 
const MatrixA (void) const
 
const VectorB (void) const
 
void AB (const Matrix &rA, const Vector &rB)
 
void UserData (Type *data) const
 
TypeUserData (void) const
 
- Public Member Functions inherited from faudes::Type
 Type (void)
 
 Type (const Type &rType)
 
virtual ~Type (void)
 
virtual TypeNew (void) const
 
virtual TypeCopy (void) const
 
virtual const TypeCast (const Type *pOther) const
 
virtual TypeAssign (const Type &rSrc)
 
Typeoperator= (const Type &rSrc)
 
virtual bool Equal (const Type &rOther) const
 
bool operator== (const Type &rOther) const
 
bool operator!= (const Type &rOther) const
 
virtual const std::string & TypeName (void) const
 
void Write (const Type *pContext=0) const
 
void Write (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void Write (const std::string &pFileName, std::ios::openmode openmode) const
 
void Write (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void XWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0) const
 
void XWrite (const Type *pContext=0) const
 
void XWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToString (const std::string &rLabel="", const Type *pContext=0) const
 
std::string ToText (const std::string &rLabel="", const Type *pContext=0) const
 
void DWrite (const Type *pContext=0) const
 
void DWrite (const std::string &pFileName, const std::string &rLabel="", const Type *pContext=0, std::ios::openmode openmode=std::ios::out|std::ios::trunc) const
 
void DWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
void SWrite (TokenWriter &rTw) const
 
void SWrite (void) const
 
std::string ToSText (void) const
 
void Read (const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0)
 
void FromString (const std::string &rString, const std::string &rLabel="", const Type *pContext=0)
 
void Read (TokenReader &rTr, const std::string &rLabel="", const Type *pContext=0)
 

Protected Member Functions

virtual PolyhedronDoAssign (const Polyhedron &rSrc)
 
virtual bool DoEqual (const Polyhedron &rOther) const
 
virtual void DoWrite (TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoSWrite (TokenWriter &tw) const
 
virtual void DoRead (TokenReader &tr, const std::string &rLabel="", const Type *pContext=0)
 
- Protected Member Functions inherited from faudes::Type
void DoAssign (const Type &rSrc)
 
bool DoEqual (const Type &rOther) const
 
virtual void DoXWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual void DoDWrite (TokenWriter &rTw, const std::string &rLabel="", const Type *pContext=0) const
 
virtual const TypeDefinitionTypeDefinitionp (void) const
 
virtual Token XBeginTag (const std::string &rLabel="", const std::string &rFallbackLabel="") const
 

Protected Attributes

std::string mName
 
Matrix mA
 
Vector mB
 
TypempUserData
 

Detailed Description

Polyhedron in R^n

This class is a container to hold a matrix A and a vector B to represent the polyhedron {x| Ax<=b}. It provides basic member access and token IO.

To facilitate the ussage of an external library (e.g. PPL) that implements operations on polyhedra, the Polyhedron container can record untyped user data in a (void*) entry. See hyb_compute.cpp for a PLL based implemenation of a reachability analysis.

The token format is as follows:

<AMatrix rows="4" columns="2">
1 0
-1 0
0 1
0 -1
</AMatrix>
<BVector count="4">
1
0
1
0
</BVector>

Definition at line 674 of file hyb_parameter.h.

Constructor & Destructor Documentation

◆ Polyhedron() [1/4]

Polyhedron::Polyhedron ( void  )

Default constructor - sets dimension to 0

Definition at line 590 of file hyb_parameter.cpp.

◆ Polyhedron() [2/4]

Polyhedron::Polyhedron ( int  dim)

Constructor by dimension

Parameters
dimdimension

Definition at line 599 of file hyb_parameter.cpp.

◆ Polyhedron() [3/4]

Polyhedron::Polyhedron ( const Polyhedron rSrc)

Copy-constructor

Definition at line 616 of file hyb_parameter.cpp.

◆ Polyhedron() [4/4]

Polyhedron::Polyhedron ( const std::string &  rFileName)

Construct from file

Definition at line 626 of file hyb_parameter.cpp.

◆ ~Polyhedron()

Polyhedron::~Polyhedron ( void  )
virtual

Destructor

Definition at line 637 of file hyb_parameter.cpp.

Member Function Documentation

◆ A()

const Matrix & Polyhedron::A ( void  ) const

Get A matrix.

Definition at line 693 of file hyb_parameter.cpp.

◆ AB()

void Polyhedron::AB ( const Matrix rA,
const Vector rB 
)

Set A matrix and B vector.

Parameters
rAA matrix
rBB vector
Exceptions
Exception
  • dimension missmatch (id 700);

Definition at line 703 of file hyb_parameter.cpp.

◆ B()

const Vector & Polyhedron::B ( void  ) const

Get B vector.

Definition at line 698 of file hyb_parameter.cpp.

◆ Clear()

void Polyhedron::Clear ( void  )
virtual

Clear all.

Sets dimension to 0

Reimplemented from faudes::Type.

Definition at line 661 of file hyb_parameter.cpp.

◆ Dimension() [1/2]

void Polyhedron::Dimension ( int  dim)

Set dimension.

This will invalidate A and B.

Parameters
dimNew dimension

Definition at line 673 of file hyb_parameter.cpp.

◆ Dimension() [2/2]

int Polyhedron::Dimension ( void  ) const

Get dimension. Gets the dimension of the polyhedron (number of columns of A).

Returns
dimension

Definition at line 687 of file hyb_parameter.cpp.

◆ DoAssign()

Polyhedron & Polyhedron::DoAssign ( const Polyhedron rSrc)
protectedvirtual

Assign from other polyhedron

Parameters
rSrcSource to copy from
Returns
Ref to this polyhedron

Definition at line 643 of file hyb_parameter.cpp.

◆ DoEqual()

bool Polyhedron::DoEqual ( const Polyhedron rOther) const
protectedvirtual

Test equality.

Note: this test refers to the plain parameters as oposed to the actual polyhedron.

Parameters
rOtherOther object to compare with.
Returns
True on match.

Definition at line 653 of file hyb_parameter.cpp.

◆ DoRead()

void Polyhedron::DoRead ( TokenReader tr,
const std::string &  rLabel = "",
const Type pContext = 0 
)
protectedvirtual

Read from TokenReader, see Type::Read for public wrappers. The method invokes TokenReader::ReadBegin() to seek the specified section, reads subsequent symbols, and calls matching TokenReader::ReadEnd(). If no section is specified, the section is assumed to start at the current position of the token stream. If the current position is no begin token, the section "Polyhedron" is read.

Parameters
trReference to TokenReader
rLabelLabel to read, defaults to current begin label or else "Polyhedron"
pContextWrite context to provide contextual information
Exceptions
Exception
  • IO errors (id 1)
  • token mismatch (id 50)

Reimplemented from faudes::Type.

Definition at line 762 of file hyb_parameter.cpp.

◆ DoSWrite()

void Polyhedron::DoSWrite ( TokenWriter tw) const
protectedvirtual

Write statistic info to TokenWriter, see Type::SWrite for public wrapper.

Parameters
twReference to TokenWriter
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::Type.

Definition at line 753 of file hyb_parameter.cpp.

◆ DoWrite()

void Polyhedron::DoWrite ( TokenWriter tw,
const std::string &  rLabel = "",
const Type pContext = 0 
) const
protectedvirtual

Write to TokenWriter, see Type::Write for public wrappers

Parameters
twReference to TokenWriter
rLabelLabel of the section to write, defaults to name of set or "Polyhedron"
pContextWrite context to provide contextual information (ignores)
Exceptions
Exception
  • IO errors (id 2)

Reimplemented from faudes::Type.

Definition at line 732 of file hyb_parameter.cpp.

◆ Name() [1/2]

virtual void faudes::Polyhedron::Name ( const std::string &  name)
inlinevirtual

Object name

Parameters
nameSet to specifies name

Reimplemented from faudes::Type.

Definition at line 725 of file hyb_parameter.h.

◆ Name() [2/2]

virtual const std::string& faudes::Polyhedron::Name ( void  ) const
inlinevirtual

Object name

Returns
name

Reimplemented from faudes::Type.

Definition at line 717 of file hyb_parameter.h.

◆ Size()

Idx Polyhedron::Size ( void  ) const

Get size.

Gets the number of inequalities (number of rows of A).

Returns
number of equations

Definition at line 667 of file hyb_parameter.cpp.

◆ UserData() [1/2]

void Polyhedron::UserData ( Type data) const

Set user data.

The polyhedron takes ownership of the provided memory. On write access on the defining parameters, the user data gets invalidated by means of "delete". The internal pointer is then set to NULL.

Definition at line 718 of file hyb_parameter.cpp.

◆ UserData() [2/2]

Type * Polyhedron::UserData ( void  ) const

Get user data.

Returns
Pointer to user data, or NULL if no valid data is available

Definition at line 725 of file hyb_parameter.cpp.

Member Data Documentation

◆ mA

Matrix faudes::Polyhedron::mA
protected

Polyhedron: data

Definition at line 821 of file hyb_parameter.h.

◆ mB

Vector faudes::Polyhedron::mB
protected

Polyhedron: data

Definition at line 824 of file hyb_parameter.h.

◆ mName

std::string faudes::Polyhedron::mName
protected

name

Definition at line 818 of file hyb_parameter.h.

◆ mpUserData

Type* faudes::Polyhedron::mpUserData
protected

User data

Definition at line 827 of file hyb_parameter.h.


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

libFAUDES 2.33b --- 2025.05.07 --- c++ api documentaion by doxygen