ams.core.service.VarReduction#
- class ams.core.service.VarReduction(u: Callable, fun: Callable, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#
A numerical matrix to reduce a 2D variable to 1D,
np.fun(shape=(1, u.n)).- Parameters:
- uCallable
The input matrix variable.
- funCallable
The reduction function that takes a shape argument (1D shape) as input.
- namestr, optional
The name of the instance.
- tex_namestr, optional
The TeX name for the instance.
- unitstr, optional
The unit of the output.
- infostr, optional
A description of the operation.
- vtypeType, optional
The variable type.
- rfunCallable, optional
Function to apply to the output of
fun.- rargsdict, optional
Keyword arguments to pass to
rfun.- no_parse: bool, optional
True to skip parsing the service.
- sparse: bool, optional
True to return output as scipy csr_matrix.
- __init__(u: Callable, fun: Callable, name: str = None, tex_name: str = None, unit: str = None, info: str = None, vtype: Type = None, rfun: Callable = None, rargs: dict = None, no_parse: bool = False, sparse: bool = False)[source]#
Methods
Assign memory for
self.vand set the array to zero.evaluate(*args, **kwargs)Return all the indexes of this item.
get_idx()Return name in a list
parse(*args, **kwargs)update()Update the Parameter value.
Attributes
Return the class name
Return the calculated numerical value of the underlying expression.
Where the live CVXPY object for this item came from.
Return the count of values in
self.v.Return the shape of the service.
Return the size.
Value of the service.