Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShLibMisc.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #include "ShLib.hpp" // ShLibMisc needs to be included from within ShLib
00021 
00022 #ifndef SHLIBMISC_HPP
00023 #define SHLIBMISC_HPP
00024 
00025 #include "ShGeneric.hpp"
00026 
00027 #ifndef WIN32
00028 namespace SH {
00029 
00042 template<int M, int N, typename T> 
00043 ShGeneric<M, T> cast(const ShGeneric<N, T>& a);
00044 template<int M> 
00045 ShGeneric<M, double> cast(double a); // @todo type do a cpp type -> value type map
00046 
00052 template<int M, int N, typename T> 
00053 ShGeneric<M, T> fillcast(const ShGeneric<N, T>& a);
00054 template<int M> 
00055 ShGeneric<M, double> fillcast(double a); // @todo type do a cpp type -> value type map
00056 
00060 template<int M, int N, typename T1, typename T2> 
00061 ShGeneric<M+N, CT1T2> 
00062 join(const ShGeneric<M, T1>& a, const ShGeneric<N, T2> &b);
00063 template<int M, typename T> 
00064 ShGeneric<M+1, T> 
00065 join(const T& a, const ShGeneric<M, T>& b);
00066 template<int M, typename T> 
00067 ShGeneric<M+1, T> 
00068 join(const ShGeneric<M, T>& a, const T& b);
00069 // @}
00070 
00074 template<int M, int N, int O, typename T1, typename T2, typename T3> 
00075 ShGeneric<M+N+O, CT1T2T3> 
00076 join(const ShGeneric<M, T1>& a, const ShGeneric<N, T2> &b, const ShGeneric<O, T3> &c);
00077 
00081 template<int M, int N, int O, int P, typename T1, typename T2, typename T3, typename T4> 
00082 ShGeneric<M+N+O+P, CT1T2T3T4> 
00083 join(const ShGeneric<M, T1>& a, const ShGeneric<N, T2> &b, const ShGeneric<O, T3> &c, const ShGeneric<P, T4> &d);
00084 
00088 template<int N, typename T>
00089 void discard(const ShGeneric<N, T>& c);
00090 
00094 template<int N, typename T>
00095 void kill(const ShGeneric<N, T>& c);
00096 
00102 template<int N, typename T> 
00103 ShGeneric<N, T> sort(const ShGeneric<N, T>& a);
00104 
00109 template<int S, typename T>
00110 void groupsort(T v[]);
00111 
00118 template<typename T>
00119 ShProgram freeze(const ShProgram& p,
00120                  const T& uniform);
00121 
00122 /* Evaluation of polynomial of order M at a using coefficients in b.
00123  */
00124 template<int N, int M, typename T1, typename T2>
00125 ShGeneric<N, CT1T2>
00126 poly(const ShGeneric<N, T1>& a, const ShGeneric<M, T2>& b);
00127 
00130 }
00131 #endif
00132 
00133 #include "ShLibMiscImpl.hpp"
00134 
00135 #endif

Generated on Thu Jul 28 17:33:03 2005 for Sh by  doxygen 1.4.3-20050530