MCPcopy Create free account
hub / github.com/cvxpy/cvxpy / index

Method index

cvxpy/interface/base_matrix_interface.py:85–91  ·  view source on GitHub ↗
(self, matrix, key)

Source from the content-addressed store, hash-verified

83
84 # Return the value at the given index in the matrix.
85 def index(self, matrix, key):
86 value = matrix[key]
87 # Reduce to a scalar if possible.
88 if cvxpy.interface.matrix_utilities.shape(value) == (1, 1):
89 return cvxpy.interface.matrix_utilities.scalar_value(value)
90 else:
91 return value
92
93 # Coerce the matrix into the given shape.
94 @abc.abstractmethod

Callers 1

indexFunction · 0.45

Calls 2

shapeMethod · 0.45
scalar_valueMethod · 0.45

Tested by

no test coverage detected