numeric-tools-0.2.0.1: Collection of numerical tools for integration, differentiation etc.

Portabilityportable
Stabilityexperimental
MaintainerAleksey Khudyakov <alexey.skladnoy@gmail.com>
Safe HaskellNone

Numeric.Tools.Mesh

Contents

Description

1-dimensional meshes. Used by Interpolation.

Synopsis

Meshes

class Indexable a => Mesh a whereSource

Class for 1-dimensional meshes. Mesh is ordered set of points. Each instance must guarantee that every next point is greater that previous and there is at least 2 points in mesh.

Every mesh is instance of Indexable and indexing should get n'th mesh node.

Methods

meshLowerBound :: a -> DoubleSource

Low bound of mesh

meshUpperBound :: a -> DoubleSource

Upper bound of mesh

meshFindIndex :: a -> Double -> IntSource

Find such index for value that

 mesh ! i <= x && mesh ! i+1 > x

Will return invalid index if value is out of range.

Instances

Uniform mesh

uniformMeshStep :: UniformMesh -> DoubleSource

Distance between points

Constructors

uniformMeshSource

Arguments

:: (Double, Double)

Lower and upper bound

-> Int

Number of points

-> UniformMesh 

Create uniform mesh

uniformMeshNSource

Arguments

:: Double

Lower bound

-> Double

Mesh step

-> Int

Number of points

-> UniformMesh 

Create uniform mesh