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

skipping to change at line 123 | skipping to change at line 123 | |||

($inv) = matinv($mat) | ($inv) = matinv($mat) | |||

=head2 polyfit | =head2 polyfit | |||

Convenience wrapper routine about the C<polfit> C<slatec> function. | Convenience wrapper routine about the C<polfit> C<slatec> function. | |||

Separates supplied arguments and return values. | Separates supplied arguments and return values. | |||

=for ref | =for ref | |||

Fit discrete data in a least squares sense by polynomials | Fit discrete data in a least squares sense by polynomials | |||

in one variable. Handles threading correctly--one can pass in a 2D PDL (as C<$y >) | in one variable. Handles broadcasting correctly--one can pass in a 2D PDL (as C <$y>) | |||

and it will pass back a 2D PDL, the rows of which are the polynomial regression | and it will pass back a 2D PDL, the rows of which are the polynomial regression | |||

results (in C<$r> corresponding to the rows of $y. | results (in C<$r> corresponding to the rows of $y. | |||

=for usage | =for usage | |||

($ndeg, $r, $ierr, $c, $coeffs, $rms) = polyfit($x, $y, $w, $maxdeg, [$eps]); | ($ndeg, $r, $ierr, $c, $coeffs, $rms) = polyfit($x, $y, $w, $maxdeg, [$eps]); | |||

$coeffs = polyfit($x,$y,$w,$maxdeg,[$eps]); | $coeffs = polyfit($x,$y,$w,$maxdeg,[$eps]); | |||

where on input: | where on input: | |||

skipping to change at line 158 | skipping to change at line 158 | |||

C<$coeffs> is the polynomial coefficients of the best fit polynomial. | C<$coeffs> is the polynomial coefficients of the best fit polynomial. | |||

C<$rms> is the rms error of the fit. | C<$rms> is the rms error of the fit. | |||

In scalar context, only $coeffs is returned. | In scalar context, only $coeffs is returned. | |||

Historically, C<$eps> was modified in-place to be a return value of the | Historically, C<$eps> was modified in-place to be a return value of the | |||

rms error. This usage is deprecated, and C<$eps> is an optional parameter now. | rms error. This usage is deprecated, and C<$eps> is an optional parameter now. | |||

It is still modified if present. | It is still modified if present. | |||

C<$c> is a working array accessible to Slatec - you can feed it to several | C<$c> is a working array accessible to Slatec - you can feed it to several | |||

other Slatec routines to get nice things out. It does not thread | other Slatec routines to get nice things out. It does not broadcast | |||

correctly and should probably be fixed by someone. If you are | correctly and should probably be fixed by someone. If you are | |||

reading this, that someone might be you. | reading this, that someone might be you. | |||

=for bad | =for bad | |||

This version of polyfit handles bad values correctly. Bad values in | This version of polyfit handles bad values correctly. Bad values in | |||

$y are ignored for the fit and give computed values on the fitted | $y are ignored for the fit and give computed values on the fitted | |||

curve in the return. Bad values in $x or $w are ignored for the fit and | curve in the return. Bad values in $x or $w are ignored for the fit and | |||

result in bad elements in the output. | result in bad elements in the output. | |||

skipping to change at line 225 | skipping to change at line 225 | |||

=for usage | =for usage | |||

$determinant = detslatec $matrix; | $determinant = detslatec $matrix; | |||

=for sig | =for sig | |||

Signature: detslatec(mat(n,m); [o] det()) | Signature: detslatec(mat(n,m); [o] det()) | |||

C<detslatec> computes the determinant of an invertible matrix and barfs if | C<detslatec> computes the determinant of an invertible matrix and barfs if | |||

the matrix argument provided is non-invertible. The matrix threads as usual. | the matrix argument provided is non-invertible. The matrix broadcasts as usual. | |||

This routine was previously known as C<det> which clashes now with | This routine was previously known as C<det> which clashes now with | |||

L<det|PDL::MatrixOps/det> which is provided by L<PDL::MatrixOps>. | L<det|PDL::MatrixOps/det> which is provided by L<PDL::MatrixOps>. | |||

=head2 fft | =head2 fft | |||

=for ref | =for ref | |||

Fast Fourier Transform | Fast Fourier Transform | |||

skipping to change at line 1498 | skipping to change at line 1498 | |||

=cut | =cut | |||

', | ', | |||

'Piecewise Cubic Hermite function to B-Spline converter.' | 'Piecewise Cubic Hermite function to B-Spline converter.' | |||

); | ); | |||

################################################################## | ################################################################## | |||

################################################################## | ################################################################## | |||

# | # | |||

# This version of polfit accepts bad values and also allows threading | # This version of polfit accepts bad values and also allows broadcasting | |||

# | # | |||

# | # | |||

# indices: | # indices: | |||

# n runs across input points; | # n runs across input points; | |||

# foo runs across wacky Slatec buffer size; | # foo runs across wacky Slatec buffer size; | |||

# bar runs across polynomial coefficients. | # bar runs across polynomial coefficients. | |||

# | # | |||

pp_def('polfit', | pp_def('polfit', | |||

Pars => '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]wt mp(n);[t]rtmp(n)', | Pars => '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]wt mp(n);[t]rtmp(n)', | |||

End of changes. 4 change blocks. | ||||

4 lines changed or deleted | | 4 lines changed or added |