FLINT3.7.0-dev

_d1c_vec_apply_2x2, _d2c_vec_apply_2x2, _d3c_vec_apply_2x2, _d4c_vec_apply_2x2

Synopsis#include <flint/dfloat.h>
void _d1c_vec_apply_2x2(d1c_ptr u, d1c_ptr v, slong stride, slong len, d1c_srcptr M)
void _d2c_vec_apply_2x2(d2c_ptr u, d2c_ptr v, slong stride, slong len, d2c_srcptr M)
void _d3c_vec_apply_2x2(d3c_ptr u, d3c_ptr v, slong stride, slong len, d3c_srcptr M)
void _d4c_vec_apply_2x2(d4c_ptr u, d4c_ptr v, slong stride, slong len, d4c_srcptr M)

Sets (ui,vi)(u_i, v_i) to (M0ui+M1vi,M2ui+M3vi)(M_0 u_i + M_1 v_i, M_2 u_i + M_3 v_i) for the elements uiu_i = u[i * stride] and viv_i = v[i * stride], 0≤i<len0 \le i < \mathit{len}: the plane rotations of the QR algorithm, on rows (stride 1) or on columns. The vectors must not overlap and M must not alias them. This is the vec_apply_2x2 method of the plain complex rings (see _gr_vec_apply_2x2).

Each part of each output is the sum of the real products of the parts of the inputs with the parts of the coefficients, computed as exact products and a single renormalisation of their sum, in SIMD four elements at a time (including the last, partial block). The terms with an exactly zero coefficient part are left out: with a real diagonal (a rotation with a real cosine) each part is a sum of three products, with a real matrix of two. The result for an element does not depend on its position in the vector. With real cosines, a rotation costs about 15, 45 and 100 ns per pair of elements for d2c, d3c and d4c; it takes about three quarters of the time of gr_mat_eig_qr for N≥2N \ge 2.

Cite this page

The FLINT team, “_d1c_vec_apply_2x2, _d2c_vec_apply_2x2, _d3c_vec_apply_2x2, _d4c_vec_apply_2x2 (dfloat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/dfloat/_d1c_vec_apply_2x2.html (generated 2026-11-07).