muParserX 2.0.0
|
Value class of muParserX. More...
#include <mpValue.h>
Public Member Functions | |
Value (char_type cType='v') | |
Construct an empty value object of a given type. More... | |
Value (int_type m, int_type n, float_type v) | |
Create a m x n matrix. | |
virtual IValue & | At (const IValue &row, const IValue &col) |
Return the matrix element at row col. More... | |
virtual IValue & | operator*= (const IValue &val) |
Assign a value with multiplication. More... | |
virtual char_type | GetType () const |
Returns a character representing the type of this value instance. More... | |
virtual int_type | GetInteger () const |
Return the value as an integer. More... | |
virtual float_type | GetImag () const |
Get the imaginary part of the value. More... | |
virtual const cmplx_type & | GetComplex () const |
Returns this value as a complex number. More... | |
![]() | |
int | GetDim () const |
Returns the dimension of the value represented by a value object. More... | |
bool | IsNonComplexScalar () const |
Returns true if the type is either floating point or interger. More... | |
bool | IsScalar () const |
Returns true if the type is not a vector and not a string. More... | |
bool | IsInteger () const |
Returns true if this value is a noncomplex integer. More... | |
bool | IsMatrix () const |
Returns true if this value is an array. More... | |
bool | IsComplex () const |
Returns true if this value is a complex value. More... | |
bool | IsString () const |
Returns true if this value is a string value. More... | |
![]() | |
ECmdCode | GetCode () const |
return the token code. More... | |
const string_type & | GetIdent () const |
Return the token identifier string. | |
Additional Inherited Members | |
![]() | |
virtual | ~IToken () |
Destructor (trivial). | |
IToken (const IToken &ref) | |
Copy constructor. More... | |
Value class of muParserX.
This class represents a value to be used with muParserX. It's a Variant like class able to store a variety of types.
|
explicit |
Construct an empty value object of a given type.
cType | The type of the value to construct (default='v'). |
Return the matrix element at row col.
Row and col are the indices of the matrix. If this element does not represent a matrix row and col must be 0 otherwise an index out of bound error is thrown.
Implements mup::IValue.
|
virtual |
Returns this value as a complex number.
nothrow |
If the value instance does not represent a complex value the returned value is undefined. No exception is triggered. If you are unsure about the type use IsComplex() or GetType() to verify the type.
Implements mup::IValue.
|
virtual |
Get the imaginary part of the value.
ParserError | in case this value represents a string or a matrix |
Implements mup::IValue.
|
virtual |
Return the value as an integer.
This function should only be called if you really need an integer value and want to make sure your either get one or throw an exception if the value can not be implicitely converted into an integer.
Implements mup::IValue.
|
virtual |
Returns a character representing the type of this value instance.
Implements mup::IValue.
Assign a value with multiplication.
val | The value to multiply to this |
When multiplying to values with each value representing a matrix type the result is checked whether it is a 1 x 1 matrix. If so the value is "unboxed" and stored directly in this value object. It is no longer treated as a matrix internally.
Implements mup::IValue.