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

mcNumber Class Reference

#include <Number.h>

Inheritance diagram for mcNumber:

Inheritance graph
[legend]
Collaboration diagram for mcNumber:

Collaboration graph
[legend]
List of all members.

Detailed Description

One of the most used class of MathCore: a simple number (and optionally its exponent).

This class allows the user to insert coefficients in the monomials.

Todo:
math_Add range checking: try to enter too high numbers should generate a warning - IS THIS REQUIRED SINCE WE USE MAPM ?

Definition at line 381 of file Number.h.

Public Member Functions

 mcNumber (const mcRealValue &n)
 An handy constructor.
bool data_isValidContainerFor (mcElementType t) const
 Returns TRUE if this element can safely contain the given element type.
mcWRAPPER void data_Set (const mcRealValue &d)
mcWRAPPER mcRealValue data_Get () const
mcWRAPPER void math_Abs ()
mcWRAPPER bool math_isValid () const
mcWRAPPER bool math_GetNumDen (mcIntegerValue &num, mcIntegerValue &den)
mcFraction math_TransformInFraction ()

Private Member Functions

 mcDEFINE_MAIN_CLASS (Number, mcExpElement)


Constructor & Destructor Documentation

mcNumber::mcNumber const mcRealValue n  )  [inline]
 

An handy constructor.

Definition at line 388 of file Number.h.

References mcObject::data_SetRefData().


Member Function Documentation

mcWRAPPER mcRealValue mcNumber::data_Get  )  const [inline]
 

Definition at line 395 of file Number.h.

References mcWRAPPER.

Referenced by mcNumberHelpers::gui_MergeWith(), mcNumberHelpers::gui_Split(), mcNumberHelpers::math_Add(), mcNumberHelpers::math_CanBeDivBy(), mcNumberHelpers::math_DivideBaseOnlyBy(), mcElementArrayHelpers::math_GetWrappedNumber(), and mcNumberHelpers::math_MultiplyBaseOnlyBy().

bool mcNumber::data_isValidContainerFor mcElementType  t  )  const [inline, virtual]
 

Returns TRUE if this element can safely contain the given element type.

Without this function a lot of errors could be undetectable:

        mcPolynomial pol; // creates a new polynomial
        mcElement e(pol); // references it
        [...]    // the programmers forgots what "e" references
        mcFraction f(e);  // mcFraction wraps a mcPolynomialHelpers class !
        f.data_GetNum();  // CRASH

This function must be overridden by mcElement-derived classes in order to provide a list of the mcElementType it can safely contain.

Reimplemented from mcExpElement.

Definition at line 391 of file Number.h.

References mcET_NUMBER.

mcWRAPPER void mcNumber::data_Set const mcRealValue d  )  [inline]
 

Definition at line 394 of file Number.h.

References mcWRAPPER.

Referenced by mcNumberHelpers::gui_Split(), and mcNumberHelpers::math_SimplifyBaseExp().

mcWRAPPER void mcNumber::math_Abs  )  [inline]
 

Definition at line 397 of file Number.h.

References mcWRAPPER.

Referenced by mcMonomialHelpers::math_Abs().

mcWRAPPER bool mcNumber::math_GetNumDen mcIntegerValue num,
mcIntegerValue den
[inline]
 

Definition at line 403 of file Number.h.

References mcWRAPPER.

mcWRAPPER bool mcNumber::math_isValid  )  const [inline]
 

Definition at line 400 of file Number.h.

References mcWRAPPER.

Referenced by mcNumberHelpers::math_CanBeDivBy().

mcFraction mcNumber::math_TransformInFraction  ) 
 

Definition at line 79 of file Number.cpp.

mcNumber::mcDEFINE_MAIN_CLASS Number  ,
mcExpElement 
[private]
 


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

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

[ Top ]