#include <Monomial.h>
Inheritance diagram for mcMonomialHelpers:
This is entirely defined & implemented through macros.
Definition at line 60 of file Monomial.h.
Public Member Functions | |
int | gui_GetSpaceBetweenRatio () const |
mcPolynomials have different space between ratio from mcPolynomials... | |
mcMonomialHelpers () | |
virtual | ~mcMonomialHelpers () |
void | data_Repair () |
Repairs the array, adding the mcMultOp where they are required (for example, between two mcNumbers), removing them where they must not be present (for example, at the beginning/end of the array), and so on... | |
void | data_TransformDivOp () |
Transforms mcDivOps to mcFractions: 24ax/2*3 becomes ((24ax)/2)*3 (brackets have been added only to increase readability) Unlike mcMonomial::math_TransformDivOp(), this function does not use the mcElement::math_MakeReciprocal() function; it creates directly mcFractions that are then filled with the elements placed before & after the old mcDivOp. | |
wxXml2Node | io_GetMathML (bool bGetPresentation) const |
Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html). | |
bool | io_ImportPresentationMathML (wxXml2Node tag, wxString &pErr) |
Imports presentation MathML reading the contents of the given XML node (without modifying it). | |
bool | io_ImportInlinedExpr (const wxString &, int *, wxString &pErr) |
Imports an inlined expression. | |
void | io_PostProcess () |
If the 'auto convert mcDivOp(s) to mcFraction(s)' feature is enabled (through #bAutoConvertDivOpToFractions) this function will remove all divop replacing them with mcFraction... | |
Array handlers | |
int | gui_AddNewElement (mcElementType type, const mcKey &key, int pos=-1) |
Creates a new element of the type & subtype, sends it the given start key and adds it to the array in the specified position. | |
void | gui_CheckCursorPos () const |
Checks the cursor position. | |
void | gui_ScanArrayForFunctions () |
Scans the array for mcSymbol sequences that matches the name of a mcFunction. | |
void | gui_ReplaceSymbolsWithFunction (int idx, int fnc) |
After a function has been recognized inside a sequence of mcSymbols, the container of the mcSymbol classes should call the following function to create the recognized mcFunction. | |
mcElement overloaded functions | |
bool | gui_isBeginKey (const mcKey &) const |
This class cannot be allocated (directly) by the user; this is why it *always* returns a FALSE value... | |
bool | gui_isArrEndKey (const mcKey &key) const |
See io_isBeginChar function. | |
int | gui_Draw (wxDC &dc, int x, int y, long flags, const wxPoint &pt, int cl) const |
Like mcElement::gui_Draw, but you can specify a center line to use to calculate the cursor position. | |
int | gui_DeleteFirstOp () |
A little helper funcitons to be used in some rare situations. | |
mcInputRes | gui_Input (const mcKey &ev, mcElement *newelem) |
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). | |
mcInputRes | gui_BackInput (const mcKey &key, mcElement *pnewelem, int n) |
Replies to the return flag of the gui_Input() function of the subelement called by the mcElementArray::gui_Input() function. | |
mcInsertRes | gui_Insert (const mcElement *toinsert, int n) |
mcInsertRes | gui_Insert (const mcElement &toinsert, mcElement *) |
Inserts the given element at the right of the cursor position. | |
void | gui_Replace (mcElement *) |
bool | gui_Split (mcElement *) |
gui_Splits this element in two parts. | |
void | gui_DoSplit (mcElementType type, const mcKey &key) |
gui_Splits the currently focused elements in two parts, inserting a new element of the given type and subtype between those two parts | |
bool | gui_MergeWith (const mcElement &) |
Merges the given element with this object. | |
int | gui_Draw (wxDC &dc, int x, int y, long flags, const wxPoint &pt) const |
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. | |
mcElementArrayMath abstract functions | |
Implementation of those functions defined as pure virtual in parent class. | |
int | math_MathToDataIdx (int dataindex) const |
Converts from math to data index. | |
int | math_DataToMathIdx (int mathindex) const |
Converts from data to math index. | |
void | math_PrepareForComparison (mcElementArray &p) const |
mcElementType | math_GetNeutralOpType () const |
double | math_GetNeutralValue () const |
mcPolynomial | math_GetPolynomialWrapper () const |
Returns a new mcPolynomial containing *this array. | |
mcArrayEntry | math_WrapMonomial (const mcMonomial &) |
mcArrayEntry | math_WrapSimple (const mcElement &) |
mcBasicOpRes | math_RaiseTo (const mcPolynomial &p) |
Raises *this element to the given polynomial. | |
Math engine functions | |
Implements math calculus. | |
void | math_Abs () |
Modifies this monomial replacing the first operator with a mcAddOp; in this way, the monomial's sign is changed if the monomial was negative; it will remain untouched if it was positive. | |
bool | math_isSimilarTo (const mcMonomial &) const |
Returns TRUE if the given monomial can be summed with this monomial; that is, both the two monomials have the same factors which contains symbols or functions. | |
void | math_TransformDivOp () |
Using the mcElement::math_MakeReciprocal function, replaces mcDivOp with mcMultOp and then transform the element(s) following it in their reciprocals. | |
void | math_RemoveAllOp () |
Removes all mcDivOp using #TransformDivOp and then removes all remaining mcMultOp from the array. | |
mcMonomial | math_DetachNonCommonFactors (const mcMonomial &) |
Returns a new monomial containing the factors non-common to *this and the given monomial. | |
mcIntegerValue | math_GetMaxDegreeFor (const mcSymbolProperties *) const |
Returns the maximum degree of the given symbol for this monomial. | |
mcIntegerValue | math_GetMaxDegreeForSymbolArray (const mcSymbolArray *p) const |
Returns the sum of the maximum degrees for all the symbols in the given array. | |
Coefficient-related functions | |
Functions working on the coefficient of this monomial. | |
void | math_SimplifyCoeff () |
void | math_RemoveCoeff () |
void | math_SetCoeff (const mcNumber &) |
void | math_ChangeCoeffSign () |
mcRealValue | math_GetCoeff () const |
mcElementMath abstract functions | |
Implements some common math functions. | |
bool | math_CanBeAddedWith (const mcElement &p) const |
Returns TRUE if this element can be added with the given element. | |
mcBasicOpRes | math_Add (const mcElement &, mcElement *p, bool add) |
Sums or subtracts this element with the given e element. | |
mcBasicOpRes | math_MultiplyBy (const mcElement &, mcElement *p) |
Multiplies two mcElements of the same type and stores the result in this object. | |
mcBasicOpRes | math_DivideBy (const mcElement &, mcElement *p) |
Divides two mcElements of the same type and stores the result in this object. | |
int | math_GetOrderPos () const |
Computes a value which is used to reorder this monomial. | |
mcMonomial | math_GetLCM (const mcElement &) const |
Returns the LCM between *this and the given element. | |
mcMonomial | math_GetGCD (const mcElement &) const |
Static Public Attributes | |
static bool | sgui_bEmptyBoxReplacing = TRUE |
If TRUE, when a monomial which doesn' contain an empty box, is deleted, then it is replaced with a monomial containing an empty box. | |
static bool | sgui_bFunctionScanEnabled = TRUE |
If TRUE, when the user edits the contents of a mcMonomial class, all mcSymbol sequences are automatically scanned searching for function names; for example, if three mcSymbol containing "s", wxT("i"), "n" are found to be contiguos or separated only by mcMultOps, then those three mcSymbol are replaced by a mcFunction representing the SIN function. | |
static bool | sgui_bTransformDivInFractions = TRUE |
If TRUE, when the user creates a mcDivOp, all the factors which are placed *before* the operator, become the numerator of a new fraction whose denominator are the elements placed *after* the operator. | |
static int | sgui_nSpaceBetween = 1 |
A value that, divided by the exponent depth of this element, gives the number of pixels to leave between all elements. | |
static mcMonomial * | smath_pZero = NULL |
static mcMonomial * | smath_pOne = NULL |
static bool | sio_bAutoConvertDivOpToFractions = TRUE |
If TRUE, just *after* (see io_PostProcess) each import process, all the div ops will be converted to fractions using mcMonomial::data_TransformDivOp(). | |
Protected Member Functions | |
int | data_GetIdxFromEntry (const mcArrayEntry *p) const |
mcElement & | data_GetRefFromEntry (const mcArrayEntry *p) |
virtual mcExpSimRes | math_HandleExpSimFlag (mcExpSimRes r, mcElement *newelem, int i) |
Handles a little mcMonomial-specific exception. | |
mcExpSimRes | math_Reorder () |
Reorders the elements contained in this monomial collapsing all the elements which can be simplified and reordering them. | |
virtual mcExpSimRes | math_BeginSimSteps () |
Removes all the mcDivOp using the TransformDivOp function. | |
virtual void | math_EndSimSteps () |
math_Adds eventually missing mcMultOp. | |
Private Member Functions | |
mcDEFINE_REFERENCE_DATA (mcMonomial, mcET_MONOMIAL) |
|
Definition at line 120 of file Monomial.h. |
|
Definition at line 121 of file Monomial.h. |
|
Implements mcElementArrayHelpers. Definition at line 128 of file Monomial.h. |
|
Implements mcElementArrayHelpers. Definition at line 131 of file Monomial.h. |
|
|
|
Creates a new element of the type & subtype, sends it the given start key and adds it to the array in the specified position.
Reimplemented from mcElementArrayHelpers. Definition at line 321 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcFraction::data_AddElements(), mcElementHelpers::data_Check(), mcElement::data_Check(), mcElementArrayHelpers::data_DeleteAll(), mcElementArray::data_DeleteFirst(), mcElementArray::data_DeleteLast(), mcElementArray::data_GetCount(), mcElementArrayHelpers::data_GetCount(), mcFraction::data_GetDen(), mcFraction::data_GetNum(), mcElementArrayHelpers::data_isOp(), mcElementArrayHelpers::data_MoveElemRight(), mcElementArrayHelpers::gui_AddNewElement(), mcElementArrayHelpers::gui_AddNewEmptyBox(), mcElementHelpers::gui_RecalcSize(), mcFraction::gui_SetCursorOnDen(), mcET_DIVOP, and sgui_bTransformDivInFractions. Referenced by gui_DoSplit(). |
|
|
Checks the cursor position. If the cursor is not in the right position, the program stops. Implements mcElementArrayHelpers. Definition at line 312 of file Monomial.cpp. References mcElementArrayHelpers::data_GetCount(), mcElementArrayHelpers::data_isOp(), and mcASSERT. |
|
A little helper funcitons to be used in some rare situations. You should NEVER use it: it's just some code which would be repeated 2-3 times in the gui_BackInput() function. |
|
gui_Splits the currently focused elements in two parts, inserting a new element of the given type and subtype between those two parts
Implements mcElementArrayHelpers. Definition at line 680 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_MoveElemRight(), mcElementArrayHelpers::data_Set(), gui_AddNewElement(), gui_Split(), mcASSERT, and mcEmptyElement. |
|
element must be drawn with mcElementHelpers::sgui_m_pActivationBrush background brush; if this pointer is equal to mcDRW_NONACTIVE, the function must simply draw everything with default transparent mode; if the pointer is not one of the previous values, the function must use the pointer to find the subelement where it lies. Then, only the subelement's gui_Draw() function must be called with the initial pointer. The subelements must be called with mcDRW_ALLACTIVE flag only for special reasons.
Reimplemented from mcElementArrayHelpers. Definition at line 238 of file Monomial.h. References mcElement::gui_Draw(). |
|
Like mcElement::gui_Draw, but you can specify a center line to use to calculate the cursor position.
Definition at line 278 of file Monomial.cpp. References mcElementArrayHelpers::gui_DrawSelection(), mcElementArrayHelpers::gui_ExDraw(), mcDRW_ALLOW_TOTAL_SELECTION, mcDRW_NOACTIVEELEM, and mcGUILOG. |
|
mcPolynomials have different space between ratio from mcPolynomials...
Reimplemented from mcElementArrayHelpers. Definition at line 92 of file Monomial.h. |
|
This function is called when the cursor is inside the element and the user presses a key (which is not the element's end tag). The way the element should process the given character is dependent to the element type: a mcNumber will insert vk next to the cursor position if vk is a digit. If vk is not acceptable, the function should call the MathCore error-handler function, mcMathCore::Get()->SyntaxError. This function should return one of the values defined for mcInputRes: mcIR_OKAY, mcIR_DELETE_THIS, mcIR_DIRECT_DELETE, mcIR_DELETE_NEXT.
Reimplemented from mcElementArrayHelpers. Definition at line 807 of file Monomial.cpp. References mcElementArrayHelpers::gui_Input(), gui_ScanArrayForFunctions(), and sgui_bFunctionScanEnabled. Referenced by gui_BackInput(). |
|
Inserts the given element at the right of the cursor position.
Implements mcElementHelpers. Definition at line 902 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::gui_GetCursorPos(), mcElement::gui_Insert(), gui_Replace(), mcINSR_OKAY, and mcINSR_REPLACE_THIS. |
|
Definition at line 941 of file Monomial.cpp. References mcINSR_OKAY. |
|
See io_isBeginChar function.
Implements mcElementArrayHelpers. Definition at line 204 of file Monomial.h. References mcElementHelpers::gui_isKeyBeginKey(), mcET_ADDOP, and mcET_SUBOP. |
|
This class cannot be allocated (directly) by the user; this is why it *always* returns a FALSE value...
Implements mcElementHelpers. Definition at line 201 of file Monomial.h. |
|
Merges the given element with this object. Like splitting, very few elements support merging, but those elements which handles splitting, should also handle merging... see gui_Split(). The function should merge the given element in *this and return TRUE if everything was okay; FALSE if the merging could not be done (because, for example, the given element is not of the right type...). Reimplemented from mcElementHelpers. Definition at line 767 of file Monomial.cpp. References mcElementArray::data_Delete(), mcElementArray::data_Get(), mcElementArray::data_GetLast(), mcElementArrayHelpers::data_GetLast(), mcElement::data_GetType(), mcElement::data_isAllowedBefore(), mcElementArray::data_isArrayEmpty(), mcElementArray::data_isOp(), mcElementArrayHelpers::data_Merge(), mcElementArray::data_MoveElemLeft(), data_Repair(), mcElement::gui_isSplittable(), mcElementHelpers::gui_isSplittable(), mcElement::gui_MergeWith(), mcElementHelpers::gui_RecalcSize(), and mcET_MONOMIAL. |
|
Definition at line 862 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_AddNewEmptyBox(), mcElementArrayHelpers::data_isElementAllowed(), mcElementArrayHelpers::data_isValidElem(), mcMathCore::Get(), mcASSERT, mcET_ADDOP, mcET_DIVOP, mcET_MULTOP, mcET_SUBOP, and mcMathCore::SyntaxError(). Referenced by gui_BackInput(), and gui_Insert(). |
|
After a function has been recognized inside a sequence of mcSymbols, the container of the mcSymbol classes should call the following function to create the recognized mcFunction.
Definition at line 841 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_Delete(), mcFunction::data_GetName(), mcElementArrayHelpers::data_MoveElemLeft(), mcElementHelpers::gui_RecalcSize(), and mcFunction::gui_Setup(). Referenced by gui_ScanArrayForFunctions(). |
|
Scans the array for mcSymbol sequences that matches the name of a mcFunction.
Definition at line 819 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetArray(), mcElementArrayHelpers::data_GetCount(), mcFunction::data_GetFunctionType(), mcElementHelpers::data_GetType(), gui_ReplaceSymbolsWithFunction(), mcET_SYMBOL, and mcFUNCTION_TYPE_NOTFOUND. Referenced by gui_Input(). |
|
gui_Splits this element in two parts. The first is stored in this element, the second is returned as a pointer (the caller must then delete it when it's no longer necessary). The split point must be determined using the current cursor position. This function has a sense only for few elements, see as an example mcNumber::gui_Split: when the user tries to insert a new operator like '/' and the cursor is inside a number, the number is split in two parts and this function is used to get the second half. If the cursor is placed in at the leftmost/rightmost point of the element and, thus, the first/second half of the element would be empty, then the function should return NULL. The classes that cannot be splitted should return NULL. This is what the standard implementation does.
Reimplemented from mcElementHelpers. Definition at line 716 of file Monomial.cpp. References mcElementArray::data_AddElements(), mcElementArrayHelpers::data_Delete(), mcElementArrayHelpers::data_DetachLastElem(), mcElementArray::data_Get(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetArray(), mcElementArrayHelpers::data_GetCount(), mcElementArrayHelpers::data_MoveElemLeft(), mcElementArray::data_Repair(), data_Repair(), mcElementHelpers::gui_RecalcSize(), mcElement::gui_SetCursorPos(), mcElement::gui_Split(), mcCP_BEGIN, mcCP_END, and mcEmptyElement. Referenced by gui_DoSplit(). |
|
Returns the MathML code for this element as presentation markup (http://www.w3.org/TR/MathML2/chapter3.html) or as content markup (http://www.w3.org/TR/MathML2/chapter4.html).
Implements mcElementHelpers. Definition at line 972 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetCount(), mcElementArrayHelpers::data_isOp(), and mcElement::io_GetMathML(). |
|
Imports an inlined expression.
"Inlined expression" means a string containing an encoded representation of math data: 234^2*ax+6y/2=0 is an inlined expression. This is the form which is used to input and output math data by a lot of math programs. Compability with these programs is crucial. However, because of the nature of this representation, the algorithm which recognizes (through io_isBeginChar functions) the elements to create, needs to know the lenght of the token which encodes this element; this is accomplished with the
Implements mcElementHelpers. Definition at line 1085 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_DeleteAll(), mcElementHelpers::data_NewElem(), data_Repair(), mcElement::io_ImportInlinedExpr(), mcElementHelpers::io_isCharBeginChar(), mcFunctionHelpers::io_isFunctionBeginChar(), mcRadicalHelpers::io_isRadicalBeginChar(), mcElementHelpers::io_PostProcessChildren(), mcET_ADDOP, mcET_FUNCTION, mcET_INVALID, mcET_RADICAL, mcET_SUBOP, mcIOLOG, and mcTXTTHIS. |
|
Imports presentation MathML reading the contents of the given XML node (without modifying it).
This function is called only if io_isBeginTag function returns a positive value for the name of parent tag of
Implements mcElementHelpers. Definition at line 1001 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_DeleteAll(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetCount(), mcElementHelpers::data_GetType(), mcElementHelpers::data_NewElem(), mcElement::io_ImportPresentationMathML(), mcElementHelpers::io_isTagBeginTag(), mcElementHelpers::io_PostProcessChildren(), mcASSERT, mcET_ADDOP, and mcET_SUBOP. |
|
If the 'auto convert mcDivOp(s) to mcFraction(s)' feature is enabled (through #bAutoConvertDivOpToFractions) this function will remove all divop replacing them with mcFraction...
Reimplemented from mcElementHelpers. Definition at line 1152 of file Monomial.cpp. References data_TransformDivOp(), and sio_bAutoConvertDivOpToFractions. |
|
Modifies this monomial replacing the first operator with a mcAddOp; in this way, the monomial's sign is changed if the monomial was negative; it will remain untouched if it was positive. This function needs a mcET_POLYNOMIAL as parent to work. Definition at line 1287 of file Monomial.cpp. References mcNumber::math_Abs(), math_GetCoeff(), and math_SetCoeff(). |
|
Sums or subtracts this element with the given A unique function for add/subtract operations is used because the algorithms used to handle this two operations are usually almost identic and thus this avoids a lot of repetitions. If the two elements cannot be summed, then an ASSERT should fail since before using this function, the caller should always use the math_CanBeAddedWith() function.
The function returns one of mcBasicOpRes values, eventually using the Implements mcElementHelpers. Definition at line 1509 of file Monomial.cpp. References data_Repair(), mcElement::math_Add(), math_CanBeAddedWith(), mcElementArrayHelpers::math_Get(), mcElementArray::math_Get(), mcMonomial::math_GetCoeff(), math_GetCoeff(), mcElementArray::math_GetCount(), mcElementArrayHelpers::math_GetCount(), math_isSimilarTo(), math_RemoveAllOp(), math_SetCoeff(), mcASSERT, mcBOR_REMOVE_OPERAND, mcET_MONOMIAL, mcMATHLOG, mcTXT, and mcTXTV. |
|
Removes all the mcDivOp using the TransformDivOp function. The comparison function used is mcSymbol::math_isBeforeInOrderListOf. Reimplemented from mcElementArrayHelpers. Definition at line 1445 of file Monomial.cpp. References data_Repair(), math_TransformDivOp(), and mcESR_DONE. |
|
Returns TRUE if this element can be added with the given element. If the function returns TRUE, then the math_Add() function should return one of mcBOR_REMOVE_OPERAND, mcBOR_REPLACE_BOTH or mcBOR_REPLACE_OPERAND. Reimplemented from mcElementArrayHelpers. Definition at line 1470 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElement::math_CanBeAddedWith(), mcElementArray::math_Get(), mcElementArray::math_GetCount(), mcElementArrayHelpers::math_GetCount(), math_isSimilarTo(), and mcET_MONOMIAL. Referenced by math_Add(). |
|
Definition at line 1869 of file Monomial.cpp. References math_GetCoeff(), and math_SetCoeff(). |
|
Converts from data to math index. See #mcElementArrayMath general description for more info. Implements mcElementArrayHelpers. Definition at line 1221 of file Monomial.cpp. References mcElementArrayHelpers::data_CheckIndex(), and mcElementArrayHelpers::data_isOp(). |
|
Returns a new monomial containing the factors non-common to *this and the given monomial.
Definition at line 1710 of file Monomial.cpp. References mcElementArray::data_AddElements(), mcElementArrayHelpers::data_Delete(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetArray(), mcElementArrayHelpers::data_GetCount(), mcElement::data_GetType(), mcElementArrayHelpers::data_MoveElemLeft(), and mcElementArrayHelpers::math_Compare(). |
|
Divides two mcElements of the same type and stores the result in this object.
Implements mcElementHelpers. Definition at line 1598 of file Monomial.cpp. References mcElementArray::data_DeleteAll(), mcFraction::data_GetDen(), mcArrayEntry::data_GetFraction(), mcElementArrayHelpers::math_EmbedInFraction(), mcElementArray::math_WrapMonomial(), mcASSERT, mcBOR_REMOVE_OPERAND, and mcET_MONOMIAL. |
|
math_Adds eventually missing mcMultOp.
Reimplemented from mcElementArrayHelpers. Definition at line 1457 of file Monomial.cpp. References data_Repair(). |
|
|
|
Returns the LCM between *this and the given element.
Implements mcElementHelpers. Definition at line 1883 of file Monomial.cpp. References mcElementArrayHelpers::math_Get(), mcElementArray::math_Get(), mcElementArrayHelpers::math_GetCount(), mcElementArray::math_GetCount(), mcElementArray::math_GetIndexOf(), mcElement::math_GetLCM(), mcElementArray::math_Remove(), mcElement::math_SimpleMultiplyBy(), mcASSERT, mcMATHLOG, mcTXT, and mcTXTTHIS. |
|
Returns the maximum degree of the given symbol for this monomial. If this monomial does not contain the given symbol, then the return value is zero; if this monomial contains a mcSymbol linked with the given mcSymbolProperties but not containing a simple mcNumber, then the return value is mcIntegerValue::pNAN. Definition at line 1338 of file Monomial.cpp. References mcSymbol::data_isLinkedWith(), mcIntegerValue::GetMax(), mcIntegerValue::GetStr(), mcValue::isValid(), mcElementHelpers::math_Find(), mcExpElement::math_GetConstExp(), mcElementHelpers::math_GetCountOf(), mcElementArray::math_GetWrappedNumber(), mcASSERT, mcEmptyElement, mcMATHLOG, mcTXT, and mcTXTTHIS. Referenced by math_GetMaxDegreeForSymbolArray(). |
|
Returns the sum of the maximum degrees for all the symbols in the given array.
Definition at line 1373 of file Monomial.cpp. References mcElementArrayHelpers::data_GetCount(), and math_GetMaxDegreeFor(). Referenced by math_GetOrderPos(). |
|
Implements mcElementArrayHelpers. Definition at line 291 of file Monomial.h. References mcET_MULTOP. |
|
Implements mcElementArrayHelpers. Definition at line 292 of file Monomial.h. |
|
Computes a value which is used to reorder this monomial.
Implements mcElementHelpers. Definition at line 1315 of file Monomial.cpp. References mcValue::GetInt(), math_GetMaxDegreeForSymbolArray(), mcMATHLOG, and mcTXTTHIS. |
|
Returns a new mcPolynomial containing *this array. mcPolynomial returns a copy of themselves, mcMonomial returns a mcPolynomial containing itself. Implements mcElementArrayHelpers. Definition at line 1396 of file Monomial.cpp. References mcElementArray::data_AddElements(), and mcElement::data_MakePrivateCopy(). |
|
Handles a little mcMonomial-specific exception.
Reimplemented from mcElementArrayHelpers. Definition at line 1256 of file Monomial.cpp. References mcElementArrayHelpers::math_HandleExpSimFlag(), mcESR_CHANGE_SIGN, mcESR_DISTRIBUTE, mcESR_REPLACE_THIS, and mcET_POLYNOMIAL. |
|
Returns TRUE if the given monomial can be summed with this monomial; that is, both the two monomials have the same factors which contains symbols or functions.
Definition at line 1624 of file Monomial.cpp. References mcElement::math_Compare(), mcMonomial::math_RemoveCoeff(), mcFIND_NOFLAGS, mcMATHLOG, and mcTXT. Referenced by math_Add(), and math_CanBeAddedWith(). |
|
Converts from math to data index. See #mcElementArrayMath general description for more info. Implements mcElementArrayHelpers. Definition at line 1209 of file Monomial.cpp. References mcElementArrayHelpers::data_GetNonOpElemIndex(), mcElementArrayHelpers::math_GetCount(), mcMATHLOG, and mcTXTTHIS. |
|
Multiplies two mcElements of the same type and stores the result in this object.
Implements mcElementHelpers. Definition at line 1569 of file Monomial.cpp. References mcElementArrayHelpers::data_DeleteAll(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetWrapped(), mcElementArrayHelpers::data_Merge(), data_Repair(), mcASSERT, mcBOR_REMOVE_OPERAND, mcEmptyElement, mcET_MONOMIAL, and mcET_NUMBER. |
|
Reimplemented from mcElementArrayHelpers. Definition at line 1430 of file Monomial.cpp. References mcET_MONOMIAL, and mcEXPSIM_NOFLAGS. |
|
Raises *this element to the given polynomial. Returns mcBOR_INVALID if the operation could not be performed (this is typically because the base is negative), or mcBOR_REMOVE_OPERAND if the operation was okay.
Implements mcElementHelpers. Definition at line 1233 of file Monomial.cpp. References mcElementArrayHelpers::math_Get(), mcElementArrayHelpers::math_GetCount(), mcElement::math_RaiseTo(), mcASSERT, mcBOR_INVALID, mcBOR_REMOVE_OPERAND, mcMATHLOG, mcTXT, and mcTXTTHIS. |
|
Removes all mcDivOp using #TransformDivOp and then removes all remaining mcMultOp from the array.
Definition at line 1672 of file Monomial.cpp. References mcElementArrayHelpers::data_Delete(), mcElementArrayHelpers::data_GetCount(), mcElementArrayHelpers::data_isOp(), mcElementArrayHelpers::data_MoveElemLeft(), and math_TransformDivOp(). Referenced by math_Add(), and math_Reorder(). |
|
Definition at line 1688 of file Monomial.cpp. References mcElementArrayHelpers::data_Get(), mcElementHelpers::data_GetType(), mcElementHelpers::math_ContainsUnknowns(), mcElementArrayHelpers::math_Get(), mcElementArrayHelpers::math_GetCount(), mcElementArrayHelpers::math_Remove(), and mcET_NUMBER. Referenced by math_SetCoeff(). |
|
Reorders the elements contained in this monomial collapsing all the elements which can be simplified and reordering them. The function puts the element in this order:
VERY IMPORTANT: this function can be called only if mcDivOp are not present in the array. Implements mcElementArrayHelpers. Definition at line 1297 of file Monomial.cpp. References mcElementArrayHelpers::data_GetArray(), mcElementArrayHelpers::data_GetCount(), mcElementArrayHelpers::data_GetNumOfElemType(), data_Repair(), math_RemoveAllOp(), mcElementArrayHelpers::math_ReorderElements(), mcASSERT, mcESR_DONE, mcESR_NOTFINISHED, and mcET_DIVOP. |
|
Definition at line 1841 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetCount(), mcElementHelpers::data_GetType(), math_RemoveCoeff(), and mcET_NUMBER. Referenced by math_Abs(), math_Add(), math_ChangeCoeffSign(), and math_SimplifyCoeff(). |
|
|
Using the mcElement::math_MakeReciprocal function, replaces mcDivOp with mcMultOp and then transform the element(s) following it in their reciprocals. A fast and safe way to remove mcDivOps. Definition at line 1648 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::data_AddNewOp(), mcElementArrayHelpers::data_Get(), mcElementArrayHelpers::data_GetCount(), mcElementHelpers::data_GetType(), mcElement::math_MakeReciprocal(), mcEmptyElement, mcET_DIVOP, and mcET_MULTOP. Referenced by math_BeginSimSteps(), and math_RemoveAllOp(). |
|
Implements mcElementArrayHelpers. Definition at line 1410 of file Monomial.cpp. References mcElementArrayHelpers::data_DeepCopy(), mcElementArrayHelpers::mcArrayEntry, and mcASSERT. |
|
Implements mcElementArrayHelpers. Definition at line 1421 of file Monomial.cpp. References mcElementArrayHelpers::data_AddElements(), mcElementArrayHelpers::mcArrayEntry, mcASSERT, mcET_MONOMIAL, and mcET_POLYNOMIAL. |
|
|
|
If TRUE, when a monomial which doesn' contain an empty box, is deleted, then it is replaced with a monomial containing an empty box. If FALSE, the monomial is immediately deleted with his previous operator. Definition at line 70 of file Monomial.cpp. Referenced by gui_BackInput(). |
|
If TRUE, when the user edits the contents of a mcMonomial class, all mcSymbol sequences are automatically scanned searching for function names; for example, if three mcSymbol containing "s", wxT("i"), "n" are found to be contiguos or separated only by mcMultOps, then those three mcSymbol are replaced by a mcFunction representing the SIN function.
Definition at line 71 of file Monomial.cpp. Referenced by gui_Input(). |
|
If TRUE, when the user creates a mcDivOp, all the factors which are placed *before* the operator, become the numerator of a new fraction whose denominator are the elements placed *after* the operator. The new fraction then replaces the entire content of this element. Definition at line 72 of file Monomial.cpp. Referenced by gui_AddNewElement(). |
|
A value that, divided by the exponent depth of this element, gives the number of pixels to leave between all elements.
Definition at line 65 of file Monomial.cpp. |
|
If TRUE, just *after* (see io_PostProcess) each import process, all the div ops will be converted to fractions using mcMonomial::data_TransformDivOp().
Definition at line 73 of file Monomial.cpp. Referenced by io_PostProcess(). |
|
Definition at line 67 of file Monomial.cpp. Referenced by math_GetGCD(). |
|
Definition at line 68 of file Monomial.cpp. |
[ Top ] |