PSCF v1.1
|
A Matrix represents a matrix-valued parameter in parameter file. More...
Public Member Functions | |
def | __init__ (self, label, file) |
Constructor. More... | |
def | read (self, file) |
Read the a parameter block from a file. More... | |
def | __str__ (self) |
String representation of this Matrix object. More... | |
def | getString (self, depth='') |
Indented string representation of this Matrix object. More... | |
def | returnData (self) |
Return the value of this Matrix as a list of lists. More... | |
def | setValue (self, val) |
Set a new value for this Matrix. More... | |
A Matrix represents a matrix-valued parameter in parameter file.
A Matrix object represents a two-dimensional array or matrix of element values. A matrix appears in a parameter file in a multi-line format that begins with a line containing a label immediately followed by an opening parenthesis and ends with a line containing only a closing parenthesis. In between, each line contains a row index, a column index and the value of a single element of the matrix.
def pscfpp.param.Matrix.__init__ | ( | self, | |
label, | |||
file | |||
) |
Constructor.
label | label string for the Matrix. |
file | python file object, open for reading |
Definition at line 701 of file param.py.
References pscfpp.command.Command.label, pscfpp.param.Composite.label, pscfpp.param.Parameter.label, pscfpp.param.Array.label, pscfpp.param.Matrix.label, Util::XmlAttribute.label(), Util::XmlEndTag.label(), Util::XmlStartTag.label(), Util::ArrayParam< Type >.label(), Util::MatrixParam< Type >.label(), Util::Parameter.label(), Pscf::Pspc::BasisFieldState< D >.read(), Pscf::Pspg::BasisFieldState< D >.read(), pscfpp.output.Thermo.read(), pscfpp.param.Composite.read(), pscfpp.param.Array.read(), pscfpp.param.Matrix.read(), pscfpp.command.Script.read(), pscfpp.field.Field.read(), Util::Label.read(), Pscf::Fd1d::Mixture.read(), Pscf::AmIteratorTmpl< Iterator< D >, FieldCUDA >.read(), Pscf::AmIteratorTmpl< Iterator, T >.read(), Pscf::AmIteratorTmpl< Iterator< D >, DArray< double > >.read(), Pscf::AmIteratorTmpl< Iterator, DArray< double > >.read(), Pscf::Pspc::Domain< D >.read(), Pscf::Pspc::FilmIteratorBase< 3, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< 1, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< 2, IteratorType >.read(), Pscf::Pspc::FilmIteratorBase< D, IteratorType >.read(), Pscf::Pspc::Mixture< D >.read(), Pscf::Pspg::Mixture< D >.read(), Util::ParamComposite.read(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
def pscfpp.param.Matrix.read | ( | self, | |
file | |||
) |
Read the a parameter block from a file.
This function reads the elements of a Matrix from the file object that is passed as a parameter. On entry, the opening line containing the opening curly bracket ("{") must already have been processed, and the first unread line of the file should contain the value of the first element. Reading stops stops when the closing "}" is read.
file | a file object, open for reading |
Definition at line 718 of file param.py.
References pscfpp.param.getValue(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
Referenced by pscfpp.param.Composite.__init__(), pscfpp.field.Field.__init__(), pscfpp.command.Script.__init__(), pscfpp.output.Thermo.__init__(), pscfpp.param.Matrix.__init__(), and pscfpp.param.Array.__init__().
def pscfpp.param.Matrix.__str__ | ( | self | ) |
String representation of this Matrix object.
This function return a multi-line string representation of this Matrix object in the PSCF param file format, with no indentation of the first line.
Definition at line 749 of file param.py.
References pscfpp.param.Composite.getString(), pscfpp.param.Parameter.getString(), pscfpp.param.Array.getString(), and pscfpp.param.Matrix.getString().
Referenced by pscfpp.field.Field.write(), pscfpp.output.Thermo.write(), and pscfpp.output.State.write().
def pscfpp.param.Matrix.getString | ( | self, | |
depth = '' |
|||
) |
Indented string representation of this Matrix object.
This function returns an indented string representation of this Matrix object in PSCF parameter file format, with a controllable indentation of the first line.
depth | the spaces string as the prefix depth. |
Definition at line 761 of file param.py.
References pscfpp.command.Command.label, pscfpp.param.Composite.label, pscfpp.param.Parameter.label, pscfpp.param.Array.label, pscfpp.param.Matrix.label, Util::XmlAttribute.label(), Util::XmlEndTag.label(), Util::XmlStartTag.label(), Util::ArrayParam< Type >.label(), Util::MatrixParam< Type >.label(), Util::Parameter.label(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
Referenced by pscfpp.param.Composite.__str__(), pscfpp.param.Parameter.__str__(), pscfpp.param.Array.__str__(), pscfpp.param.Matrix.__str__(), and pscfpp.param.Composite.write().
def pscfpp.param.Matrix.returnData | ( | self | ) |
Return the value of this Matrix as a list of lists.
Definition at line 773 of file param.py.
References pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.
def pscfpp.param.Matrix.setValue | ( | self, | |
val | |||
) |
Set a new value for this Matrix.
This function sets the new value, parameter val, to the Matrix object.
val | the new value |
Definition at line 784 of file param.py.
References pscfpp.param.getValue(), pscfpp.param.Parameter.val, pscfpp.param.Array.val, and pscfpp.param.Matrix.val.