⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vnl_numeric_traits.h

📁 InsightToolkit-1.4.0(有大量的优化算法程序)
💻 H
📖 第 1 页 / 共 2 页
字号:
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<int const> : public vnl_numeric_traits<int> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<unsigned int>
{
 public:
  //: Additive identity
  static const unsigned int zero VCL_STATIC_CONST_INIT_INT_DECL(0);
  //: Multiplicative identity
  static const unsigned int one VCL_STATIC_CONST_INIT_INT_DECL(1);
  //: Maximum value which this type can assume
  static const unsigned int maxval; // = 0xffffffff;
  //: Return value of abs()
  typedef unsigned int abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef unsigned long double_t;
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<unsigned int const> : public vnl_numeric_traits<unsigned int> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<long>
{
 public:
  //: Additive identity
  static const long zero VCL_STATIC_CONST_INIT_INT_DECL(0);
  //: Multiplicative identity
  static const long one VCL_STATIC_CONST_INIT_INT_DECL(1);
  //: Maximum value which this type can assume
  static const long maxval; // = 0x7fffffffL or 0x7fffffffffffffffL;
  //: Return value of abs()
  typedef unsigned long abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef vxl_sint_64 double_t;
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<long const> : public vnl_numeric_traits<long > {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<unsigned long>
{
 public:
  //: Additive identity
  static const unsigned long zero VCL_STATIC_CONST_INIT_INT_DECL(0);
  //: Multiplicative identity
  static const unsigned long one VCL_STATIC_CONST_INIT_INT_DECL(1);
  //: Maximum value which this type can assume
  static const unsigned long maxval; // = 0xffffffffL or 0xffffffffffffffffL;
  //: Return value of abs()
  typedef unsigned long abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef vxl_uint_64 double_t;
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<unsigned long const> : public vnl_numeric_traits<unsigned long> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<float>
{
 public:
  //: Additive identity
  static const float zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0F);
  //: Multiplicative identity
  static const float one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0F);
  //: Maximum value which this type can assume
  static const float maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(3.40282346638528860e+38F);
  //: Return value of abs()
  typedef float abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef double double_t;
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<float const> : public vnl_numeric_traits<float> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<double>
{
 public:
  //: Additive identity
  static const double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0);
  //: Multiplicative identity
  static const double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0);
  //: Maximum value which this type can assume
  static const double maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308);
  //: Return value of abs()
  typedef double abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef long double double_t;
  //: Name of type which results from multiplying this type with a double
  typedef double real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<double const> : public vnl_numeric_traits<double> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<long double>
{
 public:
  //: Additive identity
  static const long double zero VCL_STATIC_CONST_INIT_FLOAT_DECL(0.0);
  //: Multiplicative identity
  static const long double one VCL_STATIC_CONST_INIT_FLOAT_DECL(1.0);
  //: Maximum value which this type can assume
  static const long double maxval VCL_STATIC_CONST_INIT_FLOAT_DECL(1.7976931348623157E+308);
  //: Return value of abs()
  typedef long double abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef long double double_t; // ahem
  //: Name of type which results from multiplying this type with a double
  typedef long double real_t;
};
#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<long double const> : public vnl_numeric_traits<long double> {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits< vcl_complex<float> >
{
 public:
  //: Additive identity
  static const vcl_complex<float> zero;
  //: Multiplicative identity
  static const vcl_complex<float> one;
  // Maximum value which this type can assume; makes no sense for this type
  //static const vcl_complex<float> maxval;

  //: Return value of abs()
  typedef float abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef vcl_complex<vnl_numeric_traits<float>::double_t> double_t;
  //: Name of type which results from multiplying this type with a double
  typedef vcl_complex<float> real_t;
};

#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<vcl_complex<float> const> : public vnl_numeric_traits<vcl_complex<float> > {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits< vcl_complex<double> >
{
 public:
  //: Additive identity
  static const vcl_complex<double> zero;
  //: Multiplicative identity
  static const vcl_complex<double> one;
  // Maximum value which this type can assume; makes no sense for this type
  //static const vcl_complex<double> maxval;

  //: Return value of abs()
  typedef double abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef vcl_complex<vnl_numeric_traits<double>::double_t> double_t;
  //: Name of type which results from multiplying this type with a double
  typedef vcl_complex<double> real_t;
};
#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<vcl_complex<double> const> : public vnl_numeric_traits<vcl_complex<double> > {};
#endif

VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits< vcl_complex<long double> >
{
 public:
  //: Additive identity
  static const vcl_complex<long double> zero;
  //: Multiplicative identity
  static const vcl_complex<long double> one;
  // Maximum value which this type can assume; makes no sense for this type
  //static const vcl_complex<long double> maxval;

  //: Return value of abs()
  typedef long double abs_t;
  //: Name of a type twice as long as this one for accumulators and products.
  typedef vcl_complex<vnl_numeric_traits<long double>::double_t> double_t;
  //: Name of type which results from multiplying this type with a double
  typedef vcl_complex<long double> real_t;
};
#ifndef VCL_CAN_NOT_SPECIALIZE_CONST
VCL_DEFINE_SPECIALIZATION
class vnl_numeric_traits<vcl_complex<long double> const> : public vnl_numeric_traits<vcl_complex<long double> > {};
#endif


#endif // vnl_numeric_traits_h_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -