NETGeographicLib
1.49
|
.NET wrapper for GeographicLib::Accumulator. More...
#include <NETGeographicLib/Accumulator.h>
Public Member Functions | |
Accumulator (void) | |
Constructor. More... | |
~Accumulator () | |
Destructor calls the finalizer. More... | |
void | Assign (double a) |
Assigns a value to an accumulator. More... | |
double | Result () |
Returns the accumulated value. More... | |
void | Sum (double a) |
Adds a value to the accumulator. More... | |
void | Multiply (int i) |
Multiplication by an integer. More... | |
Static Public Member Functions | |
static bool | operator== (Accumulator^ lhs, double a) |
Equality operator. More... | |
static bool | operator!= (Accumulator^ lhs, double a) |
Inequality operator. More... | |
static bool | operator< (Accumulator^ lhs, double a) |
Less than operator. More... | |
static bool | operator<= (Accumulator^ lhs, double a) |
Less than or equal to operator. More... | |
static bool | operator> (Accumulator^ lhs, double a) |
Greater than operator. More... | |
static bool | operator>= (Accumulator^ lhs, double a) |
Greater than or equal to operator. More... | |
.NET wrapper for GeographicLib::Accumulator.
This class allows .NET applications to access GeographicLib::Accumulator<double>.
This allow many numbers of floating point type double to be added together with twice the normal precision. The effective precision of the sum is 106 bits or about 32 decimal places.
The implementation follows J. R. Shewchuk, Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates, Discrete & Computational Geometry 18(3) 305–363 (1997).
C# Example:
Managed C++ Example:
Visual Basic Example:
INTERFACE DIFFERENCES:
Since assignment operators (=,+=,-=,*=) are not supported in managed classes;
Use Result() instead of the () operator to obtain the summed value from the accumulator.
Definition at line 44 of file Accumulator.h.
NETGeographicLib::Accumulator::Accumulator | ( | void | ) |
Constructor.
Referenced by ~Accumulator().
|
inline |
Destructor calls the finalizer.
Definition at line 55 of file Accumulator.h.
References Accumulator(), Assign(), Multiply(), operator!=(), operator<(), operator<=(), operator==(), operator>(), operator>=(), Result(), and Sum().
void NETGeographicLib::Accumulator::Assign | ( | double | a | ) |
Assigns a value to an accumulator.
[in] | a | The value to be assigned. |
Referenced by ~Accumulator().
double NETGeographicLib::Accumulator::Result | ( | ) |
Returns the accumulated value.
Referenced by ~Accumulator().
void NETGeographicLib::Accumulator::Sum | ( | double | a | ) |
Adds a value to the accumulator.
[in] | a | The value to be added. |
Referenced by ~Accumulator().
void NETGeographicLib::Accumulator::Multiply | ( | int | i | ) |
|
static |
Equality operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().
|
static |
Inequality operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().
|
static |
Less than operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().
|
static |
Less than or equal to operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().
|
static |
Greater than operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().
|
static |
Greater than or equal to operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Referenced by ~Accumulator().