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

mcPolySolver Class Reference

#include <PolySolver.h>

Inheritance diagram for mcPolySolver:

Inheritance graph
[legend]
Collaboration diagram for mcPolySolver:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class for the polynomial solvers.

The classes derived from this one, are able to isolate the unknowns from equations which can be written in this form:

a_1*x^n + a_2*x^(n-1) + a_3*x^(n-2) ..... + a_n*x^0 = 0

Definition at line 60 of file PolySolver.h.

Public Member Functions

 mcPolySolver ()
virtual ~mcPolySolver ()
bool math_SolveLine (mcMathLine &p, const mcSymbolProperties *unk, mcSystemStepArray &)
 Prepares the given line for real solving, determines the degree of the given symbol and calls the right solver for the supported equations degrees.
bool math_SolveLineFirstDegree (mcMathLine &p, const mcSymbolProperties *unk, mcSystemStepArray &steps)
 Solves equations of the first degree.
bool math_SolveLineSecondDegree (mcMathLine &p, const mcSymbolProperties *unk, mcSystemStepArray &steps)
 Solves equations of the second degree.
bool math_WorksOn (const mcMathOrSystem &m) const
 Checks that the given data contains a polynomial equation.
void math_FindPolyCoeff (const mcMathLine &data, const mcSymbolProperties *unk, int n)
 Fills the m_pCoeff array with the coefficient for the unk symbol, up to the n-th degree.
void math_GetPolyCoeff (mcMathLine &p, const mcSymbolProperties *unk, mcSystemStepArray &steps)
 A powerful version of math_FindPolyCoeff: simplifies, moves the data and calls automatically math_FindPolyCoeff.
bool math_isReady () const
 A mcPolySolver is always ready to work...
wxPanel * gui_GetOptionsPanel () const
 A mcPolySolver does not need any special setting.

Protected Member Functions

void math_ResetCoeffArr ()
void math_DeleteCoeffArr ()

Protected Attributes

mcMonomial m_pCoeff [mcPOLYSOLVER_MAXDEGREE]
 The array of the coefficients of the unknowns.


Constructor & Destructor Documentation

mcPolySolver::mcPolySolver  ) 
 

Definition at line 73 of file PolySolver.cpp.

References math_ResetCoeffArr(), and mcST_POLYNOMIAL.

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

Definition at line 77 of file PolySolver.h.

References math_DeleteCoeffArr().


Member Function Documentation

wxPanel* mcPolySolver::gui_GetOptionsPanel  )  const [inline, virtual]
 

A mcPolySolver does not need any special setting.

Implements mcSolver.

Definition at line 111 of file PolySolver.h.

void mcPolySolver::math_DeleteCoeffArr  )  [protected]
 

Definition at line 91 of file PolySolver.cpp.

References math_ResetCoeffArr().

Referenced by math_FindPolyCoeff(), math_SolveLine(), and ~mcPolySolver().

void mcPolySolver::math_FindPolyCoeff const mcMathLine data,
const mcSymbolProperties unk,
int  n
 

Fills the m_pCoeff array with the coefficient for the unk symbol, up to the n-th degree.

Definition at line 161 of file PolySolver.cpp.

References m_pCoeff, and math_DeleteCoeffArr().

Referenced by math_GetPolyCoeff(), and math_SolveLineSecondDegree().

void mcPolySolver::math_GetPolyCoeff mcMathLine p,
const mcSymbolProperties unk,
mcSystemStepArray steps
 

A powerful version of math_FindPolyCoeff: simplifies, moves the data and calls automatically math_FindPolyCoeff.

Definition at line 175 of file PolySolver.cpp.

References mcElement::data_Check(), mcSolver::math_DoCompleteSimplification(), math_FindPolyCoeff(), mcEmptyPolynomial, mcEXPSIM_KEEP_FACTORIZATION, mcEXPSIM_NOFLAGS, mcMATHLOG, and mcPOLYSOLVLOG.

Referenced by math_SolveLineFirstDegree().

