| IGLib 1.7.2 The IGLib base library for development of numerical, technical and business applications.

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Public Member Functions | Properties | Private Attributes | List of all members
IG.Num.GridGenerator1d Class Reference

Generates 1D grids with equidistant or geometrically grown intervals. More...

Inheritance diagram for IG.Num.GridGenerator1d:
[legend]
Collaboration diagram for IG.Num.GridGenerator1d:
[legend]

## Public Member Functions
| GridGenerator1d ()
| Creates a uniform 1D grid generator that generates two nodes at 0 and 1. More...
| GridGenerator1d (double from, double to, int numNodes, bool centered, double growthFactor, double scalingFactor)
| Creates a 1D grid generator. Grid intervals can grow or fall in geometric series, either from the lower limit or from the center of the grid interval, and the grid can also be scaled. More...
| GridGenerator1d (double from, double to, int numNodes, bool centered, double growthFactor)
| Creates a 1D grid generator. Grid intervals can grow or fall in geometric series, either from the lower limit or from the center of the grid interval. More...
| GridGenerator1d (double from, double to, int numNodes, double growthFactor)
| Creates a 1D grid generator. Grid intervals can grow or fall in geometrical series from the lower bound of the grid interval. More...
| GridGenerator1d (double from, double to, int numNodes)
| Creates a 1D grid generator for uniform grid (equidistant intervals). More...
void | MakeUniformUnscaled ()
| Resets the parameters in such away that the generated grid is uniform (equidistant intervals) and with scaling factor 1. More...
override void | CalculateGrid (ref List< double > nodeList)
| Performs grid generation and stores the generated nodes directly on the provided list. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date. More...
Public Member Functions inherited from IG.Num.GridGenerator1dBase
virtual void | ClearResults ()
| Clears the results of grid generation (releases internal structures). The Calculated flag is set to false. More...
virtual void | CalculateGrid (ref List< double > nodeList, ref List< double > intervalLengthsList)
| Performs grid generation and stores the generated nodes and intervals between them directly on the provided lists. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date. More...
virtual void | CalculateGrid ()
| Performs grid generation according to current settings. The generated grid is stored in internal structures of the generator, from where it can be readily copied (e.g. by GetNodeTable() or by GetNodeList()), used in some other way (e.g. by GetIntervalLengthsList) or just referenced (e.g. by GetNodeListReference()). If the grid has already been generated and it is up to date (according to parameters of the generator) then the grid is not re-calculated. More...
virtual double | GetNode (int which)
| Returns the specified node of the generated grid. If necessary, grid is generated first in order to obtain the correct data. More...
virtual void | GetNodeTable (ref double[] result)
| Stores the node positions of the generated 1D grid into the specified table. If necessary, grid is generated first in order to obtain the correct data. More...
virtual double[] | GetNodeTable ()
| Returns a table containing 1D node positions. A copy of list of node positions is always created and returned, therefore it is guaranteed that this table will not be used by some other object related to the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
virtual void | GetNodeList (ref List< double > result)
| Stores the node positions of the generated 1D grid into the specified list. If necessary, grid is generated first in order to obtain the correct data. More...
virtual List< double > | GetNodeList ()
| Returns a list containing 1D node positions. A copy of list of node positions is always created and returned, therefore it is guaranteed that this table will not be used by some other object related to the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
virtual List< double > | GetNodeListReference ()
| Returns a list containing generated 1D node positions. This method can return a reference to the internal list containing the generated node coordinated. This means that any future generation or other operation performed by the generator can override list contents. In order to use contents of the list thread safely, enclose this method call and all subsequent operations you will perform on the returned list of generated nodes, within a lock((...).Lock){ ... } block. If necessary, grid is generated first in order to obtain the correct data. More...
virtual void | GetIntervalLengthsTable (ref double[] result)
| Stores a table of interval lengths between the generated nodes into the specified array. If necessary, grid is generated first in order to obtain the correct data. More...
virtual double[] | GetIntervalLengthsTable ()
| Generates and returns a table of interval lengths between the generated nodes. The returned table is a copy that will not be overridden by further operations on the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
virtual void | GetIntervalLengthsList (ref List< double > result)
| Stores a table of interval lengths between the generated nodes into the specified list. If necessary, grid is generated first in order to obtain the correct data. More...
virtual List< double > | GetIntervalLengthsList ()
| Generates and returns a list of interval lengths between the generated nodes. The returned list is a copy that will not be overridden by further operations on the grid generator. If necessary, grid is generated first in order to obtain the correct data. More...
virtual double | GetIntervalLength (int which)
| Returns the length of the specified interval between generated nodes of the grid. If necessary, grid is generated first in order to obtain the correct data. More...

