Skip to content

Commit 8ef9c8b

Browse files
authored
Merge pull request #38 from rlutowsk/matrices
read matrix fix
2 parents bf40d88 + 6b8f392 commit 8ef9c8b

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

gap/carat.gi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ BindGlobal( "CaratReadMatrix", function( input, str )
171171
local n, den, pos, m;
172172

173173
n := CaratNextNumber( str, 1 );
174+
while n=fail do
175+
str := CaratReadLine( input );
176+
n := CaratNextNumber( str, 1 );
177+
od;
174178

175179
# is matrix rational?
176180
pos := Position( str, '/' );

tst/carat.tst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,8 @@ gap> BravaisGroupsCrystalFamily( "4-2;1" );
122122
<matrix group of size 144 with 7 generators>,
123123
<matrix group of size 288 with 4 generators>,
124124
<matrix group of size 144 with 6 generators> ]
125+
126+
gap> name := CaratTmpFile("pres");;
127+
gap> PrintTo(name, "\n2d1\n1 1\n");
128+
gap> CaratReadMatrixFile( name );
129+
[ [ 1, 0 ], [ 0, 1 ] ]

0 commit comments

Comments
 (0)