00001 /* Copyright (C) 2002-2008 Stefan Buehler <sbuehler@ltu.se> 00002 00003 This program is free software; you can redistribute it and/or modify it 00004 under the terms of the GNU General Public License as published by the 00005 Free Software Foundation; either version 2, or (at your option) any 00006 later version. 00007 00008 This program is distributed in the hope that it will be useful, 00009 but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00011 GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License 00014 along with this program; if not, write to the Free Software 00015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 00016 USA. */ 00017 00026 #include "complex.h" 00027 00028 complex<float> operator+ (const double& d, const complex<float>& c) 00029 { 00030 return (float(d) + c); 00031 } 00032 00033 complex<float> operator* (const double& d, const complex<float>& c) 00034 { 00035 return (float(d) * c); 00036 } 00037 00038 00039 complex<float> operator+ (const complex<float>& c, const double& d) 00040 { 00041 return (c + float(d)); 00042 } 00043 00044 complex<float> operator* (const complex<float>& c, const double& d) 00045 { 00046 return (c * float(d)); 00047 } 00048 00049 00050 00051 complex<double> operator+ (const float& f, const complex<double>& c) 00052 { 00053 return (double(f) + c); 00054 } 00055 00056 complex<double> operator* (const float& f, const complex<double>& c) 00057 { 00058 return (double(f) * c); 00059 } 00060 00061 complex<double> operator+ (const complex<double>& c, const float& f) 00062 { 00063 return (c + double(f)); 00064 } 00065 00066 complex<double> operator* (const complex<double>& c, const float& f) 00067 { 00068 return (c * double(f)); 00069 } 00070