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_SV_leverage = *Math::GSL::Linalgc::gsl_linalg_SV_leverage; 82*gsl_linalg_LU_decomp = *Math::GSL::Linalgc::gsl_linalg_LU_decomp; 83*gsl_linalg_LU_solve = *Math::GSL::Linalgc::gsl_linalg_LU_solve; 84*gsl_linalg_LU_svx = *Math::GSL::Linalgc::gsl_linalg_LU_svx; 85*gsl_linalg_LU_refine = *Math::GSL::Linalgc::gsl_linalg_LU_refine; 86*gsl_linalg_LU_invert = *Math::GSL::Linalgc::gsl_linalg_LU_invert; 87*gsl_linalg_LU_det = *Math::GSL::Linalgc::gsl_linalg_LU_det; 88*gsl_linalg_LU_lndet = *Math::GSL::Linalgc::gsl_linalg_LU_lndet; 89*gsl_linalg_LU_sgndet = *Math::GSL::Linalgc::gsl_linalg_LU_sgndet; 90*gsl_linalg_complex_LU_decomp = *Math::GSL::Linalgc::gsl_linalg_complex_LU_decomp; 91*gsl_linalg_complex_LU_solve = *Math::GSL::Linalgc::gsl_linalg_complex_LU_solve; 92*gsl_linalg_complex_LU_svx = *Math::GSL::Linalgc::gsl_linalg_complex_LU_svx; 93*gsl_linalg_complex_LU_refine = *Math::GSL::Linalgc::gsl_linalg_complex_LU_refine; 94*gsl_linalg_complex_LU_invert = *Math::GSL::Linalgc::gsl_linalg_complex_LU_invert; 95*gsl_linalg_complex_LU_det = *Math::GSL::Linalgc::gsl_linalg_complex_LU_det; 96*gsl_linalg_complex_LU_lndet = *Math::GSL::Linalgc::gsl_linalg_complex_LU_lndet; 97*gsl_linalg_complex_LU_sgndet = *Math::GSL::Linalgc::gsl_linalg_complex_LU_sgndet; 98*gsl_linalg_QR_decomp = *Math::GSL::Linalgc::gsl_linalg_QR_decomp; 99*gsl_linalg_QR_solve = *Math::GSL::Linalgc::gsl_linalg_QR_solve; 100*gsl_linalg_QR_svx = *Math::GSL::Linalgc::gsl_linalg_QR_svx; 101*gsl_linalg_QR_lssolve = *Math::GSL::Linalgc::gsl_linalg_QR_lssolve; 102*gsl_linalg_QR_QRsolve = *Math::GSL::Linalgc::gsl_linalg_QR_QRsolve; 103*gsl_linalg_QR_Rsolve = *Math::GSL::Linalgc::gsl_linalg_QR_Rsolve; 104*gsl_linalg_QR_Rsvx = *Math::GSL::Linalgc::gsl_linalg_QR_Rsvx; 105*gsl_linalg_QR_update = *Math::GSL::Linalgc::gsl_linalg_QR_update; 106*gsl_linalg_QR_QTvec = *Math::GSL::Linalgc::gsl_linalg_QR_QTvec; 107*gsl_linalg_QR_Qvec = *Math::GSL::Linalgc::gsl_linalg_QR_Qvec; 108*gsl_linalg_QR_QTmat = *Math::GSL::Linalgc::gsl_linalg_QR_QTmat; 109*gsl_linalg_QR_matQ = *Math::GSL::Linalgc::gsl_linalg_QR_matQ; 110*gsl_linalg_QR_unpack = *Math::GSL::Linalgc::gsl_linalg_QR_unpack; 111*gsl_linalg_R_solve = *Math::GSL::Linalgc::gsl_linalg_R_solve; 112*gsl_linalg_R_svx = *Math::GSL::Linalgc::gsl_linalg_R_svx; 113*gsl_linalg_QRPT_decomp = *Math::GSL::Linalgc::gsl_linalg_QRPT_decomp; 114*gsl_linalg_QRPT_decomp2 = *Math::GSL::Linalgc::gsl_linalg_QRPT_decomp2; 115*gsl_linalg_QRPT_solve = *Math::GSL::Linalgc::gsl_linalg_QRPT_solve; 116*gsl_linalg_QRPT_lssolve = *Math::GSL::Linalgc::gsl_linalg_QRPT_lssolve; 117*gsl_linalg_QRPT_lssolve2 = *Math::GSL::Linalgc::gsl_linalg_QRPT_lssolve2; 118*gsl_linalg_QRPT_svx = *Math::GSL::Linalgc::gsl_linalg_QRPT_svx; 119*gsl_linalg_QRPT_QRsolve = *Math::GSL::Linalgc::gsl_linalg_QRPT_QRsolve; 120*gsl_linalg_QRPT_Rsolve = *Math::GSL::Linalgc::gsl_linalg_QRPT_Rsolve; 121*gsl_linalg_QRPT_Rsvx = *Math::GSL::Linalgc::gsl_linalg_QRPT_Rsvx; 122*gsl_linalg_QRPT_update = *Math::GSL::Linalgc::gsl_linalg_QRPT_update; 123*gsl_linalg_QRPT_rank = *Math::GSL::Linalgc::gsl_linalg_QRPT_rank; 124*gsl_linalg_QRPT_rcond = *Math::GSL::Linalgc::gsl_linalg_QRPT_rcond; 125*gsl_linalg_COD_decomp = *Math::GSL::Linalgc::gsl_linalg_COD_decomp; 126*gsl_linalg_COD_decomp_e = *Math::GSL::Linalgc::gsl_linalg_COD_decomp_e; 127*gsl_linalg_COD_lssolve = *Math::GSL::Linalgc::gsl_linalg_COD_lssolve; 128*gsl_linalg_COD_lssolve2 = *Math::GSL::Linalgc::gsl_linalg_COD_lssolve2; 129*gsl_linalg_COD_unpack = *Math::GSL::Linalgc::gsl_linalg_COD_unpack; 130*gsl_linalg_COD_matZ = *Math::GSL::Linalgc::gsl_linalg_COD_matZ; 131*gsl_linalg_LQ_decomp = *Math::GSL::Linalgc::gsl_linalg_LQ_decomp; 132*gsl_linalg_LQ_solve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_solve_T; 133*gsl_linalg_LQ_svx_T = *Math::GSL::Linalgc::gsl_linalg_LQ_svx_T; 134*gsl_linalg_LQ_lssolve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_lssolve_T; 135*gsl_linalg_LQ_Lsolve_T = *Math::GSL::Linalgc::gsl_linalg_LQ_Lsolve_T; 136*gsl_linalg_LQ_Lsvx_T = *Math::GSL::Linalgc::gsl_linalg_LQ_Lsvx_T; 137*gsl_linalg_L_solve_T = *Math::GSL::Linalgc::gsl_linalg_L_solve_T; 138*gsl_linalg_LQ_vecQ = *Math::GSL::Linalgc::gsl_linalg_LQ_vecQ; 139*gsl_linalg_LQ_vecQT = *Math::GSL::Linalgc::gsl_linalg_LQ_vecQT; 140*gsl_linalg_LQ_unpack = *Math::GSL::Linalgc::gsl_linalg_LQ_unpack; 141*gsl_linalg_LQ_update = *Math::GSL::Linalgc::gsl_linalg_LQ_update; 142*gsl_linalg_LQ_LQsolve = *Math::GSL::Linalgc::gsl_linalg_LQ_LQsolve; 143*gsl_linalg_PTLQ_decomp = *Math::GSL::Linalgc::gsl_linalg_PTLQ_decomp; 144*gsl_linalg_PTLQ_decomp2 = *Math::GSL::Linalgc::gsl_linalg_PTLQ_decomp2; 145*gsl_linalg_PTLQ_solve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_solve_T; 146*gsl_linalg_PTLQ_svx_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_svx_T; 147*gsl_linalg_PTLQ_LQsolve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_LQsolve_T; 148*gsl_linalg_PTLQ_Lsolve_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_Lsolve_T; 149*gsl_linalg_PTLQ_Lsvx_T = *Math::GSL::Linalgc::gsl_linalg_PTLQ_Lsvx_T; 150*gsl_linalg_PTLQ_update = *Math::GSL::Linalgc::gsl_linalg_PTLQ_update; 151*gsl_linalg_cholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp; 152*gsl_linalg_cholesky_decomp1 = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp1; 153*gsl_linalg_cholesky_solve = *Math::GSL::Linalgc::gsl_linalg_cholesky_solve; 154*gsl_linalg_cholesky_svx = *Math::GSL::Linalgc::gsl_linalg_cholesky_svx; 155*gsl_linalg_cholesky_invert = *Math::GSL::Linalgc::gsl_linalg_cholesky_invert; 156*gsl_linalg_cholesky_decomp_unit = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp_unit; 157*gsl_linalg_cholesky_scale = *Math::GSL::Linalgc::gsl_linalg_cholesky_scale; 158*gsl_linalg_cholesky_scale_apply = *Math::GSL::Linalgc::gsl_linalg_cholesky_scale_apply; 159*gsl_linalg_cholesky_decomp2 = *Math::GSL::Linalgc::gsl_linalg_cholesky_decomp2; 160*gsl_linalg_cholesky_svx2 = *Math::GSL::Linalgc::gsl_linalg_cholesky_svx2; 161*gsl_linalg_cholesky_solve2 = *Math::GSL::Linalgc::gsl_linalg_cholesky_solve2; 162*gsl_linalg_cholesky_rcond = *Math::GSL::Linalgc::gsl_linalg_cholesky_rcond; 163*gsl_linalg_complex_cholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_decomp; 164*gsl_linalg_complex_cholesky_solve = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_solve; 165*gsl_linalg_complex_cholesky_svx = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_svx; 166*gsl_linalg_complex_cholesky_invert = *Math::GSL::Linalgc::gsl_linalg_complex_cholesky_invert; 167*gsl_linalg_pcholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_pcholesky_decomp; 168*gsl_linalg_pcholesky_solve = *Math::GSL::Linalgc::gsl_linalg_pcholesky_solve; 169*gsl_linalg_pcholesky_svx = *Math::GSL::Linalgc::gsl_linalg_pcholesky_svx; 170*gsl_linalg_pcholesky_decomp2 = *Math::GSL::Linalgc::gsl_linalg_pcholesky_decomp2; 171*gsl_linalg_pcholesky_solve2 = *Math::GSL::Linalgc::gsl_linalg_pcholesky_solve2; 172*gsl_linalg_pcholesky_svx2 = *Math::GSL::Linalgc::gsl_linalg_pcholesky_svx2; 173*gsl_linalg_pcholesky_invert = *Math::GSL::Linalgc::gsl_linalg_pcholesky_invert; 174*gsl_linalg_pcholesky_rcond = *Math::GSL::Linalgc::gsl_linalg_pcholesky_rcond; 175*gsl_linalg_mcholesky_decomp = *Math::GSL::Linalgc::gsl_linalg_mcholesky_decomp; 176*gsl_linalg_mcholesky_solve = *Math::GSL::Linalgc::gsl_linalg_mcholesky_solve; 177*gsl_linalg_mcholesky_svx = *Math::GSL::Linalgc::gsl_linalg_mcholesky_svx; 178*gsl_linalg_mcholesky_rcond = *Math::GSL::Linalgc::gsl_linalg_mcholesky_rcond; 179*gsl_linalg_mcholesky_invert = *Math::GSL::Linalgc::gsl_linalg_mcholesky_invert; 180*gsl_linalg_symmtd_decomp = *Math::GSL::Linalgc::gsl_linalg_symmtd_decomp; 181*gsl_linalg_symmtd_unpack = *Math::GSL::Linalgc::gsl_linalg_symmtd_unpack; 182*gsl_linalg_symmtd_unpack_T = *Math::GSL::Linalgc::gsl_linalg_symmtd_unpack_T; 183*gsl_linalg_hermtd_decomp = *Math::GSL::Linalgc::gsl_linalg_hermtd_decomp; 184*gsl_linalg_hermtd_unpack = *Math::GSL::Linalgc::gsl_linalg_hermtd_unpack; 185*gsl_linalg_hermtd_unpack_T = *Math::GSL::Linalgc::gsl_linalg_hermtd_unpack_T; 186*gsl_linalg_HH_solve = *Math::GSL::Linalgc::gsl_linalg_HH_solve; 187*gsl_linalg_HH_svx = *Math::GSL::Linalgc::gsl_linalg_HH_svx; 188*gsl_linalg_solve_symm_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_symm_tridiag; 189*gsl_linalg_solve_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_tridiag; 190*gsl_linalg_solve_symm_cyc_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_symm_cyc_tridiag; 191*gsl_linalg_solve_cyc_tridiag = *Math::GSL::Linalgc::gsl_linalg_solve_cyc_tridiag; 192*gsl_linalg_bidiag_decomp = *Math::GSL::Linalgc::gsl_linalg_bidiag_decomp; 193*gsl_linalg_bidiag_unpack = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack; 194*gsl_linalg_bidiag_unpack2 = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack2; 195*gsl_linalg_bidiag_unpack_B = *Math::GSL::Linalgc::gsl_linalg_bidiag_unpack_B; 196*gsl_linalg_balance_matrix = *Math::GSL::Linalgc::gsl_linalg_balance_matrix; 197*gsl_linalg_balance_accum = *Math::GSL::Linalgc::gsl_linalg_balance_accum; 198*gsl_linalg_balance_columns = *Math::GSL::Linalgc::gsl_linalg_balance_columns; 199*gsl_linalg_tri_upper_rcond = *Math::GSL::Linalgc::gsl_linalg_tri_upper_rcond; 200*gsl_linalg_tri_lower_rcond = *Math::GSL::Linalgc::gsl_linalg_tri_lower_rcond; 201*gsl_linalg_invnorm1 = *Math::GSL::Linalgc::gsl_linalg_invnorm1; 202*gsl_linalg_tri_upper_invert = *Math::GSL::Linalgc::gsl_linalg_tri_upper_invert; 203*gsl_linalg_tri_lower_invert = *Math::GSL::Linalgc::gsl_linalg_tri_lower_invert; 204*gsl_linalg_tri_upper_unit_invert = *Math::GSL::Linalgc::gsl_linalg_tri_upper_unit_invert; 205*gsl_linalg_tri_lower_unit_invert = *Math::GSL::Linalgc::gsl_linalg_tri_lower_unit_invert; 206*gsl_linalg_givens = *Math::GSL::Linalgc::gsl_linalg_givens; 207*gsl_linalg_givens_gv = *Math::GSL::Linalgc::gsl_linalg_givens_gv; 208*gsl_permutation_alloc = *Math::GSL::Linalgc::gsl_permutation_alloc; 209*gsl_permutation_calloc = *Math::GSL::Linalgc::gsl_permutation_calloc; 210*gsl_permutation_init = *Math::GSL::Linalgc::gsl_permutation_init; 211*gsl_permutation_free = *Math::GSL::Linalgc::gsl_permutation_free; 212*gsl_permutation_memcpy = *Math::GSL::Linalgc::gsl_permutation_memcpy; 213*gsl_permutation_fread = *Math::GSL::Linalgc::gsl_permutation_fread; 214*gsl_permutation_fwrite = *Math::GSL::Linalgc::gsl_permutation_fwrite; 215*gsl_permutation_fscanf = *Math::GSL::Linalgc::gsl_permutation_fscanf; 216*gsl_permutation_fprintf = *Math::GSL::Linalgc::gsl_permutation_fprintf; 217*gsl_permutation_size = *Math::GSL::Linalgc::gsl_permutation_size; 218*gsl_permutation_data = *Math::GSL::Linalgc::gsl_permutation_data; 219*gsl_permutation_swap = *Math::GSL::Linalgc::gsl_permutation_swap; 220*gsl_permutation_valid = *Math::GSL::Linalgc::gsl_permutation_valid; 221*gsl_permutation_reverse = *Math::GSL::Linalgc::gsl_permutation_reverse; 222*gsl_permutation_inverse = *Math::GSL::Linalgc::gsl_permutation_inverse; 223*gsl_permutation_next = *Math::GSL::Linalgc::gsl_permutation_next; 224*gsl_permutation_prev = *Math::GSL::Linalgc::gsl_permutation_prev; 225*gsl_permutation_mul = *Math::GSL::Linalgc::gsl_permutation_mul; 226*gsl_permutation_linear_to_canonical = *Math::GSL::Linalgc::gsl_permutation_linear_to_canonical; 227*gsl_permutation_canonical_to_linear = *Math::GSL::Linalgc::gsl_permutation_canonical_to_linear; 228*gsl_permutation_inversions = *Math::GSL::Linalgc::gsl_permutation_inversions; 229*gsl_permutation_linear_cycles = *Math::GSL::Linalgc::gsl_permutation_linear_cycles; 230*gsl_permutation_canonical_cycles = *Math::GSL::Linalgc::gsl_permutation_canonical_cycles; 231*gsl_permutation_get = *Math::GSL::Linalgc::gsl_permutation_get; 232*gsl_complex_polar = *Math::GSL::Linalgc::gsl_complex_polar; 233*gsl_complex_rect = *Math::GSL::Linalgc::gsl_complex_rect; 234*gsl_complex_arg = *Math::GSL::Linalgc::gsl_complex_arg; 235*gsl_complex_abs = *Math::GSL::Linalgc::gsl_complex_abs; 236*gsl_complex_abs2 = *Math::GSL::Linalgc::gsl_complex_abs2; 237*gsl_complex_logabs = *Math::GSL::Linalgc::gsl_complex_logabs; 238*gsl_complex_add = *Math::GSL::Linalgc::gsl_complex_add; 239*gsl_complex_sub = *Math::GSL::Linalgc::gsl_complex_sub; 240*gsl_complex_mul = *Math::GSL::Linalgc::gsl_complex_mul; 241*gsl_complex_div = *Math::GSL::Linalgc::gsl_complex_div; 242*gsl_complex_add_real = *Math::GSL::Linalgc::gsl_complex_add_real; 243*gsl_complex_sub_real = *Math::GSL::Linalgc::gsl_complex_sub_real; 244*gsl_complex_mul_real = *Math::GSL::Linalgc::gsl_complex_mul_real; 245*gsl_complex_div_real = *Math::GSL::Linalgc::gsl_complex_div_real; 246*gsl_complex_add_imag = *Math::GSL::Linalgc::gsl_complex_add_imag; 247*gsl_complex_sub_imag = *Math::GSL::Linalgc::gsl_complex_sub_imag; 248*gsl_complex_mul_imag = *Math::GSL::Linalgc::gsl_complex_mul_imag; 249*gsl_complex_div_imag = *Math::GSL::Linalgc::gsl_complex_div_imag; 250*gsl_complex_conjugate = *Math::GSL::Linalgc::gsl_complex_conjugate; 251*gsl_complex_inverse = *Math::GSL::Linalgc::gsl_complex_inverse; 252*gsl_complex_negative = *Math::GSL::Linalgc::gsl_complex_negative; 253*gsl_complex_sqrt = *Math::GSL::Linalgc::gsl_complex_sqrt; 254*gsl_complex_sqrt_real = *Math::GSL::Linalgc::gsl_complex_sqrt_real; 255*gsl_complex_pow = *Math::GSL::Linalgc::gsl_complex_pow; 256*gsl_complex_pow_real = *Math::GSL::Linalgc::gsl_complex_pow_real; 257*gsl_complex_exp = *Math::GSL::Linalgc::gsl_complex_exp; 258*gsl_complex_log = *Math::GSL::Linalgc::gsl_complex_log; 259*gsl_complex_log10 = *Math::GSL::Linalgc::gsl_complex_log10; 260*gsl_complex_log_b = *Math::GSL::Linalgc::gsl_complex_log_b; 261*gsl_complex_sin = *Math::GSL::Linalgc::gsl_complex_sin; 262*gsl_complex_cos = *Math::GSL::Linalgc::gsl_complex_cos; 263*gsl_complex_sec = *Math::GSL::Linalgc::gsl_complex_sec; 264*gsl_complex_csc = *Math::GSL::Linalgc::gsl_complex_csc; 265*gsl_complex_tan = *Math::GSL::Linalgc::gsl_complex_tan; 266*gsl_complex_cot = *Math::GSL::Linalgc::gsl_complex_cot; 267*gsl_complex_arcsin = *Math::GSL::Linalgc::gsl_complex_arcsin; 268*gsl_complex_arcsin_real = *Math::GSL::Linalgc::gsl_complex_arcsin_real; 269*gsl_complex_arccos = *Math::GSL::Linalgc::gsl_complex_arccos; 270*gsl_complex_arccos_real = *Math::GSL::Linalgc::gsl_complex_arccos_real; 271*gsl_complex_arcsec = *Math::GSL::Linalgc::gsl_complex_arcsec; 272*gsl_complex_arcsec_real = *Math::GSL::Linalgc::gsl_complex_arcsec_real; 273*gsl_complex_arccsc = *Math::GSL::Linalgc::gsl_complex_arccsc; 274*gsl_complex_arccsc_real = *Math::GSL::Linalgc::gsl_complex_arccsc_real; 275*gsl_complex_arctan = *Math::GSL::Linalgc::gsl_complex_arctan; 276*gsl_complex_arccot = *Math::GSL::Linalgc::gsl_complex_arccot; 277*gsl_complex_sinh = *Math::GSL::Linalgc::gsl_complex_sinh; 278*gsl_complex_cosh = *Math::GSL::Linalgc::gsl_complex_cosh; 279*gsl_complex_sech = *Math::GSL::Linalgc::gsl_complex_sech; 280*gsl_complex_csch = *Math::GSL::Linalgc::gsl_complex_csch; 281*gsl_complex_tanh = *Math::GSL::Linalgc::gsl_complex_tanh; 282*gsl_complex_coth = *Math::GSL::Linalgc::gsl_complex_coth; 283*gsl_complex_arcsinh = *Math::GSL::Linalgc::gsl_complex_arcsinh; 284*gsl_complex_arccosh = *Math::GSL::Linalgc::gsl_complex_arccosh; 285*gsl_complex_arccosh_real = *Math::GSL::Linalgc::gsl_complex_arccosh_real; 286*gsl_complex_arcsech = *Math::GSL::Linalgc::gsl_complex_arcsech; 287*gsl_complex_arccsch = *Math::GSL::Linalgc::gsl_complex_arccsch; 288*gsl_complex_arctanh = *Math::GSL::Linalgc::gsl_complex_arctanh; 289*gsl_complex_arctanh_real = *Math::GSL::Linalgc::gsl_complex_arctanh_real; 290*gsl_complex_arccoth = *Math::GSL::Linalgc::gsl_complex_arccoth; 291 292############# Class : Math::GSL::Linalg::gsl_permutation_struct ############## 293 294package Math::GSL::Linalg::gsl_permutation_struct; 295use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 296@ISA = qw( Math::GSL::Linalg ); 297%OWNER = (); 298%ITERATORS = (); 299*swig_size_get = *Math::GSL::Linalgc::gsl_permutation_struct_size_get; 300*swig_size_set = *Math::GSL::Linalgc::gsl_permutation_struct_size_set; 301*swig_data_get = *Math::GSL::Linalgc::gsl_permutation_struct_data_get; 302*swig_data_set = *Math::GSL::Linalgc::gsl_permutation_struct_data_set; 303sub new { 304 my $pkg = shift; 305 my $self = Math::GSL::Linalgc::new_gsl_permutation_struct(@_); 306 bless $self, $pkg if defined($self); 307} 308 309sub DESTROY { 310 return unless $_[0]->isa('HASH'); 311 my $self = tied(%{$_[0]}); 312 return unless defined $self; 313 delete $ITERATORS{$self}; 314 if (exists $OWNER{$self}) { 315 Math::GSL::Linalgc::delete_gsl_permutation_struct($self); 316 delete $OWNER{$self}; 317 } 318} 319 320sub DISOWN { 321 my $self = shift; 322 my $ptr = tied(%$self); 323 delete $OWNER{$ptr}; 324} 325 326sub ACQUIRE { 327 my $self = shift; 328 my $ptr = tied(%$self); 329 $OWNER{$ptr} = 1; 330} 331 332 333############# Class : Math::GSL::Linalg::gsl_complex ############## 334 335package Math::GSL::Linalg::gsl_complex; 336use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 337@ISA = qw( Math::GSL::Linalg ); 338%OWNER = (); 339%ITERATORS = (); 340*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_dat_get; 341*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_dat_set; 342sub new { 343 my $pkg = shift; 344 my $self = Math::GSL::Linalgc::new_gsl_complex(@_); 345 bless $self, $pkg if defined($self); 346} 347 348sub DESTROY { 349 return unless $_[0]->isa('HASH'); 350 my $self = tied(%{$_[0]}); 351 return unless defined $self; 352 delete $ITERATORS{$self}; 353 if (exists $OWNER{$self}) { 354 Math::GSL::Linalgc::delete_gsl_complex($self); 355 delete $OWNER{$self}; 356 } 357} 358 359sub DISOWN { 360 my $self = shift; 361 my $ptr = tied(%$self); 362 delete $OWNER{$ptr}; 363} 364 365sub ACQUIRE { 366 my $self = shift; 367 my $ptr = tied(%$self); 368 $OWNER{$ptr} = 1; 369} 370 371 372############# Class : Math::GSL::Linalg::gsl_complex_long_double ############## 373 374package Math::GSL::Linalg::gsl_complex_long_double; 375use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 376@ISA = qw( Math::GSL::Linalg ); 377%OWNER = (); 378%ITERATORS = (); 379*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_long_double_dat_get; 380*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_long_double_dat_set; 381sub new { 382 my $pkg = shift; 383 my $self = Math::GSL::Linalgc::new_gsl_complex_long_double(@_); 384 bless $self, $pkg if defined($self); 385} 386 387sub DESTROY { 388 return unless $_[0]->isa('HASH'); 389 my $self = tied(%{$_[0]}); 390 return unless defined $self; 391 delete $ITERATORS{$self}; 392 if (exists $OWNER{$self}) { 393 Math::GSL::Linalgc::delete_gsl_complex_long_double($self); 394 delete $OWNER{$self}; 395 } 396} 397 398sub DISOWN { 399 my $self = shift; 400 my $ptr = tied(%$self); 401 delete $OWNER{$ptr}; 402} 403 404sub ACQUIRE { 405 my $self = shift; 406 my $ptr = tied(%$self); 407 $OWNER{$ptr} = 1; 408} 409 410 411############# Class : Math::GSL::Linalg::gsl_complex_float ############## 412 413package Math::GSL::Linalg::gsl_complex_float; 414use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS); 415@ISA = qw( Math::GSL::Linalg ); 416%OWNER = (); 417%ITERATORS = (); 418*swig_dat_get = *Math::GSL::Linalgc::gsl_complex_float_dat_get; 419*swig_dat_set = *Math::GSL::Linalgc::gsl_complex_float_dat_set; 420sub new { 421 my $pkg = shift; 422 my $self = Math::GSL::Linalgc::new_gsl_complex_float(@_); 423 bless $self, $pkg if defined($self); 424} 425 426sub DESTROY { 427 return unless $_[0]->isa('HASH'); 428 my $self = tied(%{$_[0]}); 429 return unless defined $self; 430 delete $ITERATORS{$self}; 431 if (exists $OWNER{$self}) { 432 Math::GSL::Linalgc::delete_gsl_complex_float($self); 433 delete $OWNER{$self}; 434 } 435} 436 437sub DISOWN { 438 my $self = shift; 439 my $ptr = tied(%$self); 440 delete $OWNER{$ptr}; 441} 442 443sub ACQUIRE { 444 my $self = shift; 445 my $ptr = tied(%$self); 446 $OWNER{$ptr} = 1; 447} 448 449 450# ------- VARIABLE STUBS -------- 451 452package Math::GSL::Linalg; 453 454*GSL_VERSION = *Math::GSL::Linalgc::GSL_VERSION; 455*GSL_MAJOR_VERSION = *Math::GSL::Linalgc::GSL_MAJOR_VERSION; 456*GSL_MINOR_VERSION = *Math::GSL::Linalgc::GSL_MINOR_VERSION; 457*GSL_POSZERO = *Math::GSL::Linalgc::GSL_POSZERO; 458*GSL_NEGZERO = *Math::GSL::Linalgc::GSL_NEGZERO; 459*GSL_SUCCESS = *Math::GSL::Linalgc::GSL_SUCCESS; 460*GSL_FAILURE = *Math::GSL::Linalgc::GSL_FAILURE; 461*GSL_CONTINUE = *Math::GSL::Linalgc::GSL_CONTINUE; 462*GSL_EDOM = *Math::GSL::Linalgc::GSL_EDOM; 463*GSL_ERANGE = *Math::GSL::Linalgc::GSL_ERANGE; 464*GSL_EFAULT = *Math::GSL::Linalgc::GSL_EFAULT; 465*GSL_EINVAL = *Math::GSL::Linalgc::GSL_EINVAL; 466*GSL_EFAILED = *Math::GSL::Linalgc::GSL_EFAILED; 467*GSL_EFACTOR = *Math::GSL::Linalgc::GSL_EFACTOR; 468*GSL_ESANITY = *Math::GSL::Linalgc::GSL_ESANITY; 469*GSL_ENOMEM = *Math::GSL::Linalgc::GSL_ENOMEM; 470*GSL_EBADFUNC = *Math::GSL::Linalgc::GSL_EBADFUNC; 471*GSL_ERUNAWAY = *Math::GSL::Linalgc::GSL_ERUNAWAY; 472*GSL_EMAXITER = *Math::GSL::Linalgc::GSL_EMAXITER; 473*GSL_EZERODIV = *Math::GSL::Linalgc::GSL_EZERODIV; 474*GSL_EBADTOL = *Math::GSL::Linalgc::GSL_EBADTOL; 475*GSL_ETOL = *Math::GSL::Linalgc::GSL_ETOL; 476*GSL_EUNDRFLW = *Math::GSL::Linalgc::GSL_EUNDRFLW; 477*GSL_EOVRFLW = *Math::GSL::Linalgc::GSL_EOVRFLW; 478*GSL_ELOSS = *Math::GSL::Linalgc::GSL_ELOSS; 479*GSL_EROUND = *Math::GSL::Linalgc::GSL_EROUND; 480*GSL_EBADLEN = *Math::GSL::Linalgc::GSL_EBADLEN; 481*GSL_ENOTSQR = *Math::GSL::Linalgc::GSL_ENOTSQR; 482*GSL_ESING = *Math::GSL::Linalgc::GSL_ESING; 483*GSL_EDIVERGE = *Math::GSL::Linalgc::GSL_EDIVERGE; 484*GSL_EUNSUP = *Math::GSL::Linalgc::GSL_EUNSUP; 485*GSL_EUNIMPL = *Math::GSL::Linalgc::GSL_EUNIMPL; 486*GSL_ECACHE = *Math::GSL::Linalgc::GSL_ECACHE; 487*GSL_ETABLE = *Math::GSL::Linalgc::GSL_ETABLE; 488*GSL_ENOPROG = *Math::GSL::Linalgc::GSL_ENOPROG; 489*GSL_ENOPROGJ = *Math::GSL::Linalgc::GSL_ENOPROGJ; 490*GSL_ETOLF = *Math::GSL::Linalgc::GSL_ETOLF; 491*GSL_ETOLX = *Math::GSL::Linalgc::GSL_ETOLX; 492*GSL_ETOLG = *Math::GSL::Linalgc::GSL_ETOLG; 493*GSL_EOF = *Math::GSL::Linalgc::GSL_EOF; 494*GSL_LINALG_MOD_NONE = *Math::GSL::Linalgc::GSL_LINALG_MOD_NONE; 495*GSL_LINALG_MOD_TRANSPOSE = *Math::GSL::Linalgc::GSL_LINALG_MOD_TRANSPOSE; 496*GSL_LINALG_MOD_CONJUGATE = *Math::GSL::Linalgc::GSL_LINALG_MOD_CONJUGATE; 497 498@EXPORT_OK = qw/$GSL_LINALG_MOD_NONE $GSL_LINALG_MOD_TRANSPOSE $GSL_LINALG_MOD_CONJUGATE 499 gsl_linalg_matmult gsl_linalg_matmult_mod 500 gsl_linalg_exponential_ss 501 gsl_linalg_householder_transform 502 gsl_linalg_complex_householder_transform 503 gsl_linalg_householder_hm 504 gsl_linalg_householder_mh 505 gsl_linalg_householder_hv 506 gsl_linalg_householder_hm1 507 gsl_linalg_complex_householder_hm 508 gsl_linalg_complex_householder_mh 509 gsl_linalg_complex_householder_hv 510 gsl_linalg_hessenberg_decomp 511 gsl_linalg_hessenberg_unpack 512 gsl_linalg_hessenberg_unpack_accum 513 gsl_linalg_hessenberg_set_zero 514 gsl_linalg_hessenberg_submatrix 515 gsl_linalg_hessenberg 516 gsl_linalg_hesstri_decomp 517 gsl_linalg_SV_decomp 518 gsl_linalg_SV_decomp_mod 519 gsl_linalg_SV_decomp_jacobi 520 gsl_linalg_SV_solve 521 gsl_linalg_LU_decomp 522 gsl_linalg_LU_solve 523 gsl_linalg_LU_svx 524 gsl_linalg_LU_refine 525 gsl_linalg_LU_invert 526 gsl_linalg_LU_det 527 gsl_linalg_LU_lndet 528 gsl_linalg_LU_sgndet 529 gsl_linalg_complex_LU_decomp 530 gsl_linalg_complex_LU_solve 531 gsl_linalg_complex_LU_svx 532 gsl_linalg_complex_LU_refine 533 gsl_linalg_complex_LU_invert 534 gsl_linalg_complex_LU_det 535 gsl_linalg_complex_LU_lndet 536 gsl_linalg_complex_LU_sgndet 537 gsl_linalg_QR_decomp 538 gsl_linalg_QR_solve 539 gsl_linalg_QR_svx 540 gsl_linalg_QR_lssolve 541 gsl_linalg_QR_QRsolve 542 gsl_linalg_QR_Rsolve 543 gsl_linalg_QR_Rsvx 544 gsl_linalg_QR_update 545 gsl_linalg_QR_QTvec 546 gsl_linalg_QR_Qvec 547 gsl_linalg_QR_QTmat 548 gsl_linalg_QR_unpack 549 gsl_linalg_R_solve 550 gsl_linalg_R_svx 551 gsl_linalg_QRPT_decomp 552 gsl_linalg_QRPT_decomp2 553 gsl_linalg_QRPT_solve 554 gsl_linalg_QRPT_svx 555 gsl_linalg_QRPT_QRsolve 556 gsl_linalg_QRPT_Rsolve 557 gsl_linalg_QRPT_Rsvx 558 gsl_linalg_QRPT_update 559 gsl_linalg_LQ_decomp 560 gsl_linalg_LQ_solve_T 561 gsl_linalg_LQ_svx_T 562 gsl_linalg_LQ_lssolve_T 563 gsl_linalg_LQ_Lsolve_T 564 gsl_linalg_LQ_Lsvx_T 565 gsl_linalg_L_solve_T 566 gsl_linalg_LQ_vecQ 567 gsl_linalg_LQ_vecQT 568 gsl_linalg_LQ_unpack 569 gsl_linalg_LQ_update 570 gsl_linalg_LQ_LQsolve 571 gsl_linalg_PTLQ_decomp 572 gsl_linalg_PTLQ_decomp2 573 gsl_linalg_PTLQ_solve_T 574 gsl_linalg_PTLQ_svx_T 575 gsl_linalg_PTLQ_LQsolve_T 576 gsl_linalg_PTLQ_Lsolve_T 577 gsl_linalg_PTLQ_Lsvx_T 578 gsl_linalg_PTLQ_update 579 gsl_linalg_cholesky_decomp 580 gsl_linalg_cholesky_solve 581 gsl_linalg_cholesky_svx 582 gsl_linalg_cholesky_decomp_unit 583 gsl_linalg_complex_cholesky_decomp 584 gsl_linalg_complex_cholesky_solve 585 gsl_linalg_complex_cholesky_svx 586 gsl_linalg_symmtd_decomp 587 gsl_linalg_symmtd_unpack 588 gsl_linalg_symmtd_unpack_T 589 gsl_linalg_hermtd_decomp 590 gsl_linalg_hermtd_unpack 591 gsl_linalg_hermtd_unpack_T 592 gsl_linalg_HH_solve 593 gsl_linalg_HH_svx 594 gsl_linalg_solve_symm_tridiag 595 gsl_linalg_solve_tridiag 596 gsl_linalg_solve_symm_cyc_tridiag 597 gsl_linalg_solve_cyc_tridiag 598 gsl_linalg_bidiag_decomp 599 gsl_linalg_bidiag_unpack 600 gsl_linalg_bidiag_unpack2 601 gsl_linalg_bidiag_unpack_B 602 gsl_linalg_balance_matrix 603 gsl_linalg_balance_accum 604 gsl_linalg_balance_columns 605 gsl_linalg_givens gsl_linalg_givens_gv 606 /; 607%EXPORT_TAGS = ( all =>[ @EXPORT_OK ] ); 608 609__END__ 610 611=encoding utf8 612 613=head1 NAME 614 615Math::GSL::Linalg - Functions for solving linear systems 616 617=head1 SYNOPSIS 618 619 use Math::GSL::Linalg qw/:all/; 620 621=head1 DESCRIPTION 622 623 624Here is a list of all the functions included in this module : 625 626=over 627 628=item gsl_linalg_matmult 629 630=item gsl_linalg_matmult_mod 631 632=item gsl_linalg_exponential_ss 633 634=item gsl_linalg_householder_transform 635 636=item gsl_linalg_complex_householder_transform 637 638=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. 639 640=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. 641 642=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. 643 644=item gsl_linalg_householder_hm1 645 646=item gsl_linalg_givens($a,$b,$c,$s) 647 648Performs a Givens rotation on the vector ($a,$b) and stores the answer in $c and $s. 649 650=item gsl_linalg_givens_gv($v, $i,$j, $c, $s) 651 652Performs a Givens rotation on the $i and $j-th elements of $v, storing them in $c and $s. 653 654=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. 655 656=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. 657 658=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. 659 660=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. 661 662=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. 663 664=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. 665 666=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. 667 668=item gsl_linalg_hessenberg_submatrix 669 670=item gsl_linalg_hessenberg 671 672=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. 673 674=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. 675 676=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. 677 678=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. 679 680=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. 681 682=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. 683 684=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. 685 686=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. 687 688=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. 689 690=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. 691 692=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. 693 694=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. 695 696=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. 697 698=item gsl_linalg_complex_LU_decomp($A, $p) - Does the same operation than gsl_linalg_LU_decomp but on the complex matrix $A. 699 700=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. 701 702=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. 703 704=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. 705 706=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. 707 708=item gsl_linalg_complex_LU_det($LU, $signum) - Does the same operation than gsl_linalg_LU_det but on the complex matrix $LU. 709 710=item gsl_linalg_complex_LU_lndet($LU) - Does the same operation than gsl_linalg_LU_det but on the complex matrix $LU. 711 712=item gsl_linalg_complex_LU_sgndet($LU, $signum) - Does the same operation than gsl_linalg_LU_sgndet but on the complex matrix $LU. 713 714=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). 715 716=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. 717 718=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. 719 720=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. 721 722=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. 723 724=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. 725 726=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. 727 728=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. 729 730=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. 731 732=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. 733 734=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. 735 736=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. 737 738=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. 739 740=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. 741 742=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). 743 744=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 745 746=item gsl_linalg_QRPT_solve 747 748=item gsl_linalg_QRPT_svx 749 750=item gsl_linalg_QRPT_QRsolve 751 752=item gsl_linalg_QRPT_Rsolve 753 754=item gsl_linalg_QRPT_Rsvx 755 756=item gsl_linalg_QRPT_update 757 758=item gsl_linalg_LQ_decomp 759 760=item gsl_linalg_LQ_solve_T 761 762=item gsl_linalg_LQ_svx_T 763 764=item gsl_linalg_LQ_lssolve_T 765 766=item gsl_linalg_LQ_Lsolve_T 767 768=item gsl_linalg_LQ_Lsvx_T 769 770=item gsl_linalg_L_solve_T 771 772=item gsl_linalg_LQ_vecQ 773 774=item gsl_linalg_LQ_vecQT 775 776=item gsl_linalg_LQ_unpack 777 778=item gsl_linalg_LQ_update 779 780=item gsl_linalg_LQ_LQsolve 781 782=item gsl_linalg_PTLQ_decomp 783 784=item gsl_linalg_PTLQ_decomp2 785 786=item gsl_linalg_PTLQ_solve_T 787 788=item gsl_linalg_PTLQ_svx_T 789 790=item gsl_linalg_PTLQ_LQsolve_T 791 792=item gsl_linalg_PTLQ_Lsolve_T 793 794=item gsl_linalg_PTLQ_Lsvx_T 795 796=item gsl_linalg_PTLQ_update 797 798=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. 799 800=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. 801 802=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. 803 804=item gsl_linalg_cholesky_decomp_unit 805 806=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. 807 808=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. 809 810=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. 811 812=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. 813 814=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. 815 816=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. 817 818=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. 819 820=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. 821 822=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. 823 824=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. 825 826=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. 827 828=item gsl_linalg_solve_symm_tridiag 829 830=item gsl_linalg_solve_tridiag 831 832=item gsl_linalg_solve_symm_cyc_tridiag 833 834=item gsl_linalg_solve_cyc_tridiag 835 836=item gsl_linalg_bidiag_decomp 837 838=item gsl_linalg_bidiag_unpack 839 840=item gsl_linalg_bidiag_unpack2 841 842=item gsl_linalg_bidiag_unpack_B 843 844=item gsl_linalg_balance_matrix 845 846=item gsl_linalg_balance_accum 847 848=item gsl_linalg_balance_columns 849 850 851 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. 852 853For more informations on the functions, we refer you to the GSL official documentation: L<http://www.gnu.org/software/gsl/manual/html_node/> 854 855 856=back 857 858=head1 EXAMPLES 859 860This example shows how to compute the determinant of a matrix with the LU decomposition: 861 862 use Math::GSL::Matrix qw/:all/; 863 use Math::GSL::Permutation qw/:all/; 864 use Math::GSL::Linalg qw/:all/; 865 866 my $Matrix = gsl_matrix_alloc(4,4); 867 map { gsl_matrix_set($Matrix, 0, $_, $_+1) } (0..3); 868 869 gsl_matrix_set($Matrix,1, 0, 2); 870 gsl_matrix_set($Matrix, 1, 1, 3); 871 gsl_matrix_set($Matrix, 1, 2, 4); 872 gsl_matrix_set($Matrix, 1, 3, 1); 873 874 gsl_matrix_set($Matrix, 2, 0, 3); 875 gsl_matrix_set($Matrix, 2, 1, 4); 876 gsl_matrix_set($Matrix, 2, 2, 1); 877 gsl_matrix_set($Matrix, 2, 3, 2); 878 879 gsl_matrix_set($Matrix, 3, 0, 4); 880 gsl_matrix_set($Matrix, 3, 1, 1); 881 gsl_matrix_set($Matrix, 3, 2, 2); 882 gsl_matrix_set($Matrix, 3, 3, 3); 883 884 my $permutation = gsl_permutation_alloc(4); 885 gsl_permutation_init($permutation); 886 my ($result, $signum) = gsl_linalg_LU_decomp($Matrix, $permutation); 887 my $det = gsl_linalg_LU_det($Matrix, $signum); 888 print "The value of the determinant of the matrix is $det \n"; 889 890=head1 AUTHORS 891 892Jonathan "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com> 893 894=head1 COPYRIGHT AND LICENSE 895 896Copyright (C) 2008-2021 Jonathan "Duke" Leto and Thierry Moisan 897 898This program is free software; you can redistribute it and/or modify it 899under the same terms as Perl itself. 900 901=cut 9021; 903