Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis Developer Reference
Calculator.h
Go to the documentation of this file.
1
5
6/* SPDX-License-Identifier: CC0-1.0 */
7
8// Calculator.h
9#ifndef CALCULATOR_H_
10#define CALCULATOR_H_
11
12#include "Buffer.h"
13
14// I'm not sure how to forward declare the iterators
15#include <QVector>
16
17template<class T> class QStack;
18
19namespace Isis {
54 class Calculator {
55 public:
56 Calculator(); // Constructor
58 virtual ~Calculator();
59
60 // Math methods
61 void Negative();
62 void Multiply();
63 void Add();
64 void Subtract();
65 void Divide();
66 void Modulus();
67
68 void Exponent();
69 void SquareRoot();
70 void AbsoluteValue();
71 void Log();
72 void Log10();
73
74 void LeftShift();
75 void RightShift();
76 void MinimumPixel();
77 void MaximumPixel();
78 void MinimumLine();
79 void MaximumLine();
80 void Minimum2();
81 void Maximum2();
82 void GreaterThan();
83 void LessThan();
84 void Equal();
85 void LessThanOrEqual();
86 void GreaterThanOrEqual();
87 void NotEqual();
88 void And();
89 void Or();
90
91 void Sine();
92 void Cosine();
93 void Tangent();
94 void Secant();
95 void Cosecant();
96 void Cotangent();
97 void Arcsine();
98 void Arccosine();
99 void Arctangent();
100 void Arctangent2();
101 void SineH();
102 void CosineH();
103 void TangentH();
104 void ArcsineH();
105 void ArccosineH();
106 void ArctangentH();
107
108 // Stack methods
109 void Push(double scalar);
110 void Push(Buffer &buff);
111 void Push(QVector<double> &vect);
112 QVector<double> Pop(bool keepSpecials = false);
113 void PrintTop();
114 bool Empty();
115 virtual void Clear();
116
117 protected:
118 void PerformOperation(QVector<double> &results,
121 double operation(double));
122 void PerformOperation(QVector<double> &results,
127 double operation(double, double));
128
130 int StackSize();
131
132 private:
134 QStack< QVector<double> > * p_valStack;
135 };
136};
137
138#endif
Buffer for reading and writing cube data.
Definition Buffer.h:53
void LessThan()
Pop two elements off the stack and compare them to see where one is less than the other,...
Definition Calculator.cpp:602
void PrintTop()
Print the vector at the top of the stack.
Definition Calculator.cpp:989
void Cosecant()
Pops one element and push the cosecant.
Definition Calculator.cpp:737
void Arctangent2()
Pops two elements and push the arctangent.
Definition Calculator.cpp:827
void Maximum2()
Not implemented in Calculator.cpp.
void Modulus()
Pops two elements, mods them, then pushes the result on the stack.
Definition Calculator.cpp:366
void Tangent()
Pops one element and push the tangent.
Definition Calculator.cpp:727
int StackSize()
Returns the current stack size.
Definition Calculator.cpp:874
void Arctangent()
Pops one element and push the arctangent.
Definition Calculator.cpp:787
void SineH()
Pops one element and push the hyperbolic sine.
Definition Calculator.cpp:840
void Divide()
Pops two, divides them, then pushes the quotient on the stack.
Definition Calculator.cpp:354
void GreaterThanOrEqual()
Pop two elements off the stack and compare them to see where one is greater than or equal to the othe...
Definition Calculator.cpp:632
void TangentH()
Pops one element and push the hyperbolic tangent.
Definition Calculator.cpp:860
void Push(double scalar)
Push a scalar onto the stack.
Definition Calculator.cpp:893
void Cotangent()
Pops one element and push the cotangent.
Definition Calculator.cpp:757
void ArctangentH()
Pops one element and push the inverse hyperbolic tangent.
Definition Calculator.cpp:817
Calculator()
The code that performs math operations is designed to call a function and use the result.
Definition Calculator.cpp:32
void Add()
Pops two elements, adds them, then pushes the sum on the stack.
Definition Calculator.cpp:330
void Multiply()
Pops two elements, multiplies them, then pushes the product on the stack.
Definition Calculator.cpp:317
void Minimum2()
Not implemented in Calculator.cpp.
void ArcsineH()
Pops one element and push the inverse hyperbolic sine.
Definition Calculator.cpp:797
void Negative()
Pops an element, negates it, then pushes the result.
Definition Calculator.cpp:307
virtual ~Calculator()
Virtual Constructor.
Definition Calculator.cpp:39
void RightShift()
Pop the top element, then perform a right shift with zero fill.
Definition Calculator.cpp:480
void Or()
Pop two elements, OR them, then push the result on the stack.
Definition Calculator.cpp:693
void Sine()
Pops one element and push the sine.
Definition Calculator.cpp:707
virtual void Clear()
Clear out the stack.
Definition Calculator.cpp:1021
void PerformOperation(QVector< double > &results, QVector< double >::iterator arg1Start, QVector< double >::iterator arg1End, double operation(double))
Performs the mathematical operations on each argument.
Definition Calculator.cpp:1037
void Arcsine()
Pops one element and push the arcsine.
Definition Calculator.cpp:767
void LeftShift()
Pop the top element, then perform a left shift with zero fill.
Definition Calculator.cpp:441
void LessThanOrEqual()
Pop two elements off the stack and compare them to see where one is less than or equal to the other,...
Definition Calculator.cpp:647
void NotEqual()
Pop two elements off the stack and compare them to see where one is not equal to the other,...
Definition Calculator.cpp:662
void GreaterThan()
Pop two elements off the stack and compare them to see where one is greater than the other,...
Definition Calculator.cpp:587
void Arccosine()
Pops one element and push the arccosine.
Definition Calculator.cpp:777
void Log10()
Pop an element, compute its base 10 log, then push the result on the stack.
Definition Calculator.cpp:429
void MaximumLine()
Pop one element, then push the maximum on the stack.
Definition Calculator.cpp:537
void MaximumPixel()
Pop two elements, then push the maximum on a pixel by pixel basis back on the stack.
Definition Calculator.cpp:572
void Secant()
Pops one element and push the secant.
Definition Calculator.cpp:747
void MinimumLine()
Pop one element, then push the minimum on the stack.
Definition Calculator.cpp:518
void Log()
Pop an element, compute its log, then push the result on the stack.
Definition Calculator.cpp:419
void Subtract()
Pops two elements, subtracts them, then pushes the difference on the stack.
Definition Calculator.cpp:342
void Equal()
Pop two elements off the stack and compare them to see where one is equal to the other,...
Definition Calculator.cpp:617
QVector< double > Pop(bool keepSpecials=false)
Pop an element off the stack.
Definition Calculator.cpp:949
void AbsoluteValue()
Pop an element, compute its absolute value, then push the result on the stack.
Definition Calculator.cpp:407
void MinimumPixel()
Pop two elements, then push the minimum on a pixel by pixel basis back on the stack.
Definition Calculator.cpp:557
void Exponent()
Pops two elements, computes the power then pushes the result on the stack The exponent has to be a sc...
Definition Calculator.cpp:382
void ArccosineH()
Pops one element and push the inverse hyperbolic cosine.
Definition Calculator.cpp:807
void And()
Pop two elements, AND them, then push the result on the stack.
Definition Calculator.cpp:679
void SquareRoot()
Pop an element, compute its square root, then push the root on the stack.
Definition Calculator.cpp:397
void Cosine()
Pops one element and push the cosine.
Definition Calculator.cpp:717
bool Empty()
Check if the stack is empty.
Definition Calculator.cpp:1013
void CosineH()
Pops one element and push the hyperbolic cosine.
Definition Calculator.cpp:850
This is free and unencumbered software released into the public domain.
Definition Calculator.h:17
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16