![]() |
WarpTwin
Documentation for WarpTwin models and classes.
|
A class for performing simple a-b-c-d trilinear interpolation. More...
#include <InterpolateTrilinear.h>
Public Member Functions | |
| int | setData (const std::vector< double > &valuesA, const std::vector< double > &valuesB, const std::vector< double > &valuesC, const std::vector< double > &valuesD) |
| Sets the data for the interpolator. | |
| int | getMinA (double &minA) const |
| Returns the minimum value from the 1st column of stored data. | |
| int | getMaxA (double &maxA) const |
| Returns the maximum value from the 1st column of stored data. | |
| int | getMinB (double &minB) const |
| Returns the minimum value from the 2nd column of stored data. | |
| int | getMaxB (double &maxB) const |
| Returns the maximum value from the 2nd column of stored data. | |
| int | getMinC (double &minC) const |
| Returns the minimum value from the 3rd column of stored data. | |
| int | getMaxC (double &maxC) const |
| Returns the maximum value from the 3rd column of stored data. | |
| int | interpolate (const double &a, const double &b, const double &c, double &interpolated_out) |
| Performs trilinear interpolation given an (x, y) value pair. | |
A class for performing simple a-b-c-d trilinear interpolation.
This class allows you to store tabulated a, b, c, and d values, and then to compute interpolated d values for any (a, b, c) within the bounds of the stored data. The trilinear interpolation is performed between successive data points.
Methodology:
When inputting data, each column as seen above is input and reorganized into a 4d vector.
Author: William Burken will..nosp@m.burk.nosp@m.en@at.nosp@m.tx.t.nosp@m.ech
| int warptwin::InterpolateTrilinear::getMaxA | ( | double & | maxA | ) | const |
Returns the maximum value from the 1st column of stored data.
| [out] | maxA | The maximum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::getMaxB | ( | double & | maxB | ) | const |
Returns the maximum value from the 2nd column of stored data.
| [out] | maxB | The maximum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::getMaxC | ( | double & | maxC | ) | const |
Returns the maximum value from the 3rd column of stored data.
| [out] | maxC | The maximum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::getMinA | ( | double & | minA | ) | const |
Returns the minimum value from the 1st column of stored data.
| [out] | minA | The minimum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::getMinB | ( | double & | minB | ) | const |
Returns the minimum value from the 2nd column of stored data.
| [out] | minB | The minimum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::getMinC | ( | double & | minC | ) | const |
Returns the minimum value from the 3rd column of stored data.
| [out] | minC | The minimum value will be written here if the function succeeds. |
This function returns an error if there is no data stored.
| int warptwin::InterpolateTrilinear::interpolate | ( | const double & | a, |
| const double & | b, | ||
| const double & | c, | ||
| double & | interpolated_out ) |
Performs trilinear interpolation given an (x, y) value pair.
| [in] | a | The column 1 value for which to interpolate. |
| [in] | b | The column 2 value for which to interpolate. |
| [in] | c | The column 3 value for which to interpolate. |
| [out] | interpolated_out | The interpolated z-value will be written here if the function succeeds. |
If a, b, or c is out of the bounds of the stored table, this function returns a non-zero error code. If there are not enough points to perform interpolation, it returns a non-zero error code as well.
| int warptwin::InterpolateTrilinear::setData | ( | const std::vector< double > & | valuesA, |
| const std::vector< double > & | valuesB, | ||
| const std::vector< double > & | valuesC, | ||
| const std::vector< double > & | valuesD ) |
Sets the data for the interpolator.
| valuesA | A vector of a-values (must be sorted in ascending order). |
| valuesB | A vector of b-values (must be sorted in ascending order in region of static a). |
| valuesC | A vector of c-values (must be sorted in ascending order in region of static b). |
| valuesD | A vector of output values for each combination of a, b, and c values |
This function replaces any previously stored data with the new a, b, c, and output values. It is required that valuesA.size() == valuesB.size() == valuesC.size() == valuesD.size() It is also required that valuesA is sorted in ascending order and B/C are in order in the regions of static A/B, respectively. If these conditions are not met, a non-zero error code is returned.