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

Portabilityportable
Stabilityprovisional
Maintainerechbar137@yahoo.co.in
Safe HaskellSafe

HCube.Utility

Description

Common utility functions, simple linear algebra.

Synopsis

Documentation

squareRoot :: Int -> Maybe IntSource

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

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

Multiple a matrix on the left side of a vector.

(|**|) :: Matrix -> Matrix -> MatrixSource

Multiple two matrices.

multMatrix :: Numb -> Matrix -> MatrixSource

Multiple a matrix by a scalar.

cofactors :: Matrix -> MatrixSource

The cofactor of a matrix.

transposeM :: Matrix -> MatrixSource

Transpose of a matrix.

inverse :: Matrix -> MatrixSource

Inverse of a matrix.

showM :: Matrix -> StringSource

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

maybeRead :: String -> Maybe IntSource

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.

det :: Matrix -> IntSource

The determinate of a matrix.

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

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

matrixMult :: Matrix -> Int -> MatrixSource

Multiple a matrix by a scalar.

cross :: Vec -> Vec -> VecSource

The cross product of two vectors.

minus :: Vec -> VecSource

Vector multipled by scalar -1.

vcomp :: Vec -> IntSource

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.