matrix-as-xyz-0.1.2.2: Read and Display Jones-Faithful notation for spacegroup and planegroup

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

Data.Matrix.AsXYZ

Description

Read and Display Jones-Faithful notation for spacegroup (e.g. 'x,y,z') and planegroup (e.g. 'x,y')

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 string 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 as text format

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

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

Create a matirx from xyz coordinate string of general equivalent position

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

Maybe version

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

It's uses abc instead of xyz

prettyXY Source #

Arguments

:: Integral a 
=> Matrix (Ratio a)

2x2, 2x3 or 3x3 matrix

-> String 

Get the xyz string of matrix

prettyAB Source #

Arguments

:: Integral a 
=> Matrix (Ratio a)

2x2, 2x3 or 3x3 matrix

-> String 

It's uses abc instead of xyz as text format

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