|
Go to the documentation of this file.
47 std::stringstream errstr;
48 errstr << "Index out of range.";
49 throw Exception( "Matrix::Matrix()", errstr.str(), 700);
94 for( int k=0; k<sz; k++)
101 if( mRC!=rSrc. mRC) return false;
102 if( mCC!=rSrc. mCC) return false;
104 for( int k=0; k<sz; k++)
150 if( mCC==cc && mRC==rc) return;
175 for( int k=0; k<sz; k++) mpData[k]=0;
183 for( int i=0; i< mRC; i++) {
184 for( int j=0; j< mCC; j++) {
195 if(i<0 || i>= mRC || j<0 || j>= mCC) {
196 std::stringstream errstr;
197 errstr << "Index out of range.";
198 throw Exception( "Matrix::At", errstr.str(), 700);
205 if(i<0 || i>= mRC || j<0 || j>= mCC) {
206 std::stringstream errstr;
207 errstr << "Index out of range.";
208 throw Exception( "Matrix::At", errstr.str(), 700);
216 if(i<0 || i>= mRC || j<0 || j>= mCC) {
217 std::stringstream errstr;
218 errstr << "Index out of range.";
219 throw Exception( "Matrix::At", errstr.str(), 700);
226 if(i<0 || i>= mRC || j<0 || j>= mCC) {
227 std::stringstream errstr;
228 errstr << "Index out of range.";
229 throw Exception( "Matrix::At", errstr.str(), 700);
239 for( int k=0; k<sz; k++)
265 std::string label=rLabel;
266 if(rLabel== "") label= "Matrix";
275 for( unsigned int k=0; k< Size(); k++)
295 std::string label=rLabel;
296 if(rLabel== "") label= "Matrix";
305 std::stringstream errstr;
306 errstr << "Invalid dimension. " << rTr. FileLine();
307 throw Exception( "Matrix::DoRead", errstr.str(), 700);
312 while(!rTr. Eos(label) && k<( int) Size()) {
318 std::stringstream errstr;
319 errstr << "Dimension mismatch. " << rTr. FileLine();
320 throw Exception( "Matrix::DoRead", errstr.str(), 700);
355 std::stringstream errstr;
356 errstr << "Index out of range.";
357 throw Exception( "Vector::Vector()", errstr.str(), 700);
395 for( int k=0; k< mDim; k++)
403 for( int k=0; k< mDim; k++)
425 if( mDim==dim) return;
456 if(i<0 || i>= mDim) {
457 std::stringstream errstr;
458 errstr << "Index out of range.";
459 throw Exception( "Vector::At", errstr.str(), 700);
466 if(i<0 || i>= mDim) {
467 std::stringstream errstr;
468 errstr << "Index out of range.";
469 throw Exception( "Vector::At", errstr.str(), 700);
477 if(i<0 || i>= mDim) {
478 std::stringstream errstr;
479 errstr << "Index out of range.";
480 throw Exception( "Vector::At", errstr.str(), 700);
487 if(i<0 || i>= mDim) {
488 std::stringstream errstr;
489 errstr << "Index out of range.";
490 throw Exception( "Vector::At", errstr.str(), 700);
499 for( int k=0; k<dim; k++)
515 std::string label=rLabel;
516 if(rLabel== "") label= "Vector";
524 for( int k=0; k< mDim; k++)
543 std::string label=rLabel;
544 if(rLabel== "") label= "Vector";
552 std::stringstream errstr;
553 errstr << "Invalid dimension. " << rTr. FileLine();
554 throw Exception( "Vector::DoRead", errstr.str(), 700);
559 while(!rTr. Eos(label) && k<( int) Size()) {
565 std::stringstream errstr;
566 errstr << "Dimension mismatch. " << rTr. FileLine();
567 throw Exception( "Vector::DoRead", errstr.str(), 700);
606 std::stringstream errstr;
607 errstr << "Index out of range.";
608 throw Exception( "Polyhedron::Polyhedron()", errstr.str(), 700);
654 if( mA!=rSrc. mA) return false;
655 if( mB!=rSrc. mB) return false;
675 std::stringstream errstr;
676 errstr << "Invalid dimension";
677 throw Exception( "Polyhedron::Dimension", errstr.str(), 700);
705 std::stringstream errstr;
706 errstr << "Invalid dimansions.";
707 throw Exception( "Polyhedron::AB", errstr.str(), 700);
736 std::string label=rLabel;
737 std::string ftype= "Polyhedron";
738 if(rLabel== "") label=ftype;
766 std::string label=rLabel;
767 if(rLabel== "") label= "Polyhedron";
778 std::stringstream errstr;
779 errstr << "Dimension mismatch, rows. " << rTr. FileLine();
780 throw Exception( "Polyhedron::DoRead", errstr.str(), 700);
830 std::stringstream errstr;
831 errstr << "Dimension out of range.";
832 throw Exception( "LinearRelation::LinearRelation()", errstr.str(), 700);
890 if( mA1!=rSrc. mA1) return false;
891 if( mA2!=rSrc. mA2) return false;
892 if( mB!=rSrc. mB) return false;
893 if( mC!=rSrc. mC) return false;
894 if( mD!=rSrc. mD) return false;
914 std::stringstream errstr;
915 errstr << "Invalid dimension";
916 throw Exception( "LinearRelation::Dimension", errstr.str(), 700);
975 std::stringstream errstr;
976 errstr << "Invalid dimensions.";
977 throw Exception( "LinearRelation::Relation", errstr.str(), 700);
980 std::stringstream errstr;
981 errstr << "Invalid dimensions.";
982 throw Exception( "LinearRelation::Relation", errstr.str(), 700);
985 std::stringstream errstr;
986 errstr << "Invalid dimensions.";
987 throw Exception( "LinearRelation::Relation", errstr.str(), 700);
1002 std::stringstream errstr;
1003 errstr << "Invalid dimensions.";
1004 throw Exception( "LinearRelation::Map", errstr.str(), 700);
1007 std::stringstream errstr;
1008 errstr << "Invalid dimensions.";
1009 throw Exception( "LinearRelation::Map", errstr.str(), 700);
1023 for( int i =0; i<n; i++) {
1024 for( int j =0; j<n; j++) {
1026 mA1(i+n,j)= mC(i,j);
1056 for( int i =0; i<n; i++) {
1085 std::string label=rLabel;
1086 if(rLabel== "") label= "LinearRelation";
1124 std::string label=rLabel;
1125 if(rLabel== "") label= "LinearRelation";
1136 if(token. IsEnd(label)){
1140 if(token. IsBegin( "CMatrix")) {
1143 c. Read(rTr, "CMatrix");
1144 d. Read(rTr, "DVector");
1148 if(token. IsBegin( "A1Matrix")) {
1151 a1. Read(rTr, "A1Matrix");
1152 a2. Read(rTr, "A2Matrix");
1153 b. Read(rTr, "BVector");
#define FAUDES_TYPE_IMPLEMENTATION(ftype, ctype, cbase) faudes type implementation macros, overall
Type * mpUserData User data.
virtual void DoSWrite(TokenWriter &tw) const Write statistic info to TokenWriter, see Type::SWrite for public wrapper.
const Vector & B(void) const Get B vector.
const Matrix & C(void) const Get C matrix.
virtual void DoRead(TokenReader &tr, const std::string &rLabel="", const Type *pContext=0) Read from TokenReader, see Type::Read for public wrappers.
Idx Size(void) const Get size.
virtual bool DoEqual(const LinearRelation &rOther) const Test equality.
bool Map(void) const Test for data format.
void Clear(void) Clear all.
const Vector & D(void) const Get D vector.
virtual void DoWrite(TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const Write to TokenWriter, see Type::Write for public wrappers.
virtual ~LinearRelation(void) Destructor.
const Matrix & A2(void) const Get A2 matrix.
bool Relation(void) const Test for data format.
LinearRelation(void) Default constructor.
Matrix mA1 LinearRelation: data.
bool Identity(void) const Test for data format.
Type * UserData(void) const Get user data.
int Dimension(void) const Get dimension.
virtual LinearRelation & DoAssign(const LinearRelation &rSrc) Assign from other polyhedron.
std::string mName have a name
const Matrix & A1(void) const Get A1 matrix.
void Identity(int dim=-1) Set to identity matrix.
const Scalar::Type & operator()(int i, int j) const Cosmetic access operator.
int ColumnCount(void) const Get Dimension.
Idx Size(void) const Get size.
void Clear(void) Clear all.
int RowCount(void) const Get Dimension.
virtual void DoSWrite(TokenWriter &tw) const Write statistic info to TokenWriter, see Type::SWrite for public wrapper.
virtual void DoRead(TokenReader &tr, const std::string &rLabel="", const Type *pContext=0) Read from TokenReader, see Type::Read for public wrappers.
virtual ~Matrix(void) Destructor.
void RowCount(int rc) Set dimension.
virtual void DoWrite(TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const Write to TokenWriter, see Type::Write for public wrappers.
Matrix(void) Default constructor - sets dimension to 0x0.
const Scalar::Type & At(int i, int j) const Get entry.
void Zero(int rc=-1, int cc=-1) Set to zero matrix.
virtual bool DoEqual(const Matrix &rOther) const Test equality.
void ColumnCount(int cc) Set Dimension.
const Scalar::Type * CArray(void) const Access std C array.
virtual Matrix & DoAssign(const Matrix &rSrc) Assign from other matrix.
void Dimension(int rc, int cc) Set Dimension.
virtual void DoWrite(TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const Write to TokenWriter, see Type::Write for public wrappers.
Idx Size(void) const Get size.
virtual void DoRead(TokenReader &tr, const std::string &rLabel="", const Type *pContext=0) Read from TokenReader, see Type::Read for public wrappers.
Polyhedron(void) Default constructor - sets dimension to 0.
void Clear(void) Clear all.
virtual void DoSWrite(TokenWriter &tw) const Write statistic info to TokenWriter, see Type::SWrite for public wrapper.
const Matrix & A(void) const Get A matrix.
void AB(const Matrix &rA, const Vector &rB) Set A matrix and B vector.
int Dimension(void) const Get dimension.
Type * mpUserData User data.
Matrix mA Polyhedron: data.
Vector mB Polyhedron: data.
const Vector & B(void) const Get B vector.
virtual ~Polyhedron(void) Destructor.
virtual Polyhedron & DoAssign(const Polyhedron &rSrc) Assign from other polyhedron.
virtual const std::string & Name(void) const Object name.
virtual bool DoEqual(const Polyhedron &rOther) const Test equality.
Type * UserData(void) const Get user data.
double Type Datatype for scalar.
A TokenReader reads sequential tokens from a file or string.
std::string FileLine(void) const Return "filename:line".
bool Eos(const std::string &rLabel) Peek a token and check whether it ends the specified section.
void ReadEnd(const std::string &rLabel) Close the current section by matching the previous ReadBegin().
double ReadFloat(void) Read float token.
void ReadBegin(const std::string &rLabel) Open a section by specified label.
bool Peek(Token &token) Peek next token.
A TokenWriter writes sequential tokens to a file, a string or stdout.
void WriteFloat(const double &val) Write float.
void WriteComment(const std::string &rComment) Write comment in faudes format.
void Write(Token &rToken) Write next token.
void WriteEnd(const std::string &rLabel) Write end label.
int Columns(void) const Get number of columns in a line.
Tokens model atomic data for stream IO.
Int AttributeIntegerValue(const std::string &name) Access attribute value.
bool ExistsAttributeString(const std::string &name) Test attibute existence.
bool IsBegin(void) const Test token Type.
void InsAttribute(const std::string &name, const std::string &value) Insert named attribute, no type.
void SetBegin(const std::string &rName) Initialize as Begin token.
bool ExistsAttributeInteger(const std::string &name) Test attibute existence.
void InsAttributeInteger(const std::string &name, Int value) Insert named attribute with integer value.
bool IsEnd(void) const Test token Type.
const std::string & AttributeStringValue(const std::string &name) Access attribute value.
Base class of all libFAUDES objects that participate in the run-time interface.
void Read(const std::string &rFileName, const std::string &rLabel="", const Type *pContext=0) Read configuration data from file with label specified.
void Write(const Type *pContext=0) const Write configuration data to console.
virtual Vector & DoAssign(const Vector &rSrc) Assign from other vector.
Idx Size(void) const Get size.
const Scalar::Type & operator()(int i) const Cosmetic access operator.
const Scalar::Type * CArray(void) const Access std C array.
const Scalar::Type & At(int i) const Get entry.
virtual void DoSWrite(TokenWriter &tw) const Write statistic info to TokenWriter, see Type::SWrite for public wrapper.
void Zero(int dim=-1) Set to zero vector.
void Ones(int dim=-1) Set to ones.
void Clear(void) Clear all.
virtual bool DoEqual(const Vector &rOther) const Test equality.
int Dimension(void) const Get dimension.
virtual void DoRead(TokenReader &tr, const std::string &rLabel="", const Type *pContext=0) Read from TokenReader, see Type::Read for public wrappers.
Vector(void) Default constructor - sets dimension to 0.
virtual void DoWrite(TokenWriter &tw, const std::string &rLabel="", const Type *pContext=0) const Write to TokenWriter, see Type::Write for public wrappers.
virtual ~Vector(void) Destructor.
Parameter types for linear hybrid automata.
libFAUDES resides within the namespace faudes.
uint32_t Idx Type definition for index type (allways 32bit)
std::string ToStringInteger(Int number) integer to string
libFAUDES 2.32f
--- 2024.12.22
--- c++ api documentaion by doxygen
|