Skip to content

Commit

Permalink
fix #79
Browse files Browse the repository at this point in the history
  • Loading branch information
malb committed Jul 13, 2017
1 parent 04d1f73 commit 2bc30f5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/fpylll/fplll/integer_matrix.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1432,6 +1432,18 @@ cdef class IntegerMatrix:
def from_file(cls, filename):
"""Construct new matrix from file.
>>> import tempfile
>>> A = IntegerMatrix.random(10, "qary", k=5, bits=20)
>>> fn = tempfile.mktemp()
>>> fh = open(fn, "w")
>>> fh.write(str(A))
>>> fh.close()
>>> B = IntegerMatrix.from_file(fn)
>>> A == B
True
:param filename: name of file to read from
"""
Expand All @@ -1455,7 +1467,7 @@ cdef class IntegerMatrix:
raise RuntimeError("Integer type '%s' not understood."%(<IntegerMatrix>A)._type)

for j, v in enumerate(values):
A._set(i, j, v)
(<IntegerMatrix>A)._set(i, j, v)
return A


Expand Down

0 comments on commit 2bc30f5

Please sign in to comment.