25 KOKKOS_INLINE_FUNCTION T
28 return x >= 0.0 ? 1.0 : -1.0;
39 KOKKOS_INLINE_FUNCTION
const T *
40 find(
const T & target,
const T *
const begin,
const T *
const end)
50 auto mid = left + (right - left) / 2;
54 else if (*mid < target)
71 KOKKOS_INLINE_FUNCTION
void 72 choleskySolve(Real *
const A, Real *
const x, Real *
const b,
const unsigned int n)
74 for (
unsigned int i = 0; i < n; ++i)
76 for (
unsigned int j = 0; j <= i; ++j)
78 Real sum = A[j + n * i];
80 for (
unsigned int k = 0; k < j; ++k)
81 sum -= A[k + n * i] * A[k + n * j];
86 A[j + n * i] = sum / A[j + n * j];
90 for (
unsigned int i = 0; i < n; ++i)
94 for (
unsigned int j = 0; j < i; ++j)
95 sum -= A[j + n * i] * b[j];
97 b[i] = sum / A[i + n * i];
100 for (
int i = n - 1; i >= 0; --i)
104 for (
unsigned int j = i + 1; j < n; ++j)
105 sum -= A[i + n * j] * x[j];
107 x[i] = sum / A[i + n * i];
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
KOKKOS_INLINE_FUNCTION void choleskySolve(Real *const A, Real *const x, Real *const b, const unsigned int n)
Perform an in-place linear solve using Cholesky decomposition Matrix and right-hand-side vector are m...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CTSub CT_OPERATOR_BINARY CTMul CTCompareLess CTCompareGreater CTCompareEqual _arg template * sqrt(_arg)) *_arg.template D< dtag >()) CT_SIMPLE_UNARY_FUNCTION(tanh
KOKKOS_INLINE_FUNCTION T sign(T x)
Returns the sign of a value.