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

ElementArray.cpp File Reference


Detailed Description

Implements the mcFilter, mcElementArray, mcElementArrayData mcElementArrayGUI, mcElementArrayIO, mcElementArrayMath classes.

Author:
Francesco Montorsi
Date:
26-7-2003

Definition in file ElementArray.cpp.

#include "mc/mcprec.h"
#include "mc/MathUtils.h"
#include "mc/ElementArray.h"
#include "mc/Polynomial.h"
#include "mc/Monomial.h"
#include "mc/EmptyBox.h"
#include "mc/Number.h"
#include "mc/Bracket.h"
#include "mc/Fraction.h"
#include "mc/Symbol.h"
#include "mc/Radical.h"

Include dependency graph for ElementArray.cpp:

Go to the source code of this file.

Defines

#define SCAN_ARRAY_COUNTING(do_check)
#define SCAN_ARRAY_SEARCHING(do_check)
#define RETURN_ELEM_FROM_INDEX(idx_func, cast)
#define mcIMPLEMENT_EXPSIM_FUNCTION(x, y, cond)
#define SIMCHECK_EXIT   if (ret != mcESR_DONE) { math_EndSimSteps(); return ret; }
#define EXPCHECK_EXIT   if (ret != mcESR_DONE) { math_EndExpSteps(); return ret; }

Functions

 mcIMPLEMENT_ABSTRACT_CLASS (mcElementArray, mcElement)
 mcIMPLEMENT_EXPSIM_FUNCTION (math_SimplifyAll, math_Simplify, 0) mcIMPLEMENT_EXPSIM_FUNCTION(math_SimplifyExp
 math_SimplifyNeedExp (flags, i)) bool mcElementArrayHelpers
 mcIMPLEMENT_EXPSIM_FUNCTION (math_ExpandAll, math_Expand, 0) mcExpSimRes mcElementArrayHelpers

Variables

mcArrayEntry mcEmptyArrayEntry (NULL,-1)
 math_Expand


Define Documentation

#define EXPCHECK_EXIT   if (ret != mcESR_DONE) { math_EndExpSteps(); return ret; }
 

Referenced by mcIMPLEMENT_EXPSIM_FUNCTION().

#define mcIMPLEMENT_EXPSIM_FUNCTION x,
y,
cond   ) 
 

Definition at line 2244 of file ElementArray.cpp.

#define RETURN_ELEM_FROM_INDEX idx_func,
cast   ) 
 

Value:

int i;          \
 if ((i=idx_func) != -1)      \
  return (cast)data_Get(i);    \
            \
 /* no elements of type t found */   \
 return (cast)mcEmptyElement;

Definition at line 604 of file ElementArray.cpp.

Referenced by mcElementArrayHelpers::data_GetElemOfType(), mcElementArrayHelpers::data_GetNonOpElem(), and mcElementArrayHelpers::data_GetOp().

#define SCAN_ARRAY_COUNTING do_check   ) 
 

Value:

int n=0;           \
 for (int i=0; i < data_GetCount(); i++)    \
  if (do_check) n++; /* found a valid entry */ \
 return n;

Definition at line 549 of file ElementArray.cpp.

Referenced by mcElementArrayHelpers::data_GetNumOfElemType(), and mcElementArrayHelpers::data_GetOpCount().

#define SCAN_ARRAY_SEARCHING do_check   ) 
 

Value:

/* PLEASE NOTE THAT WE MUST ALWAYS START FROM -1: */ \
 /* IN THIS WAY THE PARAMETER n MUST BE EXPRESSED */  \
 /* AS ZERO-BASED */          \
 int occurrence=-1;          \
               \
 /* scan the array searching for an element of */  \
 /* type t; then check if it matches what we are */  \
 /* searching.... */          \
 for (int i=0; i < data_GetCount(); i++) {    \
  if (do_check) {          \
   occurrence++;         \
   if (n == occurrence)       \
    return i;         \
  }             \
 }              \
               \
 /* we couldn't find the required occurence */   \
 return -1;

Definition at line 566 of file ElementArray.cpp.

Referenced by mcElementArrayHelpers::data_GetElemIndexOfType(), mcElementArrayHelpers::data_GetNonOpElemIndex(), and mcElementArrayHelpers::data_GetOpIndex().

#define SIMCHECK_EXIT   if (ret != mcESR_DONE) { math_EndSimSteps(); return ret; }
 

Referenced by mcElementArrayHelpers::math_Simplify().


Function Documentation

math_SimplifyNeedExp flags  ,
 

Definition at line 2311 of file ElementArray.cpp.

References mcElement::math_ContainsSymbols(), and mcEXPSIM_KEEP_FACTORIZATION.

mcIMPLEMENT_ABSTRACT_CLASS mcElementArray  ,
mcElement 
 

mcIMPLEMENT_EXPSIM_FUNCTION math_ExpandAll  ,
math_Expand  ,
 

Definition at line 2531 of file ElementArray.cpp.

References EXPCHECK_EXIT, mcESR_DONE, mcMATHLOG, and mcTXTTHIS.

mcIMPLEMENT_EXPSIM_FUNCTION math_SimplifyAll  ,
math_Simplify  ,
 


Variable Documentation

math_Expand
 

Definition at line 2310 of file ElementArray.cpp.

Referenced by mcElementArrayHelpers::math_Expand().

mcArrayEntry mcEmptyArrayEntry(NULL,-1)
 

Referenced by mcPolynomialHelpers::math_GetIndexOf().



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

[ Top ]