Scopira 20080306

complex.h

00001 
00002 /*
00003  *  Copyright (c) 2004    National Research Council
00004  *
00005  *  All rights reserved.
00006  *
00007  *  This material is confidential and proprietary information of
00008  *  National Research Council Canada ("Confidential Information").
00009  *  This Confidential Information may only be used and reproduced
00010  *  in accordance with the terms of the license agreement.
00011  *
00012  */
00013 
00014 #ifndef __INCLUDED_SCOPIRA_BASEKIT_COMPLEX_H__
00015 #define __INCLUDED_SCOPIRA_BASEKIT_COMPLEX_H__
00016 
00017 #include <scopira/basekit/narray.h>
00018 
00019 template <class T, class ELE>
00020 scopira::tool::oflow_i & operator << (scopira::tool::oflow_i &o,
00021   const std::complex<ELE> &el)
00022 {
00023   return o << '(' << el.real() << ',' << el.imag() << ')';
00024 }
00025 
00026 template <>
00027   inline void scopira::basekit::print_element<std::complex<float> >(scopira::tool::oflow_i &o, std::complex<float> el)
00028 {
00029   flow_printf(o, " (%8.2f,%8.2f)", el.real(), el.imag());
00030 }
00031 
00032 template <>
00033   inline void scopira::basekit::print_element<std::complex<double> >(scopira::tool::oflow_i &o, std::complex<double> el)
00034 {
00035   flow_printf(o, " (%8.2f,%8.2f)", el.real(), el.imag());
00036 }
00037 
00038 #endif
00039