Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

mcValue Class Reference

#include <Value.h>

Inheritance diagram for mcValue:

Inheritance graph
[legend]
List of all members.

Detailed Description

A variable holding an high-precision value.

This class links MathCore, wxWidgets and mpf_t libraries !!!

Definition at line 423 of file Value.h.

Public Member Functions

 mcValue ()
virtual ~mcValue ()
virtual void SetInt (int n)
virtual void SetLong (long n)=0
virtual void SetStr (const wxString &str, int base=10)=0
virtual long GetLong () const =0
virtual int GetInt () const
 operator int () const
 operator long () const
 operator unsigned long ()
virtual wxString GetStr () const =0
 Returns a string in exponential form, thus containing something like:.
bool isValid () const
 Returns TRUE if the given double is a "normal" number: not an infinite, not an 1.#INF and not a NaN...
bool isNAN () const
 Returns TRUE if this number is not mcValue::pNAN.
bool math_isFinite () const
 Returns TRUE if this number is not mcValue::pNegInf or mcValue::pPosInf.
bool isPosInf () const
bool isNegInf () const
virtual bool isInteger () const =0
 Returns TRUE if the given real number does not have decimal digits (that is, it can be converted to a mcIntegerValue without rounding).
virtual int GetFlags () const =0
 Returns the flags of this number.
virtual void SetFlags (int n)=0
 Sets the flags of this number.
void math_AddFlag (int n)
 math_Adds a flag to this number.

Static Public Member Functions

static void Init ()
 Initializes the static variables used by mcValue.
static void Cleanup ()
 Undoes what Init() does: destroys static variables.

Static Public Attributes

static int m_nMaxValueSharing = -1
 The maximum number of mcValue-derived classes which shared the same GMP structure contemporary.


Constructor & Destructor Documentation

mcValue::mcValue  )  [inline]
 

Definition at line 432 of file Value.h.

virtual mcValue::~mcValue  )  [inline, virtual]
 

Definition at line 433 of file Value.h.


Member Function Documentation

void mcValue::Cleanup  )  [static]
 

Undoes what Init() does: destroys static variables.

After this function you cannot use mcValue anymore, unless you call Init() another time...

Definition at line 121 of file Value.cpp.

Referenced by mcMathCore::CleanupMath().

virtual int mcValue::GetFlags  )  const [pure virtual]
 

Returns the flags of this number.

See the mcVALUE_XXX_FLAG defines above.

Referenced by isNAN(), isNegInf(), isPosInf(), and math_AddFlag().

virtual int mcValue::GetInt  )  const [inline, virtual]
 

Definition at line 453 of file Value.h.

References GetLong().

Referenced by mcMonomialHelpers::math_GetOrderPos(), mcPolynomialHelpers::math_RaiseTo(), mcPolySolver::math_SolveLine(), and operator int().

virtual long mcValue::GetLong  )  const [pure virtual]
 

Implemented in mcRationalValue.

Referenced by mcIntegerValue::GetComb(), GetInt(), operator long(), and operator unsigned long().

virtual wxString mcValue::GetStr  )  const [pure virtual]
 

Returns a string in exponential form, thus containing something like:.

SnnnE+yyyy example: -4318384739357974916E+6215

or

SnnnE-yyyy example: +8.208237913789131096523645193E-12873

where:

  • "S" is the sign of the number (+ or -)
  • "n" is a digit (0-9)
  • wxT("E") is a simple "E" which means that the number must be multiplied by 10^yyyy
  • "y" is a digit of the exponent (0-9)

Implemented in mcIntegerValue, mcRationalValue, and mcRealValue.

void mcValue::Init  )  [static]
 

Initializes the static variables used by mcValue.

This function must be called *before* using any other mcValue function.

Definition at line 97 of file Value.cpp.

References math_AddFlag(), mcGMPAlloc(), mcGMPFree(), mcGMPRealloc(), mcVALUE_NAN_FLAG, mcVALUE_NEGINF_FLAG, and mcVALUE_POSINF_FLAG.

Referenced by mcMathCore::SetupMath().

virtual bool mcValue::isInteger  )  const [pure virtual]
 

Returns TRUE if the given real number does not have decimal digits (that is, it can be converted to a mcIntegerValue without rounding).

Implemented in mcIntegerValue, mcRationalValue, and mcRealValue.

bool mcValue::isNAN  )  const [inline]
 

Returns TRUE if this number is not mcValue::pNAN.

Definition at line 483 of file Value.h.

References GetFlags(), and mcVALUE_NAN_FLAG.

Referenced by isValid(), mcExpElementHelpers::math_Evaluate(), and mcElementArrayHelpers::math_Evaluate().

bool mcValue::isNegInf  )  const [inline]
 

Definition at line 489 of file Value.h.

References GetFlags(), and mcVALUE_NEGINF_FLAG.

Referenced by math_isFinite().

bool mcValue::isPosInf  )  const [inline]
 

Definition at line 488 of file Value.h.

References GetFlags(), and mcVALUE_POSINF_FLAG.

Referenced by math_isFinite().

bool mcValue::isValid  )  const [inline]
 

Returns TRUE if the given double is a "normal" number: not an infinite, not an 1.#INF and not a NaN...

Definition at line 480 of file Value.h.

References isNAN(), and math_isFinite().

Referenced by mcFractionHelpers::math_Evaluate(), mcElementArrayHelpers::math_Evaluate(), mcFunctionHelpers::math_EvaluateBase(), mcPolynomialHelpers::math_GetMaxDegreeFor(), mcMonomialHelpers::math_GetMaxDegreeFor(), mcMathMngHelpers::math_GetMaxDegreeFor(), mcNumberHelpers::math_isValid(), mcNumberHelpers::math_MultiplyBaseBy(), and mcPolySolver::math_SolveLine().

void mcValue::math_AddFlag int  n  )  [inline]
 

math_Adds a flag to this number.

See the mcVALUE_XXX_FLAG defines above.

Definition at line 505 of file Value.h.

References GetFlags(), and SetFlags().

Referenced by Init().

bool mcValue::math_isFinite  )  const [inline]
 

Returns TRUE if this number is not mcValue::pNegInf or mcValue::pPosInf.

Definition at line 486 of file Value.h.

References isNegInf(), and isPosInf().

Referenced by isValid(), and mcElementHelpers::math_isFinite().

mcValue::operator int  )  const [inline]
 

Definition at line 455 of file Value.h.

References GetInt().

mcValue::operator long  )  const [inline]
 

Definition at line 456 of file Value.h.

References GetLong().

mcValue::operator unsigned long  )  [inline]
 

Definition at line 458 of file Value.h.

References GetLong().

virtual void mcValue::SetFlags int  n  )  [pure virtual]
 

Sets the flags of this number.

See the mcVALUE_XXX_FLAG defines above.

Referenced by math_AddFlag().

virtual void mcValue::SetInt int  n  )  [inline, virtual]
 

Definition at line 448 of file Value.h.

References SetLong().

virtual void mcValue::SetLong long  n  )  [pure virtual]
 

Implemented in mcRationalValue.

Referenced by SetInt().

virtual void mcValue::SetStr const wxString &  str,
int  base = 10
[pure virtual]
 

Implemented in mcRationalValue.


Member Data Documentation

int mcValue::m_nMaxValueSharing = -1 [static]
 

The maximum number of mcValue-derived classes which shared the same GMP structure contemporary.

Definition at line 53 of file Value.cpp.


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

Documentation generated with Doxygen on Sun Feb 6 17:13:19 2005
Visit MathStudio home page for more info

[ Top ]