CMP++: Uncertainty Quantification & Bayesian Calibration
Loading...
Searching...
No Matches
cmp::grid::LinspacedGrid Class Reference

Linearly spaced Cartesian tensor product grid generator. More...

#include <grid.h>

Inheritance diagram for cmp::grid::LinspacedGrid:
Collaboration diagram for cmp::grid::LinspacedGrid:

Public Member Functions

 LinspacedGrid (const Eigen::Ref< const Eigen::VectorXd > &lowerBound, const Eigen::Ref< const Eigen::VectorXd > &upperBound)
 Constructs a LinspacedGrid.
 
Eigen::MatrixXd construct (const size_t &nPoints) override
 Constructs the linearly spaced grid matrix.
 
size_t dim () const override
 Returns the dimension of the domain.
 
- Public Member Functions inherited from cmp::grid::Grid
virtual ~Grid ()=default
 

Private Member Functions

Eigen::VectorXs gridElement (const size_t &index, const size_t &n_pts, const size_t &dim)
 Helper to retrieve the multi-dimensional grid index matching a flat index.
 

Private Attributes

size_t dimension_
 Number of dimensions.
 
Eigen::VectorXd lowerBound_
 Lower bounds vector.
 
Eigen::VectorXd upperBound_
 Upper bounds vector.
 

Detailed Description

Linearly spaced Cartesian tensor product grid generator.

Mathematical Formulation Given a total number of target points \(N\), computes the number of points per dimension:

\[ N_d = \lceil N^{1/D} \rceil \]

Constructs a uniform Cartesian grid of size \(N_d^D\).

Constructor & Destructor Documentation

◆ LinspacedGrid()

cmp::grid::LinspacedGrid::LinspacedGrid ( const Eigen::Ref< const Eigen::VectorXd > &  lowerBound,
const Eigen::Ref< const Eigen::VectorXd > &  upperBound 
)
inline

Constructs a LinspacedGrid.

Parameters
lowerBoundThe lower bounds of the hyperrectangle.
upperBoundThe upper bounds of the hyperrectangle.

Member Function Documentation

◆ construct()

Eigen::MatrixXd cmp::grid::LinspacedGrid::construct ( const size_t &  nPoints)
inlineoverridevirtual

Constructs the linearly spaced grid matrix.

Parameters
nPointsTarget number of points (actual size will be rounded up to the nearest perfect power).

Implements cmp::grid::Grid.

◆ dim()

size_t cmp::grid::LinspacedGrid::dim ( ) const
inlineoverridevirtual

Returns the dimension of the domain.

Implements cmp::grid::Grid.

◆ gridElement()

Eigen::VectorXs cmp::grid::LinspacedGrid::gridElement ( const size_t &  index,
const size_t &  n_pts,
const size_t &  dim 
)
private

Helper to retrieve the multi-dimensional grid index matching a flat index.

Member Data Documentation

◆ dimension_

size_t cmp::grid::LinspacedGrid::dimension_
private

Number of dimensions.

◆ lowerBound_

Eigen::VectorXd cmp::grid::LinspacedGrid::lowerBound_
private

Lower bounds vector.

◆ upperBound_

Eigen::VectorXd cmp::grid::LinspacedGrid::upperBound_
private

Upper bounds vector.


The documentation for this class was generated from the following files: