hcube-0.1.1: Virtual Rubik's cube of arbitrary size.

Portability portable provisional echbar137@yahoo.co.in Safe

HCube.Utility

Description

Common utility functions, simple linear algebra.

Synopsis

# Documentation

Returns square root of argument if argument is a perfect square.

(|*|) :: Matrix -> Vec -> VecSource

Multiple a matrix on the left side of a vector.

Multiple two matrices.

Multiple a matrix by a scalar.

The cofactor of a matrix.

Transpose of a matrix.

Inverse of a matrix.

Display a matrix.

doM :: Monad m => (a -> Bool) -> (a -> m a) -> a -> m aSource

(~>) :: Monad m => m a -> (a -> b -> m b) -> b -> m bSource

(~|) :: Monad m => (a -> m b) -> a -> m aSource

(<*) :: Monad m => m a -> m b -> m aSource

concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]Source

A safe form of read.

spanFaces :: (Enum a, Num a, Ord b) => (Side -> Side -> b) -> [(a, b)]Source

Applies a function on the domain of Side x Side.

sides :: [Side]Source

List of the sides.

vecs :: [Vec]Source

List of the vectors.

multVec :: Numb -> Vec -> VecSource

Multiple a vector by a scalar.

mapVec :: (Vec -> Vec -> a) -> [Vec] -> aSource

Convert a function with two vector arguments to one accepting a list of vectors.

The determinate of a matrix.

vecDet :: Vec -> Vec -> Vec -> IntSource

Calculate the determinate of a matrix constructed by three column vectors.

Multiple a matrix by a scalar.

cross :: Vec -> Vec -> VecSource

The cross product of two vectors.

Vector multipled by scalar -1.

Vectors we are interested in only have one non zero component.

vpos :: Vec -> IntSource

Position of non-zero vector component.

dot :: Vec -> Vec -> NumbSource

The dot product of two vectors.