1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| int
gsl_linalg_complex_QR_decomp (gsl_matrix_complex * A, gsl_vector_complex * tau)
{
const size_t M = A->size1;
const size_t N = A->size2;
gsl_vector_complex_view c_full;
gsl_vector_complex_view c;
gsl_complex tau_i;
gsl_matrix_complex_view m;
if (tau->size != GSL_MIN (M, N))
{
GSL_ERROR ("size of tau must be MIN(M,N)", GSL_EBADLEN);
}
else
{
size_t i;
for (i = 0; i < GSL_MIN (M, N); i++)
{
/* Compute the Householder transformation to reduce the j-th
column of the matrix to a multiple of the j-th unit vector */
c_full = gsl_matrix_complex_column (A, i);
c = gsl_vector_complex_subvector (&(c_full.vector), i, M-i);
printf ("m(%d,%d) = %f + i %f\n", 0, 0,
gsl_vector_complex_get (tau, 1)); |
Partager