Module Vector


module Vector: sig  end
Basic vector rountines.


Vectors of different sizes are distinct types, built by a functor fed a module containing the length of the vector. Internally, they're just a float array, but this removes the need to check arguments for the same dimensionality.

If you want to do serious linear algebra, you're probably better off with the lapack interface. This is just for lightweight use.

exception Different_dimensions of (int * int)
Thrown whe ncreating a vector from an array of the wrong length. The first int is the expected length, the second is the actual.
module type Dimension = sig  end
Describing the dimension of a vector
module type V = sig  end
Vector operations
module Make: functor (Dim : Dimension) -> V
module DimThree: Dimension
Dimension for three-element vectors
module Three: V
Three-element vector
val cross_product : Three.t -> Three.t -> Three.t
Cross-product of two 3d vectors