25KOKKOS_INLINE_FUNCTION T
28 return x >= 0.0 ? 1.0 : -1.0;
39KOKKOS_INLINE_FUNCTION
const T *
40find(
const T & target,
const T *
const begin,
const T *
const end)
50 auto mid = left + (right - left) / 2;
54 else if (*mid < target)
69KOKKOS_INLINE_FUNCTION
unsigned int
72 return i * (i + 1) / 2 + j;
80KOKKOS_INLINE_FUNCTION
void
83 for (
unsigned int i = 0; i < n; ++i)
85 for (
unsigned int j = 0; j <= i; ++j)
89 for (
unsigned int k = 0; k < j; ++k)
109template <
typename Vector>
110KOKKOS_INLINE_FUNCTION
void
113 for (
unsigned int i = 0; i < n; ++i)
117 for (
unsigned int j = 0; j < i; ++j)
123 for (
int i = n - 1; i >= 0; --i)
127 for (
unsigned int j = i + 1; j < n; ++j)
The Kokkos wrapper class for PETSc vector.
KOKKOS_INLINE_FUNCTION void choleskyFactor(Real *const L, const unsigned int n)
Perform an in-place Cholesky decomposition of a symmetric positive definite matrix.
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 T sign(T x)
Returns the sign of a value.
KOKKOS_INLINE_FUNCTION unsigned int packedLowerIndex(const unsigned int i, const unsigned int j)
Get the index of entry (i, j), j <= i, of a lower-triangular matrix packed row by row.
KOKKOS_INLINE_FUNCTION void choleskySubstitute(const Real *const L, Vector x, Vector b, const unsigned int n)
Solve a linear system with a Cholesky factor from choleskyFactor() The right-hand-side vector is modi...