CimplTypes.h

Go to the documentation of this file.
00001 //Copyright (c) 2004-2005, Baris Sumengen
00002 //All rights reserved.
00003 //
00004 // CIMPL Matrix Performance Library
00005 //
00006 //Redistribution and use in source and binary
00007 //forms, with or without modification, are
00008 //permitted provided that the following
00009 //conditions are met:
00010 //
00011 //    * No commercial use is allowed. 
00012 //    This software can only be used
00013 //    for non-commercial purposes. This 
00014 //    distribution is mainly intended for
00015 //    academic research and teaching.
00016 //    * Redistributions of source code must
00017 //    retain the above copyright notice, this
00018 //    list of conditions and the following
00019 //    disclaimer.
00020 //    * Redistributions of binary form must
00021 //    mention the above copyright notice, this
00022 //    list of conditions and the following
00023 //    disclaimer in a clearly visible part 
00024 //    in associated product manual, 
00025 //    readme, and web site of the redistributed 
00026 //    software.
00027 //    * Redistributions in binary form must
00028 //    reproduce the above copyright notice,
00029 //    this list of conditions and the
00030 //    following disclaimer in the
00031 //    documentation and/or other materials
00032 //    provided with the distribution.
00033 //    * The name of Baris Sumengen may not be
00034 //    used to endorse or promote products
00035 //    derived from this software without
00036 //    specific prior written permission.
00037 //
00038 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
00039 //HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
00040 //EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
00041 //NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00042 //MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00043 //PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00044 //CONTRIBUTORS BE LIABLE FOR ANY
00045 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00046 //EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00047 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00048 //OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
00049 //DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00050 //HOWEVER CAUSED AND ON ANY THEORY OF
00051 //LIABILITY, WHETHER IN CONTRACT, STRICT
00052 //LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00053 //OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00054 //OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00055 //POSSIBILITY OF SUCH DAMAGE.
00056 
00057 
00058 
00059 #pragma once
00060 #ifndef CIMPLETYPES_H
00061 #define CIMPLETYPES_H
00062 
00063 
00064 #include <complex>
00065 
00066 typedef std::complex<double> ComplexDouble;
00067 typedef std::complex<float> ComplexFloat;
00068 
00069 #include "./cimpl.h"
00070 
00071 namespace CIMPL
00072 {
00073 
00074 
00075         // type conversion here
00076 
00077         Vector<double> ToDouble(Vector<float> &m);
00078         Matrix<double> ToDouble(Matrix<float> &m);
00079 
00080         Vector<ComplexFloat> ToComplexFloat(Vector<float> &m);
00081         Matrix<ComplexFloat> ToComplexFloat(Matrix<float> &m);
00082 
00083         Vector<ComplexDouble> ToComplexDouble(Vector<double> &m);
00084         Matrix<ComplexDouble> ToComplexDouble(Matrix<double> &m);
00085         Vector<ComplexDouble> ToComplexDouble(Vector<ComplexFloat> &m);
00086         Matrix<ComplexDouble> ToComplexDouble(Matrix<ComplexFloat> &m);
00087 
00088         Vector<float> Real(Vector<ComplexFloat> &m);
00089         Vector<float> Imag(Vector<ComplexFloat> &m);
00090         Matrix<float> Real(Matrix<ComplexFloat> &m);
00091         Matrix<float> Imag(Matrix<ComplexFloat> &m);
00092 
00093         Vector<double> Real(Vector<ComplexDouble> &m);
00094         Vector<double> Imag(Vector<ComplexDouble> &m);
00095         Matrix<double> Real(Matrix<ComplexDouble> &m);
00096         Matrix<double> Imag(Matrix<ComplexDouble> &m);
00097 
00098         Vector<ComplexFloat> Complex(Vector<float> &real, Vector<float> &imag);
00099         Vector<ComplexDouble> Complex(Vector<double> &real, Vector<double> &imag);
00100         Matrix<ComplexFloat> Complex(Matrix<float> &real, Matrix<float> &imag);
00101         Matrix<ComplexDouble> Complex(Matrix<double> &real, Matrix<double> &imag);
00102 
00103         Vector<ComplexFloat> Conj(Vector<ComplexFloat> &c);
00104         Vector<ComplexDouble> Conj(Vector<ComplexDouble> &c);
00105         Matrix<ComplexFloat> Conj(Matrix<ComplexFloat> &c);
00106         Matrix<ComplexDouble> Conj(Matrix<ComplexDouble> &c);
00107 
00108 
00109         template <class T, class S>
00110         Vector<S>& ConvertType(Vector<T>& source, Vector<S>& dest);
00111 
00112         template <class T, class S>
00113         Matrix<S>& ConvertType(Matrix<T>& source, Matrix<S>& dest);
00114 
00115 }; //namespace
00116 
00117 
00118 #include "./CimplTypes.inl"
00119 
00120 
00121 
00122 
00123 #endif
00124 
00125 
00126 
00127 
00128 
00129 
00130 
00131 
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 
00146 
00147 
00148 
00149 

Generated on Thu Jan 20 08:43:40 2005 for CIMPL by  doxygen 1.3.9.1