## Properties
bool | Centered`[get, set]`
| Flag specifying whether intervals grow in both direction from the center of the grid interval. More...
double | GrowthFactor`[get, set]`
| Quotient of lengths of two consecutive intervals of the generated grid. More...
double | ScalingFactor`[get, set]`
| Scaling factor by which the whole generated grid is scaled. This enables the generated grid to extend outside the prescribed lower and upper bound, or to be shrinked within this interval. WARNING: In most cases, scaling should be kept at 1.0. More...
Properties inherited from IG.Num.GridGenerator1dBase
object | Lock`[get]`
| Object used for locking of the current object (ILockable interface). More...
virtual double | CoordinateFirst`[get, set]`
| Gets or sets coordinate of the first generated node (usually the minimal generated coordinate). More...
virtual double | CoordinateLast`[get, set]`
| Gets or sets coordinate of the last generated node (usually the maximal generated coordinate). More...
virtual int | NumNodes`[get, set]`
| Gets or sets teh number of nodes to be generated. More...
virtual int | NumIntervals`[get]`
| Gets the number of intervals between the nodes. Simply NumNodes-1. More...
virtual bool | Calculated`[get, protected set]`
| Flag indicating whether the grid is generated ready to use. If true then node positions are contained in an internal structure, such that they can be obtained simply by copying this structure (i.e. no need for re-calculation). REMARK: If you intend to do something with results on basis of the value of this flag, don't forget to enclose checking of the flag and your operation into the lock(....Lock){ ... } block. More...
Properties inherited from IG.Num.IGridGenerator1d
double | CoordinateFirst`[get, set]`
| Gets or sets coordinate of the first generated node (usually the minimal generated coordinate). More...
double | CoordinateLast`[get, set]`
| Gets or sets coordinate of the last generated node (usually the maximal generated coordinate). More...
int | NumNodes`[get, set]`
| Gets or sets teh number of nodes to be generated. More...
int | NumIntervals`[get]`
| Gets the number of intervals between the nodes. Simply NumNodes-1. More...
bool | Calculated`[get]`
| Flag indicating whether the grid is generated ready to use. If true then node positions are contained in an internal structure, such that they can be obtained simply by copying this structure (i.e. no need for re-calculation). REMARK: If you intend to do something with results on basis of the value of this flag, don't forget to enclose checking of the flag and your operation into the lock(....Lock){ ... } block. More...
Properties inherited from IG.Lib.ILockable
object | Lock`[get]`

## Private Attributes
bool | _centered = false
double | _growthFactor = 1.0
double | _scalingFactor = 1.0

