HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GU_ScatteredInterp.h
Go to the documentation of this file.
1 /*
2 * PROPRIETARY INFORMATION. This software is proprietary to
3 * Side Effects Software Inc., and is not to be reproduced,
4 * transmitted, or disclosed in any way without written permission.
5 *
6 * NAME: GU_ScatteredInterp.h (GU Library, C++)
7 *
8 * COMMENTS:
9 */
10 
11 #ifndef __GU_SCATTEREDINTERP_H__
12 #define __GU_SCATTEREDINTERP_H__
13 
14 #include "GU_API.h"
15 #include <SYS/SYS_Types.h>
16 
17 // Scattered Interpolation formulation
19 {
23 };
24 
25 // Scattered interpolation kernel types
27 {
34  GU_KERNEL_EXPBUMP
35 };
36 
37 // Least squares solver types
39 {
41  GU_ROBUST_LEAST_SQUARES
42 };
43 
44 // Template must match the following matrix-like interface including:
45 // accessors for:
46 // virtual int rows() const = 0;
47 // virtual int columns() const = 0;
48 
49 // accessors for row-wise data:
50 // virtual fpreal *row(int i) = 0;
51 // virtual const fpreal *row(int i) const = 0;
52 
53 // or accessors for column-wise data:
54 // virtual fpreal *column(int i) = 0;
55 // virtual const fpreal *column(int i) const = 0;
56 
57 template <typename U>
58 struct GU_Matrix
59 {
60  template <typename V, fpreal * (V::*)(int)> struct Accessor {};
61  template <typename V, const fpreal * (V::*)(int) const> struct ConstAccessor {};
62 
63  template <typename V> static std::true_type row_test(Accessor <V, &V::row>*);
64  template <typename V> static std::false_type row_test(...);
65 
66  template <typename V> static std::true_type const_row_test(ConstAccessor <V, &V::row>*);
67  template <typename V> static std::false_type const_row_test(...);
68 
69  template <typename V> static std::true_type column_test(Accessor <V, &V::column>*);
70  template <typename V> static std::false_type column_test(...);
71 
72  template <typename V> static std::true_type const_column_test(ConstAccessor <V, &V::column>*);
73  template <typename V> static std::false_type const_column_test(...);
74 
75  // true if the type has member functions fpreal *row(int) and const fpreal *row(int) const
76  static constexpr bool has_row = std::is_same<decltype(row_test<U>(0)), std::true_type>::value &&
77  std::is_same<decltype(const_row_test<U>(0)), std::true_type>::value;
78 
79  // true if the type has member functions fpreal *column(int) and const fpreal *column(int) const
80  static constexpr bool has_column = std::is_same<decltype(column_test<U>(0)), std::true_type>::value &&
81  std::is_same<decltype(const_column_test<U>(0)), std::true_type>::value;
82 };
83 
84 #endif // __GU_SCATTEREDINTERP_H__
GU_FAST_LEAST_SQUARES
GU_SCATTERED_INTERP_AUTO
static constexpr bool has_row
enum GU_API GU_LeastSquaresSolverType
GU_KERNEL_INVERSEMULTIQUADRIC
static constexpr bool has_column
GU_KERNEL_THINPLATE
static std::true_type const_column_test(ConstAccessor< V,&V::column > *)
GU_KERNEL_GAUSSIAN
static std::true_type row_test(Accessor< V,&V::row > *)
GU_KERNEL_CAUCHY
GU_SCATTERED_INTERP_EXAMPLES
GU_KERNEL_BIHARMONIC
#define GU_API
Definition: GU_API.h:14
static std::true_type const_row_test(ConstAccessor< V,&V::row > *)
enum GU_API GU_RadialBasisKernelType
enum GU_API GU_ScatteredInterpType
GU_SCATTERED_INTERP_DOF
static std::true_type column_test(Accessor< V,&V::column > *)
GU_KERNEL_MULTIQUADRIC
GLsizei const GLfloat * value
Definition: glew.h:1849