|
Isis 3.0 Object Programmers' Reference |
Home |
#include <CubeCalculator.h>
Inheritance diagram for Isis::CubeCalculator:


This class is a RPN calculator on cubes. The base Calculator class is used in conjunction with methods to retrieve data from a cube and perform calculations.
For internal use only.
Definition at line 48 of file CubeCalculator.h.
Public Member Functions | |
| CubeCalculator () | |
| Constructor. | |
| void | Clear () |
| This method completely resets the calculator. | |
| void | PrepareCalculations (std::string postfix, std::vector< Cube * > &inCubes, Cube *outCube) |
| This method builds a list of actions to perform based on the postfix expression. | |
| std::vector< double > | RunCalculations (std::vector< Buffer * > &cubeData, int line, int band) |
| This method will execute the calculations built up when PrepareCalculations was called. | |
Private Types | |
| callNextMethod | |
| The calculation requires calling one of the methods. | |
| pushNextData | |
| The calculation requires input data. | |
| constant | |
| a constant value | |
| line | |
| current line number | |
| band | |
| current band number | |
| cubeData | |
| a brick of cube data | |
| enum | calculations { callNextMethod, pushNextData } |
| This is used to define the overall action to perform in RunCalculations(. More... | |
| enum | dataValue { constant, line, band, cubeData } |
| This is used to tell what kind of data to push onto the RPN calculator. More... | |
Private Member Functions | |
| void | AddMethodCall (void(Calculator::*method)(void)) |
| This is a conveinience method for PrepareCalculations(. | |
| void | AddDataPush (dataValue type) |
| This is a conveinience method for PrepareCalculations(. | |
| void | AddDataPush (const double &data) |
| This is a conveinience method for PrepareCalculations(. | |
| void | AddDataPush (std::vector< double > &data) |
| This is a conveinience method for PrepareCalculations(. | |
| 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 | Minimum () |
| Pop one element, then push the maximum on the stack. | |
| void | Maximum () |
| Pop one element, then push the maximum on the stack. | |
| 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 (std::vector< double > &vect) |
| Push a vector onto the stack. | |
| std::vector< 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. | |
| void | PerformOperation (std::vector< double > &results, std::vector< double >::iterator arg1Start, std::vector< double >::iterator arg1End, double operation(double)) |
| Performs the mathematical operations on each argument. | |
| void | PerformOperation (std::vector< double > &results, std::vector< double >::iterator arg1Start, std::vector< double >::iterator arg1End, std::vector< double >::iterator arg2Start, std::vector< 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. | |
Private Attributes | |
| std::vector< calculations > | p_calculations |
| This is what RunCalculations(. | |
| std::vector< void(Calculator::*)(void) > | p_methods |
| This stores the addresses to the methods RunCalculations(. | |
| std::vector< std::vector< double > > | p_data |
| This stores the addressed to the methods RunCalculations(. | |
| std::vector< dataValue > | p_dataDefinitions |
| This defines what kind of data RunCalculations(. | |
enum Isis::CubeCalculator::calculations [private] |
This is used to define the overall action to perform in RunCalculations(.
.).
| callNextMethod | The calculation requires calling one of the methods. |
| pushNextData | The calculation requires input data. |
Definition at line 68 of file CubeCalculator.h.
enum Isis::CubeCalculator::dataValue [private] |
This is used to tell what kind of data to push onto the RPN calculator.
Values >= cubeData all specify cubeData, the difference between (int)cubeData and the actual value determines which cube's data to use.
| constant | a constant value |
| line | current line number |
| band | current band number |
| cubeData | a brick of cube data |
Definition at line 82 of file CubeCalculator.h.
| Isis::CubeCalculator::CubeCalculator | ( | ) |
| void Isis::Calculator::AbsoluteValue | ( | ) | [inherited] |
Pop an element, compute its absolute value, then push the result on the stack.
Definition at line 341 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Add | ( | ) | [inherited] |
Pops two elements, adds them, then pushes the sum on the stack.
Definition at line 264 of file Calculator.cpp.
References Isis::AddOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::CubeCalculator::AddDataPush | ( | std::vector< double > & | data | ) | [private] |
This is a conveinience method for PrepareCalculations(.
..). This will cause RunCalculations(...) to push on an array of constant values.
| data | An array of constant values |
Definition at line 400 of file CubeCalculator.cpp.
References constant, p_calculations, p_data, p_dataDefinitions, and pushNextData.
| void Isis::CubeCalculator::AddDataPush | ( | const double & | data | ) | [private] |
This is a conveinience method for PrepareCalculations(.
..). This will cause RunCalculations(...) to push on a constant value.
| data | A constant |
Definition at line 385 of file CubeCalculator.cpp.
References constant, p_calculations, p_data, p_dataDefinitions, and pushNextData.
| void Isis::CubeCalculator::AddDataPush | ( | dataValue | type | ) | [private] |
This is a conveinience method for PrepareCalculations(.
..). This will cause RunCalculations(...) to push on a single variable. Currently, only line and band are supported.
| type | The variable type (line or band) |
Definition at line 364 of file CubeCalculator.cpp.
References _FILEINFO_, band, line, Isis::iException::Message(), p_calculations, p_data, p_dataDefinitions, and pushNextData.
Referenced by PrepareCalculations().
| void Isis::CubeCalculator::AddMethodCall | ( | void(Calculator::*)(void) | method | ) | [private] |
This is a conveinience method for PrepareCalculations(.
..). This will cause RunCalculations(...) to execute this method in order.
| method | The method to call, i.e. &Isis::Calculator::Multiply |
Definition at line 352 of file CubeCalculator.cpp.
References callNextMethod, p_calculations, and p_methods.
Referenced by PrepareCalculations().
| void Isis::Calculator::And | ( | ) | [inherited] |
Pop two elements, AND them, then push the result on the stack.
Definition at line 565 of file Calculator.cpp.
References Isis::BitwiseAndOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
| void Isis::Calculator::Arccosine | ( | ) | [inherited] |
Pops one element and push the arccosine.
Definition at line 661 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::ArccosineH | ( | ) | [inherited] |
Pops one element and push the inverse hyperbolic cosine.
Definition at line 691 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
| void Isis::Calculator::Arcsine | ( | ) | [inherited] |
Pops one element and push the arcsine.
Definition at line 651 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::ArcsineH | ( | ) | [inherited] |
Pops one element and push the inverse hyperbolic sine.
Definition at line 681 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
| void Isis::Calculator::Arctangent | ( | ) | [inherited] |
Pops one element and push the arctangent.
Definition at line 671 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Arctangent2 | ( | ) | [inherited] |
Pops two elements and push the arctangent.
Definition at line 711 of file Calculator.cpp.
References Isis::Calculator::p_valStack, Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::ArctangentH | ( | ) | [inherited] |
Pops one element and push the inverse hyperbolic tangent.
Definition at line 701 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
| void Isis::CubeCalculator::Clear | ( | ) | [virtual] |
This method completely resets the calculator.
The prepared calculations will be erased when this is called.
Reimplemented from Isis::Calculator.
Definition at line 33 of file CubeCalculator.cpp.
References Isis::Calculator::Clear(), p_calculations, p_data, p_dataDefinitions, and p_methods.
Referenced by PrepareCalculations().
| void Isis::Calculator::Cosecant | ( | ) | [inherited] |
Pops one element and push the cosecant.
Definition at line 621 of file Calculator.cpp.
References Isis::CosecantOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Cosine | ( | ) | [inherited] |
Pops one element and push the cosine.
Definition at line 601 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::CosineH | ( | ) | [inherited] |
Pops one element and push the hyperbolic cosine.
Definition at line 734 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Cotangent | ( | ) | [inherited] |
Pops one element and push the cotangent.
Definition at line 641 of file Calculator.cpp.
References Isis::CotangentOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Divide | ( | ) | [inherited] |
Pops two, divides them, then pushes the quotient on the stack.
Definition at line 288 of file Calculator.cpp.
References Isis::DivideOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| bool Isis::Calculator::Empty | ( | ) | [inherited] |
Check if the stack is empty.
Definition at line 879 of file Calculator.cpp.
References Isis::Calculator::p_valStack.
| void Isis::Calculator::Equal | ( | ) | [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.
Definition at line 508 of file Calculator.cpp.
References Isis::EqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Exponent | ( | ) | [inherited] |
Pops two elements, computes the power then pushes the result on the stack The exponent has to be a scalar.
| Isis::iException::Math |
Definition at line 316 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), and x.
Referenced by PrepareCalculations().
| void Isis::Calculator::GreaterThan | ( | ) | [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.
Definition at line 480 of file Calculator.cpp.
References Isis::GreaterThanOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::GreaterThanOrEqual | ( | ) | [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.
Definition at line 522 of file Calculator.cpp.
References Isis::GreaterThanOrEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::LeftShift | ( | ) | [inherited] |
Pop the top element, then perform a left shift with zero fill.
| Isis::iException::Math |
Definition at line 375 of file Calculator.cpp.
References _FILEINFO_, Isis::iException::Message(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::LessThan | ( | ) | [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.
Definition at line 494 of file Calculator.cpp.
References Isis::LessThanOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::LessThanOrEqual | ( | ) | [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.
Definition at line 536 of file Calculator.cpp.
References Isis::LessThanOrEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Log | ( | ) | [inherited] |
Pop an element, compute its log, then push the result on the stack.
| Isis::iException::Math |
Definition at line 353 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Log10 | ( | ) | [inherited] |
Pop an element, compute its base 10 log, then push the result on the stack.
Definition at line 363 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::Maximum | ( | ) | [inherited] |
Pop one element, then push the maximum on the stack.
Definition at line 463 of file Calculator.cpp.
References Isis::Calculator::Pop(), Isis::Calculator::Push(), and size.
Referenced by PrepareCalculations().
| void Isis::Calculator::Minimum | ( | ) | [inherited] |
Pop one element, then push the maximum on the stack.
Definition at line 447 of file Calculator.cpp.
References Isis::Calculator::Pop(), Isis::Calculator::Push(), and size.
Referenced by PrepareCalculations().
| void Isis::Calculator::Modulus | ( | ) | [inherited] |
Pops two elements, mods them, then pushes the result on the stack.
Definition at line 300 of file Calculator.cpp.
References Isis::ModulusOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Multiply | ( | ) | [inherited] |
Pops two elements, multiplies them, then pushes the product on the stack.
Definition at line 251 of file Calculator.cpp.
References Isis::MultiplyOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Negative | ( | ) | [inherited] |
Pops an element, negates it, then pushes the result.
Definition at line 241 of file Calculator.cpp.
References Isis::NegateOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::NotEqual | ( | ) | [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.
Definition at line 550 of file Calculator.cpp.
References Isis::NotEqualOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Or | ( | ) | [inherited] |
Pop two elements, OR them, then push the result on the stack.
Definition at line 578 of file Calculator.cpp.
References Isis::BitwiseOrOperator(), Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
| void Isis::Calculator::PerformOperation | ( | std::vector< double > & | results, | |
| std::vector< double >::iterator | arg1Start, | |||
| std::vector< double >::iterator | arg1End, | |||
| std::vector< double >::iterator | arg2Start, | |||
| std::vector< double >::iterator | arg2End, | |||
| double | operation(double, double) | |||
| ) | [protected, inherited] |
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 |
Definition at line 932 of file Calculator.cpp.
References _FILEINFO_, Isis::iException::Message(), and pos.
| void Isis::Calculator::PerformOperation | ( | std::vector< double > & | results, | |
| std::vector< double >::iterator | arg1Start, | |||
| std::vector< double >::iterator | arg1End, | |||
| double | operation(double) | |||
| ) | [protected, inherited] |
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 |
Definition at line 903 of file Calculator.cpp.
References pos.
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(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), 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().
| std::vector< double > Isis::Calculator::Pop | ( | bool | keepSpecials = false |
) | [inherited] |
Pop an element off the stack.
| keepSpecials | If true, special pixels will be preserved; otherwise, they will be mapped to double values |
Definition at line 823 of file Calculator.cpp.
References _FILEINFO_, Isis::Hrs, Isis::Lrs, Isis::iException::Message(), Isis::Null, Isis::Calculator::p_valStack, and top.
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(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LeftShift(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), Isis::Calculator::Maximum(), Isis::Calculator::Minimum(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), Isis::Calculator::Or(), Isis::Calculator::RightShift(), RunCalculations(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), and Isis::Calculator::TangentH().
| void Isis::CubeCalculator::PrepareCalculations | ( | std::string | equation, | |
| std::vector< Cube * > & | inCubes, | |||
| Cube * | outCube | |||
| ) |
This method builds a list of actions to perform based on the postfix expression.
Error checking is done using the inCubeInfos, and the outCubeInfo is necessary to tell the dimensions of the output cube. Call this method before calling RunCalculations(). This method will also erase all calculator history before building up a new set of calculations to run.
| equation | The postfix equation | |
| inCubes | The input cubes | |
| outCube | The output cube |
Definition at line 105 of file CubeCalculator.cpp.
References _FILEINFO_, Isis::Calculator::AbsoluteValue(), Isis::Calculator::Add(), AddDataPush(), AddMethodCall(), Isis::Calculator::Arccosine(), Isis::Calculator::Arcsine(), Isis::Calculator::Arctangent(), Isis::Calculator::Arctangent2(), band, Clear(), Isis::Calculator::Cosecant(), Isis::Calculator::Cosine(), Isis::Calculator::CosineH(), Isis::Calculator::Cotangent(), cubeData, Isis::Calculator::Divide(), Isis::E(), Isis::Calculator::Equal(), Isis::Calculator::Exponent(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LeftShift(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), line, Isis::Calculator::Log(), Isis::Calculator::Log10(), Isis::Calculator::Maximum(), Isis::iException::Message(), Isis::Calculator::Minimum(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), outCube, p_calculations, p_data, p_dataDefinitions, Isis::PI(), pushNextData, Isis::Calculator::RightShift(), Isis::Cube::Samples(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), Isis::Calculator::TangentH(), Isis::iString::ToDouble(), and Isis::iString::Token().
| void Isis::Calculator::PrintTop | ( | ) | [inherited] |
Print the vector at the top of the stack.
Definition at line 862 of file Calculator.cpp.
References Isis::Calculator::p_valStack, and top.
| void Isis::Calculator::Push | ( | std::vector< double > & | vect | ) | [inherited] |
Push a vector onto the stack.
| vect | The vector that will be pushed on the stack |
Definition at line 758 of file Calculator.cpp.
References Isis::Calculator::p_valStack.
| void Isis::Calculator::Push | ( | Buffer & | buff | ) | [inherited] |
Push a buffer onto the stack.
| buff | The buffer that will be pushed on the stack |
Definition at line 780 of file Calculator.cpp.
References b, Isis::IsHisPixel(), Isis::IsHrsPixel(), Isis::IsLisPixel(), Isis::IsLrsPixel(), Isis::IsNullPixel(), Isis::IsSpecial(), Isis::Calculator::p_valStack, and Isis::Buffer::size().
| void Isis::Calculator::Push | ( | double | scalar | ) | [inherited] |
Push a scalar onto the stack.
| scalar | The scalar that will be pushed on the stack |
Definition at line 768 of file Calculator.cpp.
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::ArctangentH(), Isis::Calculator::Cosecant(), Isis::Calculator::Cosine(), Isis::Calculator::CosineH(), Isis::Calculator::Cotangent(), Isis::Calculator::Divide(), Isis::Calculator::Equal(), Isis::Calculator::Exponent(), Isis::Calculator::GreaterThan(), Isis::Calculator::GreaterThanOrEqual(), Isis::Calculator::LeftShift(), Isis::Calculator::LessThan(), Isis::Calculator::LessThanOrEqual(), Isis::Calculator::Log(), Isis::Calculator::Log10(), Isis::Calculator::Maximum(), Isis::Calculator::Minimum(), Isis::Calculator::Modulus(), Isis::Calculator::Multiply(), Isis::Calculator::Negative(), Isis::Calculator::NotEqual(), Isis::Calculator::Or(), Isis::Calculator::RightShift(), RunCalculations(), Isis::Calculator::Secant(), Isis::Calculator::Sine(), Isis::Calculator::SineH(), Isis::Calculator::SquareRoot(), Isis::Calculator::Subtract(), Isis::Calculator::Tangent(), and Isis::Calculator::TangentH().
| void Isis::Calculator::RightShift | ( | ) | [inherited] |
Pop the top element, then perform a right shift with zero fill.
| Isis::iException::Math |
Definition at line 411 of file Calculator.cpp.
References _FILEINFO_, Isis::iException::Message(), Isis::Calculator::Pop(), Isis::Calculator::Push(), x, and y.
Referenced by PrepareCalculations().
| std::vector< double > Isis::CubeCalculator::RunCalculations | ( | std::vector< Buffer * > & | cubeData, | |
| int | curLine, | |||
| int | curBand | |||
| ) |
This method will execute the calculations built up when PrepareCalculations was called.
| cubeData | The input cubes' data | |
| curLine | The current line in the output cube | |
| curBand | The current band in the output cube |
| Isis::iException::Math |
Definition at line 53 of file CubeCalculator.cpp.
References _FILEINFO_, band, callNextMethod, constant, cubeData, line, Isis::iException::Message(), p_calculations, p_data, p_dataDefinitions, p_methods, Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::Calculator::StackSize().
| void Isis::Calculator::Secant | ( | ) | [inherited] |
Pops one element and push the secant.
Definition at line 631 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), and Isis::SecantOperator().
Referenced by PrepareCalculations().
| void Isis::Calculator::Sine | ( | ) | [inherited] |
Pops one element and push the sine.
Definition at line 591 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::SineH | ( | ) | [inherited] |
Pops one element and push the hyperbolic sine.
Definition at line 724 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::SquareRoot | ( | ) | [inherited] |
Pop an element, compute its square root, then push the root on the stack.
| Isis::iException::Math |
Definition at line 331 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| int Isis::Calculator::StackSize | ( | ) | [inline, protected, inherited] |
Returns the current stack size.
Definition at line 129 of file Calculator.h.
References Isis::Calculator::p_valStack.
Referenced by RunCalculations().
| void Isis::Calculator::Subtract | ( | ) | [inherited] |
Pops two elements, subtracts them, then pushes the difference on the stack.
Definition at line 276 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), Isis::Calculator::Push(), Isis::SubtractOperator(), x, and y.
Referenced by PrepareCalculations().
| void Isis::Calculator::Tangent | ( | ) | [inherited] |
Pops one element and push the tangent.
Definition at line 611 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
| void Isis::Calculator::TangentH | ( | ) | [inherited] |
Pops one element and push the hyperbolic tangent.
Definition at line 744 of file Calculator.cpp.
References Isis::Calculator::PerformOperation(), Isis::Calculator::Pop(), and Isis::Calculator::Push().
Referenced by PrepareCalculations().
std::vector< calculations > Isis::CubeCalculator::p_calculations [private] |
This is what RunCalculations(.
..) will loop over. The action to perform (push data or execute calculation) is defined in this vector.
Definition at line 99 of file CubeCalculator.h.
Referenced by AddDataPush(), AddMethodCall(), Clear(), PrepareCalculations(), and RunCalculations().
std::vector< std::vector<double> > Isis::CubeCalculator::p_data [private] |
This stores the addressed to the methods RunCalculations(.
..) will push (constants), along with placeholders for simplicity to keep synchronized with the data definitions.
Definition at line 112 of file CubeCalculator.h.
Referenced by AddDataPush(), Clear(), PrepareCalculations(), and RunCalculations().
std::vector< dataValue > Isis::CubeCalculator::p_dataDefinitions [private] |
This defines what kind of data RunCalculations(.
..) will push onto the calculator. Constants will be taken from p_data, which is synchronized (index-wise) with this vector.
Definition at line 119 of file CubeCalculator.h.
Referenced by AddDataPush(), Clear(), PrepareCalculations(), and RunCalculations().
std::vector< void (Calculator::*)( void ) > Isis::CubeCalculator::p_methods [private] |
This stores the addresses to the methods RunCalculations(.
..) will call
Definition at line 105 of file CubeCalculator.h.
Referenced by AddMethodCall(), Clear(), and RunCalculations().