isce3  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
gpuLUT1d.h
1 //
2 // Author: Bryan Riel
3 // Copyright 2017-2018
4 //
5 
6 #pragma once
7 
8 #include "forward.h"
9 
10 #include <cmath>
11 #include <isce3/core/forward.h>
12 #include <isce3/core/Common.h>
13 
14 // gpuLUT1d declaration
15 template <typename T>
17 
18  public:
19  // Disallow default constructor
20  CUDA_HOSTDEV gpuLUT1d() = delete;
21 
23  CUDA_HOST gpuLUT1d(const isce3::core::LUT1d<T> &);
24 
26  CUDA_HOSTDEV gpuLUT1d(gpuLUT1d<T> &);
27 
29  CUDA_HOSTDEV gpuLUT1d & operator=(gpuLUT1d<T> &);
30 
32  ~gpuLUT1d();
33 
35  CUDA_HOSTDEV inline double * coords() { return _coords; }
36 
38  CUDA_HOSTDEV inline const double * coords() const { return _coords; }
39 
41  CUDA_HOSTDEV inline void coords(double * c) { _coords = c; }
42 
44  CUDA_HOSTDEV inline T * values() { return _values; }
45 
47  CUDA_HOSTDEV inline const T * values() const { return _values; }
48 
50  CUDA_HOSTDEV inline void values(T * v) { _values = v; }
51 
53  CUDA_HOSTDEV inline bool extrapolate() const { return _extrapolate; }
54 
56  CUDA_HOSTDEV inline void extrapolate(bool flag) { _extrapolate = flag; }
57 
59  CUDA_HOSTDEV inline bool haveData() const { return _haveData; }
60 
62  CUDA_HOSTDEV inline T refValue() const { return _refValue; }
63 
65  CUDA_HOSTDEV inline size_t size() const { return _size; }
66 
68  CUDA_HOSTDEV inline void size(size_t s) { _size = s; }
69 
71  CUDA_DEV T eval(double x) const;
72 
74  CUDA_HOST T eval_h(double x);
75 
76  // Data members
77  private:
78  bool _haveData;
79  T _refValue;
80  double * _coords;
81  T * _values;
82  size_t _size;
83  bool _extrapolate;
84  bool _owner;
85 };
CUDA_HOSTDEV bool haveData() const
Get flag for having data.
Definition: gpuLUT1d.h:59
CUDA_HOSTDEV const double * coords() const
Read-only access to coordinates.
Definition: gpuLUT1d.h:38
CUDA_HOSTDEV const T * values() const
Read-only access to values.
Definition: gpuLUT1d.h:47
CUDA_DEV T eval(double x) const
Evaluate the LUT.
Data structure to hold a 1D Lookup table.
Definition: forward.h:29
CUDA_HOSTDEV T refValue() const
Get reference value.
Definition: gpuLUT1d.h:62
CUDA_HOSTDEV void values(T *v)
Set the values.
Definition: gpuLUT1d.h:50
CUDA_HOSTDEV bool extrapolate() const
Get extrapolate flag.
Definition: gpuLUT1d.h:53
CUDA_HOSTDEV double * coords()
Access to coordinates.
Definition: gpuLUT1d.h:35
CUDA_HOSTDEV gpuLUT1d & operator=(gpuLUT1d< T > &)
Shallow assignment operator on device.
CUDA_HOSTDEV void size(size_t s)
Set size info of LUT.
Definition: gpuLUT1d.h:68
CUDA_HOSTDEV size_t size() const
Get size info of LUT.
Definition: gpuLUT1d.h:65
CUDA_HOSTDEV void coords(double *c)
Set the coordinates.
Definition: gpuLUT1d.h:41
CUDA_HOSTDEV void extrapolate(bool flag)
Set extrapolation flag.
Definition: gpuLUT1d.h:56
Definition: forward.h:12
CUDA_HOSTDEV T * values()
Access to values.
Definition: gpuLUT1d.h:44
CUDA_HOST T eval_h(double x)
Evaluate the LUT from host (test function)

Generated for ISCE3.0 by doxygen 1.8.5.