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

mcMonomial Class Reference

#include <Monomial.h>

Inheritance diagram for mcMonomial:

Inheritance graph
[legend]
Collaboration diagram for mcMonomial:

Collaboration graph
[legend]
List of all members.

Detailed Description

Implements methods useful to manipulate the monomials contained in an external mcPolynomial.

This class is really light because it doesn't copy anything from the given expression; it just links them. Thus, you can create/delete mcMonomials everywhere you need; you can also reuse them recalling Init(). This class is somewhat slow: don't make useless calls because each function often uses complex algorithms and almost always will result in a lot of recursive calls.

Warning:
All the entry values required by mcMonomial functions must be in 'monomial coord.': if you call mcMonomial::GetElem(0), you will NOT get the first element of the attached expression, but the first element which composes this monomial.

Definition at line 441 of file Monomial.h.

Public Member Functions

 mcMonomial (const mcSymbol &towrap)
 mcMonomial (const mcNumber &towrap)
 mcMonomial (const mcRadical &towrap)
 mcMonomial (const mcBracket &towrap)
 mcMonomial (const mcFraction &towrap)
mcMonomial operator * (const mcMonomial &m) const
mcMonomial operator/ (const mcMonomial &m) const
mcMonomial operator- (const mcMonomial &m) const
mcMonomial operator+ (const mcMonomial &m) const
mcMonomial operator+= (const mcMonomial &m)
mcMonomial operator-= (const mcMonomial &m)
mcMonomial operator *= (const mcMonomial &m)
mcMonomial operator/= (const mcMonomial &m)
bool data_isValidContainerFor (mcElementType t) const
 Returns TRUE if this element can safely contain the given element type.
mcWRAPPER void math_RemoveAllOp ()
mcWRAPPER void math_Abs ()
mcWRAPPER mcIntegerValue math_GetMaxDegreeFor (const mcSymbolProperties *p) const
mcWRAPPER mcIntegerValue math_GetMaxDegreeForSymbolArray (const mcSymbolArray *p) const
mcWRAPPER void math_SimplifyCoeff ()
mcWRAPPER void math_SetCoeff (const mcNumber &n)
mcWRAPPER void math_RemoveCoeff ()
mcWRAPPER mcRealValue math_GetCoeff () const
mcWRAPPER void math_ChangeCoeffSign ()

Private Member Functions

 mcDEFINE_MAIN_CLASS (Monomial, mcElementArray)

Friends

class mcPolynomial


Constructor & Destructor Documentation

mcMonomial::mcMonomial const mcSymbol towrap  ) 
 

Definition at line 95 of file Monomial.cpp.

References mcElementArray::data_AddElements(), and mcObject::data_SetRefData().

mcMonomial::mcMonomial const mcNumber towrap  ) 
 

Definition at line 97 of file Monomial.cpp.

References mcElementArray::data_AddElements(), and mcObject::data_SetRefData().

mcMonomial::mcMonomial const mcRadical towrap  ) 
 

Definition at line 101 of file Monomial.cpp.

References mcElementArray::data_AddElements(), and mcObject::data_SetRefData().

mcMonomial::mcMonomial const mcBracket towrap  ) 
 

Definition at line 99 of file Monomial.cpp.

References mcElementArray::data_AddElements(), and mcObject::data_SetRefData().

mcMonomial::mcMonomial const mcFraction towrap  ) 
 

Definition at line 93 of file Monomial.cpp.

References mcElementArray::data_AddElements(), and mcObject::data_SetRefData().


Member Function Documentation

bool mcMonomial::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 mcElementArray.

Definition at line 471 of file Monomial.h.

References mcET_MONOMIAL.

mcWRAPPER void mcMonomial::math_Abs  )  [inline]
 

Definition at line 478 of file Monomial.h.

References mcWRAPPER.

Referenced by mcPolynomialHelpers::math_SimplifySolveOp().

mcWRAPPER void mcMonomial::math_ChangeCoeffSign  )  [inline]
 

Definition at line 504 of file Monomial.h.

References mcWRAPPER.

mcWRAPPER mcRealValue mcMonomial::math_GetCoeff  )  const [inline]
 

Definition at line 501 of file Monomial.h.

References mcWRAPPER.

Referenced by mcMonomialHelpers::math_Add(), mcPolynomialHelpers::math_PackSign(), mcPolynomialHelpers::math_SimplifySolveOp(), and mcPolynomialHelpers::math_SyncCoeffWithSigns().

mcWRAPPER mcIntegerValue mcMonomial::math_GetMaxDegreeFor const mcSymbolProperties p  )  const [inline]
 

Definition at line 490 of file Monomial.h.

References mcWRAPPER.

Referenced by mcPolynomialHelpers::math_GetMaxDegreeFor().

mcWRAPPER mcIntegerValue mcMonomial::math_GetMaxDegreeForSymbolArray const mcSymbolArray p  )  const [inline]
 

Definition at line 492 of file Monomial.h.

References mcWRAPPER.

mcWRAPPER void mcMonomial::math_RemoveAllOp  )  [inline]
 

Definition at line 474 of file Monomial.h.

References mcWRAPPER.

mcWRAPPER void mcMonomial::math_RemoveCoeff  )  [inline]
 

Definition at line 499 of file Monomial.h.

References mcWRAPPER.

Referenced by mcMonomialHelpers::math_isSimilarTo().

mcWRAPPER void mcMonomial::math_SetCoeff const mcNumber n  )  [inline]
 

Definition at line 497 of file Monomial.h.

References mcWRAPPER.

mcWRAPPER void mcMonomial::math_SimplifyCoeff  )  [inline]
 

Definition at line 495 of file Monomial.h.

References mcWRAPPER.

Referenced by mcMonomialHelpers::math_GetCoeff().

mcMonomial::mcDEFINE_MAIN_CLASS Monomial  ,
mcElementArray 
[private]
 

mcMonomial mcMonomial::operator * const mcMonomial m  )  const [inline]
 

Definition at line 455 of file Monomial.h.

References mcElement::math_SimpleMultiplyBy().

mcMonomial mcMonomial::operator *= const mcMonomial m  )  [inline]
 

Definition at line 466 of file Monomial.h.

mcMonomial mcMonomial::operator+ const mcMonomial m  )  const [inline]
 

Definition at line 461 of file Monomial.h.

References mcElement::math_SimpleAdd().

mcMonomial mcMonomial::operator+= const mcMonomial m  )  [inline]
 

Definition at line 464 of file Monomial.h.

mcMonomial mcMonomial::operator- const mcMonomial m  )  const [inline]
 

Definition at line 459 of file Monomial.h.

References mcElement::math_SimpleSubtract().

mcMonomial mcMonomial::operator-= const mcMonomial m  )  [inline]
 

Definition at line 465 of file Monomial.h.

mcMonomial mcMonomial::operator/ const mcMonomial m  )  const [inline]
 

Definition at line 457 of file Monomial.h.

References mcElement::math_SimpleDivideBy().

mcMonomial mcMonomial::operator/= const mcMonomial m  )  [inline]
 

Definition at line 467 of file Monomial.h.


Friends And Related Function Documentation

friend class mcPolynomial [friend]
 

Definition at line 443 of file Monomial.h.


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

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

[ Top ]