gsl_linalg.pd (PDL-2.074) | : | gsl_linalg.pd (PDL-2.075) | ||
---|---|---|---|---|

skipping to change at line 25 | skipping to change at line 25 | |||

use PDL::MatrixOps; # for 'x' | use PDL::MatrixOps; # for 'x' | |||

use PDL::GSL::LINALG; | use PDL::GSL::LINALG; | |||

my $A = pdl [ | my $A = pdl [ | |||

[0.18, 0.60, 0.57, 0.96], | [0.18, 0.60, 0.57, 0.96], | |||

[0.41, 0.24, 0.99, 0.58], | [0.41, 0.24, 0.99, 0.58], | |||

[0.14, 0.30, 0.97, 0.66], | [0.14, 0.30, 0.97, 0.66], | |||

[0.51, 0.13, 0.19, 0.85], | [0.51, 0.13, 0.19, 0.85], | |||

]; | ]; | |||

my $B = sequence(2,4); # column vectors | my $B = sequence(2,4); # column vectors | |||

LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null); | LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null); | |||

# transpose so first dim means is vector, higher dims thread | # transpose so first dim means is vector, higher dims broadcast | |||

LU_solve($lu, $p, $B->transpose, my $x=null); | LU_solve($lu, $p, $B->transpose, my $x=null); | |||

$x = $x->inplace->transpose; # now can be matrix-multiplied | $x = $x->inplace->transpose; # now can be matrix-multiplied | |||

=head1 DESCRIPTION | =head1 DESCRIPTION | |||

This is an interface to the linear algebra package present in the | This is an interface to the linear algebra package present in the | |||

GNU Scientific Library. Functions are named as in GSL, but with the | GNU Scientific Library. Functions are named as in GSL, but with the | |||

initial C<gsl_linalg_> removed. They are provided in both real and | initial C<gsl_linalg_> removed. They are provided in both real and | |||

complex double precision. | complex double precision. | |||

End of changes. 1 change blocks. | ||||

1 lines changed or deleted | | 1 lines changed or added |