Isis Developer Reference
|
Provides a calculator for inline equations. More...
#include <InlineCalculator.h>
Public Member Functions | |
InlineCalculator () | |
Constructs an InlineCalculator object by initializing the operator lookup list. | |
InlineCalculator (const QString &equation) | |
Constructs an InlineCalculator object by initializing the operator lookup list and compiles the given equation to prepare for evaluation. | |
virtual | ~InlineCalculator () |
Destroys the InlineCalculator object. | |
int | size () const |
Accesses the number of functions, operators, variables, and scalars to be executed. | |
QString | equation () const |
Accesses the string representation of the current equation, in postfix format. | |
bool | compile (const QString &equation) |
Compiles the given equation for evaluation. | |
QVector< double > | evaluate (CalculatorVariablePool *variablePool) |
Evaluate with a variable pool. | |
QVector< double > | evaluate () |
Evaluate compiled equation with existing variable pool. | |
void | Negative () |
Pops an element, negates it, then pushes the result. | |
void | Multiply () |
Pops two elements, multiplies them, then pushes the product on the stack. | |
void | Add () |
Pops two elements, adds them, then pushes the sum on the stack. | |
void | Subtract () |
Pops two elements, subtracts them, then pushes the difference on the stack. | |
void | Divide () |
Pops two, divides them, then pushes the quotient on the stack. | |
void | Modulus () |
Pops two elements, mods them, then pushes the result on the stack. | |
void | Exponent () |
Pops two elements, computes the power then pushes the result on the stack The exponent has to be a scalar. | |
void | SquareRoot () |
Pop an element, compute its square root, then push the root on the stack. | |
void | AbsoluteValue () |
Pop an element, compute its absolute value, then push the result on the stack. | |
void | Log () |
Pop an element, compute its log, then push the result on the stack. | |
void | Log10 () |
Pop an element, compute its base 10 log, then push the result on the stack. | |
void | LeftShift () |
Pop the top element, then perform a left shift with zero fill. | |
void | RightShift () |
Pop the top element, then perform a right shift with zero fill. | |
void | MinimumPixel () |
Pop two elements, then push the minimum on a pixel by pixel basis back on the stack. | |
void | MaximumPixel () |
Pop two elements, then push the maximum on a pixel by pixel basis back on the stack. | |
void | MinimumLine () |
Pop one element, then push the minimum on the stack. | |
void | MaximumLine () |
Pop one element, then push the maximum on the stack. | |
void | Minimum2 () |
Not implemented in Calculator.cpp. | |
void | Maximum2 () |
Not implemented in Calculator.cpp. | |
void | GreaterThan () |
Pop two elements off the stack and compare them to see where one is greater than the other, then push the results on the stack. | |
void | LessThan () |
Pop two elements off the stack and compare them to see where one is less than the other, then push the results on the stack. | |
void | Equal () |
Pop two elements off the stack and compare them to see where one is equal to the other, then push the results on the stack. | |
void | LessThanOrEqual () |
Pop two elements off the stack and compare them to see where one is less than or equal to the other, then push the results on the stack. | |
void | GreaterThanOrEqual () |
Pop two elements off the stack and compare them to see where one is greater than or equal to the other, then push the results on the stack. | |
void | NotEqual () |
Pop two elements off the stack and compare them to see where one is not equal to the other, then push the results on the stack. | |
void | And () |
Pop two elements, AND them, then push the result on the stack. | |
void | Or () |
Pop two elements, OR them, then push the result on the stack. | |
void | Sine () |
Pops one element and push the sine. | |
void | Cosine () |
Pops one element and push the cosine. | |
void | Tangent () |
Pops one element and push the tangent. | |
void | Secant () |
Pops one element and push the secant. | |
void | Cosecant () |
Pops one element and push the cosecant. | |
void | Cotangent () |
Pops one element and push the cotangent. | |
void | Arcsine () |
Pops one element and push the arcsine. | |
void | Arccosine () |
Pops one element and push the arccosine. | |
void | Arctangent () |
Pops one element and push the arctangent. | |
void | Arctangent2 () |
Pops two elements and push the arctangent. | |
void | SineH () |
Pops one element and push the hyperbolic sine. | |
void | CosineH () |
Pops one element and push the hyperbolic cosine. | |
void | TangentH () |
Pops one element and push the hyperbolic tangent. | |
void | ArcsineH () |
Pops one element and push the inverse hyperbolic sine. | |
void | ArccosineH () |
Pops one element and push the inverse hyperbolic cosine. | |
void | ArctangentH () |
Pops one element and push the inverse hyperbolic tangent. | |
void | Push (double scalar) |
Push a scalar onto the stack. | |
void | Push (Buffer &buff) |
Push a buffer onto the stack. | |
void | Push (QVector< double > &vect) |
Push a vector onto the stack. | |
QVector< double > | Pop (bool keepSpecials=false) |
Pop an element off the stack. | |
void | PrintTop () |
Print the vector at the top of the stack. | |
bool | Empty () |
Check if the stack is empty. | |
virtual void | Clear () |
Clear out the stack. | |
Protected Types | |
typedef FxBinder * | FxTypePtr |
Defintion for a FxTypePtr, a pointer to a function binder (FxBinder) | |
Protected Member Functions | |
void | scalar (const QVariant &scalar) |
Pushes the given value onto the stack as a scalar. | |
void | variable (const QVariant &variable) |
Pushes the given value onto the stack as a variable. | |
void | floatModulus () |
Pops the top two vectors off the current stack and performs the floatModulusOperator() on the corresponding components of these vectors. | |
void | radians () |
Pops the top vector off the current stack and converts from degrees to radians. | |
void | degrees () |
Pops the top vector off the current stack and converts from radians to degrees. | |
void | logicalOr () |
Pops the top two vectors off the current stack and performs a logical or on each pair. | |
void | logicalAnd () |
Pops the top two vectors off the current stack and performs a logical and on each pair. | |
void | pi () |
Pushes the PI constant onto the current stack. | |
void | eConstant () |
Pushes the Euler constant (e) onto the current stack. | |
virtual QString | toPostfix (const QString &equation) const |
Converts the given string from infix to postfix format. | |
bool | isScalar (const QString &scalar) |
Determines whether the given string contains a scalar value (i.e. | |
bool | isVariable (const QString &str) |
Determines whether the given string is a variable. | |
bool | fxExists (const QString &fxname) const |
Determines whether the given function name exists in the current function pool. | |
FxTypePtr | addFunction (FxTypePtr function) |
Adds a function to the function pool. | |
virtual bool | orphanTokenHandler (const QString &token) |
Default token handler if it is undefined during parsing/compilation. | |
void | PerformOperation (QVector< double > &results, QVector< double >::iterator arg1Start, QVector< double >::iterator arg1End, double operation(double)) |
Performs the mathematical operations on each argument. | |
void | PerformOperation (QVector< double > &results, QVector< double >::iterator arg1Start, QVector< double >::iterator arg1End, QVector< double >::iterator arg2Start, QVector< double >::iterator arg2End, double operation(double, double)) |
Performs the mathematical operation on each pair of arguments, or a set of agruments against a single argument. | |
int | StackSize () |
Returns the current stack size. | |
Provides a calculator for inline equations.
A calculator with the ability to parse infix equations with embedded variables and scalars, known as an inline equation.
|
protected |
Defintion for a FxTypePtr, a pointer to a function binder (FxBinder)
Isis::InlineCalculator::InlineCalculator | ( | ) |
Constructs an InlineCalculator object by initializing the operator lookup list.
Isis::InlineCalculator::InlineCalculator | ( | const QString & | equation | ) |
Constructs an InlineCalculator object by initializing the operator lookup list and compiles the given equation to prepare for evaluation.
equation | A string representing an equation in infix format. |
References compile(), and equation().
|
virtual |
Destroys the InlineCalculator object.
|
inherited |
Pop an element, compute its absolute value, then push the result on the stack.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops two elements, adds them, then pushes the sum on the stack.
References Isis::AddOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Adds a function to the function pool.
Once in the pool, functions cannot be overwritten. This method will throw an exception if we attempt to add a function with the same name as one already in the pool.
function | The function type pointer to be added to the pool |
IException::Programmer | "Function operator exists! Cannot replace existing functions in the pool" |
References _FILEINFO_, and Isis::IException::Programmer.
Referenced by compile().
|
inherited |
Pop two elements, AND them, then push the result on the stack.
References Isis::BitwiseAndOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
inherited |
Pops one element and push the arccosine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the inverse hyperbolic cosine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
inherited |
Pops one element and push the arcsine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the inverse hyperbolic sine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
inherited |
Pops one element and push the arctangent.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops two elements and push the arctangent.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the inverse hyperbolic tangent.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
virtualinherited |
Clear out the stack.
Reimplemented in Isis::CubeCalculator.
Referenced by Isis::CubeCalculator::Clear(), and compile().
bool Isis::InlineCalculator::compile | ( | const QString & | equation | ) |
Compiles the given equation for evaluation.
This method first converts the given infix equation into a postfix equation for evaluation and saves the postfix formatted string. It then ensures that the equation is ready for evaluation by parsing and verifying that all tokens are recognized.
equation | A string representing an equation to be compiled, in infix format. |
IException::User | "Error parsing inline equation. Equation element invalid - token not recognized." |
References _FILEINFO_, addFunction(), Isis::Calculator::Clear(), equation(), isScalar(), isVariable(), orphanTokenHandler(), scalar(), toPostfix(), Isis::IException::User, and variable().
Referenced by InlineCalculator().
|
inherited |
Pops one element and push the cosecant.
References Isis::CosecantOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the cosine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the hyperbolic cosine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the cotangent.
References Isis::CotangentOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Pops the top vector off the current stack and converts from radians to degrees.
The result is then pushed back onto the stack.
References Isis::Calculator::Pop(), Isis::Calculator::Push(), and radians().
|
inherited |
Pops two, divides them, then pushes the quotient on the stack.
References Isis::DivideOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Pushes the Euler constant (e) onto the current stack.
References Isis::E, and Isis::Calculator::Push().
|
inherited |
Check if the stack is empty.
|
inherited |
Pop two elements off the stack and compare them to see where one is equal to the other, then push the results on the stack.
References Isis::EqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
QString Isis::InlineCalculator::equation | ( | ) | const |
Accesses the string representation of the current equation, in postfix format.
This equation is most commonly entered using infix, but it is reformatted to postfix when set.
Referenced by compile(), InlineCalculator(), and toPostfix().
QVector< double > Isis::InlineCalculator::evaluate | ( | ) |
Evaluate compiled equation with existing variable pool.
This executes the operands to provide the result of the equation. The currently stored variable pool, refernenced via variables(), is used to provide the variables utilized in the equation.
This is reentrant and as long as the variable pool is unchanged between succesive calls, they all should return the same result.
IException::Unknown | "Too many operands in the equation." |
References _FILEINFO_, Isis::Calculator::Pop(), Isis::Calculator::StackSize(), and Isis::IException::Unknown.
Referenced by evaluate().
QVector< double > Isis::InlineCalculator::evaluate | ( | CalculatorVariablePool * | variablePool | ) |
Evaluate with a variable pool.
This method accepts a varible resource pool, stores it off for evaluation and then executes the operands to provide the result of the equation. It stores the variable pool for subsequent runs that should yield identical results when operator() is invoked.
variablePool | Keyword resource for variables substituted at run time of the equation |
IException::Programmer | "Calculation with variable pool failed." |
References _FILEINFO_, evaluate(), and Isis::IException::Programmer.
|
inherited |
Pops two elements, computes the power then pushes the result on the stack The exponent has to be a scalar.
Isis::iException::Math |
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Pops the top two vectors off the current stack and performs the floatModulusOperator() on the corresponding components of these vectors.
The result is then pushed back onto the stack.
References Isis::floatModulusOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
protected |
Determines whether the given function name exists in the current function pool.
fxname | A string containing the name of the function we are looking for in the pool. |
|
inherited |
Pop two elements off the stack and compare them to see where one is greater than the other, then push the results on the stack.
References Isis::GreaterThanOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements off the stack and compare them to see where one is greater than or equal to the other, then push the results on the stack.
References Isis::GreaterThanOrEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Determines whether the given string contains a scalar value (i.e.
can be converted to a double precision value).
scalar | A string to be checked. |
References scalar(), and Isis::toDouble().
Referenced by compile(), and isVariable().
|
protected |
Determines whether the given string is a variable.
If the string is empty or scalar, this method returns false. Otherwise, it is assumed to be a variable and this method returns true.
str | A string to be checked. |
References isScalar().
Referenced by compile().
|
inherited |
Pop the top element, then perform a left shift with zero fill.
Isis::iException::Math |
References _FILEINFO_, Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::IException::Unknown.
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements off the stack and compare them to see where one is less than the other, then push the results on the stack.
References Isis::LessThanOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements off the stack and compare them to see where one is less than or equal to the other, then push the results on the stack.
References Isis::LessThanOrEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop an element, compute its log, then push the result on the stack.
Isis::iException::Math |
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop an element, compute its base 10 log, then push the result on the stack.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Pops the top two vectors off the current stack and performs a logical and on each pair.
IException::Unknown | "Failed performing logical and operation, " "input vectors are of differnet lengths." |
References _FILEINFO_, Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::IException::Unknown.
|
protected |
Pops the top two vectors off the current stack and performs a logical or on each pair.
IException::Unknown | "Failed performing logical or operation, " "input vectors are of differnet lengths." |
References _FILEINFO_, Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::IException::Unknown.
|
inherited |
Not implemented in Calculator.cpp.
|
inherited |
Pop one element, then push the maximum on the stack.
References Isis::IsSpecial(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements, then push the maximum on a pixel by pixel basis back on the stack.
References Isis::MaximumOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Not implemented in Calculator.cpp.
|
inherited |
Pop one element, then push the minimum on the stack.
References Isis::IsSpecial(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements, then push the minimum on a pixel by pixel basis back on the stack.
References Isis::MinimumOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops two elements, mods them, then pushes the result on the stack.
References Isis::ModulusOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops two elements, multiplies them, then pushes the product on the stack.
References Isis::MultiplyOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops an element, negates it, then pushes the result.
References Isis::NegateOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements off the stack and compare them to see where one is not equal to the other, then push the results on the stack.
References Isis::NotEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pop two elements, OR them, then push the result on the stack.
References Isis::BitwiseOrOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
|
protectedvirtual |
Default token handler if it is undefined during parsing/compilation.
This method provides the default handling of an undefined token found while compiling an equation. Users may code their own handler that, for example, could provide additional further functionality.
If the virtualized reimplementation is unable to process it, it can throw an exception which will be caught, recorded and compiling will continue until all tokens are processed. If the optional implementation cannot handle it, return false from your version and an exception will be thrown for you.
token | Character representation of the token. This could be an undefined constant, function or soemthing else that occurs in the equation that is not resolved when this is called. |
Referenced by compile().
|
protectedinherited |
Performs the mathematical operations on each argument.
results | [out] The results of the performed operation |
arg1Start | The first argument to have the operation done on |
arg1End | One argument beyond the final argument to have the operation done upon |
operation | The operation to be done on all arguments |
Referenced by Isis::Calculator::AbsoluteValue(), Isis::Calculator::Add(), Isis::Calculator::And(), Isis::Calculator::Arccosine(), Isis::Calculator::ArccosineH(), Isis::Calculator::Arcsine(), Isis::Calculator::ArcsineH(), Isis::Calculator::Arctangent(), Isis::Calculator::Arctangent2(), Isis::Calculator::ArctangentH(), Isis::Calculator::Cosecant(), Isis::Calculator::Cosine(), Isis::Calculator::CosineH(), Isis::Calculator::Cotangent(), Isis::Calculator::Divide(), Isis::Calculator::Equal(), Isis::Calculator::Exponent(), floatModulus(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), Isis::Calculator::MaximumPixel(), Isis::Calculator::MinimumPixel(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), Isis::Calculator::Or(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), and Isis::Calculator::TangentH().
|
protectedinherited |
Performs the mathematical operation on each pair of arguments, or a set of agruments against a single argument.
results | [out] The results of the performed operation |
arg1Start | The first of the primary argument to have the operation done on |
arg1End | One arguement beyond the final primary argument to have the operation done upon |
arg2Start | The first of the secondaty argument to have the operation done on |
arg2End | One arguement beyond the final secondary argument to have the operation done upon |
operation | The operation to be done on all pairs of arguments |
References _FILEINFO_, and Isis::IException::Programmer.
|
protected |
Pushes the PI constant onto the current stack.
References Isis::Calculator::Push().
|
inherited |
Pop an element off the stack.
keepSpecials | If true, special pixels will be preserved; otherwise, they will be mapped to double values |
References _FILEINFO_, Isis::Hrs, Isis::Lrs, Isis::Null, and Isis::IException::Unknown.
Referenced by Isis::Calculator::AbsoluteValue(), Isis::Calculator::Add(), Isis::Calculator::And(), Isis::Calculator::Arccosine(), Isis::Calculator::ArccosineH(), Isis::Calculator::Arcsine(), Isis::Calculator::ArcsineH(), Isis::Calculator::Arctangent(), Isis::Calculator::Arctangent2(), Isis::Calculator::ArctangentH(), Isis::Calculator::Cosecant(), Isis::Calculator::Cosine(), Isis::Calculator::CosineH(), Isis::Calculator::Cotangent(), degrees(), Isis::Calculator::Divide(), Isis::Calculator::Equal(), evaluate(), Isis::Calculator::Exponent(), floatModulus(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LeftShift(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), logicalAnd(), logicalOr(), Isis::Calculator::MaximumLine(), Isis::Calculator::MaximumPixel(), Isis::Calculator::MinimumLine(), Isis::Calculator::MinimumPixel(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), Isis::Calculator::Or(), radians(), Isis::Calculator::RightShift(), Isis::CubeCalculator::runCalculations(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), and Isis::Calculator::TangentH().
|
inherited |
Print the vector at the top of the stack.
|
inherited |
Push a buffer onto the stack.
buff | The buffer that will be pushed on the stack |
References Isis::IsHisPixel(), Isis::IsHrsPixel(), Isis::IsLisPixel(), Isis::IsLrsPixel(), Isis::IsNullPixel(), Isis::IsSpecial(), and Isis::Calculator::Push().
|
inherited |
Push a scalar onto the stack.
scalar | The scalar that will be pushed on the stack |
References Isis::Calculator::Push().
Referenced by Isis::Calculator::AbsoluteValue(), Isis::Calculator::Add(), Isis::Calculator::And(), Isis::Calculator::Arccosine(), Isis::Calculator::ArccosineH(), Isis::Calculator::Arcsine(), Isis::Calculator::ArcsineH(), Isis::Calculator::Arctangent(), Isis::Calculator::Arctangent2(), Isis::Calculator::ArctangentH(), Isis::Calculator::Cosecant(), Isis::Calculator::Cosine(), Isis::Calculator::CosineH(), Isis::Calculator::Cotangent(), degrees(), Isis::Calculator::Divide(), eConstant(), Isis::Calculator::Equal(), Isis::Calculator::Exponent(), floatModulus(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LeftShift(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), logicalAnd(), logicalOr(), Isis::Calculator::MaximumLine(), Isis::Calculator::MaximumPixel(), Isis::Calculator::MinimumLine(), Isis::Calculator::MinimumPixel(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), Isis::Calculator::Or(), pi(), Isis::Calculator::Push(), Isis::Calculator::Push(), radians(), Isis::Calculator::RightShift(), Isis::CubeCalculator::runCalculations(), scalar(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), Isis::Calculator::TangentH(), and variable().
|
inherited |
Push a vector onto the stack.
vect | The vector that will be pushed on the stack |
|
protected |
Pops the top vector off the current stack and converts from degrees to radians.
The result is then pushed back onto the stack.
References Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by degrees().
|
inherited |
Pop the top element, then perform a right shift with zero fill.
Isis::iException::Math |
References _FILEINFO_, Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::IException::Unknown.
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protected |
Pushes the given value onto the stack as a scalar.
This method adds the given variant value to the stack as a scalar.
scalar | QVariant containing the scalar. Usually a QString. |
References Isis::Calculator::Push(), scalar(), and Isis::toDouble().
Referenced by compile(), isScalar(), and scalar().
|
inherited |
Pops one element and push the secant.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::SecantOperator().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the sine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the hyperbolic sine.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
int Isis::InlineCalculator::size | ( | ) | const |
Accesses the number of functions, operators, variables, and scalars to be executed.
|
inherited |
Pop an element, compute its square root, then push the root on the stack.
Isis::iException::Math |
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protectedinherited |
Returns the current stack size.
Get the current stack size.
Referenced by evaluate(), and Isis::CubeCalculator::runCalculations().
|
inherited |
Pops two elements, subtracts them, then pushes the difference on the stack.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::SubtractOperator().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the tangent.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
inherited |
Pops one element and push the hyperbolic tangent.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by Isis::CubeCalculator::prepareCalculations().
|
protectedvirtual |
Converts the given string from infix to postfix format.
equation | A string representing an infix equation. |
References Isis::InfixToPostfix::convert(), and equation().
Referenced by compile().
|
protected |
Pushes the given value onto the stack as a variable.
This method adds the given variant value to the stack as a variable.
variable | QVariant containing the name of the variable. Usually a QString. |
IException::User | "Could not find variable in variable pool." |
References _FILEINFO_, Isis::Calculator::Push(), Isis::IException::User, and variable().
Referenced by compile(), and variable().