"Fossies" - the Fresh Open Source Software Archive

Member "PDL-2.080/GENERATED/PDL/Slatec.pm" (28 May 2022, 34002 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 "Slatec.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::Slatec;
    5 
    6 our @EXPORT_OK = qw(eigsys matinv polyfit polycoef polyvalue svdc poco geco gefa podi gedi gesl rs ezffti ezfftf ezfftb pcoef pvalue chim chic chsp chfd chfe chia chid chcm chbs polfit );
    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::Slatec ;
   18 
   19 
   20 
   21 
   22 
   23 
   24 #line 5 "slatec.pd"
   25 
   26 use strict;
   27 use warnings;
   28 
   29 =head1 NAME
   30 
   31 PDL::Slatec - PDL interface to the slatec numerical programming library
   32 
   33 =head1 SYNOPSIS
   34 
   35  use PDL::Slatec;
   36 
   37  ($ndeg, $r, $ierr, $c) = polyfit($x, $y, $w, $maxdeg, $eps);
   38 
   39 =head1 DESCRIPTION
   40 
   41 This module serves the dual purpose of providing an interface to
   42 parts of the slatec library and showing how to interface PDL
   43 to an external library.
   44 Using this library requires a fortran compiler; the source for the routines
   45 is provided for convenience.
   46 
   47 Currently available are routines to:
   48 manipulate matrices; calculate FFT's; 
   49 fit data using polynomials; 
   50 and interpolate/integrate data using piecewise cubic Hermite interpolation.
   51 
   52 =head2 Piecewise cubic Hermite interpolation (PCHIP)
   53 
   54 PCHIP is the slatec package of routines to perform piecewise cubic
   55 Hermite interpolation of data.
   56 It features software to produce a monotone and "visually pleasing"
   57 interpolant to monotone data.  
   58 According to Fritsch & Carlson ("Monotone piecewise
   59 cubic interpolation", SIAM Journal on Numerical Analysis 
   60 17, 2 (April 1980), pp. 238-246),
   61 such an interpolant may be more reasonable than a cubic spline if
   62 the data contains both "steep" and "flat" sections.  
   63 Interpolation of cumulative probability distribution functions is 
   64 another application.
   65 These routines are cryptically named (blame FORTRAN), 
   66 beginning with 'ch', and accept either float or double ndarrays. 
   67 
   68 Most of the routines require an integer parameter called C<check>;
   69 if set to 0, then no checks on the validity of the input data are
   70 made, otherwise these checks are made.
   71 The value of C<check> can be set to 0 if a routine
   72 such as L</chim> has already been successfully called.
   73 
   74 =over 4
   75 
   76 =item * 
   77 
   78 If not known, estimate derivative values for the points
   79 using the L</chim>, L</chic>, or L</chsp> routines
   80 (the following routines require both the function (C<f>)
   81 and derivative (C<d>) values at a set of points (C<x>)). 
   82 
   83 =item * 
   84 
   85 Evaluate, integrate, or differentiate the resulting PCH
   86 function using the routines:
   87 L</chfd>; L</chfe>; L</chia>; L</chid>.
   88 
   89 =item * 
   90 
   91 If desired, you can check the monotonicity of your
   92 data using L</chcm>. 
   93 
   94 =back
   95  
   96 =cut
   97 #line 98 "Slatec.pm"
   98 
   99 
  100 
  101 
  102 
  103 
  104 =head1 FUNCTIONS
  105 
  106 =cut
  107 
  108 
  109 
  110 
  111 #line 91 "slatec.pd"
  112 
  113 =head2 eigsys
  114 
  115 =for ref
  116 
  117 Eigenvalues and eigenvectors of a real positive definite symmetric matrix.
  118 
  119 =for usage
  120 
  121  ($eigvals,$eigvecs) = eigsys($mat)
  122 
  123 Note: this function should be extended to calculate only eigenvalues if called 
  124 in scalar context!
  125 
  126 =head2 matinv
  127 
  128 =for ref
  129 
  130 Inverse of a square matrix
  131 
  132 =for usage
  133 
  134  ($inv) = matinv($mat)
  135 
  136 =head2 polyfit
  137 
  138 Convenience wrapper routine about the C<polfit> C<slatec> function.
  139 Separates supplied arguments and return values.
  140 
  141 =for ref
  142 
  143 Fit discrete data in a least squares sense by polynomials
  144 in one variable.  Handles broadcasting correctly--one can pass in a 2D PDL (as C<$y>)
  145 and it will pass back a 2D PDL, the rows of which are the polynomial regression
  146 results (in C<$r> corresponding to the rows of $y.
  147 
  148 =for usage
  149 
  150  ($ndeg, $r, $ierr, $c, $coeffs, $rms) = polyfit($x, $y, $w, $maxdeg, [$eps]);
  151 
  152  $coeffs = polyfit($x,$y,$w,$maxdeg,[$eps]);
  153 
  154 where on input:
  155 
  156 C<$x> and C<$y> are the values to fit to a polynomial.
  157 C<$w> are weighting factors
  158 C<$maxdeg> is the maximum degree of polynomial to use and 
  159 C<$eps> is the required degree of fit.
  160 
  161 and the output switches on list/scalar context.  
  162 
  163 In list context: 
  164 
  165 C<$ndeg> is the degree of polynomial actually used
  166 C<$r> is the values of the fitted polynomial 
  167 C<$ierr> is a return status code, and
  168 C<$c> is some working array or other (preserved for historical purposes)
  169 C<$coeffs> is the polynomial coefficients of the best fit polynomial.
  170 C<$rms> is the rms error of the fit.
  171 
  172 In scalar context, only $coeffs is returned.
  173 
  174 Historically, C<$eps> was modified in-place to be a return value of the
  175 rms error.  This usage is deprecated, and C<$eps> is an optional parameter now.
  176 It is still modified if present.
  177  
  178 C<$c> is a working array accessible to Slatec - you can feed it to several
  179 other Slatec routines to get nice things out.  It does not broadcast
  180 correctly and should probably be fixed by someone.  If you are 
  181 reading this, that someone might be you.
  182 
  183 =for bad
  184 
  185 This version of polyfit handles bad values correctly.  Bad values in
  186 $y are ignored for the fit and give computed values on the fitted
  187 curve in the return.  Bad values in $x or $w are ignored for the fit and
  188 result in bad elements in the output.
  189 
  190 =head2 polycoef
  191 
  192 Convenience wrapper routine around the C<pcoef> C<slatec> function.
  193 Separates supplied arguments and return values.                               
  194 
  195 =for ref
  196 
  197 Convert the C<polyfit>/C<polfit> coefficients to Taylor series form.
  198 
  199 =for usage
  200 
  201  $tc = polycoef($l, $c, $x);
  202 
  203 =head2 polyvalue
  204 
  205 Convenience wrapper routine around the C<pvalue> C<slatec> function.
  206 Separates supplied arguments and return values.
  207 
  208 For multiple input x positions, a corresponding y position is calculated.
  209 
  210 The derivatives PDL is one dimensional (of size C<nder>) if a single x
  211 position is supplied, two dimensional if more than one x position is
  212 supplied.                                                                     
  213 
  214 =for ref
  215 
  216 Use the coefficients C<c> generated by C<polyfit> (or C<polfit>) to evaluate
  217 the polynomial fit of degree C<l>, along with the first C<nder> of its
  218 derivatives, at a specified point C<x>.
  219 
  220 =for usage
  221 
  222  ($yfit, $yp) = polyvalue($l, $nder, $x, $c);
  223 
  224 =head2 detslatec
  225 
  226 =for ref
  227 
  228 compute the determinant of an invertible matrix
  229 
  230 =for example
  231 
  232   $mat = zeroes(5,5); $mat->diagonal(0,1) .= 1; # unity matrix
  233   $det = detslatec $mat;
  234 
  235 Usage:
  236 
  237 =for usage
  238 
  239   $determinant = detslatec $matrix;
  240 
  241 =for sig
  242 
  243   Signature: detslatec(mat(n,m); [o] det())
  244 
  245 C<detslatec> computes the determinant of an invertible matrix and barfs if
  246 the matrix argument provided is non-invertible. The matrix broadcasts as usual.
  247 
  248 This routine was previously known as C<det> which clashes now with
  249 L<det|PDL::MatrixOps/det> which is provided by L<PDL::MatrixOps>.
  250 
  251 =head2 fft
  252 
  253 =for ref
  254 
  255 Fast Fourier Transform
  256 
  257 =for example
  258 
  259   $v_in = pdl(1,0,1,0);
  260   ($azero,$x,$y) = PDL::Slatec::fft($v_in);
  261 
  262 C<PDL::Slatec::fft> is a convenience wrapper for L</ezfftf>, and
  263 performs a Fast Fourier Transform on an input vector C<$v_in>. The
  264 return values are the same as for L</ezfftf>.
  265 
  266 =head2 rfft
  267 
  268 =for ref
  269 
  270 reverse Fast Fourier Transform
  271 
  272 =for example
  273 
  274   $v_out = PDL::Slatec::rfft($azero,$x,$y);
  275   print $v_in, $vout
  276   [1 0 1 0] [1 0 1 0]
  277 
  278 C<PDL::Slatec::rfft> is a convenience wrapper for L</ezfftb>,
  279 and performs a reverse Fast Fourier Transform. The input is the same
  280 as the output of L</PDL::Slatec::fft>, and the output
  281 of C<rfft> is a data vector, similar to what is input into
  282 L</PDL::Slatec::fft>.
  283 
  284 =cut
  285 #line 286 "Slatec.pm"
  286 
  287 
  288 
  289 #line 423 "slatec.pd"
  290 
  291 
  292 use PDL::Core;
  293 use PDL::Basic;
  294 use PDL::Primitive;
  295 use PDL::Ufunc;
  296 use strict;
  297 
  298 # Note: handles only real symmetric positive-definite.
  299 
  300 *eigsys = \&PDL::eigsys;
  301 
  302 sub PDL::eigsys {
  303     my($h) = @_;
  304     $h = float($h);
  305     rs($h,
  306         my $eigval=PDL->null,
  307         1,my $eigmat=PDL->null,
  308         my $errflag=PDL->null
  309     );
  310 #   print $covar,$eigval,$eigmat,$fvone,$fvtwo,$errflag;
  311     if(sum($errflag) > 0) {
  312         barf("Non-positive-definite matrix given to eigsys: $h\n");
  313     }
  314     return ($eigval,$eigmat);
  315 }
  316 
  317 *matinv = \&PDL::matinv;
  318 
  319 sub PDL::matinv {
  320     my($m) = @_;
  321     my(@dims) = $m->dims;
  322 
  323     # Keep from dumping core (FORTRAN does no error checking)
  324     barf("matinv requires a 2-D square matrix")
  325         unless( @dims >= 2 && $dims[0] == $dims[1] );
  326   
  327     $m = $m->copy(); # Make sure we don't overwrite :(
  328     gefa($m,(my $ipvt=null),(my $info=null));
  329     if(sum($info) > 0) {
  330         barf("Uninvertible matrix given to inv: $m\n");
  331     }
  332     gedi($m,$ipvt,pdl(0,0),null,1);
  333     $m;
  334 }
  335 
  336 *detslatec = \&PDL::detslatec;
  337 sub PDL::detslatec {
  338     my($m) = @_;
  339     $m = $m->copy(); # Make sure we don't overwrite :(
  340     gefa($m,(my $ipvt=null),(my $info=null));
  341     if(sum($info) > 0) {
  342         barf("Uninvertible matrix given to inv: $m\n");
  343     }
  344     gedi($m,$ipvt,my $det=null,null,10);
  345     return $det->slice('(0)')*10**$det->slice('(1)');
  346 }
  347 
  348 
  349 sub prepfft {
  350     my($n) = @_;
  351     my $tmp = PDL->zeroes(float(),$n*3+15);
  352     $n = pdl $n;
  353     ezffti($n,$tmp);
  354     return $tmp;
  355 }
  356 
  357 sub fft (;@) {
  358     my($v) = @_;
  359     my $ws = prepfft($v->getdim(0));
  360     ezfftf($v,(my $az = PDL->null), (my $x = PDL->null),
  361           (my $y = PDL->null), $ws);
  362     return ($az,$x,$y);
  363 }
  364 
  365 sub rfft {
  366     my($az,$x,$y) = @_;
  367     my $ws = prepfft($x->getdim(0));
  368     my $v = $x->copy();
  369     ezfftb($v,$az,$x,$y,$ws);
  370     return $v;
  371 }
  372 
  373 # polynomial fitting routines
  374 # simple wrappers around the SLATEC implementations
  375 
  376 *polyfit = \&PDL::polyfit;
  377 sub PDL::polyfit {
  378   barf 'Usage: polyfit($x, $y, $w, $maxdeg, [$eps]);'
  379     unless (@_ == 5 || @_==4 );
  380 
  381   my ($x_in, $y_in, $w_in, $maxdeg_in, $eps_in) = @_;
  382 
  383   # if $w_in does not match the data vectors ($x_in, $y_in), then we can resize
  384   # it to match the size of $y_in :
  385   $w_in = $w_in + $y_in->zeros;
  386 
  387   # Create the output arrays
  388   my $r = PDL->null;
  389 
  390   # A array needs some work space
  391   my $sz = ((3 * $x_in->getdim(0)) + (3*$maxdeg_in) + 3); # Buffer size called for by Slatec
  392   my @otherdims = $_[0]->dims; shift @otherdims;          # Thread dims
  393   my $a1 =      PDL->new_from_specification($x_in->type,$sz,@otherdims);
  394   my $coeffs = PDL->new_from_specification($x_in->type, $maxdeg_in + 1, @otherdims);
  395 
  396   my $ierr = PDL->null;
  397   my $ndeg = PDL->null;
  398 
  399   # Now call polfit
  400   my $rms = pdl($eps_in);                                       
  401   polfit($x_in, $y_in, $w_in, $maxdeg_in, $ndeg, $rms, $r, $ierr, $a1, $coeffs);
  402   # Preserve historic compatibility by flowing rms error back into the argument
  403   if( UNIVERSAL::isa($eps_in,'PDL') ){
  404       $eps_in .= $rms;
  405   }
  406 
  407   # Return the arrays
  408   if(wantarray) {
  409     return ($ndeg, $r, $ierr, $a1, $coeffs, $rms );
  410   } else {
  411       return $coeffs;
  412   }
  413 }
  414 
  415 
  416 *polycoef = \&PDL::polycoef;
  417 sub PDL::polycoef {
  418   barf 'Usage: polycoef($l, $c, $x);'
  419     unless @_ == 3;
  420 
  421   # Allocate memory for return PDL
  422   # Simply l + 1 but cant see how to get PP to do this - TJ
  423   # Not sure the return type since I do not know
  424   # where PP will get the information from
  425   my $tc = PDL->zeroes( abs($_[0]) + 1 );                                     
  426 
  427   # Run the slatec routine
  428   pcoef($_[0], $_[1], $tc, $_[2]);
  429 
  430   # Return results
  431   return $tc;
  432 
  433 }
  434 
  435 *polyvalue = \&PDL::polyvalue;
  436 sub PDL::polyvalue {
  437   barf 'Usage: polyvalue($l, $nder, $x, $c);'
  438     unless @_ == 4;
  439 
  440   # Two output arrays
  441   my $yfit = PDL->null;
  442 
  443   # This one must be preallocated and must take into account
  444   # the size of $x if greater than 1
  445   my $yp;
  446   if ($_[2]->getdim(0) == 1) {
  447     $yp = $_[2]->zeroes($_[1]);
  448   } else {
  449     $yp = $_[2]->zeroes($_[1], $_[2]->getdim(0));
  450   }
  451 
  452   # Run the slatec function
  453   pvalue($_[0], $_[2], $yfit, $yp, $_[3]);
  454 
  455   # Returns
  456   return ($yfit, $yp);
  457 
  458 }
  459                                                                               
  460 #line 461 "Slatec.pm"
  461 
  462 
  463 
  464 #line 948 "../../blib/lib/PDL/PP.pm"
  465 
  466 
  467 
  468 =head2 svdc
  469 
  470 =for sig
  471 
  472   Signature: (x(n,p);[o]s(p);[o]e(p);[o]u(n,p);[o]v(p,p);[o]work(n);longlong job();longlong [o]info())
  473 
  474 =for ref
  475 
  476 singular value decomposition of a matrix
  477 
  478 =for bad
  479 
  480 svdc does not process bad values.
  481 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  482 
  483 
  484 =cut
  485 #line 486 "Slatec.pm"
  486 
  487 
  488 
  489 #line 950 "../../blib/lib/PDL/PP.pm"
  490 
  491 *svdc = \&PDL::svdc;
  492 #line 493 "Slatec.pm"
  493 
  494 
  495 
  496 #line 948 "../../blib/lib/PDL/PP.pm"
  497 
  498 
  499 
  500 =head2 poco
  501 
  502 =for sig
  503 
  504   Signature: (a(n,n);rcond();[o]z(n);longlong [o]info())
  505 
  506 Factor a real symmetric positive definite matrix
  507 and estimate the condition number of the matrix.
  508 
  509 =for bad
  510 
  511 poco does not process bad values.
  512 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  513 
  514 
  515 =cut
  516 #line 517 "Slatec.pm"
  517 
  518 
  519 
  520 #line 950 "../../blib/lib/PDL/PP.pm"
  521 
  522 *poco = \&PDL::poco;
  523 #line 524 "Slatec.pm"
  524 
  525 
  526 
  527 #line 948 "../../blib/lib/PDL/PP.pm"
  528 
  529 
  530 
  531 =head2 geco
  532 
  533 =for sig
  534 
  535   Signature: (a(n,n);longlong [o]ipvt(n);[o]rcond();[o]z(n))
  536 
  537 Factor a matrix using Gaussian elimination and estimate
  538 the condition number of the matrix.
  539 
  540 =for bad
  541 
  542 geco does not process bad values.
  543 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  544 
  545 
  546 =cut
  547 #line 548 "Slatec.pm"
  548 
  549 
  550 
  551 #line 950 "../../blib/lib/PDL/PP.pm"
  552 
  553 *geco = \&PDL::geco;
  554 #line 555 "Slatec.pm"
  555 
  556 
  557 
  558 #line 948 "../../blib/lib/PDL/PP.pm"
  559 
  560 
  561 
  562 =head2 gefa
  563 
  564 =for sig
  565 
  566   Signature: (a(n,n);longlong [o]ipvt(n);longlong [o]info())
  567 
  568 =for ref
  569 
  570 Factor a matrix using Gaussian elimination.
  571 
  572 =for bad
  573 
  574 gefa does not process bad values.
  575 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  576 
  577 
  578 =cut
  579 #line 580 "Slatec.pm"
  580 
  581 
  582 
  583 #line 950 "../../blib/lib/PDL/PP.pm"
  584 
  585 *gefa = \&PDL::gefa;
  586 #line 587 "Slatec.pm"
  587 
  588 
  589 
  590 #line 948 "../../blib/lib/PDL/PP.pm"
  591 
  592 
  593 
  594 =head2 podi
  595 
  596 =for sig
  597 
  598   Signature: (a(n,n);[o]det(two=2);longlong job())
  599 
  600 Compute the determinant and inverse of a certain real
  601 symmetric positive definite matrix using the factors
  602 computed by L</poco>.
  603 
  604 =for bad
  605 
  606 podi does not process bad values.
  607 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  608 
  609 
  610 =cut
  611 #line 612 "Slatec.pm"
  612 
  613 
  614 
  615 #line 950 "../../blib/lib/PDL/PP.pm"
  616 
  617 *podi = \&PDL::podi;
  618 #line 619 "Slatec.pm"
  619 
  620 
  621 
  622 #line 948 "../../blib/lib/PDL/PP.pm"
  623 
  624 
  625 
  626 =head2 gedi
  627 
  628 =for sig
  629 
  630   Signature: (a(n,n);longlong [o]ipvt(n);[o]det(two=2);[o]work(n);longlong job())
  631 
  632 Compute the determinant and inverse of a matrix using the
  633 factors computed by L</geco> or L</gefa>.
  634 
  635 =for bad
  636 
  637 gedi does not process bad values.
  638 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  639 
  640 
  641 =cut
  642 #line 643 "Slatec.pm"
  643 
  644 
  645 
  646 #line 950 "../../blib/lib/PDL/PP.pm"
  647 
  648 *gedi = \&PDL::gedi;
  649 #line 650 "Slatec.pm"
  650 
  651 
  652 
  653 #line 948 "../../blib/lib/PDL/PP.pm"
  654 
  655 
  656 
  657 =head2 gesl
  658 
  659 =for sig
  660 
  661   Signature: (a(lda,n);longlong ipvt(n);b(n);longlong job())
  662 
  663 Solve the real system C<A*X=B> or C<TRANS(A)*X=B> using the
  664 factors computed by L</geco> or L</gefa>.
  665 
  666 =for bad
  667 
  668 gesl does not process bad values.
  669 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  670 
  671 
  672 =cut
  673 #line 674 "Slatec.pm"
  674 
  675 
  676 
  677 #line 950 "../../blib/lib/PDL/PP.pm"
  678 
  679 *gesl = \&PDL::gesl;
  680 #line 681 "Slatec.pm"
  681 
  682 
  683 
  684 #line 948 "../../blib/lib/PDL/PP.pm"
  685 
  686 
  687 
  688 =head2 rs
  689 
  690 =for sig
  691 
  692   Signature: (a(n,n);[o]w(n);longlong matz();[o]z(n,n);[t]fvone(n);[t]fvtwo(n);longlong [o]ierr())
  693 
  694 This subroutine calls the recommended sequence of
  695 subroutines from the eigensystem subroutine package (EISPACK)
  696 to find the eigenvalues and eigenvectors (if desired)
  697 of a REAL SYMMETRIC matrix.
  698 
  699 =for bad
  700 
  701 rs does not process bad values.
  702 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  703 
  704 
  705 =cut
  706 #line 707 "Slatec.pm"
  707 
  708 
  709 
  710 #line 950 "../../blib/lib/PDL/PP.pm"
  711 
  712 *rs = \&PDL::rs;
  713 #line 714 "Slatec.pm"
  714 
  715 
  716 
  717 #line 948 "../../blib/lib/PDL/PP.pm"
  718 
  719 
  720 
  721 =head2 ezffti
  722 
  723 =for sig
  724 
  725   Signature: (longlong n();[o]wsave(foo))
  726 
  727 Subroutine ezffti initializes the work array C<wsave()>
  728 which is used in both L</ezfftf> and 
  729 L</ezfftb>.  
  730 The prime factorization
  731 of C<n> together with a tabulation of the trigonometric functions
  732 are computed and stored in C<wsave()>.
  733 
  734 =for bad
  735 
  736 ezffti does not process bad values.
  737 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  738 
  739 
  740 =cut
  741 #line 742 "Slatec.pm"
  742 
  743 
  744 
  745 #line 950 "../../blib/lib/PDL/PP.pm"
  746 
  747 *ezffti = \&PDL::ezffti;
  748 #line 749 "Slatec.pm"
  749 
  750 
  751 
  752 #line 948 "../../blib/lib/PDL/PP.pm"
  753 
  754 
  755 
  756 =head2 ezfftf
  757 
  758 =for sig
  759 
  760   Signature: (r(n);[o]azero();[o]a(n);[o]b(n);wsave(foo))
  761 
  762 =for ref
  763 
  764 
  765 
  766 =for bad
  767 
  768 ezfftf does not process bad values.
  769 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  770 
  771 
  772 =cut
  773 #line 774 "Slatec.pm"
  774 
  775 
  776 
  777 #line 950 "../../blib/lib/PDL/PP.pm"
  778 
  779 *ezfftf = \&PDL::ezfftf;
  780 #line 781 "Slatec.pm"
  781 
  782 
  783 
  784 #line 948 "../../blib/lib/PDL/PP.pm"
  785 
  786 
  787 
  788 =head2 ezfftb
  789 
  790 =for sig
  791 
  792   Signature: ([o]r(n);azero();a(n);b(n);wsave(foo))
  793 
  794 =for ref
  795 
  796 
  797 
  798 =for bad
  799 
  800 ezfftb does not process bad values.
  801 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  802 
  803 
  804 =cut
  805 #line 806 "Slatec.pm"
  806 
  807 
  808 
  809 #line 950 "../../blib/lib/PDL/PP.pm"
  810 
  811 *ezfftb = \&PDL::ezfftb;
  812 #line 813 "Slatec.pm"
  813 
  814 
  815 
  816 #line 948 "../../blib/lib/PDL/PP.pm"
  817 
  818 
  819 
  820 =head2 pcoef
  821 
  822 =for sig
  823 
  824   Signature: (longlong l();c();[o]tc(bar);a(foo))
  825 
  826 Convert the C<polfit> coefficients to Taylor series form.
  827 C<c> and C<a()> must be of the same type.
  828 
  829 =for bad
  830 
  831 pcoef does not process bad values.
  832 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  833 
  834 
  835 =cut
  836 #line 837 "Slatec.pm"
  837 
  838 
  839 
  840 #line 950 "../../blib/lib/PDL/PP.pm"
  841 
  842 *pcoef = \&PDL::pcoef;
  843 #line 844 "Slatec.pm"
  844 
  845 
  846 
  847 #line 948 "../../blib/lib/PDL/PP.pm"
  848 
  849 
  850 
  851 =head2 pvalue
  852 
  853 =for sig
  854 
  855   Signature: (longlong l();x();[o]yfit();[o]yp(nder);a(foo))
  856 
  857 Use the coefficients generated by C<polfit> to evaluate the
  858 polynomial fit of degree C<l>, along with the first C<nder> of
  859 its derivatives, at a specified point. C<x> and C<a> must be of the
  860 same type.
  861 
  862 =for bad
  863 
  864 pvalue does not process bad values.
  865 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  866 
  867 
  868 =cut
  869 #line 870 "Slatec.pm"
  870 
  871 
  872 
  873 #line 950 "../../blib/lib/PDL/PP.pm"
  874 
  875 *pvalue = \&PDL::pvalue;
  876 #line 877 "Slatec.pm"
  877 
  878 
  879 
  880 #line 948 "../../blib/lib/PDL/PP.pm"
  881 
  882 
  883 
  884 =head2 chim
  885 
  886 =for sig
  887 
  888   Signature: (x(n);f(n);[o]d(n);longlong [o]ierr())
  889 
  890 
  891 =for ref
  892 
  893 Calculate the derivatives of (x,f(x)) using cubic Hermite interpolation.
  894 
  895 Calculate the derivatives at the given set of points (C<$x,$f>,
  896 where C<$x> is strictly increasing).
  897 The resulting set of points - C<$x,$f,$d>, referred to
  898 as the cubic Hermite representation - can then be used in
  899 other functions, such as L</chfe>, L</chfd>,
  900 and L</chia>.
  901 
  902 The boundary conditions are compatible with monotonicity,
  903 and if the data are only piecewise monotonic, the interpolant
  904 will have an extremum at the switch points; for more control
  905 over these issues use L</chic>. 
  906 
  907 Error status returned by C<$ierr>:
  908 
  909 =over 4
  910 
  911 =item *
  912 
  913 0 if successful.
  914 
  915 =item *
  916 
  917 E<gt> 0 if there were C<ierr> switches in the direction of 
  918 monotonicity (data still valid).
  919 
  920 =item *
  921 
  922 -1 if C<nelem($x) E<lt> 2>.
  923 
  924 =item *
  925 
  926 -3 if C<$x> is not strictly increasing.
  927 
  928 =back
  929 
  930 
  931 
  932 =for bad
  933 
  934 chim does not process bad values.
  935 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
  936 
  937 
  938 =cut
  939 #line 940 "Slatec.pm"
  940 
  941 
  942 
  943 #line 950 "../../blib/lib/PDL/PP.pm"
  944 
  945 *chim = \&PDL::chim;
  946 #line 947 "Slatec.pm"
  947 
  948 
  949 
  950 #line 948 "../../blib/lib/PDL/PP.pm"
  951 
  952 
  953 
  954 =head2 chic
  955 
  956 =for sig
  957 
  958   Signature: (longlong ic(two=2);vc(two=2);mflag();x(n);f(n);[o]d(n);wk(nwk);longlong [o]ierr())
  959 
  960 
  961 =for ref
  962 
  963 Calculate the derivatives of (x,f(x)) using cubic Hermite interpolation.
  964 
  965 Calculate the derivatives at the given points (C<$x,$f>,
  966 where C<$x> is strictly increasing).
  967 Control over the boundary conditions is given by the 
  968 C<$ic> and C<$vc> ndarrays, and the value of C<$mflag> determines
  969 the treatment of points where monotoncity switches
  970 direction. A simpler, more restricted, interface is available 
  971 using L</chim>.
  972 
  973 The first and second elements of C<$ic> determine the boundary
  974 conditions at the start and end of the data respectively.
  975 If the value is 0, then the default condition, as used by
  976 L</chim>, is adopted.
  977 If greater than zero, no adjustment for monotonicity is made,
  978 otherwise if less than zero the derivative will be adjusted.
  979 The allowed magnitudes for C<ic(0)> are:
  980 
  981 =over 4
  982 
  983 =item *  
  984 
  985 1 if first derivative at C<x(0)> is given in C<vc(0)>.
  986 
  987 =item *
  988 
  989 2 if second derivative at C<x(0)> is given in C<vc(0)>.
  990 
  991 =item *
  992 
  993 3 to use the 3-point difference formula for C<d(0)>.
  994 (Reverts to the default b.c. if C<n E<lt> 3>)
  995 
  996 =item *
  997 
  998 4 to use the 4-point difference formula for C<d(0)>.
  999 (Reverts to the default b.c. if C<n E<lt> 4>)
 1000 
 1001 =item *
 1002 
 1003 5 to set C<d(0)> so that the second derivative is 
 1004 continuous at C<x(1)>.
 1005 (Reverts to the default b.c. if C<n E<lt> 4>) 
 1006 
 1007 =back
 1008 
 1009 The values for C<ic(1)> are the same as above, except that
 1010 the first-derivative value is stored in C<vc(1)> for cases 1 and 2.
 1011 The values of C<$vc> need only be set if options 1 or 2 are chosen
 1012 for C<$ic>.
 1013 
 1014 Set C<$mflag = 0> if interpolant is required to be monotonic in
 1015 each interval, regardless of the data. This causes C<$d> to be
 1016 set to 0 at all switch points. Set C<$mflag> to be non-zero to
 1017 use a formula based on the 3-point difference formula at switch
 1018 points. If C<$mflag E<gt> 0>, then the interpolant at swich points
 1019 is forced to not deviate from the data by more than C<$mflag*dfloc>, 
 1020 where C<dfloc> is the maximum of the change of C<$f> on this interval
 1021 and its two immediate neighbours.
 1022 If C<$mflag E<lt> 0>, no such control is to be imposed.            
 1023 
 1024 The ndarray C<$wk> is only needed for work space. However, I could
 1025 not get it to work as a temporary variable, so you must supply
 1026 it; it is a 1D ndarray with C<2*n> elements.
 1027 
 1028 Error status returned by C<$ierr>:
 1029 
 1030 =over 4
 1031 
 1032 =item *
 1033 
 1034 0 if successful.
 1035 
 1036 =item *
 1037 
 1038 1 if C<ic(0) E<lt> 0> and C<d(0)> had to be adjusted for
 1039 monotonicity.
 1040 
 1041 =item *
 1042 
 1043 2 if C<ic(1) E<lt> 0> and C<d(n-1)> had to be adjusted
 1044 for monotonicity.
 1045 
 1046 =item * 
 1047 
 1048 3 if both 1 and 2 are true.
 1049 
 1050 =item *
 1051 
 1052 -1 if C<n E<lt> 2>.
 1053 
 1054 =item *
 1055 
 1056 -3 if C<$x> is not strictly increasing.
 1057 
 1058 =item *
 1059 
 1060 -4 if C<abs(ic(0)) E<gt> 5>.
 1061 
 1062 =item *
 1063 
 1064 -5 if C<abs(ic(1)) E<gt> 5>.
 1065 
 1066 =item *
 1067 
 1068 -6 if both -4 and -5  are true.
 1069 
 1070 =item *
 1071 
 1072 -7 if C<nwk E<lt> 2*(n-1)>.
 1073 
 1074 =back
 1075 
 1076 
 1077 
 1078 =for bad
 1079 
 1080 chic does not process bad values.
 1081 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1082 
 1083 
 1084 =cut
 1085 #line 1086 "Slatec.pm"
 1086 
 1087 
 1088 
 1089 #line 950 "../../blib/lib/PDL/PP.pm"
 1090 
 1091 *chic = \&PDL::chic;
 1092 #line 1093 "Slatec.pm"
 1093 
 1094 
 1095 
 1096 #line 948 "../../blib/lib/PDL/PP.pm"
 1097 
 1098 
 1099 
 1100 =head2 chsp
 1101 
 1102 =for sig
 1103 
 1104   Signature: (longlong ic(two=2);vc(two=2);x(n);f(n);[o]d(n);wk(nwk);longlong [o]ierr())
 1105 
 1106 
 1107 =for ref
 1108 
 1109 Calculate the derivatives of (x,f(x)) using cubic spline interpolation.
 1110 
 1111 Calculate the derivatives, using cubic spline interpolation,
 1112 at the given points (C<$x,$f>), with the specified
 1113 boundary conditions. 
 1114 Control over the boundary conditions is given by the 
 1115 C<$ic> and C<$vc> ndarrays.
 1116 The resulting values - C<$x,$f,$d> - can
 1117 be used in all the functions which expect a cubic
 1118 Hermite function.
 1119 
 1120 The first and second elements of C<$ic> determine the boundary
 1121 conditions at the start and end of the data respectively.
 1122 The allowed values for C<ic(0)> are:
 1123 
 1124 =over 4
 1125 
 1126 =item *
 1127 
 1128 0 to set C<d(0)> so that the third derivative is 
 1129 continuous at C<x(1)>.
 1130 
 1131 =item *
 1132 
 1133 1 if first derivative at C<x(0)> is given in C<vc(0>).
 1134 
 1135 =item *
 1136 
 1137 2 if second derivative at C<x(0>) is given in C<vc(0)>.
 1138 
 1139 =item *
 1140 
 1141 3 to use the 3-point difference formula for C<d(0)>.
 1142 (Reverts to the default b.c. if C<n E<lt> 3>.)
 1143 
 1144 =item *
 1145 
 1146 4 to use the 4-point difference formula for C<d(0)>.
 1147 (Reverts to the default b.c. if C<n E<lt> 4>.)                 
 1148 
 1149 =back
 1150 
 1151 The values for C<ic(1)> are the same as above, except that
 1152 the first-derivative value is stored in C<vc(1)> for cases 1 and 2.
 1153 The values of C<$vc> need only be set if options 1 or 2 are chosen
 1154 for C<$ic>.
 1155 
 1156 The ndarray C<$wk> is only needed for work space. However, I could
 1157 not get it to work as a temporary variable, so you must supply
 1158 it; it is a 1D ndarray with C<2*n> elements.
 1159 
 1160 Error status returned by C<$ierr>:
 1161 
 1162 =over 4
 1163 
 1164 =item *
 1165 
 1166 0 if successful.
 1167 
 1168 =item *
 1169 
 1170 -1  if C<nelem($x) E<lt> 2>.
 1171 
 1172 =item *
 1173 
 1174 -3  if C<$x> is not strictly increasing.
 1175 
 1176 =item *
 1177 
 1178 -4  if C<ic(0) E<lt> 0> or C<ic(0) E<gt> 4>.
 1179 
 1180 =item *
 1181 
 1182 -5  if C<ic(1) E<lt> 0> or C<ic(1) E<gt> 4>.
 1183 
 1184 =item *
 1185 
 1186 -6  if both of the above are true.
 1187 
 1188 =item *
 1189 
 1190 -7  if C<nwk E<lt> 2*n>.
 1191 
 1192 =item *
 1193 
 1194 -8  in case of trouble solving the linear system
 1195 for the interior derivative values.
 1196 
 1197 =back
 1198 
 1199 
 1200 
 1201 =for bad
 1202 
 1203 chsp does not process bad values.
 1204 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1205 
 1206 
 1207 =cut
 1208 #line 1209 "Slatec.pm"
 1209 
 1210 
 1211 
 1212 #line 950 "../../blib/lib/PDL/PP.pm"
 1213 
 1214 *chsp = \&PDL::chsp;
 1215 #line 1216 "Slatec.pm"
 1216 
 1217 
 1218 
 1219 #line 948 "../../blib/lib/PDL/PP.pm"
 1220 
 1221 
 1222 
 1223 =head2 chfd
 1224 
 1225 =for sig
 1226 
 1227   Signature: (x(n);f(n);d(n);longlong check();xe(ne);[o]fe(ne);[o]de(ne);longlong [o]ierr())
 1228 
 1229 
 1230 =for ref
 1231 
 1232 Interpolate function and derivative values.
 1233 
 1234 Given a piecewise cubic Hermite function - such as from
 1235 L</chim> - evaluate the function (C<$fe>) and 
 1236 derivative (C<$de>) at a set of points (C<$xe>).
 1237 If function values alone are required, use L</chfe>.
 1238 Set C<check> to 0 to skip checks on the input data.
 1239 
 1240 Error status returned by C<$ierr>:
 1241 
 1242 =over 4
 1243 
 1244 =item *
 1245 
 1246 0 if successful.
 1247 
 1248 =item *
 1249 
 1250 E<gt>0 if extrapolation was performed at C<ierr> points
 1251 (data still valid).
 1252 
 1253 =item *
 1254 
 1255 -1 if C<nelem($x) E<lt> 2>
 1256 
 1257 =item *
 1258 
 1259 -3 if C<$x> is not strictly increasing.
 1260 
 1261 =item *
 1262 
 1263 -4 if C<nelem($xe) E<lt> 1>.
 1264 
 1265 =item *
 1266 
 1267 -5 if an error has occurred in a lower-level routine,
 1268 which should never happen.
 1269 
 1270 =back
 1271 
 1272 
 1273 
 1274 =for bad
 1275 
 1276 chfd does not process bad values.
 1277 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1278 
 1279 
 1280 =cut
 1281 #line 1282 "Slatec.pm"
 1282 
 1283 
 1284 
 1285 #line 950 "../../blib/lib/PDL/PP.pm"
 1286 
 1287 *chfd = \&PDL::chfd;
 1288 #line 1289 "Slatec.pm"
 1289 
 1290 
 1291 
 1292 #line 948 "../../blib/lib/PDL/PP.pm"
 1293 
 1294 
 1295 
 1296 =head2 chfe
 1297 
 1298 =for sig
 1299 
 1300   Signature: (x(n);f(n);d(n);longlong check();xe(ne);[o]fe(ne);longlong [o]ierr())
 1301 
 1302 
 1303 =for ref
 1304 
 1305 Interpolate function values.
 1306 
 1307 Given a piecewise cubic Hermite function - such as from
 1308 L</chim> - evaluate the function (C<$fe>) at
 1309 a set of points (C<$xe>).
 1310 If derivative values are also required, use L</chfd>.
 1311 Set C<check> to 0 to skip checks on the input data.
 1312 
 1313 Error status returned by C<$ierr>:
 1314 
 1315 =over 4
 1316 
 1317 =item *
 1318 
 1319 0 if successful.
 1320 
 1321 =item *
 1322 
 1323 E<gt>0 if extrapolation was performed at C<ierr> points
 1324 (data still valid).
 1325 
 1326 =item *
 1327 
 1328 -1 if C<nelem($x) E<lt> 2>
 1329 
 1330 =item *
 1331 
 1332 -3 if C<$x> is not strictly increasing.
 1333 
 1334 =item *
 1335 
 1336 -4 if C<nelem($xe) E<lt> 1>.
 1337 
 1338 =back
 1339 
 1340 
 1341 
 1342 =for bad
 1343 
 1344 chfe does not process bad values.
 1345 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1346 
 1347 
 1348 =cut
 1349 #line 1350 "Slatec.pm"
 1350 
 1351 
 1352 
 1353 #line 950 "../../blib/lib/PDL/PP.pm"
 1354 
 1355 *chfe = \&PDL::chfe;
 1356 #line 1357 "Slatec.pm"
 1357 
 1358 
 1359 
 1360 #line 948 "../../blib/lib/PDL/PP.pm"
 1361 
 1362 
 1363 
 1364 =head2 chia
 1365 
 1366 =for sig
 1367 
 1368   Signature: (x(n);f(n);d(n);longlong check();la();lb();[o]ans();longlong [o]ierr())
 1369 
 1370 
 1371 =for ref
 1372 
 1373 Integrate (x,f(x)) over arbitrary limits.
 1374 
 1375 Evaluate the definite integral of a piecewise
 1376 cubic Hermite function over an arbitrary interval,
 1377 given by C<[$la,$lb]>. C<$d> should contain the derivative values, computed by L</chim>.
 1378 See L</chid> if the integration limits are
 1379 data points.
 1380 Set C<check> to 0 to skip checks on the input data.
 1381 
 1382 The values of C<$la> and C<$lb> do not have
 1383 to lie within C<$x>, although the resulting integral
 1384 value will be highly suspect if they are not.
 1385 
 1386 Error status returned by C<$ierr>:
 1387 
 1388 =over 4
 1389 
 1390 =item *
 1391 
 1392 0 if successful.
 1393 
 1394 =item *
 1395 
 1396 1 if C<$la> lies outside C<$x>.
 1397 
 1398 =item *
 1399 
 1400 2 if C<$lb> lies outside C<$x>.
 1401 
 1402 =item *
 1403 
 1404 3 if both 1 and 2 are true.
 1405 
 1406 =item *
 1407 
 1408 -1 if C<nelem($x) E<lt> 2>
 1409 
 1410 =item *
 1411 
 1412 -3 if C<$x> is not strictly increasing.
 1413 
 1414 =item *
 1415 
 1416 -4 if an error has occurred in a lower-level routine,
 1417 which should never happen.
 1418 
 1419 =back
 1420 
 1421 
 1422 
 1423 =for bad
 1424 
 1425 chia does not process bad values.
 1426 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1427 
 1428 
 1429 =cut
 1430 #line 1431 "Slatec.pm"
 1431 
 1432 
 1433 
 1434 #line 950 "../../blib/lib/PDL/PP.pm"
 1435 
 1436 *chia = \&PDL::chia;
 1437 #line 1438 "Slatec.pm"
 1438 
 1439 
 1440 
 1441 #line 948 "../../blib/lib/PDL/PP.pm"
 1442 
 1443 
 1444 
 1445 =head2 chid
 1446 
 1447 =for sig
 1448 
 1449   Signature: (x(n);f(n);d(n);longlong check();longlong ia();longlong ib();[o]ans();longlong [o]ierr())
 1450 
 1451 
 1452 =for ref
 1453 
 1454 Integrate (x,f(x)) between data points.
 1455 
 1456 Evaluate the definite integral of a a piecewise
 1457 cubic Hermite function between C<x($ia)> and
 1458 C<x($ib)>. 
 1459 
 1460 See L</chia> for integration between arbitrary
 1461 limits.
 1462 
 1463 Although using a fortran routine, the values of
 1464 C<$ia> and C<$ib> are zero offset.
 1465 C<$d> should contain the derivative values, computed by L</chim>.
 1466 Set C<check> to 0 to skip checks on the input data.
 1467 
 1468 Error status returned by C<$ierr>:
 1469 
 1470 =over 4
 1471 
 1472 =item *
 1473 
 1474 0 if successful.
 1475 
 1476 =item *
 1477 
 1478 -1 if C<nelem($x) E<lt> 2>.
 1479 
 1480 =item *
 1481 
 1482 -3 if C<$x> is not strictly increasing.
 1483 
 1484 =item *
 1485 
 1486 -4 if C<$ia> or C<$ib> is out of range.
 1487 
 1488 =back
 1489 
 1490 
 1491 
 1492 =for bad
 1493 
 1494 chid does not process bad values.
 1495 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1496 
 1497 
 1498 =cut
 1499 #line 1500 "Slatec.pm"
 1500 
 1501 
 1502 
 1503 #line 950 "../../blib/lib/PDL/PP.pm"
 1504 
 1505 *chid = \&PDL::chid;
 1506 #line 1507 "Slatec.pm"
 1507 
 1508 
 1509 
 1510 #line 948 "../../blib/lib/PDL/PP.pm"
 1511 
 1512 
 1513 
 1514 =head2 chcm
 1515 
 1516 =for sig
 1517 
 1518   Signature: (x(n);f(n);d(n);longlong check();longlong [o]ismon(n);longlong [o]ierr())
 1519 
 1520 
 1521 =for ref
 1522 
 1523 Check the given piecewise cubic Hermite function for monotonicity.
 1524 
 1525 The outout ndarray C<$ismon> indicates over
 1526 which intervals the function is monotonic.
 1527 Set C<check> to 0 to skip checks on the input data.
 1528 
 1529 For the data interval C<[x(i),x(i+1)]>, the
 1530 values of C<ismon(i)> can be:
 1531 
 1532 =over 4
 1533 
 1534 =item *
 1535 
 1536 -3 if function is probably decreasing
 1537 
 1538 =item *
 1539 
 1540 -1 if function is strictly decreasing
 1541 
 1542 =item *
 1543 
 1544 0  if function is constant
 1545 
 1546 =item *
 1547 
 1548 1  if function is strictly increasing
 1549 
 1550 =item *
 1551 
 1552 2  if function is non-monotonic
 1553 
 1554 =item *
 1555 
 1556 3  if function is probably increasing
 1557 
 1558 =back
 1559 
 1560 If C<abs(ismon(i)) == 3>, the derivative values are
 1561 near the boundary of the monotonicity region. A small
 1562 increase produces non-monotonicity, whereas a decrease
 1563 produces strict monotonicity.
 1564 
 1565 The above applies to C<i = 0 .. nelem($x)-1>. The last element of
 1566 C<$ismon> indicates whether
 1567 the entire function is monotonic over $x.
 1568 
 1569 Error status returned by C<$ierr>:
 1570 
 1571 =over 4
 1572 
 1573 =item *
 1574 
 1575 0 if successful.
 1576 
 1577 =item *
 1578 
 1579 -1 if C<n E<lt> 2>.
 1580 
 1581 =item *
 1582 
 1583 -3 if C<$x> is not strictly increasing.
 1584 
 1585 =back
 1586 
 1587 
 1588 
 1589 =for bad
 1590 
 1591 chcm does not process bad values.
 1592 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1593 
 1594 
 1595 =cut
 1596 #line 1597 "Slatec.pm"
 1597 
 1598 
 1599 
 1600 #line 950 "../../blib/lib/PDL/PP.pm"
 1601 
 1602 *chcm = \&PDL::chcm;
 1603 #line 1604 "Slatec.pm"
 1604 
 1605 
 1606 
 1607 #line 948 "../../blib/lib/PDL/PP.pm"
 1608 
 1609 
 1610 
 1611 =head2 chbs
 1612 
 1613 =for sig
 1614 
 1615   Signature: (x(n);f(n);d(n);longlong knotyp();longlong nknots();t(tsize);[o]bcoef(bsize);longlong [o]ndim();longlong [o]kord();longlong [o]ierr())
 1616 
 1617 
 1618 =for ref
 1619 
 1620 Piecewise Cubic Hermite function to B-Spline converter.
 1621 
 1622 The resulting B-spline representation of the data
 1623 (i.e. C<nknots>, C<t>, C<bcoeff>, C<ndim>, and
 1624 C<kord>) can be evaluated by C<bvalu> (which is 
 1625 currently not available).
 1626 
 1627 Array sizes: C<tsize = 2*n + 4>, C<bsize = 2*n>,
 1628 and C<ndim = 2*n>.
 1629 
 1630 C<knotyp> is a flag which controls the knot sequence.
 1631 The knot sequence C<t> is normally computed from C<$x> 
 1632 by putting a double knot at each C<x> and setting the end knot pairs
 1633 according to the value of C<knotyp> (where C<m = ndim = 2*n>):
 1634 
 1635 =over
 1636 
 1637 =item *
 1638 
 1639 0 -   Quadruple knots at the first and last points.
 1640 
 1641 =item *
 1642 
 1643 1 -   Replicate lengths of extreme subintervals:
 1644 C<t( 0 ) = t( 1 ) = x(0) - (x(1)-x(0))> and
 1645 C<t(m+3) = t(m+2) = x(n-1) + (x(n-1)-x(n-2))>
 1646 
 1647 =item *
 1648 
 1649 2 -   Periodic placement of boundary knots:
 1650 C<t( 0 ) = t( 1 ) = x(0) - (x(n-1)-x(n-2))> and
 1651 C<t(m+3) = t(m+2) = x(n) + (x(1)-x(0))>
 1652 
 1653 =item *
 1654 
 1655 E<lt>0 - Assume the C<nknots> and C<t> were set in a previous call.
 1656 
 1657 =back
 1658 
 1659 C<nknots> is the number of knots and may be changed by the routine. 
 1660 If C<knotyp E<gt>= 0>, C<nknots> will be set to C<ndim+4>,
 1661 otherwise it is an input variable, and an error will occur if its
 1662 value is not equal to C<ndim+4>.
 1663 
 1664 C<t> is the array of C<2*n+4> knots for the B-representation
 1665 and may be changed by the routine.
 1666 If C<knotyp E<gt>= 0>, C<t> will be changed so that the
 1667 interior double knots are equal to the x-values and the
 1668 boundary knots set as indicated above,
 1669 otherwise it is assumed that C<t> was set by a
 1670 previous call (no check is made to verify that the data
 1671 forms a legitimate knot sequence). 
 1672 
 1673 Error status returned by C<$ierr>:
 1674 
 1675 =over 4
 1676 
 1677 =item *
 1678 
 1679 0 if successful.
 1680 
 1681 =item *
 1682 
 1683 -4 if C<knotyp E<gt> 2>.
 1684 
 1685 =item *
 1686 
 1687 -5 if C<knotyp E<lt> 0> and C<nknots != 2*n + 4>.
 1688 
 1689 =back
 1690 
 1691 
 1692 
 1693 =for bad
 1694 
 1695 chbs does not process bad values.
 1696 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1697 
 1698 
 1699 =cut
 1700 #line 1701 "Slatec.pm"
 1701 
 1702 
 1703 
 1704 #line 950 "../../blib/lib/PDL/PP.pm"
 1705 
 1706 *chbs = \&PDL::chbs;
 1707 #line 1708 "Slatec.pm"
 1708 
 1709 
 1710 
 1711 #line 948 "../../blib/lib/PDL/PP.pm"
 1712 
 1713 
 1714 
 1715 =head2 polfit
 1716 
 1717 =for sig
 1718 
 1719   Signature: (x(n); y(n); w(n); longlong maxdeg(); longlong [o]ndeg(); [o]eps(); [o]r(n); longlong [o]ierr(); [o]a(foo); [o]coeffs(bar);[t]xtmp(n);[t]ytmp(n);[t]wtmp(n);[t]rtmp(n))
 1720 
 1721 Fit discrete data in a least squares sense by polynomials
 1722           in one variable. C<x()>, C<y()> and C<w()> must be of the same type.
 1723       This version handles bad values appropriately
 1724 
 1725 =for bad
 1726 
 1727 polfit processes bad values.
 1728 It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
 1729 
 1730 
 1731 =cut
 1732 #line 1733 "Slatec.pm"
 1733 
 1734 
 1735 
 1736 #line 950 "../../blib/lib/PDL/PP.pm"
 1737 
 1738 *polfit = \&PDL::polfit;
 1739 #line 1740 "Slatec.pm"
 1740 
 1741 
 1742 
 1743 #line 1580 "slatec.pd"
 1744 
 1745 =head1 AUTHOR
 1746 
 1747 Copyright (C) 1997 Tuomas J. Lukka. 
 1748 Copyright (C) 2000 Tim Jenness, Doug Burke.            
 1749 All rights reserved. There is no warranty. You are allowed
 1750 to redistribute this software / documentation under certain
 1751 conditions. For details, see the file COPYING in the PDL 
 1752 distribution. If this file is separated from the PDL distribution, 
 1753 the copyright notice should be included in the file.
 1754 
 1755 =cut
 1756 #line 1757 "Slatec.pm"
 1757 
 1758 
 1759 
 1760 
 1761 
 1762 
 1763 # Exit with OK status
 1764 
 1765 1;