BG_Flood  0.8
Documentation (Work-in-progress)
Util_CPU.h
Go to the documentation of this file.
1 
2 #ifndef UTILCPU_H
3 #define UTILCPU_H
4 
5 #include "General.h"
6 #include "Param.h"
7 
8 namespace utils {
9  template <class T> __host__ __device__ T sq(T a);
10  template <class T> __host__ __device__ const T& max(const T& a, const T& b);
11  template <class T> __host__ __device__ const T& min(const T& a, const T& b);
12  template <class T> __host__ __device__ const T& nearest(const T& a, const T& b, const T& c);
13  template <class T> __host__ __device__ const T& nearest(const T& a, const T& b);
14 
15  //template <>
16 
17 }
18 
19 
20 unsigned int nextPow2(unsigned int x);
21 
22 double interptime(double next, double prev, double timenext, double time);
23 
24 template <class T> __host__ __device__ T BilinearInterpolation(T q11, T q12, T q21, T q22, T x1, T x2, T y1, T y2, T x, T y);
25 template <class T> __host__ __device__ T BarycentricInterpolation(T q1, T x1, T y1, T q2, T x2, T y2, T q3, T x3, T y3, T x, T y);
26 
27 template <class T> __host__ __device__ T calcres(T dx, int level);
28 template <class T> __host__ __device__ T minmod2(T theta, T s0, T s1, T s2);
29 
30 template <class T> __host__ __device__ bool OBBdetect(T Axmin, T Axmax, T Aymin, T Aymax, T Bxmin, T Bxmax, T Bymin, T Bymax);
31 
32 
33 template <class T> int ftoi(T value);
34 // End of global definition
35 #endif
double interptime(double next, double prev, double timenext, double time)
Definition: Util_CPU.cu:99
__host__ __device__ T calcres(T dx, int level)
Definition: Util_CPU.cu:145
int ftoi(T value)
Definition: Util_CPU.cu:198
__host__ __device__ bool OBBdetect(T Axmin, T Axmax, T Aymin, T Aymax, T Bxmin, T Bxmax, T Bymin, T Bymax)
Definition: Util_CPU.cu:182
__host__ __device__ T minmod2(T theta, T s0, T s1, T s2)
Definition: Util_CPU.cu:154
unsigned int nextPow2(unsigned int x)
Definition: Util_CPU.cu:87
__host__ __device__ T BilinearInterpolation(T q11, T q12, T q21, T q22, T x1, T x2, T y1, T y2, T x, T y)
Definition: Util_CPU.cu:106
__host__ __device__ T BarycentricInterpolation(T q1, T x1, T y1, T q2, T x2, T y2, T q3, T x3, T y3, T x, T y)
Definition: Util_CPU.cu:127
Definition: Util_CPU.cu:27
__host__ __device__ const T & nearest(const T &a, const T &b, const T &c)
Definition: Util_CPU.cu:52
__host__ __device__ const T & min(const T &a, const T &b)
Definition: Util_CPU.cu:45
__host__ __device__ T sq(T a)
Definition: Util_CPU.cu:31
__host__ __device__ const T & max(const T &a, const T &b)
Definition: Util_CPU.cu:38