## Additional Inherited Members
Static Public Member Functions inherited from IG.Num.GridGenerator1dBase
static GridGenerator1d | CreateUniform (double from, double to, int numNodes)
| Creates and returns a 1D grid generator for uniform grid (equidistant intervals). More...
static GridGenerator1d | CreateGeometric (double from, double to, int numNodes, double growthFactor)
| Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometrical series from the lower bound of the grid interval. More...
static GridGenerator1d | CreateGeometricCentered (double from, double to, int numNodes, double growthFactor)
| Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the center of the grid interval towards the bounds. More...
static GridGenerator1d | CreateGeometricScaled (double from, double to, int numNodes, double growthFactor, double scalingFactor)
| Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the lower bound towards teh upper bound of the grid interval, and the grid can also be scaled. More...
static GridGenerator1d | CreateGeometricCenteredScaled (double from, double to, int numNodes, double growthFactor, double scalingFactor)
| Creates and returns a 1D grid generator. Grid intervals can grow or fall in geometric series from the center of the grid interval, and the grid can also be scaled. More...
static GridGenerator1dFunc | CreateFunctionBased (double from, double to, int numNodes, IRealFunction function, double firstFunctionArgument, double lastFunctionArgument)
| Creates and returns a 1D grid generator where grid point positions are calculated by the specified function. More...
static void | CalculateGridUnitFactors (int numElements, bool centered, double growthFactor, double scalingFactor, ref List< double > factors)
| Calculates factors for a table of values between two points, and stores them to factors. More...
static void | CalculateGridUnitFactors (int numElements, IRealFunction func, double firstFunctionArgument, double lastFunctionArgument, ref List< double > factors)
| Calculates factors for a table of values between two points, and stores them to a list. Factors are calculated according to values of a function of one variable, evaluated in equidistant points on the specified interval, and scaled such that they lie between 0 and 1. It is caller's responsibility to provide a monotonous function, otherwise some factors can lie outside the [0,1] interval and are not ordered. More...
static void | CalculateIntervalLenghts (List< double > nodes, ref List< double > lengths)
| Calculates lengths of subsequent intervals defined by the first list, and stores it to the second list. More...
static void | CalculateIntervalLenghRatios (List< double > nodes, ref List< double > lengthRatios)
| Calculates length ratios between subsequent intervals defined by the first list, ans stores it to the second list. More...
static void | ExampleTableFactors ()
| Examples for calculating table factors. More...
static void | FitGridNode (double minCurrent, double maxCurrent, double minTarget, double maxTarget, ref double node)
| Grid stretching to fit the specified interval bounds. Modifies position of the generated 1d grid node in such a way that it fits the new grid interval. More...
static void | FitGridNodes (double minCurrent, double maxCurrent, double minTarget, double maxTarget, List< double > nodes)
| Grid stretching to fit the specified interval bounds. Modifies positions of the generated 1d grid nodes contained in the specified list in such a way that it fits the new grid interval. More...
Protected Member Functions inherited from IG.Num.GridGenerator1dBase
| GridGenerator1dBase ()
Protected Attributes inherited from IG.Num.GridGenerator1dBase
List< double > | _nodes
| Internally stored generated nodes. More...

## Detailed Description

Generates 1D grids with equidistant or geometrically grown intervals.

$A Igor Apr10 Dec10;

## Constructor & Destructor Documentation

IG.Num.GridGenerator1d.GridGenerator1d | ( |  | ) |
| inline

Creates a uniform 1D grid generator that generates two nodes at 0 and 1.

IG.Num.GridGenerator1d.GridGenerator1d | ( | double | from,
|  | double | to,
|  | int | numNodes,
|  | bool | centered,
|  | double | growthFactor,
|  | double | scalingFactor
| ) |  |
| inline

Creates a 1D grid generator. Grid intervals can grow or fall in geometric series, either from the lower limit or from the center of the grid interval, and the grid can also be scaled.

Parameters

  from | Lower bound of the generated 1D grid (can change when scaling is applied).
  to | Upper bound of the generated 1D grid (can change when scaling is applied).
  numNodes | Number of nodes generated.
  centered | Specifies whether the grid is centered in such a way that the intervals grow or fall from the center towards the bounds.
  growthFactor | Factor of interval growth. Factor 1 means a uniform grid with equidistant intervals. If factor is larger than 1 then intervals grow from the lower bound towards the upper bound. (or from the center, in the case that centered = true). If factor is less than 1 then intervals shrink in this direction.
  scalingFactor | Factor by which the grid is scaled.

