Data::Grid class reference
[Core module]
Declaration
#include <Goptical/Data/Grid>
namespace Goptical {
namespace Data {
class Grid;
};
};
This class is a member of the Data namespace.
Inheritance
Description
This class provides a numerical data container where data value can be defined for each point of a 2d rectangular grid. The grid is defined by grid samples count (n1, n2), a 2d origin vector and 2 steps values.
Severals interpolation algorithms are available to guess values between grid defined knots, see Interpolation.
Members
See also the full member list section for this class.
Inherited members
- 12 members inherited from Set
Functions
- Grid(unsigned int n1, unsigned int n2, const Math::Vector2 &origin = [...], const Math::Vector2 &step = [...])
- ~Grid()
- virtual unsigned int get_count(unsigned int dimension) const
- const Math::Vector2 & get_d_value(unsigned int n1, unsigned int n2) const
- Math::Vector2 & get_d_value(unsigned int n1, unsigned int n2)
- virtual unsigned int get_dimensions() const
- const Math::Vector2 & get_nearest_d(const Math::Vector2 &v) const
- Math::Vector2 & get_nearest_d(const Math::Vector2 &v)
- double get_nearest_y(const Math::Vector2 &v) const
- double & get_nearest_y(const Math::Vector2 &v)
- const Math::Vector2 & get_origin() const
- const Math::Vector2 & get_step() const
- virtual Math::range_t get_x_range(unsigned int dimension) const
- virtual double get_x_value(unsigned int x, unsigned int dimension) const
- Math::Vector2 get_x_value_i(unsigned int n1, unsigned int n2) const
- double get_y_value(unsigned int n1, unsigned int n2) const
- double & get_y_value(unsigned int n1, unsigned int n2)
- virtual double get_y_value(const unsigned int n[]) const
- double interpolate(const Math::Vector2 &v) const
- virtual double interpolate(const double x[]) const
- virtual double interpolate(const double x[], unsigned int deriv, unsigned int dimension) const
- Math::Vector2 interpolate_deriv(const Math::Vector2 &v) const
- void resize(unsigned int n1, unsigned int n2)
- void set_all_d(const Math::Vector2 &deriv = [...])
- void set_all_y(double y = [...])
- virtual void set_interpolation(Interpolation i)
- void set_metrics(const Math::Vector2 &origin, const Math::Vector2 &step)
Members detail
Grid(unsigned int n1, unsigned int n2, const Math::Vector2 &origin = Math::Vector2(0,0), const Math::Vector2 &step = Math::Vector2(1,1))
Create a Grid object with given sample counts and metrics.
- n1: Number of samples along the first dimension axis.
- n2: Number of samples along the second dimension axis.
- origin: Grid origin point
- step: Step values for each grid dimensions
No documentation available
This virtual function implements the get_count
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Get total number of data stored for dimension n in data set
const Math::Vector2 & get_d_value(unsigned int n1, unsigned int n2) const
Get 1st derivative/gradient vector at sample point index (n1, n2). Only available when Data::BicubicDeriv interpolation is selected.
Math::Vector2 & get_d_value(unsigned int n1, unsigned int n2)
Get modifiable reference to 1st derivative/gradient vector at sample point index (n1, n2). Only available when Data::BicubicDeriv interpolation is selected.
This virtual function implements the get_dimensions
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Get total number of dimensions
Get 1st derivative/gradient vector stored at nearest sample point from 2d vector on grid. Only available when Data::BicubicDeriv interpolation is selected.
Get modifiable reference to 1st derivative/gradient vector stored at nearest sample point from 2d vector on grid. Only available when Data::BicubicDeriv interpolation is selected.
double get_nearest_y(const Math::Vector2 &v) const
Get value stored at nearest sample point from 2d vector on grid
double & get_nearest_y(const Math::Vector2 &v)
Get modifiable reference to value stored at nearest sample point from 2d vector on grid
const Math::Vector2 & get_origin() const
Get origin vector
const Math::Vector2 & get_step() const
Get step values vector
virtual Math::range_t get_x_range(unsigned int dimension) const
This virtual function implements the get_x_range
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Get minimal and maximal x values on dimension n found in data set
This virtual function implements the get_x_value
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Get data stored at position n on dimension dim in data set
Math::Vector2 get_x_value_i(unsigned int n1, unsigned int n2) const
Get 2d vector on grid of the sample point at index (n1, n2)
Get value stored at sample point index (n1, n2)
Get modifiable reference to value stored at sample point index (n1, n2)
This virtual function implements the get_y_value
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Get y data stored at position (x0, x1, ...) in data set
double interpolate(const Math::Vector2 &v) const
Interpolate data at given 2d vector point on grid using currently selected interpolation algorithm
This virtual function implements the interpolate
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Interpolate y value corresponding to given x value(s) in data set.
This virtual function implements the interpolate
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Interpolate y value corresponding to given x value in data set. Data may be differentiated several times along the requested dimension.
- deriv: Differentiation count, 0 means y value, 1 means 1st derivative...
- dim: Differentiation dimension
Interpolate gradient at given 2d vector point on grid using currently selected interpolation algorithm
Change grid size by defining new sample counts for each dimensions
void set_all_d(const Math::Vector2 &deriv = Math::Vector2(0,0))
Change all grid points stored gradient. Only available when Data::BicubicDeriv interpolation is selected.
Change all grid points stored values
virtual void set_interpolation(Interpolation i)
This virtual function implements the set_interpolation
pure function declared in the Set
base abstract class.
Documentation inherited from base class:
Select interpolation method
Set grid origin 2d vector and step values