Object-oriented Scientific Computing Library: Version 0.910
Public Member Functions | Protected Member Functions | Protected Attributes
uniform_grid< data_t > Class Template Reference

A class representing a uniform linear or logarithmic grid. More...

#include <uniform_grid.h>

Inheritance diagram for uniform_grid< data_t >:
uniform_grid_end< data_t > uniform_grid_end_width< data_t > uniform_grid_log_end< data_t > uniform_grid_log_end_width< data_t > uniform_grid_log_width< data_t > uniform_grid_width< data_t >

Detailed Description

template<class data_t = double>
class uniform_grid< data_t >

Note:
This class has no public constructors and is to be instantiated through its children.

Definition at line 37 of file uniform_grid.h.

Public Member Functions

size_t get_nbins ()
 Get the number of bins (regions in between grid points)
size_t get_npoints ()
 Get the number of points in the grid (always get_nbins()+1)
bool is_log ()
 Return true if the grid is logarithmic.
template<class vec_t >
void vector (vec_t &v)
 Fill a vector with the specified grid.
const data_t operator[] (size_t i) const
 Get the grid point with index i ( $ i \in [0,\mathrm{n_bins}] $)

Protected Member Functions

 uniform_grid (data_t start, data_t end, data_t width, size_t n_bins, bool log=false)
 Construct a grid with specified values.

Protected Attributes

data_t g_start
 The low-side of the first bin.
data_t g_end
 The high-side of the last bin.
data_t g_width
 The width of each bin.
size_t g_n_bins
 The number of bins.
bool g_log
 If true, use a logarithmic scale.

Constructor & Destructor Documentation

template<class data_t = double>
uniform_grid< data_t >::uniform_grid ( data_t  start,
data_t  end,
data_t  width,
size_t  n_bins,
bool  log = false 
) [inline, protected]
Note:
This function is not public because it might create grids that are non-sensical. We require users to create grid objects using one of the children which don't allow non-sensical grids.

Definition at line 64 of file uniform_grid.h.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).

Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads.