NAME
PDL::Ops - Fundamental mathematical operators
DESCRIPTION
This module provides the functions used by PDL to overload the basic mathematical operators (+ - / *
etc.) and functions (sin sqrt
etc.)
It also includes the function log10
, which should be a perl function so that we can overload it!
Matrix multiplication (the operator x
) is handled by the module PDL::Primitive.
SYNOPSIS
none
FUNCTIONS
plus
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
+
$b
;
# overloads the Perl '+' operator
$a
+=
$b
;
$c
= PDL::plus(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::plus(
$a
,
$b
,
$swap
);
# overriding default
PDL::plus(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->plus(
$b
);
# method call
$c
=
$a
->plus(
$b
,
$swap
);
$a
->plus(
$b
,
$c
,
$swap
);
$a
->inplace->plus(
$b
,
$swap
);
# can be used inplace
PDL::plus(
$a
->inplace,
$b
,
$swap
);
add two ndarrays
Broadcasts over its inputs.
plus
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
mult
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
*
$b
;
# overloads the Perl '*' operator
$a
*=
$b
;
$c
= PDL::mult(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::mult(
$a
,
$b
,
$swap
);
# overriding default
PDL::mult(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->mult(
$b
);
# method call
$c
=
$a
->mult(
$b
,
$swap
);
$a
->mult(
$b
,
$c
,
$swap
);
$a
->inplace->mult(
$b
,
$swap
);
# can be used inplace
PDL::mult(
$a
->inplace,
$b
,
$swap
);
multiply two ndarrays
Broadcasts over its inputs.
mult
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
minus
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
-
$b
;
# overloads the Perl '-' operator
$a
-=
$b
;
$c
= PDL::minus(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::minus(
$a
,
$b
,
$swap
);
# overriding default
PDL::minus(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->minus(
$b
);
# method call
$c
=
$a
->minus(
$b
,
$swap
);
$a
->minus(
$b
,
$c
,
$swap
);
$a
->inplace->minus(
$b
,
$swap
);
# can be used inplace
PDL::minus(
$a
->inplace,
$b
,
$swap
);
subtract two ndarrays
Broadcasts over its inputs.
minus
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
divide
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
/
$b
;
# overloads the Perl '/' operator
$a
/=
$b
;
$c
= PDL::divide(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::divide(
$a
,
$b
,
$swap
);
# overriding default
PDL::divide(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->divide(
$b
);
# method call
$c
=
$a
->divide(
$b
,
$swap
);
$a
->divide(
$b
,
$c
,
$swap
);
$a
->inplace->divide(
$b
,
$swap
);
# can be used inplace
PDL::divide(
$a
->inplace,
$b
,
$swap
);
divide two ndarrays
Broadcasts over its inputs.
divide
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
gt
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
>
$b
;
# overloads the Perl '>' operator
$c
= PDL::gt(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::gt(
$a
,
$b
,
$swap
);
# overriding default
PDL::gt(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->gt(
$b
);
# method call
$c
=
$a
->gt(
$b
,
$swap
);
$a
->gt(
$b
,
$c
,
$swap
);
$a
->inplace->gt(
$b
,
$swap
);
# can be used inplace
PDL::gt(
$a
->inplace,
$b
,
$swap
);
the binary > (greater than) operation
Broadcasts over its inputs.
gt
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
lt
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
<
$b
;
# overloads the Perl '<' operator
$c
= PDL::lt(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::lt(
$a
,
$b
,
$swap
);
# overriding default
PDL::lt(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->lt(
$b
);
# method call
$c
=
$a
->lt(
$b
,
$swap
);
$a
->lt(
$b
,
$c
,
$swap
);
$a
->inplace->lt(
$b
,
$swap
);
# can be used inplace
PDL::lt(
$a
->inplace,
$b
,
$swap
);
the binary < (less than) operation
Broadcasts over its inputs.
lt
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
le
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
<=
$b
;
# overloads the Perl '<=' operator
$c
= PDL::le(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::le(
$a
,
$b
,
$swap
);
# overriding default
PDL::le(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->le(
$b
);
# method call
$c
=
$a
->le(
$b
,
$swap
);
$a
->le(
$b
,
$c
,
$swap
);
$a
->inplace->le(
$b
,
$swap
);
# can be used inplace
PDL::le(
$a
->inplace,
$b
,
$swap
);
the binary <= (less equal) operation
Broadcasts over its inputs.
le
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
ge
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
>=
$b
;
# overloads the Perl '>=' operator
$c
= PDL::ge(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::ge(
$a
,
$b
,
$swap
);
# overriding default
PDL::ge(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->ge(
$b
);
# method call
$c
=
$a
->ge(
$b
,
$swap
);
$a
->ge(
$b
,
$c
,
$swap
);
$a
->inplace->ge(
$b
,
$swap
);
# can be used inplace
PDL::ge(
$a
->inplace,
$b
,
$swap
);
the binary >= (greater equal) operation
Broadcasts over its inputs.
ge
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
eq
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
==
$b
;
# overloads the Perl '==' operator
$c
= PDL::eq(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::eq(
$a
,
$b
,
$swap
);
# overriding default
PDL::eq(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->eq(
$b
);
# method call
$c
=
$a
->eq(
$b
,
$swap
);
$a
->eq(
$b
,
$c
,
$swap
);
$a
->inplace->eq(
$b
,
$swap
);
# can be used inplace
PDL::eq(
$a
->inplace,
$b
,
$swap
);
binary equal to operation (==
)
Broadcasts over its inputs.
eq
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
ne
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$c
=
$a
!=
$b
;
# overloads the Perl '!=' operator
$c
= PDL::ne(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::ne(
$a
,
$b
,
$swap
);
# overriding default
PDL::ne(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->ne(
$b
);
# method call
$c
=
$a
->ne(
$b
,
$swap
);
$a
->ne(
$b
,
$c
,
$swap
);
$a
->inplace->ne(
$b
,
$swap
);
# can be used inplace
PDL::ne(
$a
->inplace,
$b
,
$swap
);
binary not equal to operation (!=
)
Broadcasts over its inputs.
ne
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
shiftleft
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$c
=
$a
<<
$b
;
# overloads the Perl '<<' operator
$a
<<=
$b
;
$c
= PDL::shiftleft(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::shiftleft(
$a
,
$b
,
$swap
);
# overriding default
PDL::shiftleft(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->shiftleft(
$b
);
# method call
$c
=
$a
->shiftleft(
$b
,
$swap
);
$a
->shiftleft(
$b
,
$c
,
$swap
);
$a
->inplace->shiftleft(
$b
,
$swap
);
# can be used inplace
PDL::shiftleft(
$a
->inplace,
$b
,
$swap
);
bitwise leftshift $a
by $b
Broadcasts over its inputs.
shiftleft
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
shiftright
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$c
=
$a
>>
$b
;
# overloads the Perl '>>' operator
$a
>>=
$b
;
$c
= PDL::shiftright(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::shiftright(
$a
,
$b
,
$swap
);
# overriding default
PDL::shiftright(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->shiftright(
$b
);
# method call
$c
=
$a
->shiftright(
$b
,
$swap
);
$a
->shiftright(
$b
,
$c
,
$swap
);
$a
->inplace->shiftright(
$b
,
$swap
);
# can be used inplace
PDL::shiftright(
$a
->inplace,
$b
,
$swap
);
bitwise rightshift $a
by $b
Broadcasts over its inputs.
shiftright
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
or2
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$c
=
$a
|
$b
;
# overloads the Perl '|' operator
$a
|=
$b
;
$c
= PDL::or2(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::or2(
$a
,
$b
,
$swap
);
# overriding default
PDL::or2(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->or2(
$b
);
# method call
$c
=
$a
->or2(
$b
,
$swap
);
$a
->or2(
$b
,
$c
,
$swap
);
$a
->inplace->or2(
$b
,
$swap
);
# can be used inplace
PDL::or2(
$a
->inplace,
$b
,
$swap
);
bitwise or of two ndarrays
Broadcasts over its inputs.
or2
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
and2
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$c
=
$a
&
$b
;
# overloads the Perl '&' operator
$a
&=
$b
;
$c
= PDL::and2(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::and2(
$a
,
$b
,
$swap
);
# overriding default
PDL::and2(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->and2(
$b
);
# method call
$c
=
$a
->and2(
$b
,
$swap
);
$a
->and2(
$b
,
$c
,
$swap
);
$a
->inplace->and2(
$b
,
$swap
);
# can be used inplace
PDL::and2(
$a
->inplace,
$b
,
$swap
);
bitwise and of two ndarrays
Broadcasts over its inputs.
and2
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
xor
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$c
=
$a
^
$b
;
# overloads the Perl '^' operator
$a
^=
$b
;
$c
= PDL::xor(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::xor(
$a
,
$b
,
$swap
);
# overriding default
PDL::xor(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->xor(
$b
);
# method call
$c
=
$a
->xor(
$b
,
$swap
);
$a
->xor(
$b
,
$c
,
$swap
);
$a
->inplace->xor(
$b
,
$swap
);
# can be used inplace
PDL::xor(
$a
->inplace,
$b
,
$swap
);
bitwise exclusive or of two ndarrays
Broadcasts over its inputs.
xor
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
xor2
Synonym for "xor".
power
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (cfloat cdouble cldouble float ldouble double)
$c
=
$a
**
$b
;
# overloads the Perl '**' operator
$a
**=
$b
;
$c
= PDL::power(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::power(
$a
,
$b
,
$swap
);
# overriding default
PDL::power(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->power(
$b
);
# method call
$c
=
$a
->power(
$b
,
$swap
);
$a
->power(
$b
,
$c
,
$swap
);
$a
->inplace->power(
$b
,
$swap
);
# can be used inplace
PDL::power(
$a
->inplace,
$b
,
$swap
);
raise ndarray $a
to the power $b
Broadcasts over its inputs.
power
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
atan2
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (float ldouble double)
$c
=
atan2
$a
,
$b
;
# overloads the Perl 'atan2' operator
$c
= PDL::
atan2
(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::
atan2
(
$a
,
$b
,
$swap
);
# overriding default
PDL::
atan2
(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->
atan2
(
$b
);
# method call
$c
=
$a
->
atan2
(
$b
,
$swap
);
$a
->
atan2
(
$b
,
$c
,
$swap
);
$a
->inplace->
atan2
(
$b
,
$swap
);
# can be used inplace
PDL::
atan2
(
$a
->inplace,
$b
,
$swap
);
elementwise atan2
of two ndarrays
Broadcasts over its inputs.
atan2
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
modulo
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
%
$b
;
# overloads the Perl '%' operator
$a
%=
$b
;
$c
= PDL::modulo(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::modulo(
$a
,
$b
,
$swap
);
# overriding default
PDL::modulo(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->modulo(
$b
);
# method call
$c
=
$a
->modulo(
$b
,
$swap
);
$a
->modulo(
$b
,
$c
,
$swap
);
$a
->inplace->modulo(
$b
,
$swap
);
# can be used inplace
PDL::modulo(
$a
->inplace,
$b
,
$swap
);
elementwise modulo
operation
Broadcasts over its inputs.
modulo
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
spaceship
Signature: (a(); b(); [o]c();
int
$swap
)
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
=
$a
<=>
$b
;
# overloads the Perl '<=>' operator
$c
= PDL::spaceship(
$a
,
$b
);
# using default value of swap=0
$c
= PDL::spaceship(
$a
,
$b
,
$swap
);
# overriding default
PDL::spaceship(
$a
,
$b
,
$c
,
$swap
);
# all arguments given
$c
=
$a
->spaceship(
$b
);
# method call
$c
=
$a
->spaceship(
$b
,
$swap
);
$a
->spaceship(
$b
,
$c
,
$swap
);
$a
->inplace->spaceship(
$b
,
$swap
);
# can be used inplace
PDL::spaceship(
$a
->inplace,
$b
,
$swap
);
elementwise "<=>" operation
Broadcasts over its inputs.
spaceship
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
bitnot
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong)
$b
= ~
$a
;
# overloads the Perl '~' operator
$b
= PDL::bitnot(
$a
);
PDL::bitnot(
$a
,
$b
);
# all arguments given
$b
=
$a
->bitnot;
# method call
$a
->bitnot(
$b
);
$a
->inplace->bitnot;
# can be used inplace
PDL::bitnot(
$a
->inplace);
unary bitwise negation
Broadcasts over its inputs.
bitnot
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
sqrt
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
=
sqrt
$a
;
# overloads the Perl 'sqrt' operator
$b
= PDL::
sqrt
(
$a
);
PDL::
sqrt
(
$a
,
$b
);
# all arguments given
$b
=
$a
->
sqrt
;
# method call
$a
->
sqrt
(
$b
);
$a
->inplace->
sqrt
;
# can be used inplace
PDL::
sqrt
(
$a
->inplace);
elementwise square root
Broadcasts over its inputs.
sqrt
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
sin
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
=
sin
$a
;
# overloads the Perl 'sin' operator
$b
= PDL::
sin
(
$a
);
PDL::
sin
(
$a
,
$b
);
# all arguments given
$b
=
$a
->
sin
;
# method call
$a
->
sin
(
$b
);
$a
->inplace->
sin
;
# can be used inplace
PDL::
sin
(
$a
->inplace);
the sin function
Broadcasts over its inputs.
sin
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
cos
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
=
cos
$a
;
# overloads the Perl 'cos' operator
$b
= PDL::
cos
(
$a
);
PDL::
cos
(
$a
,
$b
);
# all arguments given
$b
=
$a
->
cos
;
# method call
$a
->
cos
(
$b
);
$a
->inplace->
cos
;
# can be used inplace
PDL::
cos
(
$a
->inplace);
the cos function
Broadcasts over its inputs.
cos
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
not
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$b
= !
$a
;
# overloads the Perl '!' operator
$b
= PDL::not(
$a
);
PDL::not(
$a
,
$b
);
# all arguments given
$b
=
$a
->not;
# method call
$a
->not(
$b
);
$a
->inplace->not;
# can be used inplace
PDL::not(
$a
->inplace);
the elementwise not operation
Broadcasts over its inputs.
not
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
exp
Signature: (a(); [o]b())
Types: (cfloat cdouble cldouble float ldouble double)
$b
=
exp
$a
;
# overloads the Perl 'exp' operator
$b
= PDL::
exp
(
$a
);
PDL::
exp
(
$a
,
$b
);
# all arguments given
$b
=
$a
->
exp
;
# method call
$a
->
exp
(
$b
);
$a
->inplace->
exp
;
# can be used inplace
PDL::
exp
(
$a
->inplace);
the exponential function
Broadcasts over its inputs.
exp
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
log
Signature: (a(); [o]b())
Types: (cfloat cdouble cldouble float ldouble double)
$b
=
log
$a
;
# overloads the Perl 'log' operator
$b
= PDL::
log
(
$a
);
PDL::
log
(
$a
,
$b
);
# all arguments given
$b
=
$a
->
log
;
# method call
$a
->
log
(
$b
);
$a
->inplace->
log
;
# can be used inplace
PDL::
log
(
$a
->inplace);
the natural logarithm
Broadcasts over its inputs.
log
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
re
Signature: (complexv(); real [o]b())
Types: (cfloat cdouble cldouble)
$b
= PDL::re(
$complexv
);
PDL::re(
$complexv
,
$b
);
# all arguments given
$b
=
$complexv
->re;
# method call
$complexv
->re(
$b
);
Returns the real part of a complex number. Flows data back & forth.
Broadcasts over its inputs. Creates data-flow back and forth by default.
re
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
im
Signature: (complexv(); real [o]b())
Types: (cfloat cdouble cldouble)
$b
= PDL::im(
$complexv
);
PDL::im(
$complexv
,
$b
);
# all arguments given
$b
=
$complexv
->im;
# method call
$complexv
->im(
$b
);
Returns the imaginary part of a complex number. Flows data back & forth.
Broadcasts over its inputs. Creates data-flow back and forth by default.
im
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
_cabs
Signature: (complexv(); real [o]b())
Types: (cfloat cdouble cldouble)
$b
= PDL::_cabs(
$complexv
);
PDL::_cabs(
$complexv
,
$b
);
# all arguments given
$b
=
$complexv
->_cabs;
# method call
$complexv
->_cabs(
$b
);
Returns the absolute (length) of a complex number.
Broadcasts over its inputs.
_cabs
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
log10
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
= log10(
$a
);
log10(
$a
,
$b
);
# all arguments given
$b
=
$a
->log10;
# method call
$a
->log10(
$b
);
$a
->inplace->log10;
# can be used inplace
log10(
$a
->inplace);
the base 10 logarithm
Broadcasts over its inputs.
log10
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
assgn
Signature: (a(); [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
= assgn(
$a
);
assgn(
$a
,
$b
);
# all arguments given
$b
=
$a
->assgn;
# method call
$a
->assgn(
$b
);
Plain numerical assignment. This is used to implement the ".=" operator
Broadcasts over its inputs.
assgn
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
carg
Signature: (!real complexv(); real [o]b())
Types: (cfloat cdouble cldouble)
$b
= carg(
$complexv
);
carg(
$complexv
,
$b
);
# all arguments given
$b
=
$complexv
->carg;
# method call
$complexv
->carg(
$b
);
Returns the polar angle of a complex number.
Broadcasts over its inputs.
carg
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
conj
Signature: (complexv(); [o]b())
Types: (cfloat cdouble cldouble)
$b
= conj(
$complexv
);
conj(
$complexv
,
$b
);
# all arguments given
$b
=
$complexv
->conj;
# method call
$complexv
->conj(
$b
);
$complexv
->inplace->conj;
# can be used inplace
conj(
$complexv
->inplace);
complex conjugate.
Broadcasts over its inputs.
conj
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
czip
Signature: (!complex r(); !complex i(); complex [o]c())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble)
$c
= czip(
$r
,
$i
);
czip(
$r
,
$i
,
$c
);
# all arguments given
$c
=
$r
->czip(
$i
);
# method call
$r
->czip(
$i
,
$c
);
convert real, imaginary to native complex, (sort of) like LISP zip function. Will add the r
ndarray to "i" times the i
ndarray. Only takes real ndarrays as input.
Broadcasts over its inputs.
czip
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.
ipow
Signature: (a(); longlong b(); [o] ans())
Types: (ulonglong longlong float ldouble cfloat cdouble cldouble
double)
$ans
= ipow(
$a
,
$b
);
ipow(
$a
,
$b
,
$ans
);
# all arguments given
$ans
=
$a
->ipow(
$b
);
# method call
$a
->ipow(
$b
,
$ans
);
$a
->inplace->ipow(
$b
);
# can be used inplace
ipow(
$a
->inplace,
$b
);
raise ndarray $a
to integer power $b
Algorithm from Wikipedia
Broadcasts over its inputs.
ipow
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.
abs
Returns the absolute value of a number.
abs2
Signature: (a(); real [o]b())
Types: (sbyte byte short ushort long ulong indx ulonglong longlong
float double ldouble cfloat cdouble cldouble)
$b
= abs2(
$a
);
abs2(
$a
,
$b
);
# all arguments given
$b
=
$a
->abs2;
# method call
$a
->abs2(
$b
);
Returns the square of the absolute value of a number.
Broadcasts over its inputs.
abs2
processes bad values. It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays.
r2C
Signature: (r(); complex [o]c())
Types: (float ldouble cfloat cdouble cldouble double)
$c
= r2C(
$r
);
r2C(
$r
,
$c
);
# all arguments given
$c
=
$r
->r2C;
# method call
$r
->r2C(
$c
);
convert real to native complex, with an imaginary part of zero
Broadcasts over its inputs.
r2C
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.
i2C
Signature: (i(); complex [o]c())
Types: (float ldouble cfloat cdouble cldouble double)
$c
= i2C(
$i
);
i2C(
$i
,
$c
);
# all arguments given
$c
=
$i
->i2C;
# method call
$i
->i2C(
$c
);
convert imaginary to native complex, with a real part of zero
Broadcasts over its inputs.
i2C
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.
AUTHOR
Tuomas J. Lukka (lukka@fas.harvard.edu), Karl Glazebrook (kgb@aaoepp.aao.gov.au), Doug Hunt (dhunt@ucar.edu), Christian Soeller (c.soeller@auckland.ac.nz), Doug Burke (burke@ifa.hawaii.edu), and Craig DeForest (deforest@boulder.swri.edu).