19#ifndef ESPRESSO_ORTHONORMAL_VEC_HPP
20#define ESPRESSO_ORTHONORMAL_VEC_HPP
31template <
typename T, std::
size_t N>
39 try_vectors[0][0] = 1;
40 try_vectors[1][1] = 1;
43 for (
auto v : try_vectors) {
44 auto orth_component = v - (v * vec) / vec.
norm2() * vec;
45 auto norm = orth_component.
norm();
47 ret = orth_component / norm;
Vector implementation and trait types for boost qvm interoperability.
static Vector< T, N > broadcast(T const &s)
Create a vector that has all entries set to one value.
Vector< T, N > calc_orthonormal_vector(Vector< T, N > const &vec)
Return a vector that is orthonormal to vec.
DEVICE_QUALIFIER constexpr T sqrt_2()
Square root of 2.