RegisterNumericType

(function from pyomo.common.numeric_types)

pyomo.common.numeric_types.RegisterNumericType(new_type: type)[source]

Register the specified type as a “numeric type”.

A utility function for registering new types as “native numeric types” that can be leaf nodes in Pyomo numeric expressions. The type should be compatible with float (that is, store a scalar and be castable to a Python float).

Parameters:

new_type (type) – The new numeric type (e.g, numpy.float64)