Public Member Functions | List of all members
openfluid::core::MatrixValue Class Reference

#include <core/MatrixValue.hpp>

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

Public Member Functions

 MatrixValue ()
 
 MatrixValue (const MatrixValue &Val)
 
 MatrixValue (unsigned long ColsNbr, unsigned long RowsNbr)
 
 MatrixValue (unsigned long ColsNbr, unsigned long RowsNbr, double InitValue)
 
virtual ~MatrixValue ()
 
Valueoperator= (const Value &Other)
 
Type getType () const
 
Valueclone () const
 
void writeToStream (std::ostream &OutStm) const
 
void writeQuotedToStream (std::ostream &OutStm) const
 
- Public Member Functions inherited from openfluid::core::CompoundValue
 CompoundValue ()
 
bool isSimple () const
 
bool isCompound () const
 
- Public Member Functions inherited from openfluid::core::Value
 Value ()
 
virtual ~Value ()
 
virtual bool convert (Value &) const
 
bool isDoubleValue () const
 
const DoubleValueasDoubleValue () const
 
DoubleValueasDoubleValue ()
 
bool isIntegerValue () const
 
const IntegerValueasIntegerValue () const
 
IntegerValueasIntegerValue ()
 
bool isBooleanValue () const
 
const BooleanValueasBooleanValue () const
 
BooleanValueasBooleanValue ()
 
bool isStringValue () const
 
const StringValueasStringValue () const
 
StringValueasStringValue ()
 
bool isNullValue () const
 
const NullValueasNullValue () const
 
NullValueasNullValue ()
 
bool isVectorValue () const
 
const VectorValueasVectorValue () const
 
VectorValueasVectorValue ()
 
bool isMatrixValue () const
 
const MatrixValueasMatrixValue () const
 
MatrixValueasMatrixValue ()
 
bool isMapValue () const
 
const MapValueasMapValue () const
 
MapValueasMapValue ()
 
bool isTreeValue () const
 
const TreeValueasTreeValue () const
 
TreeValueasTreeValue ()
 
std::string toString () const
 
- Public Member Functions inherited from openfluid::core::Matrix< double >
 Matrix ()
 
 Matrix (const Matrix &Matrix)
 
 Matrix (unsigned long ColsNbr, unsigned long RowsNbr)
 
 Matrix (unsigned long ColsNbr, unsigned long RowsNbr, doubleInitValue)
 
virtual ~Matrix ()
 
unsigned long getColsNbr () const
 
unsigned long getRowsNbr () const
 
unsigned long getSize () const
 
unsigned long size () const
 
double * data () const
 
void setData (double *Data, unsigned long ColsNbr, unsigned long RowsNbr)
 
double getElement (unsigned long ColIndex, unsigned long RowIndex) const
 
double at (unsigned long ColIndex, unsigned long RowIndex) const
 
double get (unsigned long ColIndex, unsigned long RowIndex) const
 
void setElement (unsigned long ColIndex, unsigned long RowIndex, doubleElement)
 
void set (unsigned long ColIndex, unsigned long RowIndex, doubleElement)
 
Matrix< double > & operator= (const Matrix &A)
 
void fill (const double &Val)
 
void clear ()
 

Additional Inherited Members

- Public Types inherited from openfluid::core::Value
enum  Type {
  NONE, BOOLEAN, INTEGER, DOUBLE,
  STRING, VECTOR, MATRIX, MAP,
  TREE, NULLL
}
 
- Static Public Member Functions inherited from openfluid::core::Value
static bool getValueTypeFromString (const std::string &ValueTypeString, Value::Type &ValueType)
 
static std::string getStringFromValueType (const Value::Type ValueType)
 
- Protected Member Functions inherited from openfluid::core::Matrix< double >
bool allocate (unsigned long ColsNbr, unsigned long RowsNbr)
 
void init ()
 
- Protected Attributes inherited from openfluid::core::Matrix< double >
double * m_Data
 
unsigned long m_ColsNbr
 
unsigned long m_RowsNbr
 

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
// declaration of a MatrixValue, of 3 columns by 7 rows, with values initialized to 0.0
// declaration of a MatrixValue, of 3 columns by 7 rows, with values initialized to 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

// 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 ( )
inlinevirtual

Member Function Documentation

Value* openfluid::core::MatrixValue::clone ( ) const
inlinevirtual

Reimplemented from openfluid::core::Value.

Type openfluid::core::MatrixValue::getType ( ) const
inlinevirtual
Value& openfluid::core::MatrixValue::operator= ( const Value )
virtual

Assignment operator

Reimplemented from openfluid::core::Value.

void openfluid::core::MatrixValue::writeQuotedToStream ( std::ostream &  OutStm) const
inlinevirtual
void openfluid::core::MatrixValue::writeToStream ( std::ostream &  OutStm) const
virtual

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