cmatrix.Matrix.read_from_file

Matrix.read_from_file()

Read and convert a matrix from extern file. The file format must respect the writing convention (See write_in_file function).

Parameters

Type

Description

pathname

string

The file name to open

Returns
bint
  • True => file readed

  • False => Error occured

Examples

>>>  # Rebuild the matrix since test file, generated from write_in_file func
>>> m=Matrix(4,4)
>>> m.read_from_file("./test")
True
>>> print(m)
| +16.000 | +10.000 | +6.000 | +2.000 |
| +9.000 | +10.000 | +3.000 | +2.000 |
| +1.000 | +1.000 | +5.000 | +16.000 |
| +11.000 | +15.000 | +13.000 | +6.000 |
printed