dotnet/NETGeographicLib/Accumulator.cpp
Go to the documentation of this file.
1 
11 #include "stdafx.h"
13 #include "Accumulator.h"
14 #include "NETGeographicLib.h"
15 
16 using namespace NETGeographicLib;
17 
18 //*****************************************************************************
20 {
21  if ( m_pAccumulator != NULL )
22  {
23  delete m_pAccumulator;
24  m_pAccumulator = NULL;
25  }
26 }
27 
28 //*****************************************************************************
30 {
31  try
32  {
34  }
35  catch ( std::bad_alloc )
36  {
37  throw gcnew GeographicErr("Failed to allocate memory for a GeogrpicLib::Accumulator");
38  }
39 }
40 
41 //*****************************************************************************
42 void Accumulator::Assign( double a )
43 {
44  m_pAccumulator->operator=( a);
45 }
46 
47 //*****************************************************************************
49 {
50  return m_pAccumulator->operator()();
51 }
52 
53 //*****************************************************************************
54 void Accumulator::Sum( double a )
55 {
56  m_pAccumulator->operator+=( a );
57 }
58 
59 //*****************************************************************************
61 {
62  m_pAccumulator->operator*=( i );
63 }
64 
65 //*****************************************************************************
67 {
68  return lhs->m_pAccumulator->operator==( a );
69 }
70 
71 //*****************************************************************************
73 {
74  return lhs->m_pAccumulator->operator!=( a );
75 }
76 
77 //*****************************************************************************
79 {
80  return lhs->m_pAccumulator->operator<( a );
81 }
82 
83 //*****************************************************************************
85 {
86  return lhs->m_pAccumulator->operator<=( a );
87 }
88 
89 //*****************************************************************************
91 {
92  return lhs->m_pAccumulator->operator>( a );
93 }
94 
95 //*****************************************************************************
97 {
98  return lhs->m_pAccumulator->operator>=( a );
99 }
Header for NETGeographicLib::NETGeographicLib objects.
Exception class for NETGeographicLib.
void Sum(double a)
Adds a value to the accumulator.
static bool operator!=(Accumulator^ lhs, double a)
Inequality operator.
void Assign(double a)
Assigns a value to an accumulator.
GeographicLib::Accumulator< double > * m_pAccumulator
Definition: Accumulator.h:48
double Result()
Returns the accumulated value.
void Multiply(int i)
Multiplication by an integer.
Header for GeographicLib::Accumulator class.
static bool operator<=(Accumulator^ lhs, double a)
Less than or equal to operator.
static bool operator>(Accumulator^ lhs, double a)
Greater than operator.
#define NULL
Definition: ccolamd.c:609
static bool operator==(Accumulator^ lhs, double a)
Equality operator.
static bool operator>=(Accumulator^ lhs, double a)
Greater than or equal to operator.
Header for NETGeographicLib::Accumulator class.
.NET wrapper for GeographicLib::Accumulator.
Definition: Accumulator.h:44
static bool operator<(Accumulator^ lhs, double a)
Less than operator.


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:33:53