HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GT_DANumeric.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: GT_DANumeric.h ( GT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __GT_DANumeric__
12 #define __GT_DANumeric__
13 
14 #include "GT_API.h"
15 #include "GT_DataArray.h"
16 #include "GT_Memory.h"
17 #include <UT/UT_Assert.h>
18 #include <UT/UT_ArrayHelp.h>
19 #include <string.h>
20 
21 /// @brief An array of numeric values (int32, int64, fpreal16, fpreal32, fpreal64)
22 template <typename T>
24 {
25 public:
26  typedef T data_type;
27 
28  /// Create a numeric array
29  GT_DANumeric(GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
30  : myData(NULL)
31  , myTupleSize(tuple_size)
32  , myType(type)
33  , myCapacity(0)
34  , mySize(0)
35  {
36  resize(array_size);
37  }
38  /// Create a numeric array, copying values from the source data. The data
39  /// array does @b not hold a reference to the source data, it's copied.
40  GT_DANumeric(const T *data, GT_Size array_size, int tuple_size,
42  : myData(NULL)
43  , myTupleSize(tuple_size)
44  , myType(type)
45  , myCapacity(0)
46  , mySize(0)
47  {
48  resize(array_size);
49  copyFrom(data);
50  }
51  ~GT_DANumeric() override
52  {
53  resize(0);
54  }
55 
56  const char *className() const override { return "GT_DANumeric"; }
57 
58  /// A numeric array is hard to begin with
59  GT_DataArrayHandle harden() const override
60  {
61  GT_DataArray *me;
62  me = const_cast<
63  GT_DANumeric<T> *>(this);
64  return GT_DataArrayHandle(me);
65  }
66 
67  void truncate()
68  {
69  if (mySize != myCapacity)
70  resize(mySize);
71  }
72 
73  void resize(GT_Size size, GT_Size capacity = -1)
74  {
75  if (capacity < 0)
76  capacity = size;
77 
78  if (!capacity)
79  {
80  GT_Size bytes = myCapacity * myTupleSize * sizeof(T);
81  GT_Memory::Free(GT_MEM_DATA, myData, bytes);
82  myData = NULL;
83  }
84  else
85  {
86  GT_Size obytes = myCapacity * myTupleSize * sizeof(T);
87  GT_Size nbytes = capacity * myTupleSize * sizeof(T);
88  myData = (T *)GT_Memory::Realloc(GT_MEM_DATA,
89  myData, obytes, nbytes);
90  }
91  mySize = size;
92  myCapacity = capacity;
93  }
94 
95  /// Append a scalar value to the array
96  void append(T value)
97  {
98  if (mySize == myCapacity)
99  grow();
100  mySize++;
101  set(value, mySize-1);
102  }
103  void append(const T *value)
104  {
105  if (mySize == myCapacity)
106  grow();
107  mySize++;
108  setTuple(value, mySize-1);
109  }
111  {
112  UT_ASSERT_P(src.myTupleSize == myTupleSize);
113  UT_ASSERT_P(src.myType == myType);
114  if (src.mySize)
115  {
116  // Ensure we have enough room
117  if (mySize + src.mySize > myCapacity)
118  grow(mySize + src.mySize);
119  memcpy(myData + mySize*myTupleSize,
120  src.myData,
121  src.mySize*src.myTupleSize*sizeof(T));
122  mySize += src.mySize;
123  }
124  }
125 
126  /// Provide virtual access to the backing data
127  const void *getBackingData() const override { return myData; }
128 
129  /// Raw access to the data array
130  T *data() const { return myData; }
131  /// Raw pointer access to a tuple
133  {
134  UT_ASSERT_P(offset >= 0 && offset < mySize);
135  offset *= myTupleSize;
136  return myData + offset;
137  }
138  /// Raw pointer access to a tuple
139  const T *getData(GT_Offset offset) const
140  {
141  UT_ASSERT_P(offset >= 0 && offset < mySize);
142  offset *= myTupleSize;
143  return myData + offset;
144  }
145  /// Set a component of the tuple
146  void set(T value, GT_Offset offset, int index=0)
147  {
148  offset = offset * myTupleSize + index;
149  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
150  myData[offset] = value;
151  }
152  /// Set an entire tuple
154  {
155  UT_ASSERT_P(offset>=0 && offset<mySize);
156  offset = offset * myTupleSize;
157  memcpy(myData + offset, value, myTupleSize*sizeof(T));
158  }
159  /// Set a block of entire tuples
161  {
162  if (values->mySize)
163  {
164  UT_ASSERT_P(offset>=0 && offset<mySize);
165  offset = offset * myTupleSize;
166  memcpy(myData + offset, values->myData, values->mySize*myTupleSize*sizeof(T));
167  }
168  }
169  /// Set a block of entire tuples
171  {
172  if (n)
173  {
174  UT_ASSERT_P(offset>=0 && offset<mySize);
175  offset = offset * myTupleSize;
176  memcpy(myData + offset, values, n*myTupleSize*sizeof(T));
177  }
178  }
179  /// Copy an entire data from a flat array
180  void copyFrom(const T *src)
181  {
182  if (src)
183  {
184  memcpy(myData, src, myTupleSize*mySize*sizeof(T));
185  }
186  else UT_ASSERT_P(mySize == 0);
187  }
188 
189  /// @{
190  /// Methods defined on GT_DataArray
191  GT_Storage getStorage() const override { return GTstorage<T>(); }
192  GT_Size getTupleSize() const override { return myTupleSize; }
193  GT_Size entries() const override { return mySize; }
194  GT_Type getTypeInfo() const override { return myType; }
195  int64 getMemoryUsage() const override
196  { return sizeof(T)*mySize*myTupleSize; }
197 
198  uint8 getU8(GT_Offset offset, int index=0) const override
199  {
200  offset = offset * myTupleSize + index;
201  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
202  return (uint8)myData[offset];
203  }
204  int32 getI32(GT_Offset offset, int index=0) const override
205  {
206  offset = offset * myTupleSize + index;
207  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
208  return (int32)myData[offset];
209  }
210  int64 getI64(GT_Offset offset, int index=0) const override
211  {
212  offset = offset * myTupleSize + index;
213  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
214  return (int64)myData[offset];
215  }
216  fpreal16 getF16(GT_Offset offset, int index=0) const override
217  {
218  offset = offset * myTupleSize + index;
219  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
220  return (fpreal16)myData[offset];
221  }
222  fpreal32 getF32(GT_Offset offset, int index=0) const override
223  {
224  offset = offset * myTupleSize + index;
225  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
226  return (fpreal32)myData[offset];
227  }
228  fpreal64 getF64(GT_Offset offset, int index=0) const override
229  {
230  offset = offset * myTupleSize + index;
231  UT_ASSERT_P(offset>=0 && offset<mySize*myTupleSize);
232  return (fpreal64)myData[offset];
233  }
234  GT_String getS(GT_Offset, int) const override
236  GT_Size getStringIndexCount() const override
237  { return -1; }
238  GT_Offset getStringIndex(GT_Offset, int) const override
239  { return -1; }
241  UT_IntArray &) const override {}
242 
243  const uint8 *getU8Array(GT_DataArrayHandle &buffer) const override
244  {
245  if (SYSisSame<T, uint8>())
246  return reinterpret_cast<const uint8 *>(data());
247  return GT_DataArray::getU8Array(buffer);
248  }
249  const int8 *getI8Array(GT_DataArrayHandle &buffer) const override
250  {
251  if (SYSisSame<T, int8>())
252  return reinterpret_cast<const int8 *>(data());
253  return GT_DataArray::getI8Array(buffer);
254  }
255  const int16 *getI16Array(GT_DataArrayHandle &buffer) const override
256  {
257  if (SYSisSame<T, int16>())
258  return reinterpret_cast<const int16 *>(data());
259  return GT_DataArray::getI16Array(buffer);
260  }
261  const int32 *getI32Array(GT_DataArrayHandle &buffer) const override
262  {
263  if (SYSisSame<T, int32>())
264  return reinterpret_cast<const int32 *>(data());
265  return GT_DataArray::getI32Array(buffer);
266  }
267  const int64 *getI64Array(GT_DataArrayHandle &buffer) const override
268  {
269  if (SYSisSame<T, int64>())
270  return reinterpret_cast<const int64 *>(data());
271  return GT_DataArray::getI64Array(buffer);
272  }
274  {
275  if (SYSisSame<T, fpreal16>())
276  return reinterpret_cast<const fpreal16 *>(data());
277  return GT_DataArray::getF16Array(buffer);
278  }
280  {
281  if (SYSisSame<T, fpreal32>())
282  return reinterpret_cast<const fpreal32 *>(data());
283  return GT_DataArray::getF32Array(buffer);
284  }
286  {
287  if (SYSisSame<T, fpreal64>())
288  return reinterpret_cast<const fpreal64 *>(data());
289  return GT_DataArray::getF64Array(buffer);
290  }
291 
292  void doImport(GT_Offset idx, uint8 *data, GT_Size size) const override
293  { importTuple<uint8>(idx, data, size); }
294  void doImport(GT_Offset idx, int8 *data, GT_Size size) const override
295  { importTuple<int8>(idx, data, size); }
296  void doImport(GT_Offset idx, int16 *data, GT_Size size) const override
297  { importTuple<int16>(idx, data, size); }
298  void doImport(GT_Offset idx, int32 *data, GT_Size size) const override
299  { importTuple<int32>(idx, data, size); }
300  void doImport(GT_Offset idx, int64 *data, GT_Size size) const override
301  { importTuple<int64>(idx, data, size); }
302  void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const override
303  { importTuple<fpreal16>(idx, data, size); }
304  void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const override
305  { importTuple<fpreal32>(idx, data, size); }
306  void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const override
307  { importTuple<fpreal64>(idx, data, size); }
308 
310  int tsize, int stride) const override
311  { t_NumericFill(data, start, length, tsize, stride); }
313  int tsize, int stride) const override
314  { t_NumericFill(data, start, length, tsize, stride); }
316  int tsize, int stride) const override
317  { t_NumericFill(data, start, length, tsize, stride); }
319  int tsize, int stride) const override
320  { t_NumericFill(data, start, length, tsize, stride); }
322  int tsize, int stride) const override
323  { t_NumericFill(data, start, length, tsize, stride); }
325  int tsize, int stride) const override
326  { t_NumericFill(data, start, length, tsize, stride); }
328  int tsize, int stride) const override
329  { t_NumericFill(data, start, length, tsize, stride); }
331  int tsize, int stride) const override
332  { t_NumericFill(data, start, length, tsize, stride); }
333  /// @}
334 
335  /// @{
336  /// Hash and compare
337  bool isEqual(const GT_DataArray &src) const override;
338  SYS_HashType hashRange(exint begin, exint end) const override;
339  /// @}
340 
341  /// Accessor to capacity of the array
342  GT_Size capacity() const { return myCapacity; }
343 
344 protected:
346  {
347  public:
348  num_MinMaxTask(const T *data, int tsize)
349  : myData(data)
350  , myTupleSize(tsize)
351  {
352  initBuffers();
353  for (int j = 0; j < myTupleSize; ++j)
354  {
355  myMin[j] = myMax[j] = data[j];
356  }
357  }
359  : myData(src.myData)
360  , myTupleSize(src.myTupleSize)
361  {
362  initBuffers();
363  std::copy(src.myMin, src.myMin+myTupleSize, myMin);
364  std::copy(src.myMax, src.myMax+myTupleSize, myMax);
365  }
367  {
368  if (myMin != myMinBuffer)
369  {
370  delete [] myMin;
371  delete [] myMax;
372  }
373  }
375  {
376  for (GT_Size i = range.begin(), n = range.end(); i < n; ++i)
377  {
378  const T *pos = myData + i * myTupleSize;
379  for (int j = 0; j < myTupleSize; ++j)
380  {
381  myMin[j] = SYSmin(myMin[j], pos[j]);
382  myMax[j] = SYSmax(myMax[j], pos[j]);
383  }
384  }
385  }
387  {
388  for (int j = 0; j < myTupleSize; ++j)
389  {
390  min[j] = SYSmin(min[j], fpreal64(myMin[j]));
391  max[j] = SYSmax(max[j], fpreal64(myMax[j]));
392  }
393  }
394  void join(const num_MinMaxTask &src)
395  {
396  for (int j = 0; j < myTupleSize; ++j)
397  {
398  myMin[j] = SYSmin(myMin[j], src.myMin[j]);
399  myMax[j] = SYSmax(myMax[j], src.myMax[j]);
400  }
401  }
402  private:
403  void initBuffers()
404  {
405  if (myTupleSize > 16)
406  {
407  myMin = new T[myTupleSize];
408  myMax = new T[myTupleSize];
409  }
410  else
411  {
412  myMin = myMinBuffer;
413  myMax = myMaxBuffer;
414  }
415  }
416  const T *myData;
417  T *myMin;
418  T *myMax;
419  T myMinBuffer[16];
420  T myMaxBuffer[16];
421  int myTupleSize;
422  };
423  bool computeMinMax(fpreal64 *min, fpreal64 *max) const override
424  {
425  num_MinMaxTask task(myData, myTupleSize);
427  task.getResult(min, max);
428  return true;
429  }
430 
431 private:
432  void grow(exint sz=-1)
433  {
434  GT_Size obytes = myCapacity * myTupleSize * sizeof(T);
435  myCapacity = sz < 0 ? UTbumpAlloc(myCapacity+1) : sz;
436  GT_Size nbytes = myCapacity * myTupleSize * sizeof(T);
437  myData = (T *)GT_Memory::Realloc(GT_MEM_DATA,
438  myData, obytes, nbytes);
439  }
440  template <typename T_POD> inline void
441  importTuple(GT_Offset idx, T_POD *data, GT_Size tsize) const
442  {
443  if (tsize < 1)
444  tsize = myTupleSize;
445  else
446  tsize = SYSmin(tsize, myTupleSize);
447  const T *src = myData + idx*myTupleSize;
448  for (int i = 0; i < tsize; ++i)
449  data[i] = (T_POD)src[i];
450  }
451 
452  inline void
453  t_NumericFill(T *dest, GT_Offset start, GT_Size length,
454  int tsize, int stride) const
455  {
456  if (tsize < 1)
457  tsize = myTupleSize;
458  stride = SYSmax(stride, tsize);
459  int n = SYSmin(tsize, myTupleSize);
460  if (n == myTupleSize && stride == myTupleSize)
461  {
462  memcpy(dest, myData+start*myTupleSize,
463  length*n*sizeof(T));
464  }
465  else
466  {
467  const T *src = myData+start*myTupleSize;
468  for (GT_Offset i = 0; i < length; ++i,
469  src += myTupleSize, dest += stride)
470  {
471  for (int j = 0; j < n; ++j)
472  dest[j] = src[j];
473  }
474  }
475  }
476 
477  template <typename T_POD> inline void
478  t_NumericFill(T_POD *dest, GT_Offset start, GT_Size length,
479  int tsize, int stride) const
480  {
481  if (tsize < 1)
482  tsize = myTupleSize;
483  stride = SYSmax(stride, tsize);
484  int n = SYSmin(tsize, myTupleSize);
485  const T *src = myData+start*myTupleSize;
486  for (GT_Offset i = 0; i < length; ++i,
487  src += myTupleSize, dest += stride)
488  {
489  for (int j = 0; j < n; ++j)
490  dest[j] = (T_POD)src[j];
491  }
492  }
493 
494  T *myData;
495  GT_Size mySize;
496  GT_Size myCapacity;
497  int myTupleSize;
498  GT_Type myType;
499 };
510 
511 /// Return either an int64 or int32 array based on the contents of the
512 /// array. That is, only allocate a 64 bit integer array if it's needed.
513 /// For tuple sizes > 1, this function assumes that the array is an array
514 /// of structs, rather than a struct of arrays.
516  GT_Size size, int tuple_size=1);
518  GT_Size size, int tuple_size=1);
519 
520 #endif
const fpreal64 * getF64Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:285
#define SYSmax(a, b)
Definition: SYS_Math.h:1521
vint4 max(const vint4 &a, const vint4 &b)
Definition: simd.h:4703
GT_Storage
Definition: GT_Types.h:18
GT_API GT_DataArray * GTallocateIntArray(const int64 *array, GT_Size size, int tuple_size=1)
GLenum GLint * range
Definition: glew.h:3500
void doImport(GT_Offset idx, uint8 *data, GT_Size size) const override
Definition: GT_DANumeric.h:292
void doImport(GT_Offset idx, int8 *data, GT_Size size) const override
Definition: GT_DANumeric.h:294
void append(const T *value)
Definition: GT_DANumeric.h:103
GLsizeiptr size
Definition: glew.h:1681
GLenum src
Definition: glew.h:2410
int int32
Definition: SYS_Types.h:39
tbb::split UT_Split
Definition: GA_PolyCounts.h:24
virtual SYS_HashType hashRange(exint begin, exint end) const
GT_Size getStringIndexCount() const override
Definition: GT_DANumeric.h:236
FMT_CONSTEXPR auto begin(const C &c) -> decltype(c.begin())
Definition: format.h:251
const void * getBackingData() const override
Provide virtual access to the backing data.
Definition: GT_DANumeric.h:127
GLuint index
Definition: glew.h:1814
void doFillArray(int32 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:318
virtual const fpreal32 * getF32Array(GT_DataArrayHandle &buffer) const
GLint GLsizei const GLuint64 * values
Definition: glew.h:3612
uint8 getU8(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:198
void doFillArray(fpreal64 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:330
#define GT_API
Definition: GT_API.h:11
const uint8 * getU8Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:243
int64 exint
Definition: SYS_Types.h:125
GT_Type
Definition: GT_Types.h:34
const int64 * getI64Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:267
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
T * data() const
Raw access to the data array.
Definition: GT_DANumeric.h:130
T * getData(GT_Offset offset)
Raw pointer access to a tuple.
Definition: GT_DANumeric.h:132
GT_Size capacity() const
Accessor to capacity of the array.
Definition: GT_DANumeric.h:342
virtual const fpreal64 * getF64Array(GT_DataArrayHandle &buffer) const
int32 getI32(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:204
float fpreal32
Definition: SYS_Types.h:200
void doImport(GT_Offset idx, int16 *data, GT_Size size) const override
Definition: GT_DANumeric.h:296
virtual const int16 * getI16Array(GT_DataArrayHandle &buffer) const
void doFillArray(fpreal16 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:324
void doFillArray(fpreal32 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:327
GT_DANumeric< uint8 > GT_Unsigned8Array
Definition: GT_DANumeric.h:500
double fpreal64
Definition: SYS_Types.h:201
unsigned char uint8
Definition: SYS_Types.h:36
virtual const fpreal16 * getF16Array(GT_DataArrayHandle &buffer) const
void doImport(GT_Offset idx, fpreal64 *data, GT_Size size) const override
Definition: GT_DANumeric.h:306
Abstract data class for an array of float, int or string data.
Definition: GT_DataArray.h:40
const int32 * getI32Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:261
GT_Size getTupleSize() const override
Definition: GT_DANumeric.h:192
const int16 * getI16Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:255
GT_String getS(GT_Offset, int) const override
Definition: GT_DANumeric.h:234
UT_IntrusivePtr< GT_DataArray > GT_DataArrayHandle
Definition: GT_DataArray.h:32
int64 getI64(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:210
GLuint buffer
Definition: glew.h:1680
GLint GLenum GLsizei GLint GLsizei const void * data
Definition: glew.h:1379
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:134
num_MinMaxTask(const T *data, int tsize)
Definition: GT_DANumeric.h:348
static const UT_StringHolder theEmptyString
const T * getData(GT_Offset offset) const
Raw pointer access to a tuple.
Definition: GT_DANumeric.h:139
void doFillArray(int16 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:315
GLuint GLuint end
Definition: glew.h:1253
GLsizei n
Definition: glew.h:4040
GLuint GLsizei GLsizei * length
Definition: glew.h:1825
void doImport(GT_Offset idx, int64 *data, GT_Size size) const override
Definition: GT_DANumeric.h:300
int64 GT_Offset
Definition: GT_Types.h:114
long long int64
Definition: SYS_Types.h:116
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
virtual const int8 * getI8Array(GT_DataArrayHandle &buffer) const
void doFillArray(uint8 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:309
void resize(GT_Size size, GT_Size capacity=-1)
Definition: GT_DANumeric.h:73
signed char int8
Definition: SYS_Types.h:35
const int8 * getI8Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:249
GT_DANumeric(GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
Create a numeric array.
Definition: GT_DANumeric.h:29
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
GLuint start
Definition: glew.h:1253
~GT_DANumeric() override
Definition: GT_DANumeric.h:51
GLsizei stride
Definition: glew.h:1523
void truncate()
Definition: GT_DANumeric.h:67
int64 GT_Size
Definition: GT_Types.h:113
void setTuple(const T *value, GT_Offset offset)
Set an entire tuple.
Definition: GT_DANumeric.h:153
void set(T value, GT_Offset offset, int index=0)
Set a component of the tuple.
Definition: GT_DANumeric.h:146
fpreal16 getF16(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:216
void operator()(const UT_BlockedRange< GT_Size > &range)
Definition: GT_DANumeric.h:374
void doFillArray(int64 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:321
short int16
Definition: SYS_Types.h:37
GT_DANumeric(const T *data, GT_Size array_size, int tuple_size, GT_Type type=GT_TYPE_NONE)
Definition: GT_DANumeric.h:40
void concat(const GT_DANumeric< T > &src)
Definition: GT_DANumeric.h:110
void doFillArray(int8 *data, GT_Offset start, GT_Size length, int tsize, int stride) const override
Definition: GT_DANumeric.h:312
GT_Offset getStringIndex(GT_Offset, int) const override
Definition: GT_DANumeric.h:238
virtual const int64 * getI64Array(GT_DataArrayHandle &buffer) const
OIIO_API bool copy(string_view from, string_view to, std::string &err)
const fpreal32 * getF32Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:279
void copyFrom(const T *src)
Copy an entire data from a flat array.
Definition: GT_DANumeric.h:180
void doImport(GT_Offset idx, int32 *data, GT_Size size) const override
Definition: GT_DANumeric.h:298
void doImport(GT_Offset idx, fpreal16 *data, GT_Size size) const override
Definition: GT_DANumeric.h:302
GT_Type getTypeInfo() const override
Definition: GT_DANumeric.h:194
int64 getMemoryUsage() const override
Definition: GT_DANumeric.h:195
void append(T value)
Append a scalar value to the array.
Definition: GT_DANumeric.h:96
GT_Size entries() const override
Definition: GT_DANumeric.h:193
An array of numeric values (int32, int64, fpreal16, fpreal32, fpreal64)
Definition: GT_DANumeric.h:23
GLenum array
Definition: glew.h:9066
virtual const uint8 * getU8Array(GT_DataArrayHandle &buffer) const
void doImport(GT_Offset idx, fpreal32 *data, GT_Size size) const override
Definition: GT_DANumeric.h:304
num_MinMaxTask(num_MinMaxTask &src, UT_Split)
Definition: GT_DANumeric.h:358
void getIndexedStrings(UT_StringArray &, UT_IntArray &) const override
Definition: GT_DANumeric.h:240
fpreal64 getF64(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:228
void setTupleBlock(const T *values, GT_Size n, GT_Offset offset)
Set a block of entire tuples.
Definition: GT_DANumeric.h:170
GT_DataArrayHandle harden() const override
A numeric array is hard to begin with.
Definition: GT_DANumeric.h:59
void setTupleBlock(const GT_DANumeric< T > *values, GT_Offset offset)
Set a block of entire tuples.
Definition: GT_DANumeric.h:160
vint4 min(const vint4 &a, const vint4 &b)
Definition: simd.h:4694
void join(const num_MinMaxTask &src)
Definition: GT_DANumeric.h:394
#define SYSmin(a, b)
Definition: SYS_Math.h:1522
virtual bool isEqual(const GT_DataArray &src) const
Compare whether two data arrays are equal.
Declare prior to use.
GLsizei const GLfloat * value
Definition: glew.h:1849
const char * className() const override
Definition: GT_DANumeric.h:56
GT_Storage getStorage() const override
Definition: GT_DANumeric.h:191
const fpreal16 * getF16Array(GT_DataArrayHandle &buffer) const override
Definition: GT_DANumeric.h:273
bool computeMinMax(fpreal64 *min, fpreal64 *max) const override
Definition: GT_DANumeric.h:423
fpreal32 getF32(GT_Offset offset, int index=0) const override
Definition: GT_DANumeric.h:222
void UTparallelReduceLightItems(const Range &range, Body &body)
void getResult(fpreal64 *min, fpreal64 *max) const
Definition: GT_DANumeric.h:386
virtual const int32 * getI32Array(GT_DataArrayHandle &buffer) const
GLintptr offset
Definition: glew.h:1682