|
ML Reference
|
#include "mlInitSystemML.h"#include "mlRangeCasts.h"#include <ThirdPartyWarningsDisable.h>#include <complex>#include <ThirdPartyWarningsRestore.h>Go to the source code of this file.
Classes | |
| struct | ml::TypeTraits< T > |
| struct | ml::DataTypeSelector< dataTypeId > |
| struct | OverloadSelector::SwitchType< b > |
| Helper types to switch between implementations of functions by overloading. More... | |
Namespaces | |
| namespace | ml |
| Defines the class GetTileJob. | |
| namespace | OverloadSelector |
Macros | |
| #define | _ML_DECLARE_SCALAR_TYPETRAIT_BODY(TYPE, FLAGS) |
| #define | ML_DECLARE_SCALAR_TYPETRAIT(TYPE, FLAGS) |
| Macro to declare custom type traits. | |
| #define | _ML_DECLARE_EXTENDED_TYPETRAIT_BODY(TYPE, TYPE_ID, COMPONENT_TYPE) |
| #define | ML_DECLARE_EXTENDED_TYPETRAIT(TYPE, TYPE_ID, COMPONENT_TYPE) |
| Macro to declare custom type traits. | |
| #define | ML_DECLARE_FLOAT_VECTOR_TYPETRAIT(TEMPLATE_TYPE, BASE_TYPE, TYPE_ID) |
| Declaration of standard integer type traits. | |
| #define | ML_DECLARE_MATRIX_TYPETRAIT(TEMPLATE_TYPE, BASE_TYPE, TYPE_ID) |
| #define | INT_VECTOR_EXPANDER(BASE_TYPE, DIM_NUM) |
| #define | ML_DECLARE_INT_VECTOR_TYPETRAIT(BASE_TYPE, DIM_NUM, TYPE_ID) |
Typedefs | |
| typedef SwitchType< true > | OverloadSelector::OnTrue |
| typedef SwitchType< false > | OverloadSelector::OnFalse |
Enumerations | |
| enum | { ml::ML_INTEGER_TYPE = 0x01 , ml::ML_FLOAT_TYPE = 0x02 , ml::ML_SIGNED_TYPE = 0x04 } |
Functions | |
| template<typename T> | |
| SwitchType< ml::TypeTraits< T >::isStandardType > | OverloadSelector::isScalarType () |
| template<typename T> | |
| SwitchType< ml::TypeTraits< T >::isBuiltInIntegerType > | OverloadSelector::isBuiltInIntegerType () |
| template<typename T> | |
| ml::TypeTraits< T >::ComponentType | ml_component_cast (double v) |
| Casts the argument to the component type of the template argument. | |
| template<typename T> | |
| ml::TypeTraits< typenameml::TypeTraits< T >::IntermediateType >::ComponentType | ml_scalar_factor_cast (double v) |
| template<typename T> | |
| ml::TypeTraits< typenameml::TypeTraits< T >::IntermediateType >::ComponentType | ml_scalar_factor_cast (double v, const T &) |
| Same as above with dummy argument of type T (so one does not need to specify T explicitly). | |
| template<typename T> | |
| T | ml_cast_from_scalar (double v) |
| Casts the (scalar) argument to the type of the template argument. | |
| template<typename T> | |
| ml::TypeTraits< T >::IntermediateType | ml_cast_to_intermediate_type (const T &v) |
| template<typename T, typename S> | |
| ml::TypeTraits< T >::IntermediateType | ml_cast_to_intermediate_type_and_multiply (const T &v, S s) |
| Same as above, but will also multiply with the second argument. | |
| template<typename T> | |
| T | _ml_cast_from_intermediate_type (const typename ml::TypeTraits< T >::IntermediateType &v, OverloadSelector::OnTrue) |
| template<typename T> | |
| T | _ml_cast_from_intermediate_type (const typename ml::TypeTraits< T >::IntermediateType &v, OverloadSelector::OnFalse) |
| template<typename T> | |
| T | ml_cast_from_intermediate_type (const typename ml::TypeTraits< T >::IntermediateType &v) |
| template<typename T> | |
| T | _ml_cast_from_intermediate_type_without_clamping (const typename ml::TypeTraits< T >::IntermediateType &v, OverloadSelector::OnTrue) |
| template<typename T> | |
| T | _ml_cast_from_intermediate_type_without_clamping (const typename ml::TypeTraits< T >::IntermediateType &v, OverloadSelector::OnFalse) |
| template<typename T> | |
| T | ml_cast_from_intermediate_type_without_clamping (const typename ml::TypeTraits< T >::IntermediateType &v) |
| #define _ML_DECLARE_EXTENDED_TYPETRAIT_BODY | ( | TYPE, | |
| TYPE_ID, | |||
| COMPONENT_TYPE ) |
Definition at line 121 of file mlTypeTraits.h.
| #define _ML_DECLARE_SCALAR_TYPETRAIT_BODY | ( | TYPE, | |
| FLAGS ) |
Definition at line 90 of file mlTypeTraits.h.
| #define INT_VECTOR_EXPANDER | ( | BASE_TYPE, | |
| DIM_NUM ) |
Definition at line 258 of file mlTypeTraits.h.
| #define ML_DECLARE_EXTENDED_TYPETRAIT | ( | TYPE, | |
| TYPE_ID, | |||
| COMPONENT_TYPE ) |
Macro to declare custom type traits.
Definition at line 146 of file mlTypeTraits.h.
| #define ML_DECLARE_FLOAT_VECTOR_TYPETRAIT | ( | TEMPLATE_TYPE, | |
| BASE_TYPE, | |||
| TYPE_ID ) |
Declaration of standard integer type traits.
Declaration of standard float type traits
Definition at line 163 of file mlTypeTraits.h.
| #define ML_DECLARE_INT_VECTOR_TYPETRAIT | ( | BASE_TYPE, | |
| DIM_NUM, | |||
| TYPE_ID ) |
Definition at line 260 of file mlTypeTraits.h.
| #define ML_DECLARE_MATRIX_TYPETRAIT | ( | TEMPLATE_TYPE, | |
| BASE_TYPE, | |||
| TYPE_ID ) |
Definition at line 228 of file mlTypeTraits.h.
| #define ML_DECLARE_SCALAR_TYPETRAIT | ( | TYPE, | |
| FLAGS ) |
Macro to declare custom type traits.
Definition at line 118 of file mlTypeTraits.h.
|
inline |
Definition at line 431 of file mlTypeTraits.h.
|
inline |
Definition at line 412 of file mlTypeTraits.h.
References floor().
Referenced by ml_cast_from_intermediate_type().
|
inline |
Definition at line 453 of file mlTypeTraits.h.
|
inline |
Definition at line 446 of file mlTypeTraits.h.
References floor().
Referenced by ml_cast_from_intermediate_type_without_clamping().
|
inline |
Casts from an intermediate type to the desired type; performs clamping and rounding for the built-in integer types, for all other types, this is a simple cast.
Definition at line 439 of file mlTypeTraits.h.
References _ml_cast_from_intermediate_type(), and OverloadSelector::isBuiltInIntegerType().
|
inline |
Casts from an intermediate type to the desired type; performs rounding but no clamping for the built-in integer types, for all other types, this is a simple cast. Use this if you know that the value will always be in the data type's range.
Definition at line 462 of file mlTypeTraits.h.
References _ml_cast_from_intermediate_type_without_clamping(), and OverloadSelector::isBuiltInIntegerType().
|
inline |
Casts the (scalar) argument to the type of the template argument.
Definition at line 382 of file mlTypeTraits.h.
References ml_component_cast().
|
inline |
Casts type to an intermediate type suitable for consecutive arithmetic operations; integer types will be cast to double, all other types will be left alone.
Definition at line 390 of file mlTypeTraits.h.
|
inline |
Same as above, but will also multiply with the second argument.
Definition at line 398 of file mlTypeTraits.h.
References ml_component_cast().
|
inline |
Casts the argument to the component type of the template argument.
Definition at line 354 of file mlTypeTraits.h.
Referenced by ml_cast_from_scalar(), ml_cast_to_intermediate_type_and_multiply(), ml_scalar_factor_cast(), and ml_scalar_factor_cast().
|
inline |
Casts the double argument to a type suitable for multiplying with the template type. This is double for all scalar types and the component type for all extended datatypes. For example:
Definition at line 367 of file mlTypeTraits.h.
References ml_component_cast().
|
inline |
Same as above with dummy argument of type T (so one does not need to specify T explicitly).
Definition at line 375 of file mlTypeTraits.h.
References ml_component_cast().