PDL-Complex
view release on metacpan or search on metacpan
GENERATED/PDL/Complex.pm view on Meta::CPAN
Cproj does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut
BEGIN {*Cproj = \&PDL::Complex::Cproj;
}
=head2 Croots
=for sig
Signature: (a(m=2); [o]c(m=2,n); int n => n)
=for ref
Compute the C<n> roots of C<a>. C<n> must be a positive integer. The result will always be a complex type!
=for bad
Croots does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut
sub PDL::Complex::Croots($$) {
my ($pdl, $n) = @_;
my $r = PDL->null;
&PDL::Complex::_Croots_int($pdl, $r, $n);
bless $r;
}
BEGIN {*Croots = \&PDL::Complex::Croots;
}
#line 1027 "complex.pd"
=head2 re, im
Return the real or imaginary part of the complex number(s) given.
These are slicing operators, so data flow works. The real and
imaginary parts are returned as ndarrays (ref eq PDL).
=cut
sub re($) { $_[0]->slice("(0)") }
sub im($) { $_[0]->slice("(1)") }
{
no warnings 'redefine';
# if the argument does anything other than pass through 0-th dim, re-bless
sub slice :lvalue {
my $first = ref $_[1] ? $_[1][0] : (split ',', $_[1])[0];
my $class = ($first//'') =~ /^[:x]?$/i ? ref($_[0]) : 'PDL';
my $ret = bless $_[0]->SUPER::slice(@_[1..$#_]), $class;
$ret;
}
}
#line 1310 "Complex.pm"
=head2 rCpolynomial
=for sig
Signature: (coeffs(n); x(c=2,m); [o]out(c=2,m))
=for ref
evaluate the polynomial with (real) coefficients C<coeffs> at the (complex) position(s) C<x>. C<coeffs[0]> is the constant term.
=for bad
rCpolynomial does not process bad values.
It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
=cut
sub rCpolynomial {
my $coeffs = shift;
my $x = shift;
my $out = $x->copy;
_rCpolynomial_int($coeffs,$x,$out);
return PDL::complex($out);
}
BEGIN {*rCpolynomial = \&PDL::Complex::rCpolynomial;
}
=head2 Ctricpy
=for sig
Signature: (A(c=2,m,n);[o] C(c=2,m,n); int uplo)
=for usage
( run in 1.976 second using v1.01-cache-2.11-cpan-524268b4103 )