template <typename Int> inline float Cast_( const Scalar<Int>& s, ScalarType<float,Int> ) { switch ( s.Type() ) { default: TypeCastError( s.Type(), SINGLE ); case SINGLE: return s.template Get_<float>(); } }
template <typename Int> inline scomplex Cast_( const Scalar<Int>& s, ScalarType<scomplex,Int> q ) { switch ( s.Type() ) { default: TypeCastError( s.Type(), SCOMPLEX ); case SINGLE: return s.template Get_<float>(); case SCOMPLEX: return s.template Get_<scomplex>(); } }
template <typename Int> inline double Cast_( const Scalar<Int>& s, ScalarType<double,Int> ) { switch ( s.Type() ) { default: TypeCastError( s.Type(), DOUBLE ); case INTEGRAL: return s.template Get_<Int>(); case SINGLE: return s.template Get_<float>(); case DOUBLE: return s.template Get_<double>(); } }
bool Scalar::Equal( Scalar& a, Scalar& b ) { if( a.Type() != b.Type() ) return false; DataType* pA = a.Get(); DataType* pB = b.Get(); return DataType::Equal( pA, pB ); }
template <typename Int> inline dcomplex Cast_( const Scalar<Int>& s, ScalarType<dcomplex,Int> q ) { switch ( s.Type() ) { default: TypeCastError( s.Type(), DCOMPLEX ); case INTEGRAL: return s.template Get_<Int>(); case SINGLE: return s.template Get_<float>(); case DOUBLE: return s.template Get_<double>(); case SCOMPLEX: return s.template Get_<scomplex>(); case DCOMPLEX: return s.template Get_<dcomplex>(); } }