'Convert an arbitrary value into a matrix of type self.target_matrix.
Args:
value: The constant to be converted.
convert_scalars: Should scalars be converted?
Returns:
A matrix of type self.target_matrix or a scalar.'

@NDArrayInterface.scalar_const
def const_to_matrix(self, value, convert_scalars=False):

    if isinstance(value, list):
        return sp.csc_matrix(value, dtype=np.double).T
    return sp.csc_matrix(value, dtype=np.double)
