"Fossies" - the Fresh Open Source Software Archive

Member "PDL-2.080/GENERATED/PDL/GSL/LINALG.pm" (28 May 2022, 3733 Bytes) of package /linux/misc/PDL-2.080.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "LINALG.pm" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.079_vs_2.080.

    1 #
    2 # GENERATED WITH PDL::PP! Don't modify!
    3 #
    4 package PDL::GSL::LINALG;
    5 
    6 our @EXPORT_OK = qw(LU_decomp LU_solve LU_det solve_tridiag );
    7 our %EXPORT_TAGS = (Func=>\@EXPORT_OK);
    8 
    9 use PDL::Core;
   10 use PDL::Exporter;
   11 use DynaLoader;
   12 
   13 
   14    
   15    our @ISA = ( 'PDL::Exporter','DynaLoader' );
   16    push @PDL::Core::PP, __PACKAGE__;
   17    bootstrap PDL::GSL::LINALG ;
   18 
   19 
   20 
   21 
   22 
   23 
   24 #line 4 "gsl_linalg.pd"
   25 
   26 use strict;
   27 use warnings;
   28 
   29 =head1 NAME
   30 
   31 PDL::GSL::LINALG - PDL interface to linear algebra routines in GSL
   32 
   33 =head1 SYNOPSIS
   34 
   35   use PDL::LiteF;
   36   use PDL::MatrixOps; # for 'x'
   37   use PDL::GSL::LINALG;
   38   my $A = pdl [
   39     [0.18, 0.60, 0.57, 0.96],
   40     [0.41, 0.24, 0.99, 0.58],
   41     [0.14, 0.30, 0.97, 0.66],
   42     [0.51, 0.13, 0.19, 0.85],
   43   ];
   44   my $B = sequence(2,4); # column vectors
   45   LU_decomp(my $lu=$A->copy, my $p=null, my $signum=null);
   46   # transpose so first dim means is vector, higher dims broadcast
   47   LU_solve($lu, $p, $B->transpose, my $x=null);
   48   $x = $x->inplace->transpose; # now can be matrix-multiplied
   49 
   50 =head1 DESCRIPTION
   51 
   52 This is an interface to the linear algebra package present in the
   53 GNU Scientific Library. Functions are named as in GSL, but with the
   54 initial C<gsl_linalg_> removed. They are provided in both real and
   55 complex double precision.
   56 
   57 Currently only LU decomposition interfaces here. Pull requests welcome!
   58 #line 59 "LINALG.pm"
   59 
   60 
   61 
   62 
   63 
   64 
   65 =head1 FUNCTIONS
   66 
   67 =cut
   68 
   69 
   70 
   71 
   72 #line 948 "../../../blib/lib/PDL/PP.pm"
   73 
   74 
   75 
   76 =head2 LU_decomp
   77 
   78 =for sig
   79 
   80   Signature: ([io,phys]A(n,m); indx [o,phys]ipiv(p); int [o,phys]signum())
   81 
   82 =for ref
   83 
   84 LU decomposition of the given (real or complex) matrix.
   85 
   86 
   87 
   88 =for bad
   89 
   90 LU_decomp ignores the bad-value flag of the input ndarrays.
   91 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
   92 
   93 
   94 =cut
   95 #line 96 "LINALG.pm"
   96 
   97 
   98 
   99 #line 950 "../../../blib/lib/PDL/PP.pm"
  100 
  101 *LU_decomp = \&PDL::LU_decomp;
  102 #line 103 "LINALG.pm"
  103 
  104 
  105 
  106 #line 948 "../../../blib/lib/PDL/PP.pm"
  107 
  108 
  109 
  110 =head2 LU_solve
  111 
  112 =for sig
  113 
  114   Signature: ([phys]LU(n,m); indx [phys]ipiv(p); [phys]B(n); [o,phys]x(n))
  115 
  116 =for ref
  117 
  118 Solve C<A x = B> using the LU and permutation from L</LU_decomp>, real
  119 or complex.
  120 
  121 
  122 
  123 =for bad
  124 
  125 LU_solve ignores the bad-value flag of the input ndarrays.
  126 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  127 
  128 
  129 =cut
  130 #line 131 "LINALG.pm"
  131 
  132 
  133 
  134 #line 950 "../../../blib/lib/PDL/PP.pm"
  135 
  136 *LU_solve = \&PDL::LU_solve;
  137 #line 138 "LINALG.pm"
  138 
  139 
  140 
  141 #line 948 "../../../blib/lib/PDL/PP.pm"
  142 
  143 
  144 
  145 =head2 LU_det
  146 
  147 =for sig
  148 
  149   Signature: ([phys]LU(n,m); int [phys]signum(); [o]det())
  150 
  151 =for ref
  152 
  153 Find the determinant from the LU decomp.
  154 
  155 
  156 
  157 =for bad
  158 
  159 LU_det ignores the bad-value flag of the input ndarrays.
  160 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  161 
  162 
  163 =cut
  164 #line 165 "LINALG.pm"
  165 
  166 
  167 
  168 #line 950 "../../../blib/lib/PDL/PP.pm"
  169 
  170 *LU_det = \&PDL::LU_det;
  171 #line 172 "LINALG.pm"
  172 
  173 
  174 
  175 #line 948 "../../../blib/lib/PDL/PP.pm"
  176 
  177 
  178 
  179 =head2 solve_tridiag
  180 
  181 =for sig
  182 
  183   Signature: ([phys]diag(n); [phys]superdiag(n); [phys]subdiag(n); [phys]B(n); [o,phys]x(n))
  184 
  185 =for ref
  186 
  187 Solve C<A x = B> where A is a tridiagonal system. Real only, because
  188 GSL does not have a complex function.
  189 
  190 
  191 
  192 =for bad
  193 
  194 solve_tridiag ignores the bad-value flag of the input ndarrays.
  195 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  196 
  197 
  198 =cut
  199 #line 200 "LINALG.pm"
  200 
  201 
  202 
  203 #line 950 "../../../blib/lib/PDL/PP.pm"
  204 
  205 *solve_tridiag = \&PDL::solve_tridiag;
  206 #line 207 "LINALG.pm"
  207 
  208 
  209 
  210 
  211 
  212 #line 40 "gsl_linalg.pd"
  213 
  214 =head1 SEE ALSO
  215 
  216 L<PDL>
  217 
  218 The GSL documentation for linear algebra is online at
  219 L<https://www.gnu.org/software/gsl/doc/html/linalg.html>
  220 
  221 =cut
  222 #line 223 "LINALG.pm"
  223 
  224 
  225 
  226 
  227 # Exit with OK status
  228 
  229 1;