Loading [MathJax]/extensions/TeX/AMSsymbols.js
PSCF v1.2
pscfpp.param.Matrix Class Reference

A Matrix represents a matrix-valued parameter in parameter file. More...

Public Member Functions

 __init__ (self, label, file)
 Constructor.
 
 read (self, file)
 Read the a parameter block from a file.
 
 __str__ (self)
 String representation of this Matrix object.
 
 getString (self, depth='')
 Indented string representation of this Matrix object.
 
 returnData (self)
 Return the value of this Matrix as a list of lists.
 
 setValue (self, val)
 Set a new value for this Matrix.
 

Detailed Description

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.

Definition at line 696 of file param.py.

Constructor & Destructor Documentation

◆ __init__()

pscfpp.param.Matrix.__init__ ( self,
label,
file )

Constructor.

Parameters
labellabel string for the Matrix.
filepython file object, open for reading

Definition at line 704 of file param.py.

References pscfpp.command.Command.label, pscfpp.param.Array.label, pscfpp.param.Composite.label, pscfpp.param.Matrix.label, pscfpp.param.Parameter.label, Util::ArrayParam< Type >.label(), Util::MatrixParam< Type >.label(), Util::Parameter.label(), Util::XmlAttribute.label(), Util::XmlEndTag.label(), Util::XmlStartTag.label(), Pscf::AmIteratorTmpl< Iterator, T >.read(), Pscf::AmIteratorTmpl< Compressor< D >, DArray< double > >.read(), Pscf::AmIteratorTmpl< Compressor< D >, DeviceArray< cudaReal > >.read(), Pscf::AmIteratorTmpl< Iterator, DArray< double > >.read(), Pscf::AmIteratorTmpl< Iterator< D >, DArray< double > >.read(), Pscf::AmIteratorTmpl< Iterator< D >, FieldCUDA >.read(), Pscf::Prdc::MaskGenFilmBase< D >.read(), Pscf::R1d::Mixture.read(), Pscf::Rpc::Analyzer< D >.read(), Pscf::Rpc::AnalyzerManager< D >.read(), Pscf::Rpc::AverageAnalyzer< D >.read(), Pscf::Rpc::AverageListAnalyzer< D >.read(), Pscf::Rpc::BasisFieldState< D >.read(), Pscf::Rpc::ConcentrationWriter< D >.read(), Pscf::Rpc::Domain< D >.read(), Pscf::Rpc::EinsteinCrystalPerturbation< D >.read(), Pscf::Rpc::ExplicitBdStep< D >.read(), Pscf::Rpc::ForceBiasMove< D >.read(), Pscf::Rpc::LinearSweep< D >.read(), Pscf::Rpc::LMBdStep< D >.read(), Pscf::Rpc::LrCompressor< D >.read(), Pscf::Rpc::Mixture< D >.read(), Pscf::Rpc::PredCorrBdStep< D >.read(), Pscf::Rpc::RealMove< D >.read(), Pscf::Rpc::TrajectoryWriter< D >.read(), Pscf::Rpg::AnalyzerManager< D >.read(), Pscf::Rpg::AverageAnalyzer< D >.read(), Pscf::Rpg::AverageListAnalyzer< D >.read(), Pscf::Rpg::BasisFieldState< D >.read(), Pscf::Rpg::ConcentrationWriter< D >.read(), Pscf::Rpg::EinsteinCrystalPerturbation< D >.read(), Pscf::Rpg::ExplicitBdStep< D >.read(), Pscf::Rpg::ForceBiasMove< D >.read(), Pscf::Rpg::FourierMove< D >.read(), Pscf::Rpg::LMBdStep< D >.read(), Pscf::Rpg::LrCompressor< D >.read(), Pscf::Rpg::McSimulator< D >.read(), Pscf::Rpg::Mixture< D >.read(), Pscf::Rpg::PredCorrBdStep< D >.read(), Pscf::Rpg::RealMove< D >.read(), Pscf::Rpg::TrajectoryWriter< D >.read(), pscfpp.command.Script.read(), pscfpp.field.Field.read(), pscfpp.output.Thermo.read(), pscfpp.param.Array.read(), pscfpp.param.Composite.read(), pscfpp.param.Matrix.read(), Util::Label.read(), Util::ParamComposite.read(), pscfpp.param.Array.val, pscfpp.param.Matrix.val, and pscfpp.param.Parameter.val.

Member Function Documentation

◆ read()

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.

Parameters
filea file object, open for reading

Definition at line 721 of file param.py.

References pscfpp.param.getValue(), pscfpp.param.Array.val, pscfpp.param.Matrix.val, and pscfpp.param.Parameter.val.

Referenced by pscfpp.command.Script.__init__(), pscfpp.field.Field.__init__(), pscfpp.output.Thermo.__init__(), pscfpp.param.Array.__init__(), pscfpp.param.Composite.__init__(), and pscfpp.param.Matrix.__init__().

◆ __str__()

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 752 of file param.py.

References pscfpp.param.Array.getString(), pscfpp.param.Composite.getString(), pscfpp.param.Matrix.getString(), and pscfpp.param.Parameter.getString().

Referenced by pscfpp.field.Field.write(), pscfpp.output.State.write(), and pscfpp.output.Thermo.write().

◆ getString()

pscfpp.param.Matrix.getString ( self,
depth = '' )

◆ returnData()

pscfpp.param.Matrix.returnData ( self)

Return the value of this Matrix as a list of lists.

Definition at line 776 of file param.py.

References pscfpp.param.Array.val, pscfpp.param.Matrix.val, and pscfpp.param.Parameter.val.

◆ setValue()

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.

Parameters
valthe new value

Definition at line 787 of file param.py.

References pscfpp.param.getValue(), pscfpp.param.Array.val, pscfpp.param.Matrix.val, and pscfpp.param.Parameter.val.


The documentation for this class was generated from the following file: