ams.core.matprocessor.MParam#

class ams.core.matprocessor.MParam(name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, v: ndarray | None = None, owner: object | None = None, sparse: bool | None = False, col_names: list | None = None, row_names: list | None = None)[source]#

Class for matrix parameters built from the system.

MParam is designed to be a subclass of RParam for routine parameters management.

Parameters:
namestr, optional

Name of this parameter. If not provided, name will be set to the attribute name.

tex_namestr, optional

LaTeX-formatted parameter name. If not provided, tex_name will be assigned the same as name.

infostr, optional

A description of this parameter

unitstr, optional

Unit of the parameter.

vnp.ndarray, optional

Matrix value of the parameter.

ownerobject, optional

Owner of the MParam, usually the MatProcessor instance.

sparsebool, optional

If True, the matrix is stored in sparse format.

col_nameslist, optional

Column names of the matrix.

row_nameslist, optional

Row names of the matrix.

__init__(name: str | None = None, tex_name: str | None = None, info: str | None = None, unit: str | None = None, v: ndarray | None = None, owner: object | None = None, sparse: bool | None = False, col_names: list | None = None, row_names: list | None = None)[source]#

Methods

dense()

Return the parameter value as a dense numpy.ndarray.

evaluate(*args, **kwargs)

export_csv([path])

Export the matrix to a CSV file.

export_npz([path])

Export the matrix to a npz file.

get_all_idxes()

Return all the indexes of this item.

get_idx()

load_csv([path, chunksize, dtype])

Load the matrix from an EXPORTED CSV file.

load_npz([path])

Load the FULL matrix from a npz file.

parse(*args, **kwargs)

update()

Update the Parameter value.

Attributes

class_name

Return the class name

e

Return the calculated numerical value of the underlying expression.

formulation_source

Where the live CVXPY object for this item came from.

n

Return the size of the parameter without materializing the value.

shape

Return the shape of the parameter without materializing the value.

size

Return the size.

v

Return the underlying value of the parameter.