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

mcSystemStepArray Class Reference

#include <Solver.h>

Inheritance diagram for mcSystemStepArray:

Inheritance graph
[legend]
Collaboration diagram for mcSystemStepArray:

Collaboration graph
[legend]
List of all members.

Detailed Description

An array of mcMathOrSystem objects used to store the 'steps' created by mcSolver-derived classes.

Definition at line 317 of file Solver.h.

Public Member Functions

 mcSystemStepArray (long flags=mcSYSTEMSTEPARR_NOFLAGS)
virtual ~mcSystemStepArray ()
int math_RemoveIdenticSteps ()
 Removes those contiguos (i.e.
int math_RemoveSimpleSteps ()
 Removes from the array those contiguos steps which differ from the previous ones for a too small lenght, where the lenght is computed through the mcMathOrSystem::math_GetLenght() function and the threshold used is mcMathCore::GetThreshold().
void data_AddSys (mcMathOrSystem *pointer)
 A specialized version of mcAbstractArray::math_Add.
void data_AddFinalSys (mcMathOrSystem *pointer)
 Works like data_AddSys() but in the case that the mcSYSTEMSTEPARR_DISCARD_SIMPLE flag is set, this function forces anyway the addition of the given pointer.
void data_AddSysOnlyIfComplexEnough (mcMathOrSystem *pointer)
 A "smart" version of data_AddSys(): before adding to the array the given mcMathOrSystem object, it checks if it is considered too "simple" to be added comparing it with the previous one.
void data_AddLine (const mcMathLine &p)
 Adds a *copy* given mcMathLine into a new empty mcMathOrSystem using the data_AddSys function.
void data_AddKeyLine (const mcMathLine &p)
 Works like data_AddLine but in the case that the mcSYSTEMSTEPARR_DISCARD_SIMPLE flag is set, this function forces anyway the addition of the given pointer.
void data_AddLineOnlyIfComplexEnough (const mcMathLine &p)
 Like data_AddLine but uses the data_AddSysOnlyIfComplexEnough() function.
void data_MergeSystems (mcSystemStepArray &, int i)
 Merges the given array of mcMathOrSystem.
void data_Check () const
 Checks all the steps contained in the array.
const mcMathOrSystemdata_Get (int n) const
mcMathOrSystemdata_Get (int n)
const mcMathOrSystemdata_GetLast () const
mcMathOrSystemdata_GetLast ()
void math_AppendCombinationOf (const mcSystemStepArray &arr1, const mcSystemStepArray &arr2, mcLogicOperator lo)
 Calls the mcMathOrSystem::math_AndMerge function (when lo == mcLO_AND) or mcMathOrSystem::math_OrMerge (when lo == mcLO_OR), on each i-th step of the first array with each i-th step of the second array, and then appends the result to this array.
wxString io_GetInlinedExpr () const
 Returns a wxString containing the inlined expressions which describe the system.

Protected Member Functions

void data_Delete (int n)
 Deletes the n-th step of this array.

Protected Attributes

long m_nFlags
 Holds some info about array management.


Constructor & Destructor Documentation

mcSystemStepArray::mcSystemStepArray long  flags = mcSYSTEMSTEPARR_NOFLAGS  )  [inline]
 

Definition at line 331 of file Solver.h.

References m_nFlags.

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

Definition at line 332 of file Solver.h.

References mcAbstractArray::data_Clear().


Member Function Documentation

void mcSystemStepArray::data_AddFinalSys mcMathOrSystem pointer  ) 
 

Works like data_AddSys() but in the case that the mcSYSTEMSTEPARR_DISCARD_SIMPLE flag is set, this function forces anyway the addition of the given pointer.

Definition at line 410 of file Solver.cpp.

References mcAbstractArray::data_Add().

void mcSystemStepArray::data_AddKeyLine const mcMathLine p  ) 
 

Works like data_AddLine but in the case that the mcSYSTEMSTEPARR_DISCARD_SIMPLE flag is set, this function forces anyway the addition of the given pointer.

This function should be used only to add the *key* steps: those passages which must be absolutely retained...

Definition at line 390 of file Solver.cpp.

References mcAbstractArray::data_Add(), and mcMathOrSystem::data_AddLineToLastAndSystem().

void mcSystemStepArray::data_AddLine const mcMathLine p  ) 
 

Adds a *copy* given mcMathLine into a new empty mcMathOrSystem using the data_AddSys function.

Definition at line 375 of file Solver.cpp.

References mcAbstractArray::data_Add(), data_AddLineOnlyIfComplexEnough(), mcMathOrSystem::data_AddLineToLastAndSystem(), m_nFlags, and mcSYSTEMSTEPARR_DISCARD_SIMPLE.

Referenced by mcPolySolver::math_SolveLineSecondDegree().

void mcSystemStepArray::data_AddLineOnlyIfComplexEnough const mcMathLine p  ) 
 

Like data_AddLine but uses the data_AddSysOnlyIfComplexEnough() function.

Definition at line 413 of file Solver.cpp.

References mcMathOrSystem::data_AddLineToLastAndSystem(), and data_AddSysOnlyIfComplexEnough().

Referenced by data_AddLine().

void mcSystemStepArray::data_AddSys mcMathOrSystem pointer  ) 
 

A specialized version of mcAbstractArray::math_Add.

Definition at line 399 of file Solver.cpp.

References mcAbstractArray::data_Add(), data_AddSysOnlyIfComplexEnough(), m_nFlags, and mcSYSTEMSTEPARR_DISCARD_SIMPLE.

void mcSystemStepArray::data_AddSysOnlyIfComplexEnough mcMathOrSystem pointer  ) 
 

A "smart" version of data_AddSys(): before adding to the array the given mcMathOrSystem object, it checks if it is considered too "simple" to be added comparing it with the previous one.

If it results too simple, it is deleted; otherwise, it is added to the array normally.

Definition at line 422 of file Solver.cpp.

References mcAbstractArray::data_Add(), data_Get(), mcAbstractArray::data_GetCount(), and mcElement::math_GetTotalLenght().

Referenced by data_AddLineOnlyIfComplexEnough(), and data_AddSys().

void mcSystemStepArray::data_Check  )  const
 

Checks all the steps contained in the array.

Reimplemented from mcAbstractArray.

Definition at line 501 of file Solver.cpp.

References mcElement::data_Check(), mcAbstractArray::data_Check(), data_Get(), and mcAbstractArray::data_GetCount().

Referenced by math_RemoveSimpleSteps().

void mcSystemStepArray::data_Delete int  n  )  [protected, virtual]
 

Deletes the n-th step of this array.

Implements mcAbstractArray.

Definition at line 508 of file Solver.cpp.

References data_Get().

mcMathOrSystem* mcSystemStepArray::data_Get int  n  )  [inline]
 

Definition at line 396 of file Solver.h.

References mcAbstractArray::data_GetItem().

const mcMathOrSystem* mcSystemStepArray::data_Get int  n  )  const [inline]
 

Definition at line 394 of file Solver.h.

References mcAbstractArray::data_GetItem().

Referenced by data_AddSysOnlyIfComplexEnough(), data_Check(), data_Delete(), data_GetLast(), io_GetInlinedExpr(), math_RemoveIdenticSteps(), and math_RemoveSimpleSteps().

mcMathOrSystem* mcSystemStepArray::data_GetLast  )  [inline]
 

Definition at line 400 of file Solver.h.

References data_Get(), and mcAbstractArray::data_GetCount().

const mcMathOrSystem* mcSystemStepArray::data_GetLast  )  const [inline]
 

Definition at line 398 of file Solver.h.

References data_Get(), and mcAbstractArray::data_GetCount().

void mcSystemStepArray::data_MergeSystems mcSystemStepArray ,
int  i
 

Merges the given array of mcMathOrSystem.

wxString mcSystemStepArray::io_GetInlinedExpr  )  const
 

Returns a wxString containing the inlined expressions which describe the system.

Definition at line 514 of file Solver.cpp.

References data_Get(), mcAbstractArray::data_GetCount(), and mcElement::io_GetInlinedExpr().

void mcSystemStepArray::math_AppendCombinationOf const mcSystemStepArray arr1,
const mcSystemStepArray arr2,
mcLogicOperator  lo
 

Calls the mcMathOrSystem::math_AndMerge function (when lo == mcLO_AND) or mcMathOrSystem::math_OrMerge (when lo == mcLO_OR), on each i-th step of the first array with each i-th step of the second array, and then appends the result to this array.

Definition at line 528 of file Solver.cpp.

References mcAbstractArray::data_Add(), mcMathSystem::data_Get(), mcMathSystem::data_GetCount(), mcMathOrSystem::math_AndMerge(), mcMathOrSystem::math_OrMerge(), mcASSERT, mcLO_AND, mcLO_OR, mcMATHLOG, mcMAX, and mcTXT.

Referenced by mcPolySolver::math_SolveLineSecondDegree().

int mcSystemStepArray::math_RemoveIdenticSteps  ) 
 

Removes those contiguos (i.e.

one after the other in the array order) steps which result to be identical through the mcMathOrSystem::math_Compare function.

Returns:
The number of steps removed from the array.

Definition at line 441 of file Solver.cpp.

References data_Get(), mcAbstractArray::data_GetCount(), and mcAbstractArray::data_RemoveAt().

int mcSystemStepArray::math_RemoveSimpleSteps  ) 
 

Removes from the array those contiguos steps which differ from the previous ones for a too small lenght, where the lenght is computed through the mcMathOrSystem::math_GetLenght() function and the threshold used is mcMathCore::GetThreshold().

Returns:
The number of steps removed from the array.

Definition at line 466 of file Solver.cpp.

References data_Check(), data_Get(), mcAbstractArray::data_GetCount(), mcAbstractArray::data_RemoveAt(), and mcElement::math_GetTotalLenght().


Member Data Documentation

long mcSystemStepArray::m_nFlags [protected]
 

Holds some info about array management.

E.g. see mcSYSTEMSTEPARR_DISCARD_SIMPLE.

Definition at line 324 of file Solver.h.

Referenced by data_AddLine(), data_AddSys(), and mcSystemStepArray().


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

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

[ Top ]