31template <
typename T, std::
size_t N>
39 try_vectors[0][0] = T(1);
40 try_vectors[1][1] = T(1);
43 for (
auto v : try_vectors) {
44 auto orth_component = v - (v * vec) / vec.
norm2() * vec;
45 auto norm = orth_component.
norm();
46 if (norm >= 1. / std::numbers::sqrt2) {
47 ret = orth_component / norm;
Vector implementation and trait types for boost qvm interoperability.
static DEVICE_QUALIFIER constexpr Vector< T, N > broadcast(typename Base::value_type const &value)
Create a vector that has all entries set to the same value.
Vector< T, N > calc_orthonormal_vector(Vector< T, N > const &vec)
Return a vector that is orthonormal to vec.