原生数值类型
(数据来自 pyomo.common.numeric_types)
- pyomo.common.numeric_types.native_numeric_types = {<class 'float'>, <class 'int'>, <class 'numpy.float16'>, <class 'numpy.float32'>, <class 'numpy.float64'>, <class 'numpy.int16'>, <class 'numpy.int32'>, <class 'numpy.int64'>, <class 'numpy.int8'>, <class 'numpy.longdouble'>, <class 'numpy.uint16'>, <class 'numpy.uint32'>, <class 'numpy.uint64'>, <class 'numpy.uint8'>}
Python 集合用于识别数字常量。这个集合包括原生 Python 类型以及来自 Python 包(如 numpy)的数字类型,这些类型可能由用户注册。
请注意,
native_numeric_types不包括complex,因为它在Pyomo数值表达式中不是一个有效的常量。