1# This file was automatically generated by SWIG (http://www.swig.org). 2# Version 4.0.1 3# 4# Do not make changes to this file unless you know what you are doing--modify 5# the SWIG interface file instead. 6 7package Math::GSL::Linalg; 8use base qw(Exporter); 9use base qw(DynaLoader); 10package Math::GSL::Linalgc; 11bootstrap Math::GSL::Linalg; 12package Math::GSL::Linalg; 13@EXPORT = qw(); 14 15# ---------- BASE METHODS ------------- 16 17package Math::GSL::Linalg; 18 19sub TIEHASH { 20 my ($classname,$obj) = @_; 21 return bless $obj, $classname; 22} 23 24sub CLEAR { } 25 26sub FIRSTKEY { } 27 28sub NEXTKEY { } 29 30sub FETCH { 31 my ($self,$field) = @_; 32 my $member_func = "swig_${field}_get"; 33 $self->$member_func(); 34} 35 36sub STORE { 37 my ($self,$field,$newval) = @_; 38 my $member_func = "swig_${field}_set"; 39 $self->$member_func($newval); 40} 41 42sub this { 43 my $ptr = shift; 44 return tied(%$ptr); 45} 46 47 48# ------- FUNCTION WRAPPERS -------- 49 50package Math::GSL::Linalg; 51 52*gsl_error = *Math::GSL::Linalgc::gsl_error; 53*gsl_stream_printf = *Math::GSL::Linalgc::gsl_stream_printf; 54*gsl_strerror = *Math::GSL::Linalgc::gsl_strerror; 55*gsl_set_error_handler = *Math::GSL::Linalgc::gsl_set_error_handler; 56*gsl_set_error_handler_off = *Math::GSL::Linalgc::gsl_set_error_handler_off; 57*gsl_set_stream_handler = *Math::GSL::Linalgc::gsl_set_stream_handler; 58*gsl_set_stream = *Math::GSL::Linalgc::gsl_set_stream; 59*gsl_linalg_matmult = *Math::GSL::Linalgc::gsl_linalg_matmult; 60*gsl_linalg_matmult_mod = *Math::GSL::Linalgc::gsl_linalg_matmult_mod; 61*gsl_linalg_exponential_ss = *Math::GSL::Linalgc::gsl_linalg_exponential_ss; 62*gsl_linalg_householder_transform = *Math::GSL::Linalgc::gsl_linalg_householder_transform; 63*gsl_linalg_complex_householder_transform = *Math::GSL::Linalgc::gsl_linalg_complex_householder_transform; 64*gsl_linalg_householder_hm = *Math::GSL::Linalgc::gsl_linalg_householder_hm; 65*gsl_linalg_householder_mh = *Math::GSL::Linalgc::gsl_linalg_householder_mh; 66*gsl_linalg_householder_hv = *Math::GSL::Linalgc::gsl_linalg_householder_hv; 67*gsl_linalg_householder_hm1 = *Math::GSL::Linalgc::gsl_linalg_householder_hm1; 68*gsl_linalg_complex_householder_hm = *Math::GSL::Linalgc::gsl_linalg_complex_householder_hm; 69*gsl_linalg_complex_householder_mh = *Math::GSL::Linalgc::gsl_linalg_complex_householder_mh; 70*gsl_linalg_complex_householder_hv = *Math::GSL::Linalgc::gsl_linalg_complex_householder_hv; 71*gsl_linalg_hessenberg_decomp = *Math::GSL::Linalgc::gsl_linalg_hessenberg_decomp; 72*gsl_linalg_hessenberg_unpack = *Math::GSL::Linalgc::gsl_linalg_hessenberg_unpack; 73*gsl_linalg_hessenberg_unpack_accum = *Math::GSL::Linalgc::gsl_linalg_hessenberg_unpack_accum; 74*gsl_linalg_hessenberg_set_zero = *Math::GSL::Linalgc::gsl_linalg_hessenberg_set_zero; 75*gsl_linalg_hessenberg_submatrix = *Math::GSL::Linalgc::gsl_linalg_hessenberg_submatrix; 76*gsl_linalg_hesstri_decomp = *Math::GSL::Linalgc::gsl_linalg_hesstri_decomp; 77*gsl_linalg_SV_decomp = *Math::GSL::Linalgc::gsl_linalg_SV_decomp; 78*gsl_linalg_SV_decomp_mod = *Math::GSL::Linalgc::gsl_linalg_SV_decomp_mod; 79*gsl_linalg_SV_decomp_jacobi = *Math::GSL::Linalgc::gsl_linalg_SV_decomp_jacobi; 80*gsl_linalg_SV_solve = *Math::GSL::Linalgc::gsl_linalg_SV_solve; 81*gsl_linalg_LU_decomp = *Math::GSL::Linalgc::gsl_linalg_LU_decomp; 82*gsl_linalg_LU_solve = *Math::GSL::Linalgc::gsl_linalg_LU_solve; 83*gsl_linalg_LU_svx = *Math::GSL::Linalgc::gsl_linalg_LU_svx; 84*gsl_linalg_LU_refine = *Math::GSL::Linalgc::gsl_linalg_LU_refine; 85*gsl_linalg_LU_invert = *Math::GSL::Linalgc::gsl_linalg_LU_invert; 86*gsl_linalg_LU_det = *Math::GSL::Linalgc::gsl_linalg_LU_det; 87*gsl_linalg_LU_lndet = *Math::GSL::Linalgc::gsl_linalg_LU_lndet; 88*gsl_linalg_LU_sgndet = *Math::GSL::Linalgc::gsl_linalg_LU_sgndet; 89*gsl_linalg_complex_LU_decomp = *Math::GSL::Linalgc::gsl_linalg_complex_LU_decomp; 90*gsl_linalg_complex_LU_solve = *Math::GSL::Linalgc::gsl_linalg_complex_LU_solve; 91*gsl_linalg_complex_LU_svx = *Math::GSL::Linalgc::gsl_linalg_complex_LU_svx; 92*gsl_linalg_complex_LU_refine = *Math::GSL::Linalgc::gsl_linalg_complex_LU_refine; 93*gsl_linalg_complex_LU_invert = *Math::GSL::Linalgc::gsl_linalg_complex_LU_invert; 94*gsl_linalg_complex_LU_det = *Math::GSL::Linalgc::gsl_linalg_complex_LU_det; 95*gsl_linalg_complex_LU_lndet = *Math::GSL::Linalgc::gsl_linalg_complex_LU_lndet; 96*gsl_linalg_complex_LU_sgndet = *Math::GSL::Linalgc::gsl_linalg_complex_LU_sgndet; 97*gsl_linalg_QR_decomp = *Math::GSL::Linalgc::gsl_linalg_QR_decomp; 98*gsl_linalg_QR_solve = *Math::GSL::Linalgc::gsl_linalg_QR_solve; 99*gsl_linalg_QR_svx = *Math::GSL::Linalgc::gsl_linalg_QR_svx; 100*gsl_linalg_QR_lssolve = *Math::GSL::Linalgc::gsl_linalg_QR_lssolve; 101*gsl_linalg_QR_QRsolve = *Math::GSL::Linalgc::gsl_linalg_QR_QRsolve; 102*gsl_linalg_QR_Rsolve = *Math::GSL::Linalgc::gsl_linalg_QR_Rsolve; 103*gsl_linalg_QR_Rsvx = *Math::GSL::Linalgc::gsl_linalg_QR_Rsvx; 104*gsl_linalg_QR_update = *Math::GSL::Linalgc::gsl_linalg_QR_update; 105*gsl_linalg_QR_QTvec = *Math::GSL::Linalgc::gsl_linalg_QR_QTvec; 106*gsl_linalg_QR_Qvec = *Math::GSL::Linalgc::gsl_linalg_QR_Qvec; 107*gsl_linalg_QR_QTmat = *Math::GSL::Linalgc::gsl_linalg_QR_QTmat; 108*gsl_linalg_QR_unpack = *Math::GSL::Linalgc::gsl_linalg_QR_unpack; 109*gsl_linalg_R_solve = *Math::GSL::Linalgc::gsl_linalg_R_solve; 110*gsl_linalg_R_svx = *Math::GSL::Linalgc::gsl_linalg_R_svx; 111*gsl_linalg_QRPT_decomp = *Math::GSL::Linalgc::gsl_linalg_QRPT_decomp; 112*gsl_linalg_QRPT_decomp2 = *Math::GSL::Linalgc::gsl_linalg_QRPT_decomp2; 113*gsl_linalg_QRPT_solve = *Math::GSL::Linalgc::gsl_linalg_QRPT_solve; 114*gsl_linalg_QRPT_svx = *Math::GSL::Linalgc::gsl_linalg_QRPT_svx; 115*gsl_linalg_QRPT_QRsolve = *Math::GSL::Linalgc::gsl_linalg_QRPT_QRsolve; 116*gsl_linalg_QRPT_Rsolve = *Math::GSL::Linalgc::gsl_linalg_QRPT_Rsolve; 117*gsl_linalg_QRPT_Rsvx = *Math::GSL::Linalgc::gsl_linalg_QRPT_Rsvx; 118*gsl_linalg_QRPT_update = *Math::GSL::Linalgc::gsl_linalg_QRPT_update; 119*gsl_linalg_LQ_decomp = *Math::GSL::Linalgc::gsl_linalg_LQ_decomp; 120*gsl_linalg_LQ_solve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_solve_T; 121*gsl_linalg_LQ_svx_T = *Math::GSL::Linalgc::gsl_linalg_LQ_svx_T; 122*gsl_linalg_LQ_lssolve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_lssolve_T; 123*gsl_linalg_LQ_Lsolve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_Lsolve_T; 124*gsl_linalg_LQ_Lsvx_T = *Math::GSL::Linalgc::gsl_linalg_LQ_Lsvx_T; 125*gsl_linalg_L_solve_T = *Math::GSL::Linalgc::gsl_linalg_L_solve_T; 126*gsl_linalg_LQ_vecQ = *Math::GSL::Linalgc::gsl_linalg_LQ_vecQ; 127*gsl_linalg_LQ_vecQT = *Math::GSL::Linalgc::gsl_linalg_LQ_vecQT; 128*gsl_linalg_LQ_unpack = *Math::GSL::Linalgc::gsl_linalg_LQ_unpack; 129*gsl_linalg_LQ_update = *Math::GSL::Linalgc::gsl_linalg_LQ_update; 130*gsl_linalg_LQ_LQsolve = *Math::GSL::Linalgc::gsl_linalg_LQ_LQsolve; 131*gsl_linalg_PTLQ_decomp = *Math::GSL::Linalgc::gsl_linalg_PTLQ_decomp; 132*gsl_linalg_PTLQ_decomp2 = *Math::GSL::Linalgc::gsl_linalg_PTLQ_decomp2; 133*gsl_linalg_PTLQ_solve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_solve_T; 134*gsl_linalg_PTLQ_svx_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_svx_T; 135*gsl_linalg_PTLQ_LQsolve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_LQsolve_T; 136*gsl_linalg_PTLQ_Lsolve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_Lsolve_T; 137*gsl_linalg_PTLQ_Lsvx_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_Lsvx_T; 138*gsl_linalg_PTLQ_update = *Math::GSL::Linalgc::gsl_linalg_PTLQ_update; 139*gsl_linalg_cholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp; 140*gsl_linalg_cholesky_solve = *Math::GSL::Linalgc::gsl_linalg_cholesky_solve; 141*gsl_linalg_cholesky_svx = *Math::GSL::Linalgc::gsl_linalg_cholesky_svx; 142*gsl_linalg_cholesky_invert = *Math::GSL::Linalgc::gsl_linalg_cholesky_invert; 143*gsl_linalg_cholesky_decomp_unit = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp_unit; 144*gsl_linalg_complex_cholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_decomp; 145*gsl_linalg_complex_cholesky_solve = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_solve; 146*gsl_linalg_complex_cholesky_svx = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_svx; 147*gsl_linalg_complex_cholesky_invert = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_invert; 148*gsl_linalg_symmtd_decomp = *Math::GSL::Linalgc::gsl_linalg_symmtd_decomp; 149*gsl_linalg_symmtd_unpack = *Math::GSL::Linalgc::gsl_linalg_symmtd_unpack; 150*gsl_linalg_symmtd_unpack_T = *Math::GSL::Linalgc::gsl_linalg_symmtd_unpack_T; 151*gsl_linalg_hermtd_decomp = *Math::GSL::Linalgc::gsl_linalg_hermtd_decomp; 152*gsl_linalg_hermtd_unpack = *Math::GSL::Linalgc::gsl_linalg_hermtd_unpack; 153*gsl_linalg_hermtd_unpack_T = *Math::GSL::Linalgc::gsl_linalg_hermtd_unpack_T; 154*gsl_linalg_HH_solve = *Math::GSL::Linalgc::gsl_linalg_HH_solve; 155*gsl_linalg_HH_svx = *Math::GSL::Linalgc::gsl_linalg_HH_svx; 156*gsl_linalg_solve_symm_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_symm_tridiag; 157*gsl_linalg_solve_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_tridiag; 158*gsl_linalg_solve_symm_cyc_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_symm_cyc_tridiag; 159*gsl_linalg_solve_cyc_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_cyc_tridiag; 160*gsl_linalg_bidiag_decomp = *Math::GSL::Linalgc::gsl_linalg_bidiag_decomp; 161*gsl_linalg_bidiag_unpack = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack; 162*gsl_linalg_bidiag_unpack2 = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack2; 163*gsl_linalg_bidiag_unpack_B = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack_B; 164*gsl_linalg_balance_matrix = *Math::GSL::Linalgc::gsl_linalg_balance_matrix; 165*gsl_linalg_balance_accum = *Math::GSL::Linalgc::gsl_linalg_balance_accum; 166*gsl_linalg_balance_columns = *Math::GSL::Linalgc::gsl_linalg_balance_columns; 167*gsl_permutation_alloc = *Math::GSL::Linalgc::gsl_permutation_alloc; 168*gsl_permutation_calloc = *Math::GSL::Linalgc::gsl_permutation_calloc; 169*gsl_permutation_init = *Math::GSL::Linalgc::gsl_permutation_init; 170*gsl_permutation_free = *Math::GSL::Linalgc::gsl_permutation_free; 171*gsl_permutation_memcpy = *Math::GSL::Linalgc::gsl_permutation_memcpy; 172*gsl_permutation_fread = *Math::GSL::Linalgc::gsl_permutation_fread; 173*gsl_permutation_fwrite = *Math::GSL::Linalgc::gsl_permutation_fwrite; 174*gsl_permutation_fscanf = *Math::GSL::Linalgc::gsl_permutation_fscanf; 175*gsl_permutation_fprintf = *Math::GSL::Linalgc::gsl_permutation_fprintf; 176*gsl_permutation_size = *Math::GSL::Linalgc::gsl_permutation_size; 177*gsl_permutation_data = *Math::GSL::Linalgc::gsl_permutation_data; 178*gsl_permutation_swap = *Math::GSL::Linalgc::gsl_permutation_swap; 179*gsl_permutation_valid = *Math::GSL::Linalgc::gsl_permutation_valid; 180*gsl_permutation_reverse = *Math::GSL::Linalgc::gsl_permutation_reverse; 181*gsl_permutation_inverse = *Math::GSL::Linalgc::gsl_permutation_inverse; 182*gsl_permutation_next = *Math::GSL::Linalgc::gsl_permutation_next; 183*gsl_permutation_prev = *Math::GSL::Linalgc::gsl_permutation_prev; 184*gsl_permutation_mul = *Math::GSL::Linalgc::gsl_permutation_mul; 185*gsl_permutation_linear_to_canonical = *Math::GSL::Linalgc::gsl_permutation_linear_to_canonical; 186*gsl_permutation_canonical_to_linear = *Math::GSL::Linalgc::gsl_permutation_canonical_to_linear; 187*gsl_permutation_inversions = *Math::GSL::Linalgc::gsl_permutation_inversions; 188*gsl_permutation_linear_cycles = *Math::GSL::Linalgc::gsl_permutation_linear_cycles; 189*gsl_permutation_canonical_cycles = *Math::GSL::Linalgc::gsl_permutation_canonical_cycles; 190*gsl_permutation_get = *Math::GSL::Linalgc::gsl_permutation_get; 191*gsl_complex_polar = *Math::GSL::Linalgc::gsl_complex_polar; 192*gsl_complex_rect = *Math::GSL::Linalgc::gsl_complex_rect; 193*gsl_complex_arg = *Math::GSL::Linalgc::gsl_complex_arg; 194*gsl_complex_abs = *Math::GSL::Linalgc::gsl_complex_abs; 195*gsl_complex_abs2 = *Math::GSL::Linalgc::gsl_complex_abs2; 196*gsl_complex_logabs = *Math::GSL::Linalgc::gsl_complex_logabs; 197*gsl_complex_add = *Math::GSL::Linalgc::gsl_complex_add; 198*gsl_complex_sub = *Math::GSL::Linalgc::gsl_complex_sub; 199*gsl_complex_mul = *Math::GSL::Linalgc::gsl_complex_mul; 200*gsl_complex_div = *Math::GSL::Linalgc::gsl_complex_div; 201*gsl_complex_add_real = *Math::GSL::Linalgc::gsl_complex_add_real; 202*gsl_complex_sub_real = *Math::GSL::Linalgc::gsl_complex_sub_real; 203*gsl_complex_mul_real = *Math::GSL::Linalgc::gsl_complex_mul_real; 204*gsl_complex_div_real = *Math::GSL::Linalgc::gsl_complex_div_real; 205*gsl_complex_add_imag = *Math::GSL::Linalgc::gsl_complex_add_imag; 206*gsl_complex_sub_imag = *Math::GSL::Linalgc::gsl_complex_sub_imag; 207*gsl_complex_mul_imag = *Math::GSL::Linalgc::gsl_complex_mul_imag; 208*gsl_complex_div_imag = *Math::GSL::Linalgc::gsl_complex_div_imag; 209*gsl_complex_conjugate = *Math::GSL::Linalgc::gsl_complex_conjugate; 210*gsl_complex_inverse = *Math::GSL::Linalgc::gsl_complex_inverse; 211*gsl_complex_negative = *Math::GSL::Linalgc::gsl_complex_negative; 212*gsl_complex_sqrt = *Math::GSL::Linalgc::gsl_complex_sqrt; 213*gsl_complex_sqrt_real = *Math::GSL::Linalgc::gsl_complex_sqrt_real; 214*gsl_complex_pow = *Math::GSL::Linalgc::gsl_complex_pow; 215*gsl_complex_pow_real = *Math::GSL::Linalgc::gsl_complex_pow_real; 216*gsl_complex_exp = *Math::GSL::Linalgc::gsl_complex_exp; 217*gsl_complex_log = *Math::GSL::Linalgc::gsl_complex_log; 218*gsl_complex_log10 = *Math::GSL::Linalgc::gsl_complex_log10; 219*gsl_complex_log_b = *Math::GSL::Linalgc::gsl_complex_log_b; 220*gsl_complex_sin = *Math::GSL::Linalgc::gsl_complex_sin; 221*gsl_complex_cos = *Math::GSL::Linalgc::gsl_complex_cos; 222*gsl_complex_sec = *Math::GSL::Linalgc::gsl_complex_sec; 223*gsl_complex_csc = *Math::GSL::Linalgc::gsl_complex_csc; 224*gsl_complex_tan = *Math::GSL::Linalgc::gsl_complex_tan; 225*gsl_complex_cot = *Math::GSL::Linalgc::gsl_complex_cot; 226*gsl_complex_arcsin = *Math::GSL::Linalgc::gsl_complex_arcsin; 227*gsl_complex_arcsin_real = *Math::GSL::Linalgc::gsl_complex_arcsin_real; 228*gsl_complex_arccos = *Math::GSL::Linalgc::gsl_complex_arccos; 229*gsl_complex_arccos_real = *Math::GSL::Linalgc::gsl_complex_arccos_real; 230*gsl_complex_arcsec = *Math::GSL::Linalgc::gsl_complex_arcsec; 231*gsl_complex_arcsec_real = *Math::GSL::Linalgc::gsl_complex_arcsec_real; 232*gsl_complex_arccsc = *Math::GSL::Linalgc::gsl_complex_arccsc; 233*gsl_complex_arccsc_real = *Math::GSL::Linalgc::gsl_complex_arccsc_real; 234*gsl_complex_arctan = *Math::GSL::Linalgc::gsl_complex_arctan; 235*gsl_complex_arccot = *Math::GSL::Linalgc::gsl_complex_arccot; 236*gsl_complex_sinh = *Math::GSL::Linalgc::gsl_complex_sinh; 237*gsl_complex_cosh = *Math::GSL::Linalgc::gsl_complex_cosh; 238*gsl_complex_sech = *Math::GSL::Linalgc::gsl_complex_sech; 239*gsl_complex_csch = *Math::GSL::Linalgc::gsl_complex_csch; 240*gsl_complex_tanh = *Math::GSL::Linalgc::gsl_complex_tanh; 241*gsl_complex_coth = *Math::GSL::Linalgc::gsl_complex_coth; 242*gsl_complex_arcsinh = *Math::GSL::Linalgc::gsl_complex_arcsinh; 243*gsl_complex_arccosh = *Math::GSL::Linalgc::gsl_complex_arccosh; 244*gsl_complex_arccosh_real = *Math::GSL::Linalgc::gsl_complex_arccosh_real; 245*gsl_complex_arcsech = *Math::GSL::Linalgc::gsl_complex_arcsech; 246*gsl_complex_arccsch = *Math::GSL::Linalgc::gsl_complex_arccsch; 247*gsl_complex_arctanh = *Math::GSL::Linalgc::gsl_complex_arctanh; 248*gsl_complex_arctanh_real = *Math::GSL::Linalgc::gsl_complex_arctanh_real; 249*gsl_complex_arccoth = *Math::GSL::Linalgc::gsl_complex_arccoth; 250 251############# Class : Math::GSL::Linalg::gsl_permutation_struct ############## 252 253package Math::GSL::Linalg::gsl_permutation_struct; 254use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 255@ISA = qw( Math::GSL::Linalg ); 256%OWNER = (); 257%ITERATORS = (); 258*swig_size_get = *Math::GSL::Linalgc::gsl_permutation_struct_size_get; 259*swig_size_set = *Math::GSL::Linalgc::gsl_permutation_struct_size_set; 260*swig_data_get = *Math::GSL::Linalgc::gsl_permutation_struct_data_get; 261*swig_data_set = *Math::GSL::Linalgc::gsl_permutation_struct_data_set; 262sub new { 263 my $pkg = shift; 264 my $self = Math::GSL::Linalgc::new_gsl_permutation_struct(@_); 265 bless $self, $pkg if defined($self); 266} 267 268sub DESTROY { 269 return unless $_[0]->isa('HASH'); 270 my $self = tied(%{$_[0]}); 271 return unless defined $self; 272 delete $ITERATORS{$self}; 273 if (exists $OWNER{$self}) { 274 Math::GSL::Linalgc::delete_gsl_permutation_struct($self); 275 delete $OWNER{$self}; 276 } 277} 278 279sub DISOWN { 280 my $self = shift; 281 my $ptr = tied(%$self); 282 delete $OWNER{$ptr}; 283} 284 285sub ACQUIRE { 286 my $self = shift; 287 my $ptr = tied(%$self); 288 $OWNER{$ptr} = 1; 289} 290 291 292############# Class : Math::GSL::Linalg::gsl_complex ############## 293 294package Math::GSL::Linalg::gsl_complex; 295use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 296@ISA = qw( Math::GSL::Linalg ); 297%OWNER = (); 298%ITERATORS = (); 299*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_dat_get; 300*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_dat_set; 301sub new { 302 my $pkg = shift; 303 my $self = Math::GSL::Linalgc::new_gsl_complex(@_); 304 bless $self, $pkg if defined($self); 305} 306 307sub DESTROY { 308 return unless $_[0]->isa('HASH'); 309 my $self = tied(%{$_[0]}); 310 return unless defined $self; 311 delete $ITERATORS{$self}; 312 if (exists $OWNER{$self}) { 313 Math::GSL::Linalgc::delete_gsl_complex($self); 314 delete $OWNER{$self}; 315 } 316} 317 318sub DISOWN { 319 my $self = shift; 320 my $ptr = tied(%$self); 321 delete $OWNER{$ptr}; 322} 323 324sub ACQUIRE { 325 my $self = shift; 326 my $ptr = tied(%$self); 327 $OWNER{$ptr} = 1; 328} 329 330 331############# Class : Math::GSL::Linalg::gsl_complex_long_double ############## 332 333package Math::GSL::Linalg::gsl_complex_long_double; 334use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 335@ISA = qw( Math::GSL::Linalg ); 336%OWNER = (); 337%ITERATORS = (); 338*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_long_double_dat_get; 339*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_long_double_dat_set; 340sub new { 341 my $pkg = shift; 342 my $self = Math::GSL::Linalgc::new_gsl_complex_long_double(@_); 343 bless $self, $pkg if defined($self); 344} 345 346sub DESTROY { 347 return unless $_[0]->isa('HASH'); 348 my $self = tied(%{$_[0]}); 349 return unless defined $self; 350 delete $ITERATORS{$self}; 351 if (exists $OWNER{$self}) { 352 Math::GSL::Linalgc::delete_gsl_complex_long_double($self); 353 delete $OWNER{$self}; 354 } 355} 356 357sub DISOWN { 358 my $self = shift; 359 my $ptr = tied(%$self); 360 delete $OWNER{$ptr}; 361} 362 363sub ACQUIRE { 364 my $self = shift; 365 my $ptr = tied(%$self); 366 $OWNER{$ptr} = 1; 367} 368 369 370############# Class : Math::GSL::Linalg::gsl_complex_float ############## 371 372package Math::GSL::Linalg::gsl_complex_float; 373use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 374@ISA = qw( Math::GSL::Linalg ); 375%OWNER = (); 376%ITERATORS = (); 377*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_float_dat_get; 378*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_float_dat_set; 379sub new { 380 my $pkg = shift; 381 my $self = Math::GSL::Linalgc::new_gsl_complex_float(@_); 382 bless $self, $pkg if defined($self); 383} 384 385sub DESTROY { 386 return unless $_[0]->isa('HASH'); 387 my $self = tied(%{$_[0]}); 388 return unless defined $self; 389 delete $ITERATORS{$self}; 390 if (exists $OWNER{$self}) { 391 Math::GSL::Linalgc::delete_gsl_complex_float($self); 392 delete $OWNER{$self}; 393 } 394} 395 396sub DISOWN { 397 my $self = shift; 398 my $ptr = tied(%$self); 399 delete $OWNER{$ptr}; 400} 401 402sub ACQUIRE { 403 my $self = shift; 404 my $ptr = tied(%$self); 405 $OWNER{$ptr} = 1; 406} 407 408 409# ------- VARIABLE STUBS -------- 410 411package Math::GSL::Linalg; 412 413*GSL_VERSION = *Math::GSL::Linalgc::GSL_VERSION; 414*GSL_MAJOR_VERSION = *Math::GSL::Linalgc::GSL_MAJOR_VERSION; 415*GSL_MINOR_VERSION = *Math::GSL::Linalgc::GSL_MINOR_VERSION; 416*GSL_POSZERO = *Math::GSL::Linalgc::GSL_POSZERO; 417*GSL_NEGZERO = *Math::GSL::Linalgc::GSL_NEGZERO; 418*GSL_SUCCESS = *Math::GSL::Linalgc::GSL_SUCCESS; 419*GSL_FAILURE = *Math::GSL::Linalgc::GSL_FAILURE; 420*GSL_CONTINUE = *Math::GSL::Linalgc::GSL_CONTINUE; 421*GSL_EDOM = *Math::GSL::Linalgc::GSL_EDOM; 422*GSL_ERANGE = *Math::GSL::Linalgc::GSL_ERANGE; 423*GSL_EFAULT = *Math::GSL::Linalgc::GSL_EFAULT; 424*GSL_EINVAL = *Math::GSL::Linalgc::GSL_EINVAL; 425*GSL_EFAILED = *Math::GSL::Linalgc::GSL_EFAILED; 426*GSL_EFACTOR = *Math::GSL::Linalgc::GSL_EFACTOR; 427*GSL_ESANITY = *Math::GSL::Linalgc::GSL_ESANITY; 428*GSL_ENOMEM = *Math::GSL::Linalgc::GSL_ENOMEM; 429*GSL_EBADFUNC = *Math::GSL::Linalgc::GSL_EBADFUNC; 430*GSL_ERUNAWAY = *Math::GSL::Linalgc::GSL_ERUNAWAY; 431*GSL_EMAXITER = *Math::GSL::Linalgc::GSL_EMAXITER; 432*GSL_EZERODIV = *Math::GSL::Linalgc::GSL_EZERODIV; 433*GSL_EBADTOL = *Math::GSL::Linalgc::GSL_EBADTOL; 434*GSL_ETOL = *Math::GSL::Linalgc::GSL_ETOL; 435*GSL_EUNDRFLW = *Math::GSL::Linalgc::GSL_EUNDRFLW; 436*GSL_EOVRFLW = *Math::GSL::Linalgc::GSL_EOVRFLW; 437*GSL_ELOSS = *Math::GSL::Linalgc::GSL_ELOSS; 438*GSL_EROUND = *Math::GSL::Linalgc::GSL_EROUND; 439*GSL_EBADLEN = *Math::GSL::Linalgc::GSL_EBADLEN; 440*GSL_ENOTSQR = *Math::GSL::Linalgc::GSL_ENOTSQR; 441*GSL_ESING = *Math::GSL::Linalgc::GSL_ESING; 442*GSL_EDIVERGE = *Math::GSL::Linalgc::GSL_EDIVERGE; 443*GSL_EUNSUP = *Math::GSL::Linalgc::GSL_EUNSUP; 444*GSL_EUNIMPL = *Math::GSL::Linalgc::GSL_EUNIMPL; 445*GSL_ECACHE = *Math::GSL::Linalgc::GSL_ECACHE; 446*GSL_ETABLE = *Math::GSL::Linalgc::GSL_ETABLE; 447*GSL_ENOPROG = *Math::GSL::Linalgc::GSL_ENOPROG; 448*GSL_ENOPROGJ = *Math::GSL::Linalgc::GSL_ENOPROGJ; 449*GSL_ETOLF = *Math::GSL::Linalgc::GSL_ETOLF; 450*GSL_ETOLX = *Math::GSL::Linalgc::GSL_ETOLX; 451*GSL_ETOLG = *Math::GSL::Linalgc::GSL_ETOLG; 452*GSL_EOF = *Math::GSL::Linalgc::GSL_EOF; 453*GSL_LINALG_MOD_NONE = *Math::GSL::Linalgc::GSL_LINALG_MOD_NONE; 454*GSL_LINALG_MOD_TRANSPOSE = *Math::GSL::Linalgc::GSL_LINALG_MOD_TRANSPOSE; 455*GSL_LINALG_MOD_CONJUGATE = *Math::GSL::Linalgc::GSL_LINALG_MOD_CONJUGATE; 456 457@EXPORT_OK = qw/$GSL_LINALG_MOD_NONE $GSL_LINALG_MOD_TRANSPOSE $GSL_LINALG_MOD_CONJUGATE 458 gsl_linalg_matmult gsl_linalg_matmult_mod 459 gsl_linalg_exponential_ss 460 gsl_linalg_householder_transform 461 gsl_linalg_complex_householder_transform 462 gsl_linalg_householder_hm 463 gsl_linalg_householder_mh 464 gsl_linalg_householder_hv 465 gsl_linalg_householder_hm1 466 gsl_linalg_complex_householder_hm 467 gsl_linalg_complex_householder_mh 468 gsl_linalg_complex_householder_hv 469 gsl_linalg_hessenberg_decomp 470 gsl_linalg_hessenberg_unpack 471 gsl_linalg_hessenberg_unpack_accum 472 gsl_linalg_hessenberg_set_zero 473 gsl_linalg_hessenberg_submatrix 474 gsl_linalg_hessenberg 475 gsl_linalg_hesstri_decomp 476 gsl_linalg_SV_decomp 477 gsl_linalg_SV_decomp_mod 478 gsl_linalg_SV_decomp_jacobi 479 gsl_linalg_SV_solve 480 gsl_linalg_LU_decomp 481 gsl_linalg_LU_solve 482 gsl_linalg_LU_svx 483 gsl_linalg_LU_refine 484 gsl_linalg_LU_invert 485 gsl_linalg_LU_det 486 gsl_linalg_LU_lndet 487 gsl_linalg_LU_sgndet 488 gsl_linalg_complex_LU_decomp 489 gsl_linalg_complex_LU_solve 490 gsl_linalg_complex_LU_svx 491 gsl_linalg_complex_LU_refine 492 gsl_linalg_complex_LU_invert 493 gsl_linalg_complex_LU_det 494 gsl_linalg_complex_LU_lndet 495 gsl_linalg_complex_LU_sgndet 496 gsl_linalg_QR_decomp 497 gsl_linalg_QR_solve 498 gsl_linalg_QR_svx 499 gsl_linalg_QR_lssolve 500 gsl_linalg_QR_QRsolve 501 gsl_linalg_QR_Rsolve 502 gsl_linalg_QR_Rsvx 503 gsl_linalg_QR_update 504 gsl_linalg_QR_QTvec 505 gsl_linalg_QR_Qvec 506 gsl_linalg_QR_QTmat 507 gsl_linalg_QR_unpack 508 gsl_linalg_R_solve 509 gsl_linalg_R_svx 510 gsl_linalg_QRPT_decomp 511 gsl_linalg_QRPT_decomp2 512 gsl_linalg_QRPT_solve 513 gsl_linalg_QRPT_svx 514 gsl_linalg_QRPT_QRsolve 515 gsl_linalg_QRPT_Rsolve 516 gsl_linalg_QRPT_Rsvx 517 gsl_linalg_QRPT_update 518 gsl_linalg_LQ_decomp 519 gsl_linalg_LQ_solve_T 520 gsl_linalg_LQ_svx_T 521 gsl_linalg_LQ_lssolve_T 522 gsl_linalg_LQ_Lsolve_T 523 gsl_linalg_LQ_Lsvx_T 524 gsl_linalg_L_solve_T 525 gsl_linalg_LQ_vecQ 526 gsl_linalg_LQ_vecQT 527 gsl_linalg_LQ_unpack 528 gsl_linalg_LQ_update 529 gsl_linalg_LQ_LQsolve 530 gsl_linalg_PTLQ_decomp 531 gsl_linalg_PTLQ_decomp2 532 gsl_linalg_PTLQ_solve_T 533 gsl_linalg_PTLQ_svx_T 534 gsl_linalg_PTLQ_LQsolve_T 535 gsl_linalg_PTLQ_Lsolve_T 536 gsl_linalg_PTLQ_Lsvx_T 537 gsl_linalg_PTLQ_update 538 gsl_linalg_cholesky_decomp 539 gsl_linalg_cholesky_solve 540 gsl_linalg_cholesky_svx 541 gsl_linalg_cholesky_decomp_unit 542 gsl_linalg_complex_cholesky_decomp 543 gsl_linalg_complex_cholesky_solve 544 gsl_linalg_complex_cholesky_svx 545 gsl_linalg_symmtd_decomp 546 gsl_linalg_symmtd_unpack 547 gsl_linalg_symmtd_unpack_T 548 gsl_linalg_hermtd_decomp 549 gsl_linalg_hermtd_unpack 550 gsl_linalg_hermtd_unpack_T 551 gsl_linalg_HH_solve 552 gsl_linalg_HH_svx 553 gsl_linalg_solve_symm_tridiag 554 gsl_linalg_solve_tridiag 555 gsl_linalg_solve_symm_cyc_tridiag 556 gsl_linalg_solve_cyc_tridiag 557 gsl_linalg_bidiag_decomp 558 gsl_linalg_bidiag_unpack 559 gsl_linalg_bidiag_unpack2 560 gsl_linalg_bidiag_unpack_B 561 gsl_linalg_balance_matrix 562 gsl_linalg_balance_accum 563 gsl_linalg_balance_columns 564 gsl_linalg_givens gsl_linalg_givens_gv 565 /; 566%EXPORT_TAGS = ( all =>[ @EXPORT_OK ] ); 567 568__END__ 569 570=encoding utf8 571 572=head1 NAME 573 574Math::GSL::Linalg - Functions for solving linear systems 575 576=head1 SYNOPSIS 577 578 use Math::GSL::Linalg qw/:all/; 579 580=head1 DESCRIPTION 581 582 583Here is a list of all the functions included in this module : 584 585=over 586 587=item gsl_linalg_matmult 588 589=item gsl_linalg_matmult_mod 590 591=item gsl_linalg_exponential_ss 592 593=item gsl_linalg_householder_transform 594 595=item gsl_linalg_complex_householder_transform 596 597=item gsl_linalg_householder_hm($tau, $v, $A) - This function applies the Householder matrix P defined by the scalar $tau and the vector $v to the left-hand side of the matrix $A. On output the result P A is stored in $A. The function returns 0 if it succeded, 1 otherwise. 598 599=item gsl_linalg_householder_mh($tau, $v, $A) - This function applies the Householder matrix P defined by the scalar $tau and the vector $v to the right-hand side of the matrix $A. On output the result A P is stored in $A. 600 601=item gsl_linalg_householder_hv($tau, $v, $w) - This function applies the Householder transformation P defined by the scalar $tau and the vector $v to the vector $w. On output the result P w is stored in $w. 602 603=item gsl_linalg_householder_hm1 604 605=item gsl_linalg_givens($a,$b,$c,$s) 606 607Performs a Givens rotation on the vector ($a,$b) and stores the answer in $c and $s. 608 609=item gsl_linalg_givens_gv($v, $i,$j, $c, $s) 610 611Performs a Givens rotation on the $i and $j-th elements of $v, storing them in $c and $s. 612 613=item gsl_linalg_complex_householder_hm($tau, $v, $A) - Does the same operation than gsl_linalg_householder_hm but with the complex matrix $A, the complex value $tau and the complex vector $v. 614 615=item gsl_linalg_complex_householder_mh($tau, $v, $A) - Does the same operation than gsl_linalg_householder_mh but with the complex matrix $A, the complex value $tau and the complex vector $v. 616 617=item gsl_linalg_complex_householder_hv($tau, $v, $w) - Does the same operation than gsl_linalg_householder_hv but with the complex value $tau and the complex vectors $v and $w. 618 619=item gsl_linalg_hessenberg_decomp($A, $tau) - This function computes the Hessenberg decomposition of the matrix $A by applying the similarity transformation H = U^T A U. On output, H is stored in the upper portion of $A. The information required to construct the matrix U is stored in the lower triangular portion of $A. U is a product of N - 2 Householder matrices. The Householder vectors are stored in the lower portion of $A (below the subdiagonal) and the Householder coefficients are stored in the vector $tau. tau must be of length N. The function returns 0 if it succeded, 1 otherwise. 620 621=item gsl_linalg_hessenberg_unpack($H, $tau, $U) - This function constructs the orthogonal matrix $U from the information stored in the Hessenberg matrix $H along with the vector $tau. $H and $tau are outputs from gsl_linalg_hessenberg_decomp. 622 623=item gsl_linalg_hessenberg_unpack_accum($H, $tau, $V) - This function is similar to gsl_linalg_hessenberg_unpack, except it accumulates the matrix U into $V, so that V' = VU. The matrix $V must be initialized prior to calling this function. Setting $V to the identity matrix provides the same result as gsl_linalg_hessenberg_unpack. If $H is order N, then $V must have N columns but may have any number of rows. 624 625=item gsl_linalg_hessenberg_set_zero($H) - This function sets the lower triangular portion of $H, below the subdiagonal, to zero. It is useful for clearing out the Householder vectors after calling gsl_linalg_hessenberg_decomp. 626 627=item gsl_linalg_hessenberg_submatrix 628 629=item gsl_linalg_hessenberg 630 631=item gsl_linalg_hesstri_decomp($A, $B, $U, $V, $work) - This function computes the Hessenberg-Triangular decomposition of the matrix pair ($A, $B). On output, H is stored in $A, and R is stored in $B. If $U and $V are provided (they may be null), the similarity transformations are stored in them. Additional workspace of length N is needed in the vector $work. 632 633=item gsl_linalg_SV_decomp($A, $V, $S, $work) - This function factorizes the M-by-N matrix $A into the singular value decomposition A = U S V^T for M >= N. On output the matrix $A is replaced by U. The diagonal elements of the singular value matrix S are stored in the vector $S. The singular values are non-negative and form a non-increasing sequence from S_1 to S_N. The matrix $V contains the elements of V in untransposed form. To form the product U S V^T it is necessary to take the transpose of V. A workspace of length N is required in vector $work. This routine uses the Golub-Reinsch SVD algorithm. 634 635=item gsl_linalg_SV_decomp_mod($A, $X, $V, $S, $work) - This function computes the SVD using the modified Golub-Reinsch algorithm, which is faster for M>>N. It requires the vector $work of length N and the N-by-N matrix $X as additional working space. $A and $V are matrices while $S is a vector. 636 637=item gsl_linalg_SV_decomp_jacobi($A, $V, $S) - This function computes the SVD of the M-by-N matrix $A using one-sided Jacobi orthogonalization for M >= N. The Jacobi method can compute singular values to higher relative accuracy than Golub-Reinsch algorithms. $V is a matrix while $S is a vector. 638 639=item gsl_linalg_SV_solve($U, $V, $S, $b, $x) - This function solves the system A x = b using the singular value decomposition ($U, $S, $V) of A given by gsl_linalg_SV_decomp. Only non-zero singular values are used in computing the solution. The parts of the solution corresponding to singular values of zero are ignored. Other singular values can be edited out by setting them to zero before calling this function. In the over-determined case where A has more rows than columns the system is solved in the least squares sense, returning the solution x which minimizes ||A x - b||_2. 640 641=item gsl_linalg_LU_decomp($a, $p) - factorize the matrix $a into the LU decomposition PA = LU. On output the diagonal and upper triangular part of the input matrix A contain the matrix U. The lower triangular part of the input matrix (excluding the diagonal) contains L. The diagonal elements of L are unity, and are not stored. The function returns two value, the first is 0 if the operation succeeded, 1 otherwise, and the second is the sign of the permutation. 642 643=item gsl_linalg_LU_solve($LU, $p, $b, $x) - This function solves the square system A x = b using the LU decomposition of the matrix A into (LU, p) given by gsl_linalg_LU_decomp. $LU is a matrix, $p a permutation and $b and $x are vectors. The function returns 1 if the operation succeded, 0 otherwise. 644 645=item gsl_linalg_LU_svx($LU, $p, $x) - This function solves the square system A x = b in-place using the LU decomposition of A into (LU,p). On input $x should contain the right-hand side b, which is replaced by the solution on output. $LU is a matrix, $p a permutation and $x is a vector. The function returns 1 if the operation succeded, 0 otherwise. 646 647=item gsl_linalg_LU_refine($A, $LU, $p, $b, $x, $residual) - This function apply an iterative improvement to $x, the solution of $A $x = $b, using the LU decomposition of $A into ($LU,$p). The initial residual $r = $A $x - $b (where $x and $b are vectors) is also computed and stored in the vector $residual. 648 649=item gsl_linalg_LU_invert($LU, $p, $inverse) - This function computes the inverse of a matrix A from its LU decomposition stored in the matrix $LU and the permutation $p, storing the result in the matrix $inverse. 650 651=item gsl_linalg_LU_det($LU, $signum) - This function returns the determinant of a matrix A from its LU decomposition stored in the $LU matrix. It needs the integer $signum which is the sign of the permutation returned by gsl_linalg_LU_decomp. 652 653=item gsl_linalg_LU_lndet($LU) - This function returns the logarithm of the absolute value of the determinant of a matrix A, from its LU decomposition stored in the $LU matrix. 654 655=item gsl_linalg_LU_sgndet($LU, $signum) - This functions computes the sign or phase factor of the determinant of a matrix A, det(A)/|det(A)|, from its LU decomposition, $LU. 656 657=item gsl_linalg_complex_LU_decomp($A, $p) - Does the same operation than gsl_linalg_LU_decomp but on the complex matrix $A. 658 659=item gsl_linalg_complex_LU_solve($LU, $p, $b, $x) - This functions solve the square system A x = b using the LU decomposition of A into ($LU, $p) given by gsl_linalg_complex_LU_decomp. 660 661=item gsl_linalg_complex_LU_svx($LU, $p, $x) - Does the same operation than gsl_linalg_LU_svx but on the complex matrix $LU and the complex vector $x. 662 663=item gsl_linalg_complex_LU_refine($A, $LU, $p, $b, $x, $residual) - Does the same operation than gsl_linalg_LU_refine but on the complex matrices $A and $LU and with the complex vectors $b, $x and $residual. 664 665=item gsl_linalg_complex_LU_invert($LU, $p, $inverse) - Does the same operation than gsl_linalg_LU_invert but on the complex matrces $LU and $inverse. 666 667=item gsl_linalg_complex_LU_det($LU, $signum) - Does the same operation than gsl_linalg_LU_det but on the complex matrix $LU. 668 669=item gsl_linalg_complex_LU_lndet($LU) - Does the same operation than gsl_linalg_LU_det but on the complex matrix $LU. 670 671=item gsl_linalg_complex_LU_sgndet($LU, $signum) - Does the same operation than gsl_linalg_LU_sgndet but on the complex matrix $LU. 672 673=item gsl_linalg_QR_decomp($a, $tau) - factorize the M-by-N matrix A into the QR decomposition A = Q R. On output the diagonal and upper triangular part of the input matrix $a contain the matrix R. The vector $tau and the columns of the lower triangular part of the matrix $a contain the Householder coefficients and Householder vectors which encode the orthogonal matrix Q. The vector tau must be of length k= min(M,N). 674 675=item gsl_linalg_QR_solve($QR, $tau, $b, $x) - This function solves the square system A x = b using the QR decomposition of A into (QR, tau) given by gsl_linalg_QR_decomp. $QR is matrix, and $tau, $b and $x are vectors. 676 677=item gsl_linalg_QR_svx($QR, $tau, $x) - This function solves the square system A x = b in-place using the QR decomposition of A into the matrix $QR and the vector $tau given by gsl_linalg_QR_decomp. On input, the vector $x should contain the right-hand side b, which is replaced by the solution on output. 678 679=item gsl_linalg_QR_lssolve($QR, $tau, $b, $x, $residual) - This function finds the least squares solution to the overdetermined system $A $x = $b where the matrix $A has more rows than columns. The least squares solution minimizes the Euclidean norm of the residual, ||Ax - b||.The routine uses the $QR decomposition of $A into ($QR, $tau) given by gsl_linalg_QR_decomp. The solution is returned in $x. The residual is computed as a by-product and stored in residual. The function returns 0 if it succeded, 1 otherwise. 680 681=item gsl_linalg_QR_QRsolve($Q, $R, $b, $x) - This function solves the system $R $x = $Q**T $b for $x. It can be used when the $QR decomposition of a matrix is available in unpacked form as ($Q, $R). The function returns 0 if it succeded, 1 otherwise. 682 683=item gsl_linalg_QR_Rsolve($QR, $b, $x) - This function solves the triangular system R $x = $b for $x. It may be useful if the product b' = Q^T b has already been computed using gsl_linalg_QR_QTvec. 684 685=item gsl_linalg_QR_Rsvx($QR, $x) - This function solves the triangular system R $x = b for $x in-place. On input $x should contain the right-hand side b and is replaced by the solution on output. This function may be useful if the product b' = Q^T b has already been computed using gsl_linalg_QR_QTvec. The function returns 0 if it succeded, 1 otherwise. 686 687=item gsl_linalg_QR_update($Q, $R, $b, $x) - This function performs a rank-1 update $w $v**T of the QR decomposition ($Q, $R). The update is given by Q'R' = Q R + w v^T where the output matrices Q' and R' are also orthogonal and right triangular. Note that w is destroyed by the update. The function returns 0 if it succeded, 1 otherwise. 688 689=item gsl_linalg_QR_QTvec($QR, $tau, $v) - This function applies the matrix Q^T encoded in the decomposition ($QR,$tau) to the vector $v, storing the result Q^T v in $v. The matrix multiplication is carried out directly using the encoding of the Householder vectors without needing to form the full matrix Q^T. The function returns 0 if it succeded, 1 otherwise. 690 691=item gsl_linalg_QR_Qvec($QR, $tau, $v) - This function applies the matrix Q encoded in the decomposition ($QR,$tau) to the vector $v, storing the result Q v in $v. The matrix multiplication is carried out directly using the encoding of the Householder vectors without needing to form the full matrix Q. The function returns 0 if it succeded, 1 otherwise. 692 693=item gsl_linalg_QR_QTmat($QR, $tau, $A) - This function applies the matrix Q^T encoded in the decomposition ($QR,$tau) to the matrix $A, storing the result Q^T A in $A. The matrix multiplication is carried out directly using the encoding of the Householder vectors without needing to form the full matrix Q^T. The function returns 0 if it succeded, 1 otherwise. 694 695=item gsl_linalg_QR_unpack($QR, $tau, $Q, $R) - This function unpacks the encoded QR decomposition ($QR,$tau) into the matrices $Q and $R, where $Q is M-by-M and $R is M-by-N. The function returns 0 if it succeded, 1 otherwise. 696 697=item gsl_linalg_R_solve($R, $b, $x) - This function solves the triangular system $R $x = $b for the N-by-N matrix $R. The function returns 0 if it succeded, 1 otherwise. 698 699=item gsl_linalg_R_svx($R, $x) - This function solves the triangular system $R $x = b in-place. On input $x should contain the right-hand side b, which is replaced by the solution on output. The function returns 0 if it succeded, 1 otherwise. 700 701=item gsl_linalg_QRPT_decomp($A, $tau, $p, $norm) - This function factorizes the M-by-N matrix $A into the QRP^T decomposition A = Q R P^T. On output the diagonal and upper triangular part of the input matrix contain the matrix R. The permutation matrix P is stored in the permutation $p. There's two value returned by this function : the first is 0 if the operation succeeded, 1 otherwise. The second is sign of the permutation. It has the value (-1)^n, where n is the number of interchanges in the permutation. The vector $tau and the columns of the lower triangular part of the matrix $A contain the Householder coefficients and vectors which encode the orthogonal matrix Q. The vector tau must be of length k=\min(M,N). The matrix Q is related to these components by, Q = Q_k ... Q_2 Q_1 where Q_i = I - \tau_i v_i v_i^T and v_i is the Householder vector v_i = (0,...,1,A(i+1,i),A(i+2,i),...,A(m,i)). This is the same storage scheme as used by lapack. The vector norm is a workspace of length N used for column pivoting. The algorithm used to perform the decomposition is Householder QR with column pivoting (Golub & Van Loan, Matrix Computations, Algorithm 5.4.1). 702 703=item gsl_linalg_QRPT_decomp2($A, $q, $r, $tau, $p, $norm) - This function factorizes the matrix $A into the decomposition A = Q R P^T without modifying $A itself and storing the output in the separate matrices $q and $r. For the rest, it operates exactly like gsl_linalg_QRPT_decomp 704 705=item gsl_linalg_QRPT_solve 706 707=item gsl_linalg_QRPT_svx 708 709=item gsl_linalg_QRPT_QRsolve 710 711=item gsl_linalg_QRPT_Rsolve 712 713=item gsl_linalg_QRPT_Rsvx 714 715=item gsl_linalg_QRPT_update 716 717=item gsl_linalg_LQ_decomp 718 719=item gsl_linalg_LQ_solve_T 720 721=item gsl_linalg_LQ_svx_T 722 723=item gsl_linalg_LQ_lssolve_T 724 725=item gsl_linalg_LQ_Lsolve_T 726 727=item gsl_linalg_LQ_Lsvx_T 728 729=item gsl_linalg_L_solve_T 730 731=item gsl_linalg_LQ_vecQ 732 733=item gsl_linalg_LQ_vecQT 734 735=item gsl_linalg_LQ_unpack 736 737=item gsl_linalg_LQ_update 738 739=item gsl_linalg_LQ_LQsolve 740 741=item gsl_linalg_PTLQ_decomp 742 743=item gsl_linalg_PTLQ_decomp2 744 745=item gsl_linalg_PTLQ_solve_T 746 747=item gsl_linalg_PTLQ_svx_T 748 749=item gsl_linalg_PTLQ_LQsolve_T 750 751=item gsl_linalg_PTLQ_Lsolve_T 752 753=item gsl_linalg_PTLQ_Lsvx_T 754 755=item gsl_linalg_PTLQ_update 756 757=item gsl_linalg_cholesky_decomp($A) - Factorize the symmetric, positive-definite square matrix $A into the Cholesky decomposition A = L L^T and stores it into the matrix $A. The function returns 0 if the operation succeeded, 0 otherwise. 758 759=item gsl_linalg_cholesky_solve($cholesky, $b, $x) - This function solves the system A x = b using the Cholesky decomposition of A into the matrix $cholesky given by gsl_linalg_cholesky_decomp. $b and $x are vectors. The function returns 0 if the operation succeeded, 0 otherwise. 760 761=item gsl_linalg_cholesky_svx($cholesky, $x) - This function solves the system A x = b in-place using the Cholesky decomposition of A into the matrix $cholesky given by gsl_linalg_cholesky_decomp. On input the vector $x should contain the right-hand side b, which is replaced by the solution on output. The function returns 0 if the operation succeeded, 0 otherwise. 762 763=item gsl_linalg_cholesky_decomp_unit 764 765=item gsl_linalg_complex_cholesky_decomp($A) - Factorize the symmetric, positive-definite square matrix $A which contains complex numbers into the Cholesky decomposition A = L L^T and stores it into the matrix $A. The function returns 0 if the operation succeeded, 0 otherwise. 766 767=item gsl_linalg_complex_cholesky_solve($cholesky, $b, $x) - This function solves the system A x = b using the Cholesky decomposition of A into the matrix $cholesky given by gsl_linalg_complex_cholesky_decomp. $b and $x are vectors. The function returns 0 if the operation succeeded, 0 otherwise. 768 769=item gsl_linalg_complex_cholesky_svx($cholesky, $x) - This function solves the system A x = b in-place using the Cholesky decomposition of A into the matrix $cholesky given by gsl_linalg_complex_cholesky_decomp. On input the vector $x should contain the right-hand side b, which is replaced by the solution on output. The function returns 0 if the operation succeeded, 0 otherwise. 770 771=item gsl_linalg_symmtd_decomp($A, $tau) - This function factorizes the symmetric square matrix $A into the symmetric tridiagonal decomposition Q T Q^T. On output the diagonal and subdiagonal part of the input matrix $A contain the tridiagonal matrix T. The remaining lower triangular part of the input matrix contains the Householder vectors which, together with the Householder coefficients $tau, encode the orthogonal matrix Q. This storage scheme is the same as used by lapack. The upper triangular part of $A is not referenced. $tau is a vector. 772 773=item gsl_linalg_symmtd_unpack($A, $tau, $Q, $diag, $subdiag) - This function unpacks the encoded symmetric tridiagonal decomposition ($A, $tau) obtained from gsl_linalg_symmtd_decomp into the orthogonal matrix $Q, the vector of diagonal elements $diag and the vector of subdiagonal elements $subdiag. 774 775=item gsl_linalg_symmtd_unpack_T($A, $diag, $subdiag) - This function unpacks the diagonal and subdiagonal of the encoded symmetric tridiagonal decomposition ($A, $tau) obtained from gsl_linalg_symmtd_decomp into the vectors $diag and $subdiag. 776 777=item gsl_linalg_hermtd_decomp($A, $tau) - This function factorizes the hermitian matrix $A into the symmetric tridiagonal decomposition U T U^T. On output the real parts of the diagonal and subdiagonal part of the input matrix $A contain the tridiagonal matrix T. The remaining lower triangular part of the input matrix contains the Householder vectors which, together with the Householder coefficients $tau, encode the orthogonal matrix Q. This storage scheme is the same as used by lapack. The upper triangular part of $A and imaginary parts of the diagonal are not referenced. $A is a complex matrix and $tau a complex vector. 778 779=item gsl_linalg_hermtd_unpack($A, $tau, $U, $diag, $subdiag) - This function unpacks the encoded tridiagonal decomposition ($A, $tau) obtained from gsl_linalg_hermtd_decomp into the unitary complex matrix $U, the real vector of diagonal elements $diag and the real vector of subdiagonal elements $subdiag. 780 781=item gsl_linalg_hermtd_unpack_T($A, $diag, $subdiag) - This function unpacks the diagonal and subdiagonal of the encoded tridiagonal decomposition (A, tau) obtained from the gsl_linalg_hermtd_decomp into the real vectors $diag and $subdiag. 782 783=item gsl_linalg_HH_solve($a, $b, $x) - This function solves the system $A $x = $b directly using Householder transformations where $A is a matrix, $b and $x vectors. On output the solution is stored in $x and $b is not modified. $A is destroyed by the Householder transformations. 784 785=item gsl_linalg_HH_svx($A, $x) - This function solves the system $A $x = b in-place using Householder transformations where $A is a matrix, $b is a vector. On input $x should contain the right-hand side b, which is replaced by the solution on output. The matrix $A is destroyed by the Householder transformations. 786 787=item gsl_linalg_solve_symm_tridiag 788 789=item gsl_linalg_solve_tridiag 790 791=item gsl_linalg_solve_symm_cyc_tridiag 792 793=item gsl_linalg_solve_cyc_tridiag 794 795=item gsl_linalg_bidiag_decomp 796 797=item gsl_linalg_bidiag_unpack 798 799=item gsl_linalg_bidiag_unpack2 800 801=item gsl_linalg_bidiag_unpack_B 802 803=item gsl_linalg_balance_matrix 804 805=item gsl_linalg_balance_accum 806 807=item gsl_linalg_balance_columns 808 809 810 You have to add the functions you want to use inside the qw /put_function_here / with spaces between each function. You can also write use Math::GSL::Complex qw/:all/ to use all available functions of the module. 811 812For more informations on the functions, we refer you to the GSL official documentation: L<http://www.gnu.org/software/gsl/manual/html_node/> 813 814 815=back 816 817=head1 EXAMPLES 818 819This example shows how to compute the determinant of a matrix with the LU decomposition: 820 821 use Math::GSL::Matrix qw/:all/; 822 use Math::GSL::Permutation qw/:all/; 823 use Math::GSL::Linalg qw/:all/; 824 825 my $Matrix = gsl_matrix_alloc(4,4); 826 map { gsl_matrix_set($Matrix, 0, $_, $_+1) } (0..3); 827 828 gsl_matrix_set($Matrix,1, 0, 2); 829 gsl_matrix_set($Matrix, 1, 1, 3); 830 gsl_matrix_set($Matrix, 1, 2, 4); 831 gsl_matrix_set($Matrix, 1, 3, 1); 832 833 gsl_matrix_set($Matrix, 2, 0, 3); 834 gsl_matrix_set($Matrix, 2, 1, 4); 835 gsl_matrix_set($Matrix, 2, 2, 1); 836 gsl_matrix_set($Matrix, 2, 3, 2); 837 838 gsl_matrix_set($Matrix, 3, 0, 4); 839 gsl_matrix_set($Matrix, 3, 1, 1); 840 gsl_matrix_set($Matrix, 3, 2, 2); 841 gsl_matrix_set($Matrix, 3, 3, 3); 842 843 my $permutation = gsl_permutation_alloc(4); 844 gsl_permutation_init($permutation); 845 my ($result, $signum) = gsl_linalg_LU_decomp($Matrix, $permutation); 846 my $det = gsl_linalg_LU_det($Matrix, $signum); 847 print "The value of the determinant of the matrix is $det \n"; 848 849=head1 AUTHORS 850 851Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> 852 853=head1 COPYRIGHT AND LICENSE 854 855Copyright (C) 2008-2021 Jonathan "Duke" Leto and Thierry Moisan 856 857This program is free software; you can redistribute it and/or modify it 858under the same terms as Perl itself. 859 860=cut 8611; 862