Functions.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 #pragma once
00058 #ifndef MATHCORE_FUNCTIONS_H
00059 #define MATHCORE_FUNCTIONS_H
00060 
00061 #include "./cimpl.h"
00062 using namespace CIMPL;
00063 
00064 
00065 namespace MathCore
00066 {
00067 
00068 // Inverts elements
00069         Vector<float> Inv(Vector<float>& m);
00070         Vector<double> Inv(Vector<double>& m);
00071         Matrix<float> Inv(Matrix<float>& m);
00072         Matrix<double> Inv(Matrix<double>& m);
00073         
00074         Vector<float>&  InvI(Vector<float>& m);
00075         Vector<double>& InvI(Vector<double>& m);
00076         Matrix<float>&  InvI(Matrix<float>& m);
00077         Matrix<double>& InvI(Matrix<double>& m);
00078 
00079 // Division of elements
00080         Vector<float> Div(Vector<float>& m1, Vector<float>& m2);
00081         Vector<double> Div(Vector<double>& m1, Vector<double>& m2);
00082         Matrix<float> Div(Matrix<float>& m1, Matrix<float>& m2);
00083         Matrix<double> Div(Matrix<double>& m1, Matrix<double>& m2);
00084 
00085         Vector<float>&  DivI(Vector<float>& m1, Vector<float>& m2);
00086         Vector<double>& DivI(Vector<double>& m1, Vector<double>& m2);
00087         Matrix<float>&  DivI(Matrix<float>& m1, Matrix<float>& m2);
00088         Matrix<double>& DivI(Matrix<double>& m1, Matrix<double>& m2);
00089 
00090 // Square root of elements
00091         Vector<float> Sqrt(Vector<float>& m);
00092         Vector<double> Sqrt(Vector<double>& m);
00093         Matrix<float> Sqrt(Matrix<float>& m);
00094         Matrix<double> Sqrt(Matrix<double>& m);
00095         
00096         Vector<float>&  SqrtI(Vector<float>& m);
00097         Vector<double>& SqrtI(Vector<double>& m);
00098         Matrix<float>&  SqrtI(Matrix<float>& m);
00099         Matrix<double>& SqrtI(Matrix<double>& m);
00100 
00101 // Inverse Square root of elements
00102         Vector<float> InvSqrt(Vector<float>& m);
00103         Vector<double> InvSqrt(Vector<double>& m);
00104         Matrix<float> InvSqrt(Matrix<float>& m);
00105         Matrix<double> InvSqrt(Matrix<double>& m);
00106         
00107         Vector<float>&  InvSqrtI(Vector<float>& m);
00108         Vector<double>& InvSqrtI(Vector<double>& m);
00109         Matrix<float>&  InvSqrtI(Matrix<float>& m);
00110         Matrix<double>& InvSqrtI(Matrix<double>& m);
00111 
00112 // Cube root of elements
00113         Vector<float> Cbrt(Vector<float>& m);
00114         Vector<double> Cbrt(Vector<double>& m);
00115         Matrix<float> Cbrt(Matrix<float>& m);
00116         Matrix<double> Cbrt(Matrix<double>& m);
00117         
00118         Vector<float>&  CbrtI(Vector<float>& m);
00119         Vector<double>& CbrtI(Vector<double>& m);
00120         Matrix<float>&  CbrtI(Matrix<float>& m);
00121         Matrix<double>& CbrtI(Matrix<double>& m);
00122 
00123 // Cube root of elements
00124         Vector<float> InvCbrt(Vector<float>& m);
00125         Vector<double> InvCbrt(Vector<double>& m);
00126         Matrix<float> InvCbrt(Matrix<float>& m);
00127         Matrix<double> InvCbrt(Matrix<double>& m);
00128         
00129         Vector<float>&  InvCbrtI(Vector<float>& m);
00130         Vector<double>& InvCbrtI(Vector<double>& m);
00131         Matrix<float>&  InvCbrtI(Matrix<float>& m);
00132         Matrix<double>& InvCbrtI(Matrix<double>& m);
00133 
00134 // Pow of elements
00135         Vector<float> Pow(Vector<float>& m1, Vector<float>& m2);
00136         Vector<double> Pow(Vector<double>& m1, Vector<double>& m2);
00137         Matrix<float> Pow(Matrix<float>& m1, Matrix<float>& m2);
00138         Matrix<double> Pow(Matrix<double>& m1, Matrix<double>& m2);
00139 
00140         Vector<float>&  PowI(Vector<float>& m1, Vector<float>& m2);
00141         Vector<double>& PowI(Vector<double>& m1, Vector<double>& m2);
00142         Matrix<float>&  PowI(Matrix<float>& m1, Matrix<float>& m2);
00143         Matrix<double>& PowI(Matrix<double>& m1, Matrix<double>& m2);
00144 
00145 // Pow of vector elements to a constant
00146         Vector<float> Powx(Vector<float>& m1, const float m2);
00147         Vector<double> Powx(Vector<double>& m1, const double m2);
00148         Matrix<float> Powx(Matrix<float>& m1, const float m2);
00149         Matrix<double> Powx(Matrix<double>& m1, const double m2);
00150 
00151         Vector<float>&  PowxI(Vector<float>& m1, const float m2);
00152         Vector<double>& PowxI(Vector<double>& m1, const double m2);
00153         Matrix<float>&  PowxI(Matrix<float>& m1, const float m2);
00154         Matrix<double>& PowxI(Matrix<double>& m1, const double m2);
00155 
00156 
00157 
00158 // Exponent of elements
00159         Vector<float> Exp(Vector<float>& m);
00160         Vector<double> Exp(Vector<double>& m);
00161         Matrix<float> Exp(Matrix<float>& m);
00162         Matrix<double> Exp(Matrix<double>& m);
00163         
00164         Vector<float>&  ExpI(Vector<float>& m);
00165         Vector<double>& ExpI(Vector<double>& m);
00166         Matrix<float>&  ExpI(Matrix<float>& m);
00167         Matrix<double>& ExpI(Matrix<double>& m);
00168 
00169 
00170 // Ln of elements
00171         Vector<float> Ln(Vector<float>& m);
00172         Vector<double> Ln(Vector<double>& m);
00173         Matrix<float> Ln(Matrix<float>& m);
00174         Matrix<double> Ln(Matrix<double>& m);
00175         
00176         Vector<float>&  LnI(Vector<float>& m);
00177         Vector<double>& LnI(Vector<double>& m);
00178         Matrix<float>&  LnI(Matrix<float>& m);
00179         Matrix<double>& LnI(Matrix<double>& m);
00180 
00181 // Log10 of elements
00182         Vector<float> Log10(Vector<float>& m);
00183         Vector<double> Log10(Vector<double>& m);
00184         Matrix<float> Log10(Matrix<float>& m);
00185         Matrix<double> Log10(Matrix<double>& m);
00186         
00187         Vector<float>&  Log10I(Vector<float>& m);
00188         Vector<double>& Log10I(Vector<double>& m);
00189         Matrix<float>&  Log10I(Matrix<float>& m);
00190         Matrix<double>& Log10I(Matrix<double>& m);
00191 
00192 
00193 // Cos of elements
00194         Vector<float> Cos(Vector<float>& m);
00195         Vector<double> Cos(Vector<double>& m);
00196         Matrix<float> Cos(Matrix<float>& m);
00197         Matrix<double> Cos(Matrix<double>& m);
00198         
00199         Vector<float>&  CosI(Vector<float>& m);
00200         Vector<double>& CosI(Vector<double>& m);
00201         Matrix<float>&  CosI(Matrix<float>& m);
00202         Matrix<double>& CosI(Matrix<double>& m);
00203 
00204 // Sin of elements
00205         Vector<float> Sin(Vector<float>& m);
00206         Vector<double> Sin(Vector<double>& m);
00207         Matrix<float> Sin(Matrix<float>& m);
00208         Matrix<double> Sin(Matrix<double>& m);
00209         
00210         Vector<float>&  SinI(Vector<float>& m);
00211         Vector<double>& SinI(Vector<double>& m);
00212         Matrix<float>&  SinI(Matrix<float>& m);
00213         Matrix<double>& SinI(Matrix<double>& m);
00214 
00215 // Tan of elements
00216         Vector<float> Tan(Vector<float>& m);
00217         Vector<double> Tan(Vector<double>& m);
00218         Matrix<float> Tan(Matrix<float>& m);
00219         Matrix<double> Tan(Matrix<double>& m);
00220         
00221         Vector<float>&  TanI(Vector<float>& m);
00222         Vector<double>& TanI(Vector<double>& m);
00223         Matrix<float>&  TanI(Matrix<float>& m);
00224         Matrix<double>& TanI(Matrix<double>& m);
00225 
00226 // Acos of elements
00227         Vector<float> Acos(Vector<float>& m);
00228         Vector<double> Acos(Vector<double>& m);
00229         Matrix<float> Acos(Matrix<float>& m);
00230         Matrix<double> Acos(Matrix<double>& m);
00231         
00232         Vector<float>&  AcosI(Vector<float>& m);
00233         Vector<double>& AcosI(Vector<double>& m);
00234         Matrix<float>&  AcosI(Matrix<float>& m);
00235         Matrix<double>& AcosI(Matrix<double>& m);
00236 
00237 // Asin of elements
00238         Vector<float> Asin(Vector<float>& m);
00239         Vector<double> Asin(Vector<double>& m);
00240         Matrix<float> Asin(Matrix<float>& m);
00241         Matrix<double> Asin(Matrix<double>& m);
00242         
00243         Vector<float>&  AsinI(Vector<float>& m);
00244         Vector<double>& AsinI(Vector<double>& m);
00245         Matrix<float>&  AsinI(Matrix<float>& m);
00246         Matrix<double>& AsinI(Matrix<double>& m);
00247 
00248 // Atan of elements
00249         Vector<float> Atan(Vector<float>& m);
00250         Vector<double> Atan(Vector<double>& m);
00251         Matrix<float> Atan(Matrix<float>& m);
00252         Matrix<double> Atan(Matrix<double>& m);
00253         
00254         Vector<float>&  AtanI(Vector<float>& m);
00255         Vector<double>& AtanI(Vector<double>& m);
00256         Matrix<float>&  AtanI(Matrix<float>& m);
00257         Matrix<double>& AtanI(Matrix<double>& m);
00258 
00259 // Atan2 of elements
00260         Vector<float> Atan2(Vector<float>& m1, Vector<float>& m2);
00261         Vector<double> Atan2(Vector<double>& m1, Vector<double>& m2);
00262         Matrix<float> Atan2(Matrix<float>& m1, Matrix<float>& m2);
00263         Matrix<double> Atan2(Matrix<double>& m1, Matrix<double>& m2);
00264 
00265         Vector<float>&  Atan2I(Vector<float>& m1, Vector<float>& m2);
00266         Vector<double>& Atan2I(Vector<double>& m1, Vector<double>& m2);
00267         Matrix<float>&  Atan2I(Matrix<float>& m1, Matrix<float>& m2);
00268         Matrix<double>& Atan2I(Matrix<double>& m1, Matrix<double>& m2);
00269 
00270 
00271 
00272 // Cosh of elements
00273         Vector<float> Cosh(Vector<float>& m);
00274         Vector<double> Cosh(Vector<double>& m);
00275         Matrix<float> Cosh(Matrix<float>& m);
00276         Matrix<double> Cosh(Matrix<double>& m);
00277         
00278         Vector<float>&  CoshI(Vector<float>& m);
00279         Vector<double>& CoshI(Vector<double>& m);
00280         Matrix<float>&  CoshI(Matrix<float>& m);
00281         Matrix<double>& CoshI(Matrix<double>& m);
00282 
00283 // Sinh of elements
00284         Vector<float> Sinh(Vector<float>& m);
00285         Vector<double> Sinh(Vector<double>& m);
00286         Matrix<float> Sinh(Matrix<float>& m);
00287         Matrix<double> Sinh(Matrix<double>& m);
00288         
00289         Vector<float>&  SinhI(Vector<float>& m);
00290         Vector<double>& SinhI(Vector<double>& m);
00291         Matrix<float>&  SinhI(Matrix<float>& m);
00292         Matrix<double>& SinhI(Matrix<double>& m);
00293 
00294 // Tanh of elements
00295         Vector<float> Tanh(Vector<float>& m);
00296         Vector<double> Tanh(Vector<double>& m);
00297         Matrix<float> Tanh(Matrix<float>& m);
00298         Matrix<double> Tanh(Matrix<double>& m);
00299         
00300         Vector<float>&  TanhI(Vector<float>& m);
00301         Vector<double>& TanhI(Vector<double>& m);
00302         Matrix<float>&  TanhI(Matrix<float>& m);
00303         Matrix<double>& TanhI(Matrix<double>& m);
00304 
00305 // Acosh of elements
00306         Vector<float> Acosh(Vector<float>& m);
00307         Vector<double> Acosh(Vector<double>& m);
00308         Matrix<float> Acosh(Matrix<float>& m);
00309         Matrix<double> Acosh(Matrix<double>& m);
00310         
00311         Vector<float>&  AcoshI(Vector<float>& m);
00312         Vector<double>& AcoshI(Vector<double>& m);
00313         Matrix<float>&  AcoshI(Matrix<float>& m);
00314         Matrix<double>& AcoshI(Matrix<double>& m);
00315 
00316 // Asinh of elements
00317         Vector<float> Asinh(Vector<float>& m);
00318         Vector<double> Asinh(Vector<double>& m);
00319         Matrix<float> Asinh(Matrix<float>& m);
00320         Matrix<double> Asinh(Matrix<double>& m);
00321         
00322         Vector<float>&  AsinhI(Vector<float>& m);
00323         Vector<double>& AsinhI(Vector<double>& m);
00324         Matrix<float>&  AsinhI(Matrix<float>& m);
00325         Matrix<double>& AsinhI(Matrix<double>& m);
00326 
00327 // Atanh of elements
00328         Vector<float> Atanh(Vector<float>& m);
00329         Vector<double> Atanh(Vector<double>& m);
00330         Matrix<float> Atanh(Matrix<float>& m);
00331         Matrix<double> Atanh(Matrix<double>& m);
00332         
00333         Vector<float>&  AtanhI(Vector<float>& m);
00334         Vector<double>& AtanhI(Vector<double>& m);
00335         Matrix<float>&  AtanhI(Matrix<float>& m);
00336         Matrix<double>& AtanhI(Matrix<double>& m);
00337 
00338 
00339 // Erf of elements
00340         Vector<float> Erf(Vector<float>& m);
00341         Vector<double> Erf(Vector<double>& m);
00342         Matrix<float> Erf(Matrix<float>& m);
00343         Matrix<double> Erf(Matrix<double>& m);
00344         
00345         Vector<float>&  ErfI(Vector<float>& m);
00346         Vector<double>& ErfI(Vector<double>& m);
00347         Matrix<float>&  ErfI(Matrix<float>& m);
00348         Matrix<double>& ErfI(Matrix<double>& m);
00349 
00350 // Erfc of elements
00351         Vector<float> Erfc(Vector<float>& m);
00352         Vector<double> Erfc(Vector<double>& m);
00353         Matrix<float> Erfc(Matrix<float>& m);
00354         Matrix<double> Erfc(Matrix<double>& m);
00355         
00356         Vector<float>&  ErfcI(Vector<float>& m);
00357         Vector<double>& ErfcI(Vector<double>& m);
00358         Matrix<float>&  ErfcI(Matrix<float>& m);
00359         Matrix<double>& ErfcI(Matrix<double>& m);
00360 
00361 
00362 
00363 
00364 };
00365 
00366 
00367 
00368 
00369 
00370 #endif
00371 

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