HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_MatrixShared.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  */
7 
8 #pragma once
9 
10 #ifndef __UT_MATRIXSHARED_H_INCLUDED__
11 #define __UT_MATRIXSHARED_H_INCLUDED__
12 
13 #include <SYS/SYS_Math.h>
14 #include <SYS/SYS_Types.h>
15 
16 // refactored from OP_Node.C
17 namespace
18 {
19  template <typename T>
20  struct ut_MinAbsScale;
21 
22  template <>
23  struct ut_MinAbsScale<fpreal32>
24  {
25  static inline fpreal32 value() { return SYS_FTOLERANCE; }
26  };
27  template <>
28  struct ut_MinAbsScale<fpreal64>
29  {
30  static inline fpreal64 value() { return 1e-14; }
31  };
32 
33 }
34 
35 template <typename T>
36 static inline T
37 UTconditionScale(T f)
38 {
40  {
41  f = f < 0 ? -ut_MinAbsScale<T>::value()
42  : +ut_MinAbsScale<T>::value();
43  }
44  return f;
45 }
46 
47 #endif // __UT_MATRIXSHARED_H_INCLUDED__
GLsizei const GLfloat * value
Definition: glcorearb.h:824
#define SYSabs(a)
Definition: SYS_Math.h:1954
GLfloat f
Definition: glcorearb.h:1926
#define SYS_FTOLERANCE
Definition: SYS_Types.h:208