Rhino C++ API
8.14
|
#include <opennurbs_math.h>
Public Member Functions | |
ON_Sum () | |
void | Begin (double starting_value=0.0) |
void | operator+= (double x) |
void | operator-= (double x) |
void | operator= (double x) |
void | Plus (double x) |
void | Plus (double x, double dx) |
int | SummandCount () const |
double | Total (double *error_estimate=nullptr) |
Description: Class for carefully adding long list of numbers.
ON_Sum::ON_Sum | ( | ) |
Description: Creates a sum that is ready to be used.
void ON_Sum::Begin | ( | double | starting_value = 0.0 | ) |
Description: If a sum is being used more than once, call Begin() before starting each sum. Parameters: starting_value - [in] Initial value of sum.
void ON_Sum::operator+= | ( | double | x | ) |
Description: Calls ON_Sum::Plus(x);
void ON_Sum::operator-= | ( | double | x | ) |
Description: Calls ON_Sum::Plus(-x);
void ON_Sum::operator= | ( | double | x | ) |
Description: Calls ON_Sum::Begin(x)
void ON_Sum::Plus | ( | double | x | ) |
Description: Add x to the current sum. Parameters: x - [in] value to add to the current sum.
void ON_Sum::Plus | ( | double | x, |
double | dx | ||
) |
Description: Add x to the current sum. Parameters: x - [in] value to add to the current sum. dx - [in] symmetric uncertainty in x. (true value is in the range x-dx to x+dx
int ON_Sum::SummandCount | ( | ) | const |
Returns: Number of summands.
double ON_Sum::Total | ( | double * | error_estimate = nullptr | ) |
Description: Calculates the total sum.
Parameters: error_estimate - [out] if not nullptr, the returned value of error_estimate is an estimate of the error in the sum. Returns: Total of the sum. Remarks: You can get subtotals by mixing calls to Plus() and Total(). In delicate sums, some precision may be lost in the final total if you call Total() to calculate subtotals.