References IG.Lib.Centered.

IG.Num.GridGenerator1d.GridGenerator1d | ( | double | from,
|  | double | to,
|  | int | numNodes,
|  | bool | centered,
|  | double | growthFactor
| ) |  |
| inline

Creates a 1D grid generator. Grid intervals can grow or fall in geometric series, either from the lower limit or from the center of the grid interval.

Parameters

  from | Lower bound of the generated 1D grid.
  to | Upper bound of the generated 1D grid.
  numNodes | Number of nodes generated.
  centered | Specifies whether the grid is cnetered in such a way that the intervals grow or fall from the center towards the bounds.
  growthFactor | Factor of interval growth. Factor 1 means a uniform grid with equidistant intervals. If factor is larger than 1 then intervals grow from the lower bound towards the upper bound. (or from the center, in the case that centered = true). If factor is less than 1 then intervals shrink in this direction.

IG.Num.GridGenerator1d.GridGenerator1d | ( | double | from,
|  | double | to,
|  | int | numNodes,
|  | double | growthFactor
| ) |  |
| inline

Creates a 1D grid generator. Grid intervals can grow or fall in geometrical series from the lower bound of the grid interval.

Parameters

  from | Lower bound of the generated 1D grid.
  to | Upper bound of the generated 1D grid.
  numNodes | Number of nodes generated.
  growthFactor | Factor of interval growth. Factor 1 means a uniform grid with equidistant intervals. If factor is larger than 1 then intervals grow from the lower bound towards the upper bound. If factor is less than 1 then intervals shrink in this direction.

IG.Num.GridGenerator1d.GridGenerator1d | ( | double | from,
|  | double | to,
|  | int | numNodes
| ) |  |
| inline

Creates a 1D grid generator for uniform grid (equidistant intervals).

Parameters

  from | Lower bound of the generated 1D grid.
  to | Upper bound of the generated 1D grid.
  numNodes | Number of nodes generated.

## Member Function Documentation

void IG.Num.GridGenerator1d.MakeUniformUnscaled | ( |  | ) |
| inline

Resets the parameters in such away that the generated grid is uniform (equidistant intervals) and with scaling factor 1.

References IG.Lib.Centered.

override void IG.Num.GridGenerator1d.CalculateGrid | ( | ref List< double > | nodeList | ) |
| inline

Performs grid generation and stores the generated nodes directly on the provided list. Unless necessary due to nature of generation, results are not stored internally on the current grid generator object. Because of this, the Calculated flag is normally not set after calling this function. WARNING: This method generates a grid even if it has already been generated and is up to date.

Parameters

  nodeList | A list where node coordinates are stored. List is allocated or re-allocated if necessary.

Implements IG.Num.IGridGenerator1d.

References IG.Lib.Centered.

## Member Data Documentation

bool IG.Num.GridGenerator1d._centered = false
| private

double IG.Num.GridGenerator1d._growthFactor = 1.0
| private

double IG.Num.GridGenerator1d._scalingFactor = 1.0
| private

## Property Documentation

bool IG.Num.GridGenerator1d.Centered
| get set

Flag specifying whether intervals grow in both direction from the center of the grid interval.

double IG.Num.GridGenerator1d.GrowthFactor
| get set

Quotient of lengths of two consecutive intervals of the generated grid.

Referenced by IG.Num.NeuralTrainingLimits.PrepareNeuronsTable(), and IG.Script.LoadableScriptShellNeuralBase.PrepareNeuronsTable().

double IG.Num.GridGenerator1d.ScalingFactor
| get set

Scaling factor by which the whole generated grid is scaled. This enables the generated grid to extend outside the prescribed lower and upper bound, or to be shrinked within this interval. WARNING: In most cases, scaling should be kept at 1.0.

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

- igbase/numeric/geometry/GridGenerator1d.cs