.NET wrapper for GeographicLib::Accumulator. More...
#include <Accumulator.h>
Public Member Functions | |
Accumulator (void) | |
Constructor. More... | |
void | Assign (double a) |
Assigns a value to an accumulator. More... | |
void | Multiply (int i) |
Multiplication by an integer. More... | |
double | Result () |
Returns the accumulated value. More... | |
void | Sum (double a) |
Adds a value to the accumulator. More... | |
~Accumulator () | |
Destructor calls the finalizer. More... | |
Static Public Member Functions | |
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) |
Equality 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... | |
Private Member Functions | |
!Accumulator (void) | |
Private Attributes | |
GeographicLib::Accumulator< double > * | m_pAccumulator |
.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.
|
private |
Definition at line 19 of file dotnet/NETGeographicLib/Accumulator.cpp.
Accumulator::Accumulator | ( | void | ) |
Constructor.
Definition at line 29 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
inline |
Destructor calls the finalizer.
Definition at line 55 of file Accumulator.h.
void Accumulator::Assign | ( | double | a | ) |
Assigns a value to an accumulator.
[in] | a | The value to be assigned. |
Definition at line 42 of file dotnet/NETGeographicLib/Accumulator.cpp.
void Accumulator::Multiply | ( | int | i | ) |
Multiplication by an integer.
[in] | i | The multiplier. |
Definition at line 60 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Inequality operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 72 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Less than operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 78 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Less than or equal to operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 84 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Equality operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 66 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Greater than operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 90 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
static |
Greater than or equal to operator.
[in] | lhs | The accumulator. |
[in] | a | The value to be compared to. |
Definition at line 96 of file dotnet/NETGeographicLib/Accumulator.cpp.
double Accumulator::Result | ( | ) |
Returns the accumulated value.
Definition at line 48 of file dotnet/NETGeographicLib/Accumulator.cpp.
void Accumulator::Sum | ( | double | a | ) |
Adds a value to the accumulator.
[in] | a | The value to be added. |
Definition at line 54 of file dotnet/NETGeographicLib/Accumulator.cpp.
|
private |
Definition at line 48 of file Accumulator.h.