Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef TRAITS_HPP_
00021 #define TRAITS_HPP_
00022
00023
00024
00025 template<class C> struct NumTraits { };
00026 template<> struct NumTraits<miINT8_t>
00027 {
00028 enum { isComplex = 0, size = 1, MatType = miINT8, matrixClass = mxINT8_CLASS };
00029 typedef miINT8_t Real;
00030 };
00031 template<> struct NumTraits<miUINT8_t>
00032 {
00033 enum { isComplex = 0, size = 1, MatType = miUINT8, matrixClass = mxUINT8_CLASS };
00034 typedef miUINT8_t Real;
00035 };
00036 template<> struct NumTraits<miINT16_t>
00037 {
00038 enum { isComplex = 0, size = 2, MatType = miINT16, matrixClass = mxINT16_CLASS };
00039 typedef miINT16_t Real;
00040 };
00041 template<> struct NumTraits<miUINT16_t>
00042 {
00043 enum { isComplex = 0, size = 2, MatType = miUINT16, matrixClass = mxUINT16_CLASS };
00044 typedef miUINT16_t Real;
00045 };
00046 template<> struct NumTraits<miINT32_t>
00047 {
00048 enum { isComplex = 0, size = 4, MatType = miINT32, matrixClass = mxINT32_CLASS };
00049 typedef miINT32_t Real;
00050 };
00051 template<> struct NumTraits<miUINT32_t>
00052 {
00053 enum { isComplex = 0, size = 4, MatType = miUINT32, matrixClass = mxUINT32_CLASS };
00054 typedef miUINT32_t Real;
00055 };
00056 template<> struct NumTraits<miINT64_t>
00057 {
00058 enum { isComplex = 0, size = 8, MatType = miINT64, matrixClass = -1 };
00059 typedef miINT64_t Real;
00060 };
00061 template<> struct NumTraits<miUINT64_t>
00062 {
00063 enum { isComplex = 0, size = 8, MatType = miUINT64, matrixClass = -1 };
00064 typedef miUINT64_t Real;
00065 };
00066 template<> struct NumTraits<miSINGLE_t>
00067 {
00068 enum { isComplex = 0, size = 4, MatType = miSINGLE, matrixClass = mxSINGLE_CLASS };
00069 typedef miSINGLE_t Real;
00070 };
00071 template<> struct NumTraits<miDOUBLE_t>
00072 {
00073 enum { isComplex = 0, size = 8, MatType = miDOUBLE, matrixClass = mxDOUBLE_CLASS };
00074 typedef miDOUBLE_t Real;
00075 };
00076 template<class S> struct NumTraits<std::complex<S> >
00077 {
00078 enum { isComplex = 1, size = NumTraits<S>::size, MatType = NumTraits<S>::MatType, matrixClass = NumTraits<S>::matrixClass };
00079 typedef S Real;
00080 };
00081
00082
00083
00084 #endif