pub struct Error<F, In> { /* private fields */ }
Expand description
Aggregator structure that compares computed and real values, input by input, computes the corresponding errors and stores them.
The first generic parameter specifies the type of floating point used. The second one specifies the input argument(s). In most cases, this will be a single floating point number, however, for multiple argument functions this can be a tuple.
Implementations§
Source§impl<F: FloatExt, In: Debug + Default + Copy> Error<F, In>
impl<F: FloatExt, In: Debug + Default + Copy> Error<F, In>
Sourcepub fn with_bounds(bounds: ErrorBounds<F>) -> Self
pub fn with_bounds(bounds: ErrorBounds<F>) -> Self
Initializes the structure with given bounds.
Sourcepub fn calculate(&mut self, arg: In, computed: F, real: F)
pub fn calculate(&mut self, arg: In, computed: F, real: F)
Calculates the errors between computed value and real value. If it is the current maximum, its value is stored along with the argument that caused it.
Sourcepub fn max_rel_arg(&self) -> In
pub fn max_rel_arg(&self) -> In
Returns the argument for maximum relative error encountered.
Sourcepub fn max_abs_arg(&self) -> In
pub fn max_abs_arg(&self) -> In
Returns the argument for absolute relative error encountered.
Sourcepub fn print_plain(&self, name: &str)
pub fn print_plain(&self, name: &str)
Prints the errors (and arguments) in a plain, human-readable form.
Sourcepub fn print_csv(&self, name: &str)
pub fn print_csv(&self, name: &str)
Prints the errors (and arguments) as one line in CSV format. Use
print_csv_header
method to print the header for the CSV file.
Sourcepub fn print_csv_header()
pub fn print_csv_header()
Prints the header for CSV file which contents are given by print_csv
method.