bool mcPolySolver::math_isReady  )  const [inline, virtual]
 

A mcPolySolver is always ready to work...

Implements mcSolver.

Definition at line 108 of file PolySolver.h.

void mcPolySolver::math_ResetCoeffArr  )  [protected]
 

Definition at line 85 of file PolySolver.cpp.

References m_pCoeff, mcEmptyElement, and mcPOLYSOLVER_MAXDEGREE.

Referenced by math_DeleteCoeffArr(), and mcPolySolver().

bool mcPolySolver::math_SolveLine mcMathLine p,
const mcSymbolProperties unk,
mcSystemStepArray
[virtual]
 

Prepares the given line for real solving, determines the degree of the given symbol and calls the right solver for the supported equations degrees.

Implements mcSolver.

Definition at line 113 of file PolySolver.cpp.

References mcValue::GetInt(), mcValue::isValid(), math_DeleteCoeffArr(), math_SolveLineFirstDegree(), math_SolveLineSecondDegree(), mcASSERT, mcLOG, mcMATHLOG, mcPOLYSOLVER_MAXDEGREE, mcTXT, and mcTXTP.

bool mcPolySolver::math_SolveLineFirstDegree mcMathLine p,
const mcSymbolProperties unk,
mcSystemStepArray steps
 

Solves equations of the first degree.

Definition at line 225 of file PolySolver.cpp.

References m_pCoeff, mcSolver::math_DoCompleteSimplification(), math_GetPolyCoeff(), mcElement::math_SimpleDivideBy(), mcEmptyMonomial, mcEXPSIM_NOFLAGS, mcPOLYSOLVLOG, and mcTXT.

Referenced by math_SolveLine(), and math_SolveLineSecondDegree().

bool mcPolySolver::math_SolveLineSecondDegree mcMathLine p,
const mcSymbolProperties unk,
mcSystemStepArray steps
 

Solves equations of the second degree.

Definition at line 254 of file PolySolver.cpp.

References mcSystemStepArray::data_AddLine(), mcMathOrSystem::data_AddLineToNewAndSystem(), mcMathOrSystem::data_AddSys(), mcElement::data_Check(), mcElementArray::data_DeleteAll(), mcMathMng::data_GetRightMem(), m_pCoeff, mcSystemStepArray::math_AppendCombinationOf(), mcPolynomial::math_ChangeAllSigns(), mcSolver::math_DoCompleteSimplification(), math_FindPolyCoeff(), mcPolynomial::math_GetIndexOf(), mcPolynomial::math_GetMonomialIdxFromEntry(), mcElementArray::math_Remove(), mcElement::math_SimpleRaiseTo(), math_SolveLineFirstDegree(), mcSolver::math_SplitInTwoEquations(), mcElementArray::math_WrapSymbol(), mcASSERT, mcEmptyMonomial, mcEmptyPolynomial, mcEXPSIM_KEEP_FACTORIZATION, mcEXPSIM_NOFLAGS, mcLO_OR, mcMATHLOG, mcPOLYSOLVLOG, and mcTXT.

Referenced by math_SolveLine().

bool mcPolySolver::math_WorksOn const mcMathOrSystem m  )  const [virtual]
 

Checks that the given data contains a polynomial equation.

Implements mcSolver.

Definition at line 98 of file PolySolver.cpp.

References mcMathType::m_tMath1, mcMathType::m_tMath2, mcElement::math_GetMathType(), mcMSTL1_EQUATIONS, mcMTL1_POLYNOMIAL, and mcMTL2_ALGEBRAIC.


Member Data Documentation

mcMonomial mcPolySolver::m_pCoeff[mcPOLYSOLVER_MAXDEGREE] [protected]
 

The array of the coefficients of the unknowns.

The m_pCoeff[0] entry contains the coefficient of #m_pCurrUnk raised to one.

Definition at line 67 of file PolySolver.h.

Referenced by math_FindPolyCoeff(), math_ResetCoeffArr(), math_SolveLineFirstDegree(), and math_SolveLineSecondDegree().


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

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

[ Top ]