[Insight-users] numeric traits for the std::complex < >

Suyash P. Awate suyash at cs.utah.edu
Tue May 10 12:22:50 EDT 2005


Skipped content of type multipart/alternative-------------- next part --------------
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkNumericTraitsComplex.cxx,v $
  Language:  C++
  Date:      $Date: 2005/01/09 15:58:08 $
  Version:   $Revision: 1.3 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#include "itkNumericTraitsComplex.h"

namespace itk
{

const std::complex<double>  NumericTraits<std::complex<double> >::Zero = std::complex<double>( NumericTraits<double>::Zero );
const std::complex<double>  NumericTraits<std::complex<double> >::One  = std::complex<double>( NumericTraits<double>::One );
 
} // end namespace itk
-------------- next part --------------
/*=========================================================================

  Program:   Insight Segmentation & Registration Toolkit
  Module:    $RCSfile: itkNumericTraitsComplex.h,v $
  Language:  C++
  Date:      $Date: 2005/01/09 15:58:08 $
  Version:   $Revision: 1.6 $

  Copyright (c) Insight Software Consortium. All rights reserved.
  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even 
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef __itkNumericTraitsComplex_h
#define __itkNumericTraitsComplex_h

#include "itkNumericTraits.h"
#include <complex>

namespace itk
{

/** \class NumericTraits<std::complex<double> >
 * \brief Define traits for type std::complex<double>.
 * \ingroup DataRepresentation
 */
template <>
class NumericTraits<std::complex<double> > {
public:
  typedef std::complex<double> ValueType;
  typedef std::complex<double> PrintType;
  typedef std::complex<double> AbsType;
  typedef std::complex<double> AccumulateType;
  typedef std::complex<double> RealType;
  static const std::complex<double> ITKCommon_EXPORT Zero;
  static const std::complex<double> ITKCommon_EXPORT One;
  
};

} // end namespace itk

#endif // __itkNumericTraitscomplex_h


More information about the Insight-users mailing list