Public Member Functions

openfluid::core::MatrixValue Class Reference

Inheritance diagram for openfluid::core::MatrixValue:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 MatrixValue ()
 MatrixValue (const MatrixValue &Val)
 MatrixValue (unsigned long ColsNbr, unsigned long RowsNbr)
 MatrixValue (unsigned long ColsNbr, unsigned long RowsNbr, double InitValue)
Valueoperator= (const Value &Other)
virtual ~MatrixValue ()
Type getType () const
Valueclone () const
void writeToStream (std::ostream &OutStm) const

Detailed Description

MatrixValue is a container for a 2D matrix of signed double precision floating point values.

See also:
Value
Matrix


Example : declaration

  // declaration of a MatrixValue, empty by default
  openfluid::core::MatrixValue Val1;

  // declaration of a MatrixValue, of 3 columns by 7 rows, with values initialized to 0.0
  openfluid::core::MatrixValue Val2(3,7);

  // declaration of a MatrixValue, of 3 columns by 7 rows, with values initialized to 1.99
  openfluid::core::MatrixValue Val3(3,7,1.99);

Example : getting the contained values

  double Tmp1;

  Tmp1 = Val1.get(2,3);

Example : getting all values as a c-style array of double, rows-first indexed

  double DblArrayVal[];

  DblArrayVal = Val1.getData();

Example : setting the contained values

  // using the set method
  Val1.set(0,0,101.99);

Example : conversion from string

  openfluid::core::StringValue StringVal;
  openfluid::core::MatrixValue Val2;

  // to MatrixValue, using two string values separators
  StringVal.set("3;5;2.8;6;17.999923|1;1;1;1;1|2.11;2.12;2.13;2.14;2.15");
  StringVal.toMatrixValue(";","|",Val2);

  // to MatrixValue, using a single string values separator and row length
  StringVal.set("3;5;2.8;6;17.999923;1;1;1;1;1;2.11;2.12;2.13;2.14;2.15");
  StringVal.toMatrixValue(";",5,Val2);

Example : conversion to string

  std::string StdStrVal = Val1.toString();

Constructor & Destructor Documentation

openfluid::core::MatrixValue::MatrixValue ( ) [inline]

Default constructor

openfluid::core::MatrixValue::MatrixValue ( const MatrixValue Val) [inline]

Copy constructor

openfluid::core::MatrixValue::MatrixValue ( unsigned long  ColsNbr,
unsigned long  RowsNbr 
) [inline]

Constructor, creates a Matrix containing ColsNbr x RowsNbr elements

openfluid::core::MatrixValue::MatrixValue ( unsigned long  ColsNbr,
unsigned long  RowsNbr,
double  InitValue 
) [inline]

Constructor, creates a Matrix containing ColsNbr x RowsNbr elements, initialized with value InitValue

virtual openfluid::core::MatrixValue::~MatrixValue ( ) [inline, virtual]

Member Function Documentation

Value* openfluid::core::MatrixValue::clone ( ) const [inline, virtual]

Reimplemented from openfluid::core::Value.

Type openfluid::core::MatrixValue::getType ( ) const [inline, virtual]
Value& openfluid::core::MatrixValue::operator= ( const Value ) [virtual]

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::MatrixValue::writeToStream ( std::ostream &  OutStm) const [virtual]

Generated using Doxygen 1.7.3
Creative Commons License Creative Commons By-NC-ND license