matrix-as-xyz-0.1.1.0: Read and Display representation of matrix like "x,y,z"

Copyright(c) Jun Narumi 2017-2018
LicenseBSD3
Maintainernarumij@gmail.com
Stabilityexperimental
Portability?
Safe HaskellNone
LanguageHaskell2010

Data.Matrix.AsXYZ

Description

Read and Display matrix with xyz reperesentation. (like general equivalnet position of International tables of Crystallography.)

Synopsis

Documentation

fromXYZ :: Integral a => String -> Matrix (Ratio a) Source #

Create a matirx from xyz coordinate string of general equivalent position

                                     ( 1 % 1 0 % 1 0 % 1 0 % 1 )
                                     ( 0 % 1 1 % 1 0 % 1 0 % 1 )
                                     ( 0 % 1 0 % 1 1 % 1 0 % 1 )
fromXYZ "x,y,z" :: Matrix Rational = ( 0 % 1 0 % 1 0 % 1 1 % 1 )

                                                 ( 1 % 1 0 % 1 0 % 1 1 % 2 )
                                                 ( 0 % 1 1 % 1 0 % 1 1 % 3 )
                                                 ( 0 % 1 0 % 1 1 % 1 1 % 4 )
fromXYZ "x+1/2,y+1/3,z+1/4" :: Matrix Rational = ( 0 % 1 0 % 1 0 % 1 1 % 1 )

                                                             (  1  2  3  4 )
                                                             (  5  6  7  8 )
                                                             (  9 10 11 12 )
fromXYZ "x+2y+3z+4,5x+6y+7z+8,9x+10y+11z+12" :: Matrix Int = (  0  0  0  1 )

fromXYZ' :: Integral a => String -> Maybe (Matrix (Ratio a)) Source #

Maybe version

fromABC :: Integral a => String -> Matrix (Ratio a) Source #

It's uses abc instead of xyz

                                     ( 1 % 1 0 % 1 0 % 1 0 % 1 )
                                     ( 0 % 1 1 % 1 0 % 1 0 % 1 )
                                     ( 0 % 1 0 % 1 1 % 1 0 % 1 )
fromXYZ "a,b,c" :: Matrix Rational = ( 0 % 1 0 % 1 0 % 1 1 % 1 )

prettyXYZ Source #

Arguments

:: Integral a 
=> Matrix (Ratio a)

3x3, 3x4 or 4x4 matrix

-> String 

Get the xyz representation of matrix

>>> prettyXYZ (identity 4 :: Matrix Rational)
"x,y,z"
          ( 0 % 1 0 % 1 0 % 1 1 % 2 )
          ( 0 % 1 0 % 1 0 % 1 2 % 3 )
          ( 0 % 1 0 % 1 0 % 1 4 % 5 )
prettyXYZ ( 0 % 1 0 % 1 0 % 1 1 % 1 ) = "1/2,2/3,4/5"

prettyABC Source #

Arguments

:: Integral a 
=> Matrix (Ratio a)

3x3, 3x4 or 4x4 matrix

-> String 

It's uses abc instead of xyz

>>> prettyABC (identity 4 :: Matrix Rational)
"a,b,c"