1#ifndef FUSED_ALGORITHMS_QR_GIVENS_H
2#define FUSED_ALGORITHMS_QR_GIVENS_H
63 template <
typename T, my_
size_t M, my_
size_t N>
88 template <
typename T, my_
size_t M, my_
size_t N>
91 static_assert(is_floating_point_v<T>,
92 "qr_givens requires a floating-point scalar type");
93 static_assert(M >= N,
"qr_givens requires M >= N");
105 T a = result.
R(i - 1, j);
106 T b = result.
R(i, j);
120 T r1 = result.
R(i - 1, k);
121 T r2 = result.
R(i, k);
122 result.
R(i - 1, k) = c * r1 + s * r2;
123 result.
R(i, k) = -s * r1 + c * r2;
129 T q1 = result.
Q(k, i - 1);
130 T q2 = result.
Q(k, i);
131 result.
Q(k, i - 1) = c * q1 + s * q2;
132 result.
Q(k, i) = -s * q1 + c * q2;
Definition fused_matrix.h:12
FusedMatrix & setIdentity(void)
Definition fused_matrix.h:234
Global configuration for the tesseract tensor library.
#define my_size_t
Size/index type used throughout the library.
Definition config.h:126
#define PRECISION_TOLERANCE
Tolerance for floating-point comparisons (e.g. symmetry checks, Cholesky).
Definition config.h:117
constexpr T abs(T x) noexcept
Compute the absolute value of a numeric value.
Definition math_utils.h:48
constexpr T sqrt(T x) noexcept
Compute the square root of a floating-point value.
Definition math_utils.h:29
GivensQRResult< T, M, N > qr_givens(const FusedMatrix< T, M, N > &A)
Compute the QR decomposition using Givens rotations.
Definition qr_givens.h:89
Result of Givens QR decomposition.
Definition qr_givens.h:65
FusedMatrix< T, M, M > Q
Orthogonal factor (M×M).
Definition qr_givens.h:66
FusedMatrix< T, M, N > R
Upper-triangular factor (M×N).
Definition qr_givens.h:67