| 1 | # | ||||||||||||||||||||||||||||
| 2 | # GENERATED WITH PDL::PP from lib/PDL/Ops.pd! Don't modify! | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | package PDL::Ops; | ||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 70 | our @EXPORT_OK = qw(log10 assgn carg conj czip ipow abs2 r2C i2C ); | |||||||||||||||||||||||||||
| 7 | 70 | our %EXPORT_TAGS = (Func=>\@EXPORT_OK); | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 70 | ▶ | use PDL::Core; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 70 | ▶ | use PDL::Exporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | 70 | ▶ | use DynaLoader; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 70 | our @ISA = ( 'PDL::Exporter','DynaLoader' ); | |||||||||||||||||||||||||||
| 16 | 70 | push @PDL::Core::PP, __PACKAGE__; | |||||||||||||||||||||||||||
| 17 | 70 | bootstrap PDL::Ops ; | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | { package # hide from MetaCPAN | ||||||||||||||||||||||||||||
| 20 | PDL; | ||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 23 | { | ||||||||||||||||||||||||||||
| 24 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 25 | sub overload_plus { | ||||||||||||||||||||||||||||
| 26 | Carp::confess("PDL::plus: overloaded '+' given undef") | ||||||||||||||||||||||||||||
| 27 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 28 | return PDL::plus(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 29 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 30 | && defined($foo = overload::Method($_[1], '+')) | ||||||||||||||||||||||||||||
| 31 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 32 | goto &$foo; | ||||||||||||||||||||||||||||
| 33 | } | ||||||||||||||||||||||||||||
| 34 | use overload '+' => $overload_sub = \&overload_plus; | ||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 38 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 39 | sub overload_plus_mutate { | ||||||||||||||||||||||||||||
| 40 | Carp::confess("PDL::plus: overloaded '+=' given undef") | ||||||||||||||||||||||||||||
| 41 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 42 | PDL::plus($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 43 | } | ||||||||||||||||||||||||||||
| 44 | use overload '+=' => \&overload_plus_mutate; | ||||||||||||||||||||||||||||
| 45 | #line 46 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||
| 47 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 48 | PDL; | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 51 | { | ||||||||||||||||||||||||||||
| 52 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 53 | sub overload_mult { | ||||||||||||||||||||||||||||
| 54 | Carp::confess("PDL::mult: overloaded '*' given undef") | ||||||||||||||||||||||||||||
| 55 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 56 | return PDL::mult(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 57 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 58 | && defined($foo = overload::Method($_[1], '*')) | ||||||||||||||||||||||||||||
| 59 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 60 | goto &$foo; | ||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||
| 62 | use overload '*' => $overload_sub = \&overload_mult; | ||||||||||||||||||||||||||||
| 63 | } | ||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 66 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 67 | sub overload_mult_mutate { | ||||||||||||||||||||||||||||
| 68 | Carp::confess("PDL::mult: overloaded '*=' given undef") | ||||||||||||||||||||||||||||
| 69 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 70 | PDL::mult($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | use overload '*=' => \&overload_mult_mutate; | ||||||||||||||||||||||||||||
| 73 | #line 74 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 76 | PDL; | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 79 | { | ||||||||||||||||||||||||||||
| 80 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 81 | sub overload_minus { | ||||||||||||||||||||||||||||
| 82 | Carp::confess("PDL::minus: overloaded '-' given undef") | ||||||||||||||||||||||||||||
| 83 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 84 | return PDL::minus(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 85 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 86 | && defined($foo = overload::Method($_[1], '-')) | ||||||||||||||||||||||||||||
| 87 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 88 | goto &$foo; | ||||||||||||||||||||||||||||
| 89 | } | ||||||||||||||||||||||||||||
| 90 | use overload '-' => $overload_sub = \&overload_minus; | ||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||
| 93 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 94 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 95 | sub overload_minus_mutate { | ||||||||||||||||||||||||||||
| 96 | Carp::confess("PDL::minus: overloaded '-=' given undef") | ||||||||||||||||||||||||||||
| 97 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 98 | PDL::minus($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 99 | } | ||||||||||||||||||||||||||||
| 100 | use overload '-=' => \&overload_minus_mutate; | ||||||||||||||||||||||||||||
| 101 | #line 102 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 102 | } | ||||||||||||||||||||||||||||
| 103 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 104 | PDL; | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 107 | { | ||||||||||||||||||||||||||||
| 108 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 109 | sub overload_divide { | ||||||||||||||||||||||||||||
| 110 | Carp::confess("PDL::divide: overloaded '/' given undef") | ||||||||||||||||||||||||||||
| 111 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 112 | return PDL::divide(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 113 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 114 | && defined($foo = overload::Method($_[1], '/')) | ||||||||||||||||||||||||||||
| 115 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 116 | goto &$foo; | ||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||
| 118 | use overload '/' => $overload_sub = \&overload_divide; | ||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 122 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 123 | sub overload_divide_mutate { | ||||||||||||||||||||||||||||
| 124 | Carp::confess("PDL::divide: overloaded '/=' given undef") | ||||||||||||||||||||||||||||
| 125 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 126 | PDL::divide($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||
| 128 | use overload '/=' => \&overload_divide_mutate; | ||||||||||||||||||||||||||||
| 129 | #line 130 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 130 | } | ||||||||||||||||||||||||||||
| 131 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 132 | PDL; | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 135 | { | ||||||||||||||||||||||||||||
| 136 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 137 | sub overload_gt { | ||||||||||||||||||||||||||||
| 138 | Carp::confess("PDL::gt: overloaded '>' given undef") | ||||||||||||||||||||||||||||
| 139 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 140 | return PDL::gt(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 141 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 142 | && defined($foo = overload::Method($_[1], '>')) | ||||||||||||||||||||||||||||
| 143 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 144 | goto &$foo; | ||||||||||||||||||||||||||||
| 145 | } | ||||||||||||||||||||||||||||
| 146 | use overload '>' => $overload_sub = \&overload_gt; | ||||||||||||||||||||||||||||
| 147 | } | ||||||||||||||||||||||||||||
| 148 | #line 149 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 149 | 0 | } | |||||||||||||||||||||||||||
| 150 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 151 | PDL; | ||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||
| 153 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 154 | { | ||||||||||||||||||||||||||||
| 155 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 156 | sub overload_lt { | ||||||||||||||||||||||||||||
| 157 | Carp::confess("PDL::lt: overloaded '<' given undef") | ||||||||||||||||||||||||||||
| 158 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 159 | return PDL::lt(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 160 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 161 | && defined($foo = overload::Method($_[1], '<')) | ||||||||||||||||||||||||||||
| 162 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 163 | goto &$foo; | ||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||
| 165 | use overload '<' => $overload_sub = \&overload_lt; | ||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||
| 167 | #line 168 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 168 | 0 | } | |||||||||||||||||||||||||||
| 169 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 170 | PDL; | ||||||||||||||||||||||||||||
| 171 | |||||||||||||||||||||||||||||
| 172 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 173 | { | ||||||||||||||||||||||||||||
| 174 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 175 | sub overload_le { | ||||||||||||||||||||||||||||
| 176 | Carp::confess("PDL::le: overloaded '<=' given undef") | ||||||||||||||||||||||||||||
| 177 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 178 | return PDL::le(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 179 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 180 | && defined($foo = overload::Method($_[1], '<=')) | ||||||||||||||||||||||||||||
| 181 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 182 | goto &$foo; | ||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||
| 184 | use overload '<=' => $overload_sub = \&overload_le; | ||||||||||||||||||||||||||||
| 185 | } | ||||||||||||||||||||||||||||
| 186 | #line 187 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 187 | 70 | } | |||||||||||||||||||||||||||
| 188 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 189 | PDL; | ||||||||||||||||||||||||||||
| 190 | |||||||||||||||||||||||||||||
| 191 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 192 | { | ||||||||||||||||||||||||||||
| 193 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 194 | sub overload_ge { | ||||||||||||||||||||||||||||
| 195 | Carp::confess("PDL::ge: overloaded '>=' given undef") | ||||||||||||||||||||||||||||
| 196 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 197 | return PDL::ge(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 198 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 199 | && defined($foo = overload::Method($_[1], '>=')) | ||||||||||||||||||||||||||||
| 200 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 201 | goto &$foo; | ||||||||||||||||||||||||||||
| 202 | } | ||||||||||||||||||||||||||||
| 203 | use overload '>=' => $overload_sub = \&overload_ge; | ||||||||||||||||||||||||||||
| 204 | } | ||||||||||||||||||||||||||||
| 205 | #line 206 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 206 | 0 | } | |||||||||||||||||||||||||||
| 207 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 208 | PDL; | ||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||
| 210 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 211 | { | ||||||||||||||||||||||||||||
| 212 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 213 | sub overload_eq { | ||||||||||||||||||||||||||||
| 214 | Carp::confess("PDL::eq: overloaded '==' given undef") | ||||||||||||||||||||||||||||
| 215 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 216 | return PDL::eq(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 217 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 218 | && defined($foo = overload::Method($_[1], '==')) | ||||||||||||||||||||||||||||
| 219 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 220 | goto &$foo; | ||||||||||||||||||||||||||||
| 221 | } | ||||||||||||||||||||||||||||
| 222 | use overload '==' => $overload_sub = \&overload_eq; | ||||||||||||||||||||||||||||
| 223 | } | ||||||||||||||||||||||||||||
| 224 | #line 225 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 225 | 70 | } | |||||||||||||||||||||||||||
| 226 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 227 | PDL; | ||||||||||||||||||||||||||||
| 228 | |||||||||||||||||||||||||||||
| 229 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 230 | { | ||||||||||||||||||||||||||||
| 231 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 232 | sub overload_ne { | ||||||||||||||||||||||||||||
| 233 | Carp::confess("PDL::ne: overloaded '!=' given undef") | ||||||||||||||||||||||||||||
| 234 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 235 | return PDL::ne(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 236 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 237 | && defined($foo = overload::Method($_[1], '!=')) | ||||||||||||||||||||||||||||
| 238 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 239 | goto &$foo; | ||||||||||||||||||||||||||||
| 240 | } | ||||||||||||||||||||||||||||
| 241 | use overload '!=' => $overload_sub = \&overload_ne; | ||||||||||||||||||||||||||||
| 242 | } | ||||||||||||||||||||||||||||
| 243 | #line 244 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 244 | 70 | } | |||||||||||||||||||||||||||
| 245 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 246 | PDL; | ||||||||||||||||||||||||||||
| 247 | |||||||||||||||||||||||||||||
| 248 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 249 | { | ||||||||||||||||||||||||||||
| 250 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 251 | sub overload_shiftleft { | ||||||||||||||||||||||||||||
| 252 | Carp::confess("PDL::shiftleft: overloaded '<<' given undef") | ||||||||||||||||||||||||||||
| 253 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 254 | return PDL::shiftleft(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 255 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 256 | && defined($foo = overload::Method($_[1], '<<')) | ||||||||||||||||||||||||||||
| 257 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 258 | goto &$foo; | ||||||||||||||||||||||||||||
| 259 | } | ||||||||||||||||||||||||||||
| 260 | use overload '<<' => $overload_sub = \&overload_shiftleft; | ||||||||||||||||||||||||||||
| 261 | } | ||||||||||||||||||||||||||||
| 262 | |||||||||||||||||||||||||||||
| 263 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 264 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 265 | sub overload_shiftleft_mutate { | ||||||||||||||||||||||||||||
| 266 | Carp::confess("PDL::shiftleft: overloaded '<<=' given undef") | ||||||||||||||||||||||||||||
| 267 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 268 | PDL::shiftleft($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 269 | } | ||||||||||||||||||||||||||||
| 270 | use overload '<<=' => \&overload_shiftleft_mutate; | ||||||||||||||||||||||||||||
| 271 | #line 272 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 272 | } | ||||||||||||||||||||||||||||
| 273 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 274 | PDL; | ||||||||||||||||||||||||||||
| 275 | |||||||||||||||||||||||||||||
| 276 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 277 | { | ||||||||||||||||||||||||||||
| 278 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 279 | sub overload_shiftright { | ||||||||||||||||||||||||||||
| 280 | Carp::confess("PDL::shiftright: overloaded '>>' given undef") | ||||||||||||||||||||||||||||
| 281 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 282 | return PDL::shiftright(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 283 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 284 | && defined($foo = overload::Method($_[1], '>>')) | ||||||||||||||||||||||||||||
| 285 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 286 | goto &$foo; | ||||||||||||||||||||||||||||
| 287 | } | ||||||||||||||||||||||||||||
| 288 | use overload '>>' => $overload_sub = \&overload_shiftright; | ||||||||||||||||||||||||||||
| 289 | } | ||||||||||||||||||||||||||||
| 290 | |||||||||||||||||||||||||||||
| 291 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 292 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 293 | sub overload_shiftright_mutate { | ||||||||||||||||||||||||||||
| 294 | Carp::confess("PDL::shiftright: overloaded '>>=' given undef") | ||||||||||||||||||||||||||||
| 295 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 296 | PDL::shiftright($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 297 | } | ||||||||||||||||||||||||||||
| 298 | use overload '>>=' => \&overload_shiftright_mutate; | ||||||||||||||||||||||||||||
| 299 | #line 300 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 300 | } | ||||||||||||||||||||||||||||
| 301 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 302 | PDL; | ||||||||||||||||||||||||||||
| 303 | |||||||||||||||||||||||||||||
| 304 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 305 | { | ||||||||||||||||||||||||||||
| 306 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 307 | sub overload_or2 { | ||||||||||||||||||||||||||||
| 308 | Carp::confess("PDL::or2: overloaded '|' given undef") | ||||||||||||||||||||||||||||
| 309 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 310 | return PDL::or2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | ||||||||||||||||||||||||||||
| 311 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 312 | && defined($foo = overload::Method($_[1], '|')) | ||||||||||||||||||||||||||||
| 313 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 314 | goto &$foo; | ||||||||||||||||||||||||||||
| 315 | } | ||||||||||||||||||||||||||||
| 316 | use overload '|' => $overload_sub = \&overload_or2; | ||||||||||||||||||||||||||||
| 317 | } | ||||||||||||||||||||||||||||
| 318 | |||||||||||||||||||||||||||||
| 319 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 320 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 321 | sub overload_or2_mutate { | ||||||||||||||||||||||||||||
| 322 | Carp::confess("PDL::or2: overloaded '|=' given undef") | ||||||||||||||||||||||||||||
| 323 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 324 | PDL::or2($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 325 | } | ||||||||||||||||||||||||||||
| 326 | use overload '|=' => \&overload_or2_mutate; | ||||||||||||||||||||||||||||
| 327 | #line 328 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 328 | } | ||||||||||||||||||||||||||||
| 329 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 330 | PDL; | ||||||||||||||||||||||||||||
| 331 | |||||||||||||||||||||||||||||
| 332 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 333 | { | ||||||||||||||||||||||||||||
| 334 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 335 | sub overload_and2 { | ||||||||||||||||||||||||||||
| 336 | Carp::confess("PDL::and2: overloaded '&' given undef") | ||||||||||||||||||||||||||||
| 337 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 338 | return PDL::and2($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | ||||||||||||||||||||||||||||
| 339 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 340 | && defined($foo = overload::Method($_[1], '&')) | ||||||||||||||||||||||||||||
| 341 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 342 | goto &$foo; | ||||||||||||||||||||||||||||
| 343 | } | ||||||||||||||||||||||||||||
| 344 | use overload '&' => $overload_sub = \&overload_and2; | ||||||||||||||||||||||||||||
| 345 | } | ||||||||||||||||||||||||||||
| 346 | |||||||||||||||||||||||||||||
| 347 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 348 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 349 | sub overload_and2_mutate { | ||||||||||||||||||||||||||||
| 350 | Carp::confess("PDL::and2: overloaded '&=' given undef") | ||||||||||||||||||||||||||||
| 351 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 352 | PDL::and2($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 353 | } | ||||||||||||||||||||||||||||
| 354 | use overload '&=' => \&overload_and2_mutate; | ||||||||||||||||||||||||||||
| 355 | #line 356 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 356 | } | ||||||||||||||||||||||||||||
| 357 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 358 | PDL; | ||||||||||||||||||||||||||||
| 359 | |||||||||||||||||||||||||||||
| 360 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 361 | { | ||||||||||||||||||||||||||||
| 362 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 363 | sub overload_xor { | ||||||||||||||||||||||||||||
| 364 | Carp::confess("PDL::xor: overloaded '^' given undef") | ||||||||||||||||||||||||||||
| 365 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 366 | return PDL::xor($_[2]?@_[1,0]:@_[0,1]) unless ref $_[1] | ||||||||||||||||||||||||||||
| 367 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 368 | && defined($foo = overload::Method($_[1], '^')) | ||||||||||||||||||||||||||||
| 369 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 370 | goto &$foo; | ||||||||||||||||||||||||||||
| 371 | } | ||||||||||||||||||||||||||||
| 372 | use overload '^' => $overload_sub = \&overload_xor; | ||||||||||||||||||||||||||||
| 373 | } | ||||||||||||||||||||||||||||
| 374 | |||||||||||||||||||||||||||||
| 375 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 376 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 377 | sub overload_xor_mutate { | ||||||||||||||||||||||||||||
| 378 | Carp::confess("PDL::xor: overloaded '^=' given undef") | ||||||||||||||||||||||||||||
| 379 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 380 | PDL::xor($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 381 | } | ||||||||||||||||||||||||||||
| 382 | use overload '^=' => \&overload_xor_mutate; | ||||||||||||||||||||||||||||
| 383 | #line 384 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 384 | } | ||||||||||||||||||||||||||||
| 385 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 386 | PDL; | ||||||||||||||||||||||||||||
| 387 | |||||||||||||||||||||||||||||
| 388 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 389 | { | ||||||||||||||||||||||||||||
| 390 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 391 | sub overload_power { | ||||||||||||||||||||||||||||
| 392 | Carp::confess("PDL::power: overloaded '**' given undef") | ||||||||||||||||||||||||||||
| 393 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 394 | return PDL::power(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 395 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 396 | && defined($foo = overload::Method($_[1], '**')) | ||||||||||||||||||||||||||||
| 397 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 398 | goto &$foo; | ||||||||||||||||||||||||||||
| 399 | } | ||||||||||||||||||||||||||||
| 400 | use overload '**' => $overload_sub = \&overload_power; | ||||||||||||||||||||||||||||
| 401 | } | ||||||||||||||||||||||||||||
| 402 | |||||||||||||||||||||||||||||
| 403 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 404 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 405 | sub overload_power_mutate { | ||||||||||||||||||||||||||||
| 406 | Carp::confess("PDL::power: overloaded '**=' given undef") | ||||||||||||||||||||||||||||
| 407 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 408 | PDL::power($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 409 | } | ||||||||||||||||||||||||||||
| 410 | use overload '**=' => \&overload_power_mutate; | ||||||||||||||||||||||||||||
| 411 | #line 412 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 412 | } | ||||||||||||||||||||||||||||
| 413 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 414 | PDL; | ||||||||||||||||||||||||||||
| 415 | |||||||||||||||||||||||||||||
| 416 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 417 | { | ||||||||||||||||||||||||||||
| 418 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 419 | sub overload_atan2 { | ||||||||||||||||||||||||||||
| 420 | Carp::confess("PDL::atan2: overloaded 'atan2' given undef") | ||||||||||||||||||||||||||||
| 421 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 422 | return PDL::atan2(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 423 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 424 | && defined($foo = overload::Method($_[1], 'atan2')) | ||||||||||||||||||||||||||||
| 425 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 426 | goto &$foo; | ||||||||||||||||||||||||||||
| 427 | } | ||||||||||||||||||||||||||||
| 428 | use overload 'atan2' => $overload_sub = \&overload_atan2; | ||||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||
| 430 | #line 431 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 431 | 0 | } | |||||||||||||||||||||||||||
| 432 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 433 | PDL; | ||||||||||||||||||||||||||||
| 434 | |||||||||||||||||||||||||||||
| 435 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 436 | { | ||||||||||||||||||||||||||||
| 437 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 438 | sub overload_modulo { | ||||||||||||||||||||||||||||
| 439 | Carp::confess("PDL::modulo: overloaded '%' given undef") | ||||||||||||||||||||||||||||
| 440 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 441 | return PDL::modulo(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 442 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 443 | && defined($foo = overload::Method($_[1], '%')) | ||||||||||||||||||||||||||||
| 444 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 445 | goto &$foo; | ||||||||||||||||||||||||||||
| 446 | } | ||||||||||||||||||||||||||||
| 447 | use overload '%' => $overload_sub = \&overload_modulo; | ||||||||||||||||||||||||||||
| 448 | } | ||||||||||||||||||||||||||||
| 449 | |||||||||||||||||||||||||||||
| 450 | #line 1461 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 451 | # in1, in2, out, swap if true | ||||||||||||||||||||||||||||
| 452 | sub overload_modulo_mutate { | ||||||||||||||||||||||||||||
| 453 | Carp::confess("PDL::modulo: overloaded '%=' given undef") | ||||||||||||||||||||||||||||
| 454 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 455 | PDL::modulo($_[0]->inplace, $_[1]); $_[0] | ||||||||||||||||||||||||||||
| 456 | } | ||||||||||||||||||||||||||||
| 457 | use overload '%=' => \&overload_modulo_mutate; | ||||||||||||||||||||||||||||
| 458 | #line 459 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||
| 460 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 461 | PDL; | ||||||||||||||||||||||||||||
| 462 | |||||||||||||||||||||||||||||
| 463 | #line 1445 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 464 | { | ||||||||||||||||||||||||||||
| 465 | my ($foo, $overload_sub); | ||||||||||||||||||||||||||||
| 466 | sub overload_spaceship { | ||||||||||||||||||||||||||||
| 467 | Carp::confess("PDL::spaceship: overloaded '<=>' given undef") | ||||||||||||||||||||||||||||
| 468 | if grep !defined, @_[0,1]; | ||||||||||||||||||||||||||||
| 469 | return PDL::spaceship(@_) unless ref $_[1] | ||||||||||||||||||||||||||||
| 470 | && (ref $_[1] ne 'PDL') | ||||||||||||||||||||||||||||
| 471 | && defined($foo = overload::Method($_[1], '<=>')) | ||||||||||||||||||||||||||||
| 472 | && $foo != $overload_sub; # recursion guard | ||||||||||||||||||||||||||||
| 473 | goto &$foo; | ||||||||||||||||||||||||||||
| 474 | } | ||||||||||||||||||||||||||||
| 475 | use overload '<=>' => $overload_sub = \&overload_spaceship; | ||||||||||||||||||||||||||||
| 476 | } | ||||||||||||||||||||||||||||
| 477 | #line 478 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 478 | 0 | } | |||||||||||||||||||||||||||
| 479 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 480 | PDL; | ||||||||||||||||||||||||||||
| 481 | |||||||||||||||||||||||||||||
| 482 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 483 | sub overload_bitnot { | ||||||||||||||||||||||||||||
| 484 | Carp::confess("PDL::bitnot: overloaded '~' given undef") | ||||||||||||||||||||||||||||
| 485 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 486 | PDL::bitnot($_[0]); | ||||||||||||||||||||||||||||
| 487 | } | ||||||||||||||||||||||||||||
| 488 | use overload '~' => \&overload_bitnot; | ||||||||||||||||||||||||||||
| 489 | #line 490 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 490 | } | ||||||||||||||||||||||||||||
| 491 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 492 | PDL; | ||||||||||||||||||||||||||||
| 493 | |||||||||||||||||||||||||||||
| 494 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 495 | sub overload_sqrt { | ||||||||||||||||||||||||||||
| 496 | Carp::confess("PDL::sqrt: overloaded 'sqrt' given undef") | ||||||||||||||||||||||||||||
| 497 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 498 | PDL::sqrt($_[0]); | ||||||||||||||||||||||||||||
| 499 | } | ||||||||||||||||||||||||||||
| 500 | use overload 'sqrt' => \&overload_sqrt; | ||||||||||||||||||||||||||||
| 501 | #line 502 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 502 | } | ||||||||||||||||||||||||||||
| 503 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 504 | PDL; | ||||||||||||||||||||||||||||
| 505 | |||||||||||||||||||||||||||||
| 506 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 507 | sub overload_sin { | ||||||||||||||||||||||||||||
| 508 | Carp::confess("PDL::sin: overloaded 'sin' given undef") | ||||||||||||||||||||||||||||
| 509 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 510 | PDL::sin($_[0]); | ||||||||||||||||||||||||||||
| 511 | } | ||||||||||||||||||||||||||||
| 512 | use overload 'sin' => \&overload_sin; | ||||||||||||||||||||||||||||
| 513 | #line 514 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 514 | } | ||||||||||||||||||||||||||||
| 515 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 516 | PDL; | ||||||||||||||||||||||||||||
| 517 | |||||||||||||||||||||||||||||
| 518 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 519 | sub overload_cos { | ||||||||||||||||||||||||||||
| 520 | Carp::confess("PDL::cos: overloaded 'cos' given undef") | ||||||||||||||||||||||||||||
| 521 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 522 | PDL::cos($_[0]); | ||||||||||||||||||||||||||||
| 523 | } | ||||||||||||||||||||||||||||
| 524 | use overload 'cos' => \&overload_cos; | ||||||||||||||||||||||||||||
| 525 | #line 526 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 526 | } | ||||||||||||||||||||||||||||
| 527 | 70 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 528 | PDL; | ||||||||||||||||||||||||||||
| 529 | |||||||||||||||||||||||||||||
| 530 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 531 | sub overload_not { | ||||||||||||||||||||||||||||
| 532 | Carp::confess("PDL::not: overloaded '!' given undef") | ||||||||||||||||||||||||||||
| 533 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 534 | PDL::not($_[0]); | ||||||||||||||||||||||||||||
| 535 | } | ||||||||||||||||||||||||||||
| 536 | use overload '!' => \&overload_not; | ||||||||||||||||||||||||||||
| 537 | #line 538 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 538 | } | ||||||||||||||||||||||||||||
| 539 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 540 | PDL; | ||||||||||||||||||||||||||||
| 541 | |||||||||||||||||||||||||||||
| 542 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 543 | sub overload_exp { | ||||||||||||||||||||||||||||
| 544 | Carp::confess("PDL::exp: overloaded 'exp' given undef") | ||||||||||||||||||||||||||||
| 545 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 546 | PDL::exp($_[0]); | ||||||||||||||||||||||||||||
| 547 | } | ||||||||||||||||||||||||||||
| 548 | use overload 'exp' => \&overload_exp; | ||||||||||||||||||||||||||||
| 549 | #line 550 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 550 | } | ||||||||||||||||||||||||||||
| 551 | 0 | { package # hide from MetaCPAN | |||||||||||||||||||||||||||
| 552 | PDL; | ||||||||||||||||||||||||||||
| 553 | |||||||||||||||||||||||||||||
| 554 | #line 1436 "lib/PDL/PP.pm" | ||||||||||||||||||||||||||||
| 555 | sub overload_log { | ||||||||||||||||||||||||||||
| 556 | Carp::confess("PDL::log: overloaded 'log' given undef") | ||||||||||||||||||||||||||||
| 557 | if grep !defined, $_[0]; | ||||||||||||||||||||||||||||
| 558 | PDL::log($_[0]); | ||||||||||||||||||||||||||||
| 559 | } | ||||||||||||||||||||||||||||
| 560 | use overload 'log' => \&overload_log; | ||||||||||||||||||||||||||||
| 561 | #line 562 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 562 | } | ||||||||||||||||||||||||||||
| 563 | |||||||||||||||||||||||||||||
| 564 | |||||||||||||||||||||||||||||
| 565 | |||||||||||||||||||||||||||||
| 566 | |||||||||||||||||||||||||||||
| 567 | |||||||||||||||||||||||||||||
| 568 | |||||||||||||||||||||||||||||
| 569 | |||||||||||||||||||||||||||||
| 570 | #line 21 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 571 | |||||||||||||||||||||||||||||
| 572 | use strict; | ||||||||||||||||||||||||||||
| 573 | use warnings; | ||||||||||||||||||||||||||||
| 574 | |||||||||||||||||||||||||||||
| 575 | =head1 NAME | ||||||||||||||||||||||||||||
| 576 | |||||||||||||||||||||||||||||
| 577 | PDL::Ops - Fundamental mathematical operators | ||||||||||||||||||||||||||||
| 578 | |||||||||||||||||||||||||||||
| 579 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 580 | |||||||||||||||||||||||||||||
| 581 | This module provides the functions used by PDL to | ||||||||||||||||||||||||||||
| 582 | overload the basic mathematical operators (C<+ - / *> | ||||||||||||||||||||||||||||
| 583 | etc.) and functions (C<sin sqrt> etc.) | ||||||||||||||||||||||||||||
| 584 | |||||||||||||||||||||||||||||
| 585 | It also includes the function C<log10>, which should | ||||||||||||||||||||||||||||
| 586 | be a perl function so that we can overload it! | ||||||||||||||||||||||||||||
| 587 | |||||||||||||||||||||||||||||
| 588 | Matrix multiplication (the operator C<x>) is handled | ||||||||||||||||||||||||||||
| 589 | by the module L<PDL::Primitive>. | ||||||||||||||||||||||||||||
| 590 | |||||||||||||||||||||||||||||
| 591 | =head1 SYNOPSIS | ||||||||||||||||||||||||||||
| 592 | |||||||||||||||||||||||||||||
| 593 | none | ||||||||||||||||||||||||||||
| 594 | |||||||||||||||||||||||||||||
| 595 | =cut | ||||||||||||||||||||||||||||
| 596 | #line 597 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 597 | |||||||||||||||||||||||||||||
| 598 | |||||||||||||||||||||||||||||
| 599 | =head1 FUNCTIONS | ||||||||||||||||||||||||||||
| 600 | |||||||||||||||||||||||||||||
| 601 | =cut | ||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||
| 603 | |||||||||||||||||||||||||||||
| 604 | |||||||||||||||||||||||||||||
| 605 | |||||||||||||||||||||||||||||
| 606 | |||||||||||||||||||||||||||||
| 607 | |||||||||||||||||||||||||||||
| 608 | =head2 plus | ||||||||||||||||||||||||||||
| 609 | |||||||||||||||||||||||||||||
| 610 | =for sig | ||||||||||||||||||||||||||||
| 611 | |||||||||||||||||||||||||||||
| 612 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 613 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 614 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 615 | |||||||||||||||||||||||||||||
| 616 | =for usage | ||||||||||||||||||||||||||||
| 617 | |||||||||||||||||||||||||||||
| 618 | $c = $a + $b; # overloads the Perl '+' operator | ||||||||||||||||||||||||||||
| 619 | $a += $b; | ||||||||||||||||||||||||||||
| 620 | $c = PDL::plus($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 621 | $c = PDL::plus($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 622 | PDL::plus($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 623 | $c = $a->plus($b); # method call | ||||||||||||||||||||||||||||
| 624 | $c = $a->plus($b, $swap); | ||||||||||||||||||||||||||||
| 625 | $a->plus($b, $c, $swap); | ||||||||||||||||||||||||||||
| 626 | $a->inplace->plus($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 627 | PDL::plus($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 628 | |||||||||||||||||||||||||||||
| 629 | =for ref | ||||||||||||||||||||||||||||
| 630 | |||||||||||||||||||||||||||||
| 631 | add two ndarrays | ||||||||||||||||||||||||||||
| 632 | |||||||||||||||||||||||||||||
| 633 | =pod | ||||||||||||||||||||||||||||
| 634 | |||||||||||||||||||||||||||||
| 635 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 636 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 637 | |||||||||||||||||||||||||||||
| 638 | =for bad | ||||||||||||||||||||||||||||
| 639 | |||||||||||||||||||||||||||||
| 640 | C<plus> processes bad values. | ||||||||||||||||||||||||||||
| 641 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 642 | |||||||||||||||||||||||||||||
| 643 | =cut | ||||||||||||||||||||||||||||
| 644 | |||||||||||||||||||||||||||||
| 645 | |||||||||||||||||||||||||||||
| 646 | |||||||||||||||||||||||||||||
| 647 | |||||||||||||||||||||||||||||
| 648 | 70 | *plus = \&PDL::plus; | |||||||||||||||||||||||||||
| 649 | |||||||||||||||||||||||||||||
| 650 | |||||||||||||||||||||||||||||
| 651 | |||||||||||||||||||||||||||||
| 652 | |||||||||||||||||||||||||||||
| 653 | |||||||||||||||||||||||||||||
| 654 | |||||||||||||||||||||||||||||
| 655 | =head2 mult | ||||||||||||||||||||||||||||
| 656 | |||||||||||||||||||||||||||||
| 657 | =for sig | ||||||||||||||||||||||||||||
| 658 | |||||||||||||||||||||||||||||
| 659 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 660 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 661 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 662 | |||||||||||||||||||||||||||||
| 663 | =for usage | ||||||||||||||||||||||||||||
| 664 | |||||||||||||||||||||||||||||
| 665 | $c = $a * $b; # overloads the Perl '*' operator | ||||||||||||||||||||||||||||
| 666 | $a *= $b; | ||||||||||||||||||||||||||||
| 667 | $c = PDL::mult($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 668 | $c = PDL::mult($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 669 | PDL::mult($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 670 | $c = $a->mult($b); # method call | ||||||||||||||||||||||||||||
| 671 | $c = $a->mult($b, $swap); | ||||||||||||||||||||||||||||
| 672 | $a->mult($b, $c, $swap); | ||||||||||||||||||||||||||||
| 673 | $a->inplace->mult($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 674 | PDL::mult($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 675 | |||||||||||||||||||||||||||||
| 676 | =for ref | ||||||||||||||||||||||||||||
| 677 | |||||||||||||||||||||||||||||
| 678 | multiply two ndarrays | ||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||
| 680 | =pod | ||||||||||||||||||||||||||||
| 681 | |||||||||||||||||||||||||||||
| 682 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 683 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 684 | |||||||||||||||||||||||||||||
| 685 | =for bad | ||||||||||||||||||||||||||||
| 686 | |||||||||||||||||||||||||||||
| 687 | C<mult> processes bad values. | ||||||||||||||||||||||||||||
| 688 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 689 | |||||||||||||||||||||||||||||
| 690 | =cut | ||||||||||||||||||||||||||||
| 691 | |||||||||||||||||||||||||||||
| 692 | |||||||||||||||||||||||||||||
| 693 | |||||||||||||||||||||||||||||
| 694 | |||||||||||||||||||||||||||||
| 695 | 0 | *mult = \&PDL::mult; | |||||||||||||||||||||||||||
| 696 | |||||||||||||||||||||||||||||
| 697 | |||||||||||||||||||||||||||||
| 698 | |||||||||||||||||||||||||||||
| 699 | |||||||||||||||||||||||||||||
| 700 | |||||||||||||||||||||||||||||
| 701 | |||||||||||||||||||||||||||||
| 702 | =head2 minus | ||||||||||||||||||||||||||||
| 703 | |||||||||||||||||||||||||||||
| 704 | =for sig | ||||||||||||||||||||||||||||
| 705 | |||||||||||||||||||||||||||||
| 706 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 707 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 708 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 709 | |||||||||||||||||||||||||||||
| 710 | =for usage | ||||||||||||||||||||||||||||
| 711 | |||||||||||||||||||||||||||||
| 712 | $c = $a - $b; # overloads the Perl '-' operator | ||||||||||||||||||||||||||||
| 713 | $a -= $b; | ||||||||||||||||||||||||||||
| 714 | $c = PDL::minus($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 715 | $c = PDL::minus($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 716 | PDL::minus($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 717 | $c = $a->minus($b); # method call | ||||||||||||||||||||||||||||
| 718 | $c = $a->minus($b, $swap); | ||||||||||||||||||||||||||||
| 719 | $a->minus($b, $c, $swap); | ||||||||||||||||||||||||||||
| 720 | $a->inplace->minus($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 721 | PDL::minus($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 722 | |||||||||||||||||||||||||||||
| 723 | =for ref | ||||||||||||||||||||||||||||
| 724 | |||||||||||||||||||||||||||||
| 725 | subtract two ndarrays | ||||||||||||||||||||||||||||
| 726 | |||||||||||||||||||||||||||||
| 727 | =pod | ||||||||||||||||||||||||||||
| 728 | |||||||||||||||||||||||||||||
| 729 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 730 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 731 | |||||||||||||||||||||||||||||
| 732 | =for bad | ||||||||||||||||||||||||||||
| 733 | |||||||||||||||||||||||||||||
| 734 | C<minus> processes bad values. | ||||||||||||||||||||||||||||
| 735 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 736 | |||||||||||||||||||||||||||||
| 737 | =cut | ||||||||||||||||||||||||||||
| 738 | |||||||||||||||||||||||||||||
| 739 | |||||||||||||||||||||||||||||
| 740 | |||||||||||||||||||||||||||||
| 741 | |||||||||||||||||||||||||||||
| 742 | 0 | *minus = \&PDL::minus; | |||||||||||||||||||||||||||
| 743 | |||||||||||||||||||||||||||||
| 744 | |||||||||||||||||||||||||||||
| 745 | |||||||||||||||||||||||||||||
| 746 | |||||||||||||||||||||||||||||
| 747 | |||||||||||||||||||||||||||||
| 748 | |||||||||||||||||||||||||||||
| 749 | =head2 divide | ||||||||||||||||||||||||||||
| 750 | |||||||||||||||||||||||||||||
| 751 | =for sig | ||||||||||||||||||||||||||||
| 752 | |||||||||||||||||||||||||||||
| 753 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 754 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 755 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 756 | |||||||||||||||||||||||||||||
| 757 | =for usage | ||||||||||||||||||||||||||||
| 758 | |||||||||||||||||||||||||||||
| 759 | $c = $a / $b; # overloads the Perl '/' operator | ||||||||||||||||||||||||||||
| 760 | $a /= $b; | ||||||||||||||||||||||||||||
| 761 | $c = PDL::divide($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 762 | $c = PDL::divide($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 763 | PDL::divide($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 764 | $c = $a->divide($b); # method call | ||||||||||||||||||||||||||||
| 765 | $c = $a->divide($b, $swap); | ||||||||||||||||||||||||||||
| 766 | $a->divide($b, $c, $swap); | ||||||||||||||||||||||||||||
| 767 | $a->inplace->divide($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 768 | PDL::divide($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 769 | |||||||||||||||||||||||||||||
| 770 | =for ref | ||||||||||||||||||||||||||||
| 771 | |||||||||||||||||||||||||||||
| 772 | divide two ndarrays | ||||||||||||||||||||||||||||
| 773 | |||||||||||||||||||||||||||||
| 774 | =pod | ||||||||||||||||||||||||||||
| 775 | |||||||||||||||||||||||||||||
| 776 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 777 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 778 | |||||||||||||||||||||||||||||
| 779 | =for bad | ||||||||||||||||||||||||||||
| 780 | |||||||||||||||||||||||||||||
| 781 | C<divide> processes bad values. | ||||||||||||||||||||||||||||
| 782 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 783 | |||||||||||||||||||||||||||||
| 784 | =cut | ||||||||||||||||||||||||||||
| 785 | |||||||||||||||||||||||||||||
| 786 | |||||||||||||||||||||||||||||
| 787 | |||||||||||||||||||||||||||||
| 788 | |||||||||||||||||||||||||||||
| 789 | 70 | *divide = \&PDL::divide; | |||||||||||||||||||||||||||
| 790 | |||||||||||||||||||||||||||||
| 791 | |||||||||||||||||||||||||||||
| 792 | |||||||||||||||||||||||||||||
| 793 | |||||||||||||||||||||||||||||
| 794 | |||||||||||||||||||||||||||||
| 795 | |||||||||||||||||||||||||||||
| 796 | =head2 gt | ||||||||||||||||||||||||||||
| 797 | |||||||||||||||||||||||||||||
| 798 | =for sig | ||||||||||||||||||||||||||||
| 799 | |||||||||||||||||||||||||||||
| 800 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 801 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 802 | float double ldouble) | ||||||||||||||||||||||||||||
| 803 | |||||||||||||||||||||||||||||
| 804 | =for usage | ||||||||||||||||||||||||||||
| 805 | |||||||||||||||||||||||||||||
| 806 | $c = $a > $b; # overloads the Perl '>' operator | ||||||||||||||||||||||||||||
| 807 | $c = PDL::gt($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 808 | $c = PDL::gt($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 809 | PDL::gt($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 810 | $c = $a->gt($b); # method call | ||||||||||||||||||||||||||||
| 811 | $c = $a->gt($b, $swap); | ||||||||||||||||||||||||||||
| 812 | $a->gt($b, $c, $swap); | ||||||||||||||||||||||||||||
| 813 | $a->inplace->gt($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 814 | PDL::gt($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 815 | |||||||||||||||||||||||||||||
| 816 | =for ref | ||||||||||||||||||||||||||||
| 817 | |||||||||||||||||||||||||||||
| 818 | the binary E<gt> (greater than) operation | ||||||||||||||||||||||||||||
| 819 | |||||||||||||||||||||||||||||
| 820 | =pod | ||||||||||||||||||||||||||||
| 821 | |||||||||||||||||||||||||||||
| 822 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 823 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 824 | |||||||||||||||||||||||||||||
| 825 | =for bad | ||||||||||||||||||||||||||||
| 826 | |||||||||||||||||||||||||||||
| 827 | C<gt> processes bad values. | ||||||||||||||||||||||||||||
| 828 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 829 | |||||||||||||||||||||||||||||
| 830 | =cut | ||||||||||||||||||||||||||||
| 831 | |||||||||||||||||||||||||||||
| 832 | |||||||||||||||||||||||||||||
| 833 | |||||||||||||||||||||||||||||
| 834 | |||||||||||||||||||||||||||||
| 835 | 0 | *gt = \&PDL::gt; | |||||||||||||||||||||||||||
| 836 | |||||||||||||||||||||||||||||
| 837 | |||||||||||||||||||||||||||||
| 838 | |||||||||||||||||||||||||||||
| 839 | |||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||
| 841 | |||||||||||||||||||||||||||||
| 842 | =head2 lt | ||||||||||||||||||||||||||||
| 843 | |||||||||||||||||||||||||||||
| 844 | =for sig | ||||||||||||||||||||||||||||
| 845 | |||||||||||||||||||||||||||||
| 846 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 847 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 848 | float double ldouble) | ||||||||||||||||||||||||||||
| 849 | |||||||||||||||||||||||||||||
| 850 | =for usage | ||||||||||||||||||||||||||||
| 851 | |||||||||||||||||||||||||||||
| 852 | $c = $a < $b; # overloads the Perl '<' operator | ||||||||||||||||||||||||||||
| 853 | $c = PDL::lt($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 854 | $c = PDL::lt($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 855 | PDL::lt($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 856 | $c = $a->lt($b); # method call | ||||||||||||||||||||||||||||
| 857 | $c = $a->lt($b, $swap); | ||||||||||||||||||||||||||||
| 858 | $a->lt($b, $c, $swap); | ||||||||||||||||||||||||||||
| 859 | $a->inplace->lt($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 860 | PDL::lt($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 861 | |||||||||||||||||||||||||||||
| 862 | =for ref | ||||||||||||||||||||||||||||
| 863 | |||||||||||||||||||||||||||||
| 864 | the binary E<lt> (less than) operation | ||||||||||||||||||||||||||||
| 865 | |||||||||||||||||||||||||||||
| 866 | =pod | ||||||||||||||||||||||||||||
| 867 | |||||||||||||||||||||||||||||
| 868 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 869 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 870 | |||||||||||||||||||||||||||||
| 871 | =for bad | ||||||||||||||||||||||||||||
| 872 | |||||||||||||||||||||||||||||
| 873 | C<lt> processes bad values. | ||||||||||||||||||||||||||||
| 874 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 875 | |||||||||||||||||||||||||||||
| 876 | =cut | ||||||||||||||||||||||||||||
| 877 | |||||||||||||||||||||||||||||
| 878 | |||||||||||||||||||||||||||||
| 879 | |||||||||||||||||||||||||||||
| 880 | |||||||||||||||||||||||||||||
| 881 | 0 | *lt = \&PDL::lt; | |||||||||||||||||||||||||||
| 882 | |||||||||||||||||||||||||||||
| 883 | |||||||||||||||||||||||||||||
| 884 | |||||||||||||||||||||||||||||
| 885 | |||||||||||||||||||||||||||||
| 886 | |||||||||||||||||||||||||||||
| 887 | |||||||||||||||||||||||||||||
| 888 | =head2 le | ||||||||||||||||||||||||||||
| 889 | |||||||||||||||||||||||||||||
| 890 | =for sig | ||||||||||||||||||||||||||||
| 891 | |||||||||||||||||||||||||||||
| 892 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 893 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 894 | float double ldouble) | ||||||||||||||||||||||||||||
| 895 | |||||||||||||||||||||||||||||
| 896 | =for usage | ||||||||||||||||||||||||||||
| 897 | |||||||||||||||||||||||||||||
| 898 | $c = $a <= $b; # overloads the Perl '<=' operator | ||||||||||||||||||||||||||||
| 899 | $c = PDL::le($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 900 | $c = PDL::le($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 901 | PDL::le($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 902 | $c = $a->le($b); # method call | ||||||||||||||||||||||||||||
| 903 | $c = $a->le($b, $swap); | ||||||||||||||||||||||||||||
| 904 | $a->le($b, $c, $swap); | ||||||||||||||||||||||||||||
| 905 | $a->inplace->le($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 906 | PDL::le($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 907 | |||||||||||||||||||||||||||||
| 908 | =for ref | ||||||||||||||||||||||||||||
| 909 | |||||||||||||||||||||||||||||
| 910 | the binary E<lt>= (less equal) operation | ||||||||||||||||||||||||||||
| 911 | |||||||||||||||||||||||||||||
| 912 | =pod | ||||||||||||||||||||||||||||
| 913 | |||||||||||||||||||||||||||||
| 914 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 915 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 916 | |||||||||||||||||||||||||||||
| 917 | =for bad | ||||||||||||||||||||||||||||
| 918 | |||||||||||||||||||||||||||||
| 919 | C<le> processes bad values. | ||||||||||||||||||||||||||||
| 920 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 921 | |||||||||||||||||||||||||||||
| 922 | =cut | ||||||||||||||||||||||||||||
| 923 | |||||||||||||||||||||||||||||
| 924 | |||||||||||||||||||||||||||||
| 925 | |||||||||||||||||||||||||||||
| 926 | |||||||||||||||||||||||||||||
| 927 | 70 | *le = \&PDL::le; | |||||||||||||||||||||||||||
| 928 | |||||||||||||||||||||||||||||
| 929 | |||||||||||||||||||||||||||||
| 930 | |||||||||||||||||||||||||||||
| 931 | |||||||||||||||||||||||||||||
| 932 | |||||||||||||||||||||||||||||
| 933 | |||||||||||||||||||||||||||||
| 934 | =head2 ge | ||||||||||||||||||||||||||||
| 935 | |||||||||||||||||||||||||||||
| 936 | =for sig | ||||||||||||||||||||||||||||
| 937 | |||||||||||||||||||||||||||||
| 938 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 939 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 940 | float double ldouble) | ||||||||||||||||||||||||||||
| 941 | |||||||||||||||||||||||||||||
| 942 | =for usage | ||||||||||||||||||||||||||||
| 943 | |||||||||||||||||||||||||||||
| 944 | $c = $a >= $b; # overloads the Perl '>=' operator | ||||||||||||||||||||||||||||
| 945 | $c = PDL::ge($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 946 | $c = PDL::ge($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 947 | PDL::ge($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 948 | $c = $a->ge($b); # method call | ||||||||||||||||||||||||||||
| 949 | $c = $a->ge($b, $swap); | ||||||||||||||||||||||||||||
| 950 | $a->ge($b, $c, $swap); | ||||||||||||||||||||||||||||
| 951 | $a->inplace->ge($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 952 | PDL::ge($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 953 | |||||||||||||||||||||||||||||
| 954 | =for ref | ||||||||||||||||||||||||||||
| 955 | |||||||||||||||||||||||||||||
| 956 | the binary E<gt>= (greater equal) operation | ||||||||||||||||||||||||||||
| 957 | |||||||||||||||||||||||||||||
| 958 | =pod | ||||||||||||||||||||||||||||
| 959 | |||||||||||||||||||||||||||||
| 960 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 961 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 962 | |||||||||||||||||||||||||||||
| 963 | =for bad | ||||||||||||||||||||||||||||
| 964 | |||||||||||||||||||||||||||||
| 965 | C<ge> processes bad values. | ||||||||||||||||||||||||||||
| 966 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 967 | |||||||||||||||||||||||||||||
| 968 | =cut | ||||||||||||||||||||||||||||
| 969 | |||||||||||||||||||||||||||||
| 970 | |||||||||||||||||||||||||||||
| 971 | |||||||||||||||||||||||||||||
| 972 | |||||||||||||||||||||||||||||
| 973 | 0 | *ge = \&PDL::ge; | |||||||||||||||||||||||||||
| 974 | |||||||||||||||||||||||||||||
| 975 | |||||||||||||||||||||||||||||
| 976 | |||||||||||||||||||||||||||||
| 977 | |||||||||||||||||||||||||||||
| 978 | |||||||||||||||||||||||||||||
| 979 | |||||||||||||||||||||||||||||
| 980 | =head2 eq | ||||||||||||||||||||||||||||
| 981 | |||||||||||||||||||||||||||||
| 982 | =for sig | ||||||||||||||||||||||||||||
| 983 | |||||||||||||||||||||||||||||
| 984 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 985 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 986 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 987 | |||||||||||||||||||||||||||||
| 988 | =for usage | ||||||||||||||||||||||||||||
| 989 | |||||||||||||||||||||||||||||
| 990 | $c = $a == $b; # overloads the Perl '==' operator | ||||||||||||||||||||||||||||
| 991 | $c = PDL::eq($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 992 | $c = PDL::eq($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 993 | PDL::eq($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 994 | $c = $a->eq($b); # method call | ||||||||||||||||||||||||||||
| 995 | $c = $a->eq($b, $swap); | ||||||||||||||||||||||||||||
| 996 | $a->eq($b, $c, $swap); | ||||||||||||||||||||||||||||
| 997 | $a->inplace->eq($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 998 | PDL::eq($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 999 | |||||||||||||||||||||||||||||
| 1000 | =for ref | ||||||||||||||||||||||||||||
| 1001 | |||||||||||||||||||||||||||||
| 1002 | binary I<equal to> operation (C<==>) | ||||||||||||||||||||||||||||
| 1003 | |||||||||||||||||||||||||||||
| 1004 | =pod | ||||||||||||||||||||||||||||
| 1005 | |||||||||||||||||||||||||||||
| 1006 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1007 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1008 | |||||||||||||||||||||||||||||
| 1009 | =for bad | ||||||||||||||||||||||||||||
| 1010 | |||||||||||||||||||||||||||||
| 1011 | C<eq> processes bad values. | ||||||||||||||||||||||||||||
| 1012 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1013 | |||||||||||||||||||||||||||||
| 1014 | =cut | ||||||||||||||||||||||||||||
| 1015 | |||||||||||||||||||||||||||||
| 1016 | |||||||||||||||||||||||||||||
| 1017 | |||||||||||||||||||||||||||||
| 1018 | |||||||||||||||||||||||||||||
| 1019 | 0 | *eq = \&PDL::eq; | |||||||||||||||||||||||||||
| 1020 | |||||||||||||||||||||||||||||
| 1021 | |||||||||||||||||||||||||||||
| 1022 | |||||||||||||||||||||||||||||
| 1023 | |||||||||||||||||||||||||||||
| 1024 | |||||||||||||||||||||||||||||
| 1025 | |||||||||||||||||||||||||||||
| 1026 | =head2 ne | ||||||||||||||||||||||||||||
| 1027 | |||||||||||||||||||||||||||||
| 1028 | =for sig | ||||||||||||||||||||||||||||
| 1029 | |||||||||||||||||||||||||||||
| 1030 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1031 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1032 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1033 | |||||||||||||||||||||||||||||
| 1034 | =for usage | ||||||||||||||||||||||||||||
| 1035 | |||||||||||||||||||||||||||||
| 1036 | $c = $a != $b; # overloads the Perl '!=' operator | ||||||||||||||||||||||||||||
| 1037 | $c = PDL::ne($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1038 | $c = PDL::ne($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1039 | PDL::ne($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1040 | $c = $a->ne($b); # method call | ||||||||||||||||||||||||||||
| 1041 | $c = $a->ne($b, $swap); | ||||||||||||||||||||||||||||
| 1042 | $a->ne($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1043 | $a->inplace->ne($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1044 | PDL::ne($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1045 | |||||||||||||||||||||||||||||
| 1046 | =for ref | ||||||||||||||||||||||||||||
| 1047 | |||||||||||||||||||||||||||||
| 1048 | binary I<not equal to> operation (C<!=>) | ||||||||||||||||||||||||||||
| 1049 | |||||||||||||||||||||||||||||
| 1050 | =pod | ||||||||||||||||||||||||||||
| 1051 | |||||||||||||||||||||||||||||
| 1052 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1053 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1054 | |||||||||||||||||||||||||||||
| 1055 | =for bad | ||||||||||||||||||||||||||||
| 1056 | |||||||||||||||||||||||||||||
| 1057 | C<ne> processes bad values. | ||||||||||||||||||||||||||||
| 1058 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1059 | |||||||||||||||||||||||||||||
| 1060 | =cut | ||||||||||||||||||||||||||||
| 1061 | |||||||||||||||||||||||||||||
| 1062 | |||||||||||||||||||||||||||||
| 1063 | |||||||||||||||||||||||||||||
| 1064 | |||||||||||||||||||||||||||||
| 1065 | 70 | *ne = \&PDL::ne; | |||||||||||||||||||||||||||
| 1066 | |||||||||||||||||||||||||||||
| 1067 | |||||||||||||||||||||||||||||
| 1068 | |||||||||||||||||||||||||||||
| 1069 | |||||||||||||||||||||||||||||
| 1070 | |||||||||||||||||||||||||||||
| 1071 | |||||||||||||||||||||||||||||
| 1072 | =head2 shiftleft | ||||||||||||||||||||||||||||
| 1073 | |||||||||||||||||||||||||||||
| 1074 | =for sig | ||||||||||||||||||||||||||||
| 1075 | |||||||||||||||||||||||||||||
| 1076 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1077 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1078 | |||||||||||||||||||||||||||||
| 1079 | =for usage | ||||||||||||||||||||||||||||
| 1080 | |||||||||||||||||||||||||||||
| 1081 | $c = $a << $b; # overloads the Perl '<<' operator | ||||||||||||||||||||||||||||
| 1082 | $a <<= $b; | ||||||||||||||||||||||||||||
| 1083 | $c = PDL::shiftleft($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1084 | $c = PDL::shiftleft($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1085 | PDL::shiftleft($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1086 | $c = $a->shiftleft($b); # method call | ||||||||||||||||||||||||||||
| 1087 | $c = $a->shiftleft($b, $swap); | ||||||||||||||||||||||||||||
| 1088 | $a->shiftleft($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1089 | $a->inplace->shiftleft($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1090 | PDL::shiftleft($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1091 | |||||||||||||||||||||||||||||
| 1092 | =for ref | ||||||||||||||||||||||||||||
| 1093 | |||||||||||||||||||||||||||||
| 1094 | bitwise leftshift C<$a> by C<$b> | ||||||||||||||||||||||||||||
| 1095 | |||||||||||||||||||||||||||||
| 1096 | =pod | ||||||||||||||||||||||||||||
| 1097 | |||||||||||||||||||||||||||||
| 1098 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1099 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1100 | |||||||||||||||||||||||||||||
| 1101 | =for bad | ||||||||||||||||||||||||||||
| 1102 | |||||||||||||||||||||||||||||
| 1103 | C<shiftleft> processes bad values. | ||||||||||||||||||||||||||||
| 1104 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1105 | |||||||||||||||||||||||||||||
| 1106 | =cut | ||||||||||||||||||||||||||||
| 1107 | |||||||||||||||||||||||||||||
| 1108 | |||||||||||||||||||||||||||||
| 1109 | |||||||||||||||||||||||||||||
| 1110 | |||||||||||||||||||||||||||||
| 1111 | 0 | *shiftleft = \&PDL::shiftleft; | |||||||||||||||||||||||||||
| 1112 | |||||||||||||||||||||||||||||
| 1113 | |||||||||||||||||||||||||||||
| 1114 | |||||||||||||||||||||||||||||
| 1115 | |||||||||||||||||||||||||||||
| 1116 | |||||||||||||||||||||||||||||
| 1117 | |||||||||||||||||||||||||||||
| 1118 | =head2 shiftright | ||||||||||||||||||||||||||||
| 1119 | |||||||||||||||||||||||||||||
| 1120 | =for sig | ||||||||||||||||||||||||||||
| 1121 | |||||||||||||||||||||||||||||
| 1122 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1123 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1124 | |||||||||||||||||||||||||||||
| 1125 | =for usage | ||||||||||||||||||||||||||||
| 1126 | |||||||||||||||||||||||||||||
| 1127 | $c = $a >> $b; # overloads the Perl '>>' operator | ||||||||||||||||||||||||||||
| 1128 | $a >>= $b; | ||||||||||||||||||||||||||||
| 1129 | $c = PDL::shiftright($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1130 | $c = PDL::shiftright($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1131 | PDL::shiftright($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1132 | $c = $a->shiftright($b); # method call | ||||||||||||||||||||||||||||
| 1133 | $c = $a->shiftright($b, $swap); | ||||||||||||||||||||||||||||
| 1134 | $a->shiftright($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1135 | $a->inplace->shiftright($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1136 | PDL::shiftright($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1137 | |||||||||||||||||||||||||||||
| 1138 | =for ref | ||||||||||||||||||||||||||||
| 1139 | |||||||||||||||||||||||||||||
| 1140 | bitwise rightshift C<$a> by C<$b> | ||||||||||||||||||||||||||||
| 1141 | |||||||||||||||||||||||||||||
| 1142 | =pod | ||||||||||||||||||||||||||||
| 1143 | |||||||||||||||||||||||||||||
| 1144 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1145 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1146 | |||||||||||||||||||||||||||||
| 1147 | =for bad | ||||||||||||||||||||||||||||
| 1148 | |||||||||||||||||||||||||||||
| 1149 | C<shiftright> processes bad values. | ||||||||||||||||||||||||||||
| 1150 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1151 | |||||||||||||||||||||||||||||
| 1152 | =cut | ||||||||||||||||||||||||||||
| 1153 | |||||||||||||||||||||||||||||
| 1154 | |||||||||||||||||||||||||||||
| 1155 | |||||||||||||||||||||||||||||
| 1156 | |||||||||||||||||||||||||||||
| 1157 | 0 | *shiftright = \&PDL::shiftright; | |||||||||||||||||||||||||||
| 1158 | |||||||||||||||||||||||||||||
| 1159 | |||||||||||||||||||||||||||||
| 1160 | |||||||||||||||||||||||||||||
| 1161 | |||||||||||||||||||||||||||||
| 1162 | |||||||||||||||||||||||||||||
| 1163 | |||||||||||||||||||||||||||||
| 1164 | =head2 or2 | ||||||||||||||||||||||||||||
| 1165 | |||||||||||||||||||||||||||||
| 1166 | =for sig | ||||||||||||||||||||||||||||
| 1167 | |||||||||||||||||||||||||||||
| 1168 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1169 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1170 | |||||||||||||||||||||||||||||
| 1171 | =for usage | ||||||||||||||||||||||||||||
| 1172 | |||||||||||||||||||||||||||||
| 1173 | $c = $a | $b; # overloads the Perl '|' operator | ||||||||||||||||||||||||||||
| 1174 | $a |= $b; | ||||||||||||||||||||||||||||
| 1175 | $c = PDL::or2($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1176 | $c = PDL::or2($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1177 | PDL::or2($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1178 | $c = $a->or2($b); # method call | ||||||||||||||||||||||||||||
| 1179 | $c = $a->or2($b, $swap); | ||||||||||||||||||||||||||||
| 1180 | $a->or2($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1181 | $a->inplace->or2($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1182 | PDL::or2($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1183 | |||||||||||||||||||||||||||||
| 1184 | =for ref | ||||||||||||||||||||||||||||
| 1185 | |||||||||||||||||||||||||||||
| 1186 | bitwise I<or> of two ndarrays | ||||||||||||||||||||||||||||
| 1187 | |||||||||||||||||||||||||||||
| 1188 | =pod | ||||||||||||||||||||||||||||
| 1189 | |||||||||||||||||||||||||||||
| 1190 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1191 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1192 | |||||||||||||||||||||||||||||
| 1193 | =for bad | ||||||||||||||||||||||||||||
| 1194 | |||||||||||||||||||||||||||||
| 1195 | C<or2> processes bad values. | ||||||||||||||||||||||||||||
| 1196 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1197 | |||||||||||||||||||||||||||||
| 1198 | =cut | ||||||||||||||||||||||||||||
| 1199 | |||||||||||||||||||||||||||||
| 1200 | |||||||||||||||||||||||||||||
| 1201 | |||||||||||||||||||||||||||||
| 1202 | |||||||||||||||||||||||||||||
| 1203 | 70 | *or2 = \&PDL::or2; | |||||||||||||||||||||||||||
| 1204 | |||||||||||||||||||||||||||||
| 1205 | |||||||||||||||||||||||||||||
| 1206 | |||||||||||||||||||||||||||||
| 1207 | |||||||||||||||||||||||||||||
| 1208 | |||||||||||||||||||||||||||||
| 1209 | |||||||||||||||||||||||||||||
| 1210 | =head2 and2 | ||||||||||||||||||||||||||||
| 1211 | |||||||||||||||||||||||||||||
| 1212 | =for sig | ||||||||||||||||||||||||||||
| 1213 | |||||||||||||||||||||||||||||
| 1214 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1215 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1216 | |||||||||||||||||||||||||||||
| 1217 | =for usage | ||||||||||||||||||||||||||||
| 1218 | |||||||||||||||||||||||||||||
| 1219 | $c = $a & $b; # overloads the Perl '&' operator | ||||||||||||||||||||||||||||
| 1220 | $a &= $b; | ||||||||||||||||||||||||||||
| 1221 | $c = PDL::and2($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1222 | $c = PDL::and2($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1223 | PDL::and2($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1224 | $c = $a->and2($b); # method call | ||||||||||||||||||||||||||||
| 1225 | $c = $a->and2($b, $swap); | ||||||||||||||||||||||||||||
| 1226 | $a->and2($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1227 | $a->inplace->and2($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1228 | PDL::and2($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1229 | |||||||||||||||||||||||||||||
| 1230 | =for ref | ||||||||||||||||||||||||||||
| 1231 | |||||||||||||||||||||||||||||
| 1232 | bitwise I<and> of two ndarrays | ||||||||||||||||||||||||||||
| 1233 | |||||||||||||||||||||||||||||
| 1234 | =pod | ||||||||||||||||||||||||||||
| 1235 | |||||||||||||||||||||||||||||
| 1236 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1237 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1238 | |||||||||||||||||||||||||||||
| 1239 | =for bad | ||||||||||||||||||||||||||||
| 1240 | |||||||||||||||||||||||||||||
| 1241 | C<and2> processes bad values. | ||||||||||||||||||||||||||||
| 1242 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1243 | |||||||||||||||||||||||||||||
| 1244 | =cut | ||||||||||||||||||||||||||||
| 1245 | |||||||||||||||||||||||||||||
| 1246 | |||||||||||||||||||||||||||||
| 1247 | |||||||||||||||||||||||||||||
| 1248 | |||||||||||||||||||||||||||||
| 1249 | 0 | *and2 = \&PDL::and2; | |||||||||||||||||||||||||||
| 1250 | |||||||||||||||||||||||||||||
| 1251 | |||||||||||||||||||||||||||||
| 1252 | |||||||||||||||||||||||||||||
| 1253 | |||||||||||||||||||||||||||||
| 1254 | |||||||||||||||||||||||||||||
| 1255 | |||||||||||||||||||||||||||||
| 1256 | =head2 xor | ||||||||||||||||||||||||||||
| 1257 | |||||||||||||||||||||||||||||
| 1258 | =for sig | ||||||||||||||||||||||||||||
| 1259 | |||||||||||||||||||||||||||||
| 1260 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1261 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1262 | |||||||||||||||||||||||||||||
| 1263 | =for usage | ||||||||||||||||||||||||||||
| 1264 | |||||||||||||||||||||||||||||
| 1265 | $c = $a ^ $b; # overloads the Perl '^' operator | ||||||||||||||||||||||||||||
| 1266 | $a ^= $b; | ||||||||||||||||||||||||||||
| 1267 | $c = PDL::xor($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1268 | $c = PDL::xor($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1269 | PDL::xor($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1270 | $c = $a->xor($b); # method call | ||||||||||||||||||||||||||||
| 1271 | $c = $a->xor($b, $swap); | ||||||||||||||||||||||||||||
| 1272 | $a->xor($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1273 | $a->inplace->xor($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1274 | PDL::xor($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1275 | |||||||||||||||||||||||||||||
| 1276 | =for ref | ||||||||||||||||||||||||||||
| 1277 | |||||||||||||||||||||||||||||
| 1278 | bitwise I<exclusive or> of two ndarrays | ||||||||||||||||||||||||||||
| 1279 | |||||||||||||||||||||||||||||
| 1280 | =pod | ||||||||||||||||||||||||||||
| 1281 | |||||||||||||||||||||||||||||
| 1282 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1283 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1284 | |||||||||||||||||||||||||||||
| 1285 | =for bad | ||||||||||||||||||||||||||||
| 1286 | |||||||||||||||||||||||||||||
| 1287 | C<xor> processes bad values. | ||||||||||||||||||||||||||||
| 1288 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1289 | |||||||||||||||||||||||||||||
| 1290 | =cut | ||||||||||||||||||||||||||||
| 1291 | |||||||||||||||||||||||||||||
| 1292 | |||||||||||||||||||||||||||||
| 1293 | |||||||||||||||||||||||||||||
| 1294 | |||||||||||||||||||||||||||||
| 1295 | 0 | *xor = \&PDL::xor; | |||||||||||||||||||||||||||
| 1296 | |||||||||||||||||||||||||||||
| 1297 | |||||||||||||||||||||||||||||
| 1298 | |||||||||||||||||||||||||||||
| 1299 | |||||||||||||||||||||||||||||
| 1300 | |||||||||||||||||||||||||||||
| 1301 | #line 315 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 1302 | |||||||||||||||||||||||||||||
| 1303 | =head2 xor2 | ||||||||||||||||||||||||||||
| 1304 | |||||||||||||||||||||||||||||
| 1305 | =for ref | ||||||||||||||||||||||||||||
| 1306 | |||||||||||||||||||||||||||||
| 1307 | Synonym for L</xor>. | ||||||||||||||||||||||||||||
| 1308 | |||||||||||||||||||||||||||||
| 1309 | =cut | ||||||||||||||||||||||||||||
| 1310 | |||||||||||||||||||||||||||||
| 1311 | *PDL::xor2 = *xor2 = \&PDL::xor; | ||||||||||||||||||||||||||||
| 1312 | #line 1313 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 1313 | |||||||||||||||||||||||||||||
| 1314 | |||||||||||||||||||||||||||||
| 1315 | =head2 power | ||||||||||||||||||||||||||||
| 1316 | |||||||||||||||||||||||||||||
| 1317 | =for sig | ||||||||||||||||||||||||||||
| 1318 | |||||||||||||||||||||||||||||
| 1319 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1320 | Types: (cfloat cdouble cldouble float ldouble double) | ||||||||||||||||||||||||||||
| 1321 | |||||||||||||||||||||||||||||
| 1322 | =for usage | ||||||||||||||||||||||||||||
| 1323 | |||||||||||||||||||||||||||||
| 1324 | $c = $a ** $b; # overloads the Perl '**' operator | ||||||||||||||||||||||||||||
| 1325 | $a **= $b; | ||||||||||||||||||||||||||||
| 1326 | $c = PDL::power($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1327 | $c = PDL::power($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1328 | PDL::power($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1329 | $c = $a->power($b); # method call | ||||||||||||||||||||||||||||
| 1330 | $c = $a->power($b, $swap); | ||||||||||||||||||||||||||||
| 1331 | $a->power($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1332 | $a->inplace->power($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1333 | PDL::power($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1334 | |||||||||||||||||||||||||||||
| 1335 | =for ref | ||||||||||||||||||||||||||||
| 1336 | |||||||||||||||||||||||||||||
| 1337 | raise ndarray C<$a> to the power C<$b> | ||||||||||||||||||||||||||||
| 1338 | |||||||||||||||||||||||||||||
| 1339 | =pod | ||||||||||||||||||||||||||||
| 1340 | |||||||||||||||||||||||||||||
| 1341 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1342 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1343 | |||||||||||||||||||||||||||||
| 1344 | =for bad | ||||||||||||||||||||||||||||
| 1345 | |||||||||||||||||||||||||||||
| 1346 | C<power> processes bad values. | ||||||||||||||||||||||||||||
| 1347 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1348 | |||||||||||||||||||||||||||||
| 1349 | =cut | ||||||||||||||||||||||||||||
| 1350 | |||||||||||||||||||||||||||||
| 1351 | |||||||||||||||||||||||||||||
| 1352 | |||||||||||||||||||||||||||||
| 1353 | |||||||||||||||||||||||||||||
| 1354 | 70 | *power = \&PDL::power; | |||||||||||||||||||||||||||
| 1355 | |||||||||||||||||||||||||||||
| 1356 | |||||||||||||||||||||||||||||
| 1357 | |||||||||||||||||||||||||||||
| 1358 | |||||||||||||||||||||||||||||
| 1359 | |||||||||||||||||||||||||||||
| 1360 | |||||||||||||||||||||||||||||
| 1361 | =head2 atan2 | ||||||||||||||||||||||||||||
| 1362 | |||||||||||||||||||||||||||||
| 1363 | =for sig | ||||||||||||||||||||||||||||
| 1364 | |||||||||||||||||||||||||||||
| 1365 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1366 | Types: (float ldouble double) | ||||||||||||||||||||||||||||
| 1367 | |||||||||||||||||||||||||||||
| 1368 | =for usage | ||||||||||||||||||||||||||||
| 1369 | |||||||||||||||||||||||||||||
| 1370 | $c = atan2 $a, $b; # overloads the Perl 'atan2' operator | ||||||||||||||||||||||||||||
| 1371 | $c = PDL::atan2($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1372 | $c = PDL::atan2($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1373 | PDL::atan2($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1374 | $c = $a->atan2($b); # method call | ||||||||||||||||||||||||||||
| 1375 | $c = $a->atan2($b, $swap); | ||||||||||||||||||||||||||||
| 1376 | $a->atan2($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1377 | $a->inplace->atan2($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1378 | PDL::atan2($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1379 | |||||||||||||||||||||||||||||
| 1380 | =for ref | ||||||||||||||||||||||||||||
| 1381 | |||||||||||||||||||||||||||||
| 1382 | elementwise C<atan2> of two ndarrays | ||||||||||||||||||||||||||||
| 1383 | |||||||||||||||||||||||||||||
| 1384 | =pod | ||||||||||||||||||||||||||||
| 1385 | |||||||||||||||||||||||||||||
| 1386 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1387 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1388 | |||||||||||||||||||||||||||||
| 1389 | =for bad | ||||||||||||||||||||||||||||
| 1390 | |||||||||||||||||||||||||||||
| 1391 | C<atan2> processes bad values. | ||||||||||||||||||||||||||||
| 1392 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1393 | |||||||||||||||||||||||||||||
| 1394 | =cut | ||||||||||||||||||||||||||||
| 1395 | |||||||||||||||||||||||||||||
| 1396 | |||||||||||||||||||||||||||||
| 1397 | |||||||||||||||||||||||||||||
| 1398 | |||||||||||||||||||||||||||||
| 1399 | 70 | *atan2 = \&PDL::atan2; | |||||||||||||||||||||||||||
| 1400 | |||||||||||||||||||||||||||||
| 1401 | |||||||||||||||||||||||||||||
| 1402 | |||||||||||||||||||||||||||||
| 1403 | |||||||||||||||||||||||||||||
| 1404 | |||||||||||||||||||||||||||||
| 1405 | |||||||||||||||||||||||||||||
| 1406 | =head2 modulo | ||||||||||||||||||||||||||||
| 1407 | |||||||||||||||||||||||||||||
| 1408 | =for sig | ||||||||||||||||||||||||||||
| 1409 | |||||||||||||||||||||||||||||
| 1410 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1411 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1412 | float double ldouble) | ||||||||||||||||||||||||||||
| 1413 | |||||||||||||||||||||||||||||
| 1414 | =for usage | ||||||||||||||||||||||||||||
| 1415 | |||||||||||||||||||||||||||||
| 1416 | $c = $a % $b; # overloads the Perl '%' operator | ||||||||||||||||||||||||||||
| 1417 | $a %= $b; | ||||||||||||||||||||||||||||
| 1418 | $c = PDL::modulo($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1419 | $c = PDL::modulo($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1420 | PDL::modulo($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1421 | $c = $a->modulo($b); # method call | ||||||||||||||||||||||||||||
| 1422 | $c = $a->modulo($b, $swap); | ||||||||||||||||||||||||||||
| 1423 | $a->modulo($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1424 | $a->inplace->modulo($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1425 | PDL::modulo($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1426 | |||||||||||||||||||||||||||||
| 1427 | =for ref | ||||||||||||||||||||||||||||
| 1428 | |||||||||||||||||||||||||||||
| 1429 | elementwise C<modulo> operation | ||||||||||||||||||||||||||||
| 1430 | |||||||||||||||||||||||||||||
| 1431 | =pod | ||||||||||||||||||||||||||||
| 1432 | |||||||||||||||||||||||||||||
| 1433 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1434 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1435 | |||||||||||||||||||||||||||||
| 1436 | =for bad | ||||||||||||||||||||||||||||
| 1437 | |||||||||||||||||||||||||||||
| 1438 | C<modulo> processes bad values. | ||||||||||||||||||||||||||||
| 1439 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1440 | |||||||||||||||||||||||||||||
| 1441 | =cut | ||||||||||||||||||||||||||||
| 1442 | |||||||||||||||||||||||||||||
| 1443 | |||||||||||||||||||||||||||||
| 1444 | |||||||||||||||||||||||||||||
| 1445 | |||||||||||||||||||||||||||||
| 1446 | 0 | *modulo = \&PDL::modulo; | |||||||||||||||||||||||||||
| 1447 | |||||||||||||||||||||||||||||
| 1448 | |||||||||||||||||||||||||||||
| 1449 | |||||||||||||||||||||||||||||
| 1450 | |||||||||||||||||||||||||||||
| 1451 | |||||||||||||||||||||||||||||
| 1452 | |||||||||||||||||||||||||||||
| 1453 | =head2 spaceship | ||||||||||||||||||||||||||||
| 1454 | |||||||||||||||||||||||||||||
| 1455 | =for sig | ||||||||||||||||||||||||||||
| 1456 | |||||||||||||||||||||||||||||
| 1457 | Signature: (a(); b(); [o]c(); int $swap) | ||||||||||||||||||||||||||||
| 1458 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1459 | float double ldouble) | ||||||||||||||||||||||||||||
| 1460 | |||||||||||||||||||||||||||||
| 1461 | =for usage | ||||||||||||||||||||||||||||
| 1462 | |||||||||||||||||||||||||||||
| 1463 | $c = $a <=> $b; # overloads the Perl '<=>' operator | ||||||||||||||||||||||||||||
| 1464 | $c = PDL::spaceship($a, $b); # using default value of swap=0 | ||||||||||||||||||||||||||||
| 1465 | $c = PDL::spaceship($a, $b, $swap); # overriding default | ||||||||||||||||||||||||||||
| 1466 | PDL::spaceship($a, $b, $c, $swap); # all arguments given | ||||||||||||||||||||||||||||
| 1467 | $c = $a->spaceship($b); # method call | ||||||||||||||||||||||||||||
| 1468 | $c = $a->spaceship($b, $swap); | ||||||||||||||||||||||||||||
| 1469 | $a->spaceship($b, $c, $swap); | ||||||||||||||||||||||||||||
| 1470 | $a->inplace->spaceship($b, $swap); # can be used inplace | ||||||||||||||||||||||||||||
| 1471 | PDL::spaceship($a->inplace, $b, $swap); | ||||||||||||||||||||||||||||
| 1472 | |||||||||||||||||||||||||||||
| 1473 | =for ref | ||||||||||||||||||||||||||||
| 1474 | |||||||||||||||||||||||||||||
| 1475 | elementwise "<=>" operation | ||||||||||||||||||||||||||||
| 1476 | |||||||||||||||||||||||||||||
| 1477 | =pod | ||||||||||||||||||||||||||||
| 1478 | |||||||||||||||||||||||||||||
| 1479 | Can operate inplace with C<a> as output C<c>. | ||||||||||||||||||||||||||||
| 1480 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1481 | |||||||||||||||||||||||||||||
| 1482 | =for bad | ||||||||||||||||||||||||||||
| 1483 | |||||||||||||||||||||||||||||
| 1484 | C<spaceship> processes bad values. | ||||||||||||||||||||||||||||
| 1485 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1486 | |||||||||||||||||||||||||||||
| 1487 | =cut | ||||||||||||||||||||||||||||
| 1488 | |||||||||||||||||||||||||||||
| 1489 | |||||||||||||||||||||||||||||
| 1490 | |||||||||||||||||||||||||||||
| 1491 | |||||||||||||||||||||||||||||
| 1492 | 70 | *spaceship = \&PDL::spaceship; | |||||||||||||||||||||||||||
| 1493 | |||||||||||||||||||||||||||||
| 1494 | |||||||||||||||||||||||||||||
| 1495 | |||||||||||||||||||||||||||||
| 1496 | |||||||||||||||||||||||||||||
| 1497 | |||||||||||||||||||||||||||||
| 1498 | |||||||||||||||||||||||||||||
| 1499 | =head2 bitnot | ||||||||||||||||||||||||||||
| 1500 | |||||||||||||||||||||||||||||
| 1501 | =for sig | ||||||||||||||||||||||||||||
| 1502 | |||||||||||||||||||||||||||||
| 1503 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1504 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong) | ||||||||||||||||||||||||||||
| 1505 | |||||||||||||||||||||||||||||
| 1506 | =for usage | ||||||||||||||||||||||||||||
| 1507 | |||||||||||||||||||||||||||||
| 1508 | $b = ~$a; # overloads the Perl '~' operator | ||||||||||||||||||||||||||||
| 1509 | $b = PDL::bitnot($a); | ||||||||||||||||||||||||||||
| 1510 | PDL::bitnot($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1511 | $b = $a->bitnot; # method call | ||||||||||||||||||||||||||||
| 1512 | $a->bitnot($b); | ||||||||||||||||||||||||||||
| 1513 | $a->inplace->bitnot; # can be used inplace | ||||||||||||||||||||||||||||
| 1514 | PDL::bitnot($a->inplace); | ||||||||||||||||||||||||||||
| 1515 | |||||||||||||||||||||||||||||
| 1516 | =for ref | ||||||||||||||||||||||||||||
| 1517 | |||||||||||||||||||||||||||||
| 1518 | unary bitwise negation | ||||||||||||||||||||||||||||
| 1519 | |||||||||||||||||||||||||||||
| 1520 | =pod | ||||||||||||||||||||||||||||
| 1521 | |||||||||||||||||||||||||||||
| 1522 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1523 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1524 | |||||||||||||||||||||||||||||
| 1525 | =for bad | ||||||||||||||||||||||||||||
| 1526 | |||||||||||||||||||||||||||||
| 1527 | C<bitnot> processes bad values. | ||||||||||||||||||||||||||||
| 1528 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1529 | |||||||||||||||||||||||||||||
| 1530 | =cut | ||||||||||||||||||||||||||||
| 1531 | |||||||||||||||||||||||||||||
| 1532 | |||||||||||||||||||||||||||||
| 1533 | |||||||||||||||||||||||||||||
| 1534 | |||||||||||||||||||||||||||||
| 1535 | 0 | *bitnot = \&PDL::bitnot; | |||||||||||||||||||||||||||
| 1536 | |||||||||||||||||||||||||||||
| 1537 | |||||||||||||||||||||||||||||
| 1538 | |||||||||||||||||||||||||||||
| 1539 | |||||||||||||||||||||||||||||
| 1540 | |||||||||||||||||||||||||||||
| 1541 | |||||||||||||||||||||||||||||
| 1542 | =head2 sqrt | ||||||||||||||||||||||||||||
| 1543 | |||||||||||||||||||||||||||||
| 1544 | =for sig | ||||||||||||||||||||||||||||
| 1545 | |||||||||||||||||||||||||||||
| 1546 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1547 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1548 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1549 | |||||||||||||||||||||||||||||
| 1550 | =for usage | ||||||||||||||||||||||||||||
| 1551 | |||||||||||||||||||||||||||||
| 1552 | $b = sqrt $a; # overloads the Perl 'sqrt' operator | ||||||||||||||||||||||||||||
| 1553 | $b = PDL::sqrt($a); | ||||||||||||||||||||||||||||
| 1554 | PDL::sqrt($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1555 | $b = $a->sqrt; # method call | ||||||||||||||||||||||||||||
| 1556 | $a->sqrt($b); | ||||||||||||||||||||||||||||
| 1557 | $a->inplace->sqrt; # can be used inplace | ||||||||||||||||||||||||||||
| 1558 | PDL::sqrt($a->inplace); | ||||||||||||||||||||||||||||
| 1559 | |||||||||||||||||||||||||||||
| 1560 | =for ref | ||||||||||||||||||||||||||||
| 1561 | |||||||||||||||||||||||||||||
| 1562 | elementwise square root | ||||||||||||||||||||||||||||
| 1563 | |||||||||||||||||||||||||||||
| 1564 | =pod | ||||||||||||||||||||||||||||
| 1565 | |||||||||||||||||||||||||||||
| 1566 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1567 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1568 | |||||||||||||||||||||||||||||
| 1569 | =for bad | ||||||||||||||||||||||||||||
| 1570 | |||||||||||||||||||||||||||||
| 1571 | C<sqrt> processes bad values. | ||||||||||||||||||||||||||||
| 1572 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1573 | |||||||||||||||||||||||||||||
| 1574 | =cut | ||||||||||||||||||||||||||||
| 1575 | |||||||||||||||||||||||||||||
| 1576 | |||||||||||||||||||||||||||||
| 1577 | |||||||||||||||||||||||||||||
| 1578 | |||||||||||||||||||||||||||||
| 1579 | 0 | *sqrt = \&PDL::sqrt; | |||||||||||||||||||||||||||
| 1580 | |||||||||||||||||||||||||||||
| 1581 | |||||||||||||||||||||||||||||
| 1582 | |||||||||||||||||||||||||||||
| 1583 | |||||||||||||||||||||||||||||
| 1584 | |||||||||||||||||||||||||||||
| 1585 | |||||||||||||||||||||||||||||
| 1586 | =head2 sin | ||||||||||||||||||||||||||||
| 1587 | |||||||||||||||||||||||||||||
| 1588 | =for sig | ||||||||||||||||||||||||||||
| 1589 | |||||||||||||||||||||||||||||
| 1590 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1591 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1592 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1593 | |||||||||||||||||||||||||||||
| 1594 | =for usage | ||||||||||||||||||||||||||||
| 1595 | |||||||||||||||||||||||||||||
| 1596 | $b = sin $a; # overloads the Perl 'sin' operator | ||||||||||||||||||||||||||||
| 1597 | $b = PDL::sin($a); | ||||||||||||||||||||||||||||
| 1598 | PDL::sin($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1599 | $b = $a->sin; # method call | ||||||||||||||||||||||||||||
| 1600 | $a->sin($b); | ||||||||||||||||||||||||||||
| 1601 | $a->inplace->sin; # can be used inplace | ||||||||||||||||||||||||||||
| 1602 | PDL::sin($a->inplace); | ||||||||||||||||||||||||||||
| 1603 | |||||||||||||||||||||||||||||
| 1604 | =for ref | ||||||||||||||||||||||||||||
| 1605 | |||||||||||||||||||||||||||||
| 1606 | the sin function | ||||||||||||||||||||||||||||
| 1607 | |||||||||||||||||||||||||||||
| 1608 | =pod | ||||||||||||||||||||||||||||
| 1609 | |||||||||||||||||||||||||||||
| 1610 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1611 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1612 | |||||||||||||||||||||||||||||
| 1613 | =for bad | ||||||||||||||||||||||||||||
| 1614 | |||||||||||||||||||||||||||||
| 1615 | C<sin> processes bad values. | ||||||||||||||||||||||||||||
| 1616 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1617 | |||||||||||||||||||||||||||||
| 1618 | =cut | ||||||||||||||||||||||||||||
| 1619 | |||||||||||||||||||||||||||||
| 1620 | |||||||||||||||||||||||||||||
| 1621 | |||||||||||||||||||||||||||||
| 1622 | |||||||||||||||||||||||||||||
| 1623 | 70 | *sin = \&PDL::sin; | |||||||||||||||||||||||||||
| 1624 | |||||||||||||||||||||||||||||
| 1625 | |||||||||||||||||||||||||||||
| 1626 | |||||||||||||||||||||||||||||
| 1627 | |||||||||||||||||||||||||||||
| 1628 | |||||||||||||||||||||||||||||
| 1629 | |||||||||||||||||||||||||||||
| 1630 | =head2 cos | ||||||||||||||||||||||||||||
| 1631 | |||||||||||||||||||||||||||||
| 1632 | =for sig | ||||||||||||||||||||||||||||
| 1633 | |||||||||||||||||||||||||||||
| 1634 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1635 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1636 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1637 | |||||||||||||||||||||||||||||
| 1638 | =for usage | ||||||||||||||||||||||||||||
| 1639 | |||||||||||||||||||||||||||||
| 1640 | $b = cos $a; # overloads the Perl 'cos' operator | ||||||||||||||||||||||||||||
| 1641 | $b = PDL::cos($a); | ||||||||||||||||||||||||||||
| 1642 | PDL::cos($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1643 | $b = $a->cos; # method call | ||||||||||||||||||||||||||||
| 1644 | $a->cos($b); | ||||||||||||||||||||||||||||
| 1645 | $a->inplace->cos; # can be used inplace | ||||||||||||||||||||||||||||
| 1646 | PDL::cos($a->inplace); | ||||||||||||||||||||||||||||
| 1647 | |||||||||||||||||||||||||||||
| 1648 | =for ref | ||||||||||||||||||||||||||||
| 1649 | |||||||||||||||||||||||||||||
| 1650 | the cos function | ||||||||||||||||||||||||||||
| 1651 | |||||||||||||||||||||||||||||
| 1652 | =pod | ||||||||||||||||||||||||||||
| 1653 | |||||||||||||||||||||||||||||
| 1654 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1655 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1656 | |||||||||||||||||||||||||||||
| 1657 | =for bad | ||||||||||||||||||||||||||||
| 1658 | |||||||||||||||||||||||||||||
| 1659 | C<cos> processes bad values. | ||||||||||||||||||||||||||||
| 1660 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1661 | |||||||||||||||||||||||||||||
| 1662 | =cut | ||||||||||||||||||||||||||||
| 1663 | |||||||||||||||||||||||||||||
| 1664 | |||||||||||||||||||||||||||||
| 1665 | |||||||||||||||||||||||||||||
| 1666 | |||||||||||||||||||||||||||||
| 1667 | 70 | *cos = \&PDL::cos; | |||||||||||||||||||||||||||
| 1668 | |||||||||||||||||||||||||||||
| 1669 | |||||||||||||||||||||||||||||
| 1670 | |||||||||||||||||||||||||||||
| 1671 | |||||||||||||||||||||||||||||
| 1672 | |||||||||||||||||||||||||||||
| 1673 | |||||||||||||||||||||||||||||
| 1674 | =head2 not | ||||||||||||||||||||||||||||
| 1675 | |||||||||||||||||||||||||||||
| 1676 | =for sig | ||||||||||||||||||||||||||||
| 1677 | |||||||||||||||||||||||||||||
| 1678 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1679 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1680 | float double ldouble) | ||||||||||||||||||||||||||||
| 1681 | |||||||||||||||||||||||||||||
| 1682 | =for usage | ||||||||||||||||||||||||||||
| 1683 | |||||||||||||||||||||||||||||
| 1684 | $b = !$a; # overloads the Perl '!' operator | ||||||||||||||||||||||||||||
| 1685 | $b = PDL::not($a); | ||||||||||||||||||||||||||||
| 1686 | PDL::not($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1687 | $b = $a->not; # method call | ||||||||||||||||||||||||||||
| 1688 | $a->not($b); | ||||||||||||||||||||||||||||
| 1689 | $a->inplace->not; # can be used inplace | ||||||||||||||||||||||||||||
| 1690 | PDL::not($a->inplace); | ||||||||||||||||||||||||||||
| 1691 | |||||||||||||||||||||||||||||
| 1692 | =for ref | ||||||||||||||||||||||||||||
| 1693 | |||||||||||||||||||||||||||||
| 1694 | the elementwise I<not> operation | ||||||||||||||||||||||||||||
| 1695 | |||||||||||||||||||||||||||||
| 1696 | =pod | ||||||||||||||||||||||||||||
| 1697 | |||||||||||||||||||||||||||||
| 1698 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1699 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1700 | |||||||||||||||||||||||||||||
| 1701 | =for bad | ||||||||||||||||||||||||||||
| 1702 | |||||||||||||||||||||||||||||
| 1703 | C<not> processes bad values. | ||||||||||||||||||||||||||||
| 1704 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1705 | |||||||||||||||||||||||||||||
| 1706 | =cut | ||||||||||||||||||||||||||||
| 1707 | |||||||||||||||||||||||||||||
| 1708 | |||||||||||||||||||||||||||||
| 1709 | |||||||||||||||||||||||||||||
| 1710 | |||||||||||||||||||||||||||||
| 1711 | 0 | *not = \&PDL::not; | |||||||||||||||||||||||||||
| 1712 | |||||||||||||||||||||||||||||
| 1713 | |||||||||||||||||||||||||||||
| 1714 | |||||||||||||||||||||||||||||
| 1715 | |||||||||||||||||||||||||||||
| 1716 | |||||||||||||||||||||||||||||
| 1717 | |||||||||||||||||||||||||||||
| 1718 | =head2 exp | ||||||||||||||||||||||||||||
| 1719 | |||||||||||||||||||||||||||||
| 1720 | =for sig | ||||||||||||||||||||||||||||
| 1721 | |||||||||||||||||||||||||||||
| 1722 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1723 | Types: (cfloat cdouble cldouble float ldouble double) | ||||||||||||||||||||||||||||
| 1724 | |||||||||||||||||||||||||||||
| 1725 | =for usage | ||||||||||||||||||||||||||||
| 1726 | |||||||||||||||||||||||||||||
| 1727 | $b = exp $a; # overloads the Perl 'exp' operator | ||||||||||||||||||||||||||||
| 1728 | $b = PDL::exp($a); | ||||||||||||||||||||||||||||
| 1729 | PDL::exp($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1730 | $b = $a->exp; # method call | ||||||||||||||||||||||||||||
| 1731 | $a->exp($b); | ||||||||||||||||||||||||||||
| 1732 | $a->inplace->exp; # can be used inplace | ||||||||||||||||||||||||||||
| 1733 | PDL::exp($a->inplace); | ||||||||||||||||||||||||||||
| 1734 | |||||||||||||||||||||||||||||
| 1735 | =for ref | ||||||||||||||||||||||||||||
| 1736 | |||||||||||||||||||||||||||||
| 1737 | the exponential function | ||||||||||||||||||||||||||||
| 1738 | |||||||||||||||||||||||||||||
| 1739 | =pod | ||||||||||||||||||||||||||||
| 1740 | |||||||||||||||||||||||||||||
| 1741 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1742 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1743 | |||||||||||||||||||||||||||||
| 1744 | =for bad | ||||||||||||||||||||||||||||
| 1745 | |||||||||||||||||||||||||||||
| 1746 | C<exp> processes bad values. | ||||||||||||||||||||||||||||
| 1747 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1748 | |||||||||||||||||||||||||||||
| 1749 | =cut | ||||||||||||||||||||||||||||
| 1750 | |||||||||||||||||||||||||||||
| 1751 | |||||||||||||||||||||||||||||
| 1752 | |||||||||||||||||||||||||||||
| 1753 | |||||||||||||||||||||||||||||
| 1754 | 70 | *exp = \&PDL::exp; | |||||||||||||||||||||||||||
| 1755 | |||||||||||||||||||||||||||||
| 1756 | |||||||||||||||||||||||||||||
| 1757 | |||||||||||||||||||||||||||||
| 1758 | |||||||||||||||||||||||||||||
| 1759 | |||||||||||||||||||||||||||||
| 1760 | |||||||||||||||||||||||||||||
| 1761 | =head2 log | ||||||||||||||||||||||||||||
| 1762 | |||||||||||||||||||||||||||||
| 1763 | =for sig | ||||||||||||||||||||||||||||
| 1764 | |||||||||||||||||||||||||||||
| 1765 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1766 | Types: (cfloat cdouble cldouble float ldouble double) | ||||||||||||||||||||||||||||
| 1767 | |||||||||||||||||||||||||||||
| 1768 | =for usage | ||||||||||||||||||||||||||||
| 1769 | |||||||||||||||||||||||||||||
| 1770 | $b = log $a; # overloads the Perl 'log' operator | ||||||||||||||||||||||||||||
| 1771 | $b = PDL::log($a); | ||||||||||||||||||||||||||||
| 1772 | PDL::log($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1773 | $b = $a->log; # method call | ||||||||||||||||||||||||||||
| 1774 | $a->log($b); | ||||||||||||||||||||||||||||
| 1775 | $a->inplace->log; # can be used inplace | ||||||||||||||||||||||||||||
| 1776 | PDL::log($a->inplace); | ||||||||||||||||||||||||||||
| 1777 | |||||||||||||||||||||||||||||
| 1778 | =for ref | ||||||||||||||||||||||||||||
| 1779 | |||||||||||||||||||||||||||||
| 1780 | the natural logarithm | ||||||||||||||||||||||||||||
| 1781 | |||||||||||||||||||||||||||||
| 1782 | =pod | ||||||||||||||||||||||||||||
| 1783 | |||||||||||||||||||||||||||||
| 1784 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1785 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1786 | |||||||||||||||||||||||||||||
| 1787 | =for bad | ||||||||||||||||||||||||||||
| 1788 | |||||||||||||||||||||||||||||
| 1789 | C<log> processes bad values. | ||||||||||||||||||||||||||||
| 1790 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1791 | |||||||||||||||||||||||||||||
| 1792 | =cut | ||||||||||||||||||||||||||||
| 1793 | |||||||||||||||||||||||||||||
| 1794 | |||||||||||||||||||||||||||||
| 1795 | |||||||||||||||||||||||||||||
| 1796 | |||||||||||||||||||||||||||||
| 1797 | 70 | *log = \&PDL::log; | |||||||||||||||||||||||||||
| 1798 | |||||||||||||||||||||||||||||
| 1799 | |||||||||||||||||||||||||||||
| 1800 | |||||||||||||||||||||||||||||
| 1801 | |||||||||||||||||||||||||||||
| 1802 | |||||||||||||||||||||||||||||
| 1803 | |||||||||||||||||||||||||||||
| 1804 | =head2 re | ||||||||||||||||||||||||||||
| 1805 | |||||||||||||||||||||||||||||
| 1806 | =for sig | ||||||||||||||||||||||||||||
| 1807 | |||||||||||||||||||||||||||||
| 1808 | Signature: (complexv(); real [o]b()) | ||||||||||||||||||||||||||||
| 1809 | Types: (cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1810 | |||||||||||||||||||||||||||||
| 1811 | =for usage | ||||||||||||||||||||||||||||
| 1812 | |||||||||||||||||||||||||||||
| 1813 | $b = PDL::re($complexv); | ||||||||||||||||||||||||||||
| 1814 | PDL::re($complexv, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1815 | $b = $complexv->re; # method call | ||||||||||||||||||||||||||||
| 1816 | $complexv->re($b); | ||||||||||||||||||||||||||||
| 1817 | $complexv->re .= $data; # usable as lvalue | ||||||||||||||||||||||||||||
| 1818 | |||||||||||||||||||||||||||||
| 1819 | =for ref | ||||||||||||||||||||||||||||
| 1820 | |||||||||||||||||||||||||||||
| 1821 | Returns the real part of a complex number. Flows data back & forth. | ||||||||||||||||||||||||||||
| 1822 | |||||||||||||||||||||||||||||
| 1823 | =pod | ||||||||||||||||||||||||||||
| 1824 | |||||||||||||||||||||||||||||
| 1825 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1826 | Creates data-flow back and forth by default. | ||||||||||||||||||||||||||||
| 1827 | |||||||||||||||||||||||||||||
| 1828 | =for bad | ||||||||||||||||||||||||||||
| 1829 | |||||||||||||||||||||||||||||
| 1830 | C<re> processes bad values. | ||||||||||||||||||||||||||||
| 1831 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1832 | |||||||||||||||||||||||||||||
| 1833 | =cut | ||||||||||||||||||||||||||||
| 1834 | |||||||||||||||||||||||||||||
| 1835 | |||||||||||||||||||||||||||||
| 1836 | |||||||||||||||||||||||||||||
| 1837 | |||||||||||||||||||||||||||||
| 1838 | 70 | *re = \&PDL::re; | |||||||||||||||||||||||||||
| 1839 | |||||||||||||||||||||||||||||
| 1840 | |||||||||||||||||||||||||||||
| 1841 | |||||||||||||||||||||||||||||
| 1842 | |||||||||||||||||||||||||||||
| 1843 | |||||||||||||||||||||||||||||
| 1844 | |||||||||||||||||||||||||||||
| 1845 | =head2 im | ||||||||||||||||||||||||||||
| 1846 | |||||||||||||||||||||||||||||
| 1847 | =for sig | ||||||||||||||||||||||||||||
| 1848 | |||||||||||||||||||||||||||||
| 1849 | Signature: (complexv(); real [o]b()) | ||||||||||||||||||||||||||||
| 1850 | Types: (cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1851 | |||||||||||||||||||||||||||||
| 1852 | =for usage | ||||||||||||||||||||||||||||
| 1853 | |||||||||||||||||||||||||||||
| 1854 | $b = PDL::im($complexv); | ||||||||||||||||||||||||||||
| 1855 | PDL::im($complexv, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1856 | $b = $complexv->im; # method call | ||||||||||||||||||||||||||||
| 1857 | $complexv->im($b); | ||||||||||||||||||||||||||||
| 1858 | $complexv->im .= $data; # usable as lvalue | ||||||||||||||||||||||||||||
| 1859 | |||||||||||||||||||||||||||||
| 1860 | =for ref | ||||||||||||||||||||||||||||
| 1861 | |||||||||||||||||||||||||||||
| 1862 | Returns the imaginary part of a complex number. Flows data back & forth. | ||||||||||||||||||||||||||||
| 1863 | |||||||||||||||||||||||||||||
| 1864 | =pod | ||||||||||||||||||||||||||||
| 1865 | |||||||||||||||||||||||||||||
| 1866 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1867 | Creates data-flow back and forth by default. | ||||||||||||||||||||||||||||
| 1868 | |||||||||||||||||||||||||||||
| 1869 | =for bad | ||||||||||||||||||||||||||||
| 1870 | |||||||||||||||||||||||||||||
| 1871 | C<im> processes bad values. | ||||||||||||||||||||||||||||
| 1872 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1873 | |||||||||||||||||||||||||||||
| 1874 | =cut | ||||||||||||||||||||||||||||
| 1875 | |||||||||||||||||||||||||||||
| 1876 | |||||||||||||||||||||||||||||
| 1877 | |||||||||||||||||||||||||||||
| 1878 | |||||||||||||||||||||||||||||
| 1879 | 70 | *im = \&PDL::im; | |||||||||||||||||||||||||||
| 1880 | |||||||||||||||||||||||||||||
| 1881 | |||||||||||||||||||||||||||||
| 1882 | |||||||||||||||||||||||||||||
| 1883 | |||||||||||||||||||||||||||||
| 1884 | |||||||||||||||||||||||||||||
| 1885 | |||||||||||||||||||||||||||||
| 1886 | =head2 _cabs | ||||||||||||||||||||||||||||
| 1887 | |||||||||||||||||||||||||||||
| 1888 | =for sig | ||||||||||||||||||||||||||||
| 1889 | |||||||||||||||||||||||||||||
| 1890 | Signature: (complexv(); real [o]b()) | ||||||||||||||||||||||||||||
| 1891 | Types: (cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1892 | |||||||||||||||||||||||||||||
| 1893 | =for usage | ||||||||||||||||||||||||||||
| 1894 | |||||||||||||||||||||||||||||
| 1895 | $b = PDL::_cabs($complexv); | ||||||||||||||||||||||||||||
| 1896 | PDL::_cabs($complexv, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1897 | $b = $complexv->_cabs; # method call | ||||||||||||||||||||||||||||
| 1898 | $complexv->_cabs($b); | ||||||||||||||||||||||||||||
| 1899 | |||||||||||||||||||||||||||||
| 1900 | =for ref | ||||||||||||||||||||||||||||
| 1901 | |||||||||||||||||||||||||||||
| 1902 | Returns the absolute (length) of a complex number. | ||||||||||||||||||||||||||||
| 1903 | |||||||||||||||||||||||||||||
| 1904 | =pod | ||||||||||||||||||||||||||||
| 1905 | |||||||||||||||||||||||||||||
| 1906 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1907 | |||||||||||||||||||||||||||||
| 1908 | =for bad | ||||||||||||||||||||||||||||
| 1909 | |||||||||||||||||||||||||||||
| 1910 | C<_cabs> processes bad values. | ||||||||||||||||||||||||||||
| 1911 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1912 | |||||||||||||||||||||||||||||
| 1913 | =cut | ||||||||||||||||||||||||||||
| 1914 | |||||||||||||||||||||||||||||
| 1915 | |||||||||||||||||||||||||||||
| 1916 | |||||||||||||||||||||||||||||
| 1917 | |||||||||||||||||||||||||||||
| 1918 | |||||||||||||||||||||||||||||
| 1919 | |||||||||||||||||||||||||||||
| 1920 | |||||||||||||||||||||||||||||
| 1921 | |||||||||||||||||||||||||||||
| 1922 | |||||||||||||||||||||||||||||
| 1923 | |||||||||||||||||||||||||||||
| 1924 | |||||||||||||||||||||||||||||
| 1925 | |||||||||||||||||||||||||||||
| 1926 | |||||||||||||||||||||||||||||
| 1927 | |||||||||||||||||||||||||||||
| 1928 | =head2 log10 | ||||||||||||||||||||||||||||
| 1929 | |||||||||||||||||||||||||||||
| 1930 | =for sig | ||||||||||||||||||||||||||||
| 1931 | |||||||||||||||||||||||||||||
| 1932 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1933 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1934 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1935 | |||||||||||||||||||||||||||||
| 1936 | =for usage | ||||||||||||||||||||||||||||
| 1937 | |||||||||||||||||||||||||||||
| 1938 | $b = log10($a); | ||||||||||||||||||||||||||||
| 1939 | log10($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1940 | $b = $a->log10; # method call | ||||||||||||||||||||||||||||
| 1941 | $a->log10($b); | ||||||||||||||||||||||||||||
| 1942 | $a->inplace->log10; # can be used inplace | ||||||||||||||||||||||||||||
| 1943 | log10($a->inplace); | ||||||||||||||||||||||||||||
| 1944 | |||||||||||||||||||||||||||||
| 1945 | =for ref | ||||||||||||||||||||||||||||
| 1946 | |||||||||||||||||||||||||||||
| 1947 | the base 10 logarithm | ||||||||||||||||||||||||||||
| 1948 | |||||||||||||||||||||||||||||
| 1949 | =pod | ||||||||||||||||||||||||||||
| 1950 | |||||||||||||||||||||||||||||
| 1951 | Can operate inplace with C<a> as output C<b>. | ||||||||||||||||||||||||||||
| 1952 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 1953 | |||||||||||||||||||||||||||||
| 1954 | =for bad | ||||||||||||||||||||||||||||
| 1955 | |||||||||||||||||||||||||||||
| 1956 | C<log10> processes bad values. | ||||||||||||||||||||||||||||
| 1957 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 1958 | |||||||||||||||||||||||||||||
| 1959 | =cut | ||||||||||||||||||||||||||||
| 1960 | |||||||||||||||||||||||||||||
| 1961 | |||||||||||||||||||||||||||||
| 1962 | |||||||||||||||||||||||||||||
| 1963 | |||||||||||||||||||||||||||||
| 1964 | sub PDL::log10 { | ||||||||||||||||||||||||||||
| 1965 | 13 | ▶ | my ($x, $y) = @_; | ||||||||||||||||||||||||||
|
Subroutine
log10: called CC=6 SCAR=18.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 1966 | 13 | ▶ | return log($x) / log(10) if !UNIVERSAL::isa($x,"PDL"); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1967 | 11 | ▶ | barf "inplace but output given" if $x->is_inplace and defined $y; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$x->is_inplace and defined $y
MC/DC0%0/2
$x->is_inplace and defined $y
$x->is_inplace
defined $y
Truth table66%2/3
A and B
A= $x->is_inplaceB= defined $y
| |||||||||||||||||||||||||||||
| 1968 | 11 | ▶ | if ($x->is_inplace) { $x->set_inplace(0); $y = $x; } | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 1969 | 7 | elsif (!defined $y) { $y = $x->initialize; } | |||||||||||||||||||||||||||
| 1970 | 11 | &PDL::_log10_int( $x, $y ); | |||||||||||||||||||||||||||
| 1971 | 11 | $y; | |||||||||||||||||||||||||||
| 1972 | }; | ||||||||||||||||||||||||||||
| 1973 | |||||||||||||||||||||||||||||
| 1974 | |||||||||||||||||||||||||||||
| 1975 | |||||||||||||||||||||||||||||
| 1976 | 70 | *log10 = \&PDL::log10; | |||||||||||||||||||||||||||
| 1977 | |||||||||||||||||||||||||||||
| 1978 | |||||||||||||||||||||||||||||
| 1979 | |||||||||||||||||||||||||||||
| 1980 | |||||||||||||||||||||||||||||
| 1981 | |||||||||||||||||||||||||||||
| 1982 | |||||||||||||||||||||||||||||
| 1983 | =head2 assgn | ||||||||||||||||||||||||||||
| 1984 | |||||||||||||||||||||||||||||
| 1985 | =for sig | ||||||||||||||||||||||||||||
| 1986 | |||||||||||||||||||||||||||||
| 1987 | Signature: (a(); [o]b()) | ||||||||||||||||||||||||||||
| 1988 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 1989 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 1990 | |||||||||||||||||||||||||||||
| 1991 | =for usage | ||||||||||||||||||||||||||||
| 1992 | |||||||||||||||||||||||||||||
| 1993 | $b = assgn($a); | ||||||||||||||||||||||||||||
| 1994 | assgn($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 1995 | $b = $a->assgn; # method call | ||||||||||||||||||||||||||||
| 1996 | $a->assgn($b); | ||||||||||||||||||||||||||||
| 1997 | |||||||||||||||||||||||||||||
| 1998 | =for ref | ||||||||||||||||||||||||||||
| 1999 | |||||||||||||||||||||||||||||
| 2000 | Plain numerical assignment. This is used to implement the ".=" operator | ||||||||||||||||||||||||||||
| 2001 | |||||||||||||||||||||||||||||
| 2002 | =pod | ||||||||||||||||||||||||||||
| 2003 | |||||||||||||||||||||||||||||
| 2004 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2005 | |||||||||||||||||||||||||||||
| 2006 | =for bad | ||||||||||||||||||||||||||||
| 2007 | |||||||||||||||||||||||||||||
| 2008 | C<assgn> processes bad values. | ||||||||||||||||||||||||||||
| 2009 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2010 | |||||||||||||||||||||||||||||
| 2011 | =cut | ||||||||||||||||||||||||||||
| 2012 | |||||||||||||||||||||||||||||
| 2013 | |||||||||||||||||||||||||||||
| 2014 | |||||||||||||||||||||||||||||
| 2015 | |||||||||||||||||||||||||||||
| 2016 | 70 | *assgn = \&PDL::assgn; | |||||||||||||||||||||||||||
| 2017 | |||||||||||||||||||||||||||||
| 2018 | |||||||||||||||||||||||||||||
| 2019 | |||||||||||||||||||||||||||||
| 2020 | |||||||||||||||||||||||||||||
| 2021 | |||||||||||||||||||||||||||||
| 2022 | |||||||||||||||||||||||||||||
| 2023 | =head2 carg | ||||||||||||||||||||||||||||
| 2024 | |||||||||||||||||||||||||||||
| 2025 | =for sig | ||||||||||||||||||||||||||||
| 2026 | |||||||||||||||||||||||||||||
| 2027 | Signature: (!real complexv(); real [o]b()) | ||||||||||||||||||||||||||||
| 2028 | Types: (cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 2029 | |||||||||||||||||||||||||||||
| 2030 | =for usage | ||||||||||||||||||||||||||||
| 2031 | |||||||||||||||||||||||||||||
| 2032 | $b = carg($complexv); | ||||||||||||||||||||||||||||
| 2033 | carg($complexv, $b); # all arguments given | ||||||||||||||||||||||||||||
| 2034 | $b = $complexv->carg; # method call | ||||||||||||||||||||||||||||
| 2035 | $complexv->carg($b); | ||||||||||||||||||||||||||||
| 2036 | |||||||||||||||||||||||||||||
| 2037 | =for ref | ||||||||||||||||||||||||||||
| 2038 | |||||||||||||||||||||||||||||
| 2039 | Returns the polar angle of a complex number. | ||||||||||||||||||||||||||||
| 2040 | |||||||||||||||||||||||||||||
| 2041 | =pod | ||||||||||||||||||||||||||||
| 2042 | |||||||||||||||||||||||||||||
| 2043 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2044 | |||||||||||||||||||||||||||||
| 2045 | =for bad | ||||||||||||||||||||||||||||
| 2046 | |||||||||||||||||||||||||||||
| 2047 | C<carg> processes bad values. | ||||||||||||||||||||||||||||
| 2048 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2049 | |||||||||||||||||||||||||||||
| 2050 | =cut | ||||||||||||||||||||||||||||
| 2051 | |||||||||||||||||||||||||||||
| 2052 | |||||||||||||||||||||||||||||
| 2053 | |||||||||||||||||||||||||||||
| 2054 | |||||||||||||||||||||||||||||
| 2055 | 0 | *carg = \&PDL::carg; | |||||||||||||||||||||||||||
| 2056 | |||||||||||||||||||||||||||||
| 2057 | |||||||||||||||||||||||||||||
| 2058 | |||||||||||||||||||||||||||||
| 2059 | |||||||||||||||||||||||||||||
| 2060 | |||||||||||||||||||||||||||||
| 2061 | |||||||||||||||||||||||||||||
| 2062 | =head2 conj | ||||||||||||||||||||||||||||
| 2063 | |||||||||||||||||||||||||||||
| 2064 | =for sig | ||||||||||||||||||||||||||||
| 2065 | |||||||||||||||||||||||||||||
| 2066 | Signature: (complexv(); [o]b()) | ||||||||||||||||||||||||||||
| 2067 | Types: (cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 2068 | |||||||||||||||||||||||||||||
| 2069 | =for usage | ||||||||||||||||||||||||||||
| 2070 | |||||||||||||||||||||||||||||
| 2071 | $b = conj($complexv); | ||||||||||||||||||||||||||||
| 2072 | conj($complexv, $b); # all arguments given | ||||||||||||||||||||||||||||
| 2073 | $b = $complexv->conj; # method call | ||||||||||||||||||||||||||||
| 2074 | $complexv->conj($b); | ||||||||||||||||||||||||||||
| 2075 | $complexv->inplace->conj; # can be used inplace | ||||||||||||||||||||||||||||
| 2076 | conj($complexv->inplace); | ||||||||||||||||||||||||||||
| 2077 | |||||||||||||||||||||||||||||
| 2078 | =for ref | ||||||||||||||||||||||||||||
| 2079 | |||||||||||||||||||||||||||||
| 2080 | complex conjugate. | ||||||||||||||||||||||||||||
| 2081 | |||||||||||||||||||||||||||||
| 2082 | =pod | ||||||||||||||||||||||||||||
| 2083 | |||||||||||||||||||||||||||||
| 2084 | Can operate inplace with C<complexv> as output C<b>. | ||||||||||||||||||||||||||||
| 2085 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2086 | |||||||||||||||||||||||||||||
| 2087 | =for bad | ||||||||||||||||||||||||||||
| 2088 | |||||||||||||||||||||||||||||
| 2089 | C<conj> processes bad values. | ||||||||||||||||||||||||||||
| 2090 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2091 | |||||||||||||||||||||||||||||
| 2092 | =cut | ||||||||||||||||||||||||||||
| 2093 | |||||||||||||||||||||||||||||
| 2094 | |||||||||||||||||||||||||||||
| 2095 | |||||||||||||||||||||||||||||
| 2096 | |||||||||||||||||||||||||||||
| 2097 | 70 | *conj = \&PDL::conj; | |||||||||||||||||||||||||||
| 2098 | |||||||||||||||||||||||||||||
| 2099 | |||||||||||||||||||||||||||||
| 2100 | |||||||||||||||||||||||||||||
| 2101 | |||||||||||||||||||||||||||||
| 2102 | |||||||||||||||||||||||||||||
| 2103 | |||||||||||||||||||||||||||||
| 2104 | =head2 czip | ||||||||||||||||||||||||||||
| 2105 | |||||||||||||||||||||||||||||
| 2106 | =for sig | ||||||||||||||||||||||||||||
| 2107 | |||||||||||||||||||||||||||||
| 2108 | Signature: (!complex r(); !complex i(); complex [o]c()) | ||||||||||||||||||||||||||||
| 2109 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 2110 | float double ldouble) | ||||||||||||||||||||||||||||
| 2111 | |||||||||||||||||||||||||||||
| 2112 | =for usage | ||||||||||||||||||||||||||||
| 2113 | |||||||||||||||||||||||||||||
| 2114 | $c = czip($r, $i); | ||||||||||||||||||||||||||||
| 2115 | czip($r, $i, $c); # all arguments given | ||||||||||||||||||||||||||||
| 2116 | $c = $r->czip($i); # method call | ||||||||||||||||||||||||||||
| 2117 | $r->czip($i, $c); | ||||||||||||||||||||||||||||
| 2118 | |||||||||||||||||||||||||||||
| 2119 | =for ref | ||||||||||||||||||||||||||||
| 2120 | |||||||||||||||||||||||||||||
| 2121 | Convert real, imaginary to native complex, (sort of) like the LISP zip function. | ||||||||||||||||||||||||||||
| 2122 | |||||||||||||||||||||||||||||
| 2123 | Will add the C<r> ndarray to "i" times the C<i> ndarray. Only | ||||||||||||||||||||||||||||
| 2124 | takes real ndarrays as input. | ||||||||||||||||||||||||||||
| 2125 | |||||||||||||||||||||||||||||
| 2126 | =pod | ||||||||||||||||||||||||||||
| 2127 | |||||||||||||||||||||||||||||
| 2128 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2129 | |||||||||||||||||||||||||||||
| 2130 | =for bad | ||||||||||||||||||||||||||||
| 2131 | |||||||||||||||||||||||||||||
| 2132 | C<czip> does not process bad values. | ||||||||||||||||||||||||||||
| 2133 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2134 | |||||||||||||||||||||||||||||
| 2135 | =cut | ||||||||||||||||||||||||||||
| 2136 | |||||||||||||||||||||||||||||
| 2137 | |||||||||||||||||||||||||||||
| 2138 | |||||||||||||||||||||||||||||
| 2139 | |||||||||||||||||||||||||||||
| 2140 | 70 | *czip = \&PDL::czip; | |||||||||||||||||||||||||||
| 2141 | |||||||||||||||||||||||||||||
| 2142 | |||||||||||||||||||||||||||||
| 2143 | |||||||||||||||||||||||||||||
| 2144 | |||||||||||||||||||||||||||||
| 2145 | |||||||||||||||||||||||||||||
| 2146 | |||||||||||||||||||||||||||||
| 2147 | =head2 ipow | ||||||||||||||||||||||||||||
| 2148 | |||||||||||||||||||||||||||||
| 2149 | =for sig | ||||||||||||||||||||||||||||
| 2150 | |||||||||||||||||||||||||||||
| 2151 | Signature: (a(); longlong b(); [o] ans()) | ||||||||||||||||||||||||||||
| 2152 | Types: (ulonglong longlong float ldouble cfloat cdouble cldouble | ||||||||||||||||||||||||||||
| 2153 | double) | ||||||||||||||||||||||||||||
| 2154 | |||||||||||||||||||||||||||||
| 2155 | =for usage | ||||||||||||||||||||||||||||
| 2156 | |||||||||||||||||||||||||||||
| 2157 | $ans = ipow($a, $b); | ||||||||||||||||||||||||||||
| 2158 | ipow($a, $b, $ans); # all arguments given | ||||||||||||||||||||||||||||
| 2159 | $ans = $a->ipow($b); # method call | ||||||||||||||||||||||||||||
| 2160 | $a->ipow($b, $ans); | ||||||||||||||||||||||||||||
| 2161 | $a->inplace->ipow($b); # can be used inplace | ||||||||||||||||||||||||||||
| 2162 | ipow($a->inplace, $b); | ||||||||||||||||||||||||||||
| 2163 | |||||||||||||||||||||||||||||
| 2164 | =for ref | ||||||||||||||||||||||||||||
| 2165 | |||||||||||||||||||||||||||||
| 2166 | raise ndarray C<$a> to integer power C<$b> | ||||||||||||||||||||||||||||
| 2167 | |||||||||||||||||||||||||||||
| 2168 | Algorithm from L<Wikipedia|http://en.wikipedia.org/wiki/Exponentiation_by_squaring> | ||||||||||||||||||||||||||||
| 2169 | |||||||||||||||||||||||||||||
| 2170 | =pod | ||||||||||||||||||||||||||||
| 2171 | |||||||||||||||||||||||||||||
| 2172 | Can operate inplace with C<a> as output C<ans>. | ||||||||||||||||||||||||||||
| 2173 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2174 | |||||||||||||||||||||||||||||
| 2175 | =for bad | ||||||||||||||||||||||||||||
| 2176 | |||||||||||||||||||||||||||||
| 2177 | C<ipow> does not process bad values. | ||||||||||||||||||||||||||||
| 2178 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2179 | |||||||||||||||||||||||||||||
| 2180 | =cut | ||||||||||||||||||||||||||||
| 2181 | |||||||||||||||||||||||||||||
| 2182 | |||||||||||||||||||||||||||||
| 2183 | |||||||||||||||||||||||||||||
| 2184 | |||||||||||||||||||||||||||||
| 2185 | 70 | *ipow = \&PDL::ipow; | |||||||||||||||||||||||||||
| 2186 | |||||||||||||||||||||||||||||
| 2187 | |||||||||||||||||||||||||||||
| 2188 | |||||||||||||||||||||||||||||
| 2189 | |||||||||||||||||||||||||||||
| 2190 | |||||||||||||||||||||||||||||
| 2191 | #line 478 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 2192 | |||||||||||||||||||||||||||||
| 2193 | =head2 abs | ||||||||||||||||||||||||||||
| 2194 | |||||||||||||||||||||||||||||
| 2195 | =for ref | ||||||||||||||||||||||||||||
| 2196 | |||||||||||||||||||||||||||||
| 2197 | Returns the absolute value of a number. | ||||||||||||||||||||||||||||
| 2198 | |||||||||||||||||||||||||||||
| 2199 | =cut | ||||||||||||||||||||||||||||
| 2200 | |||||||||||||||||||||||||||||
| 2201 | sub PDL::abs { $_[0]->type->real ? goto &PDL::_rabs : goto &PDL::_cabs } | ||||||||||||||||||||||||||||
| 2202 | #line 2203 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 2203 | |||||||||||||||||||||||||||||
| 2204 | |||||||||||||||||||||||||||||
| 2205 | =head2 abs2 | ||||||||||||||||||||||||||||
| 2206 | |||||||||||||||||||||||||||||
| 2207 | =for sig | ||||||||||||||||||||||||||||
| 2208 | |||||||||||||||||||||||||||||
| 2209 | Signature: (a(); real [o]b()) | ||||||||||||||||||||||||||||
| 2210 | Types: (sbyte byte short ushort long ulong indx ulonglong longlong | ||||||||||||||||||||||||||||
| 2211 | float double ldouble cfloat cdouble cldouble) | ||||||||||||||||||||||||||||
| 2212 | |||||||||||||||||||||||||||||
| 2213 | =for usage | ||||||||||||||||||||||||||||
| 2214 | |||||||||||||||||||||||||||||
| 2215 | $b = abs2($a); | ||||||||||||||||||||||||||||
| 2216 | abs2($a, $b); # all arguments given | ||||||||||||||||||||||||||||
| 2217 | $b = $a->abs2; # method call | ||||||||||||||||||||||||||||
| 2218 | $a->abs2($b); | ||||||||||||||||||||||||||||
| 2219 | |||||||||||||||||||||||||||||
| 2220 | =for ref | ||||||||||||||||||||||||||||
| 2221 | |||||||||||||||||||||||||||||
| 2222 | Returns the square of the absolute value of a number. | ||||||||||||||||||||||||||||
| 2223 | |||||||||||||||||||||||||||||
| 2224 | =pod | ||||||||||||||||||||||||||||
| 2225 | |||||||||||||||||||||||||||||
| 2226 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2227 | |||||||||||||||||||||||||||||
| 2228 | =for bad | ||||||||||||||||||||||||||||
| 2229 | |||||||||||||||||||||||||||||
| 2230 | C<abs2> processes bad values. | ||||||||||||||||||||||||||||
| 2231 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2232 | |||||||||||||||||||||||||||||
| 2233 | =cut | ||||||||||||||||||||||||||||
| 2234 | |||||||||||||||||||||||||||||
| 2235 | |||||||||||||||||||||||||||||
| 2236 | |||||||||||||||||||||||||||||
| 2237 | |||||||||||||||||||||||||||||
| 2238 | 70 | *abs2 = \&PDL::abs2; | |||||||||||||||||||||||||||
| 2239 | |||||||||||||||||||||||||||||
| 2240 | |||||||||||||||||||||||||||||
| 2241 | |||||||||||||||||||||||||||||
| 2242 | |||||||||||||||||||||||||||||
| 2243 | |||||||||||||||||||||||||||||
| 2244 | |||||||||||||||||||||||||||||
| 2245 | =head2 r2C | ||||||||||||||||||||||||||||
| 2246 | |||||||||||||||||||||||||||||
| 2247 | =for sig | ||||||||||||||||||||||||||||
| 2248 | |||||||||||||||||||||||||||||
| 2249 | Signature: (r(); complex [o]c()) | ||||||||||||||||||||||||||||
| 2250 | Types: (float ldouble cfloat cdouble cldouble double) | ||||||||||||||||||||||||||||
| 2251 | |||||||||||||||||||||||||||||
| 2252 | =for usage | ||||||||||||||||||||||||||||
| 2253 | |||||||||||||||||||||||||||||
| 2254 | $c = r2C($r); | ||||||||||||||||||||||||||||
| 2255 | r2C($r, $c); # all arguments given | ||||||||||||||||||||||||||||
| 2256 | $c = $r->r2C; # method call | ||||||||||||||||||||||||||||
| 2257 | $r->r2C($c); | ||||||||||||||||||||||||||||
| 2258 | |||||||||||||||||||||||||||||
| 2259 | =for ref | ||||||||||||||||||||||||||||
| 2260 | |||||||||||||||||||||||||||||
| 2261 | convert real to native complex, with an imaginary part of zero | ||||||||||||||||||||||||||||
| 2262 | |||||||||||||||||||||||||||||
| 2263 | =pod | ||||||||||||||||||||||||||||
| 2264 | |||||||||||||||||||||||||||||
| 2265 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2266 | |||||||||||||||||||||||||||||
| 2267 | =for bad | ||||||||||||||||||||||||||||
| 2268 | |||||||||||||||||||||||||||||
| 2269 | C<r2C> does not process bad values. | ||||||||||||||||||||||||||||
| 2270 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2271 | |||||||||||||||||||||||||||||
| 2272 | =cut | ||||||||||||||||||||||||||||
| 2273 | |||||||||||||||||||||||||||||
| 2274 | |||||||||||||||||||||||||||||
| 2275 | |||||||||||||||||||||||||||||
| 2276 | |||||||||||||||||||||||||||||
| 2277 | sub PDL::r2C ($) { | ||||||||||||||||||||||||||||
| 2278 | 34 | ▶ | return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | ||||||||||||||||||||||||||
|
Subroutine
r2C: called CC=4 SCAR=14.0
Pod
undocumented
Branch: 1 branch
Condition100%3/3
UNIVERSAL::isa($_[0], "PDL") and CORE::not $_[0]->type->real
MC/DC100%2/2
UNIVERSAL::isa($_[0], "PDL") and CORE::not $_[0]->type->real
UNIVERSAL::isa($_[0], "PDL")
CORE::not $_[0]->type->real
Truth table100%3/3
A and not(B)
A= UNIVERSAL::isa($_[0], "PDL")B= CORE::not $_[0]->type->real
| |||||||||||||||||||||||||||||
| 2279 | 26 | ▶ | my $r = $_[1] // PDL->nullcreate($_[0]); | ||||||||||||||||||||||||||
|
Condition33%1/3
$_[1] // "PDL"->nullcreate($_[0])
MC/DC0%0/2
$_[1] // "PDL"->nullcreate($_[0])
$_[1]
"PDL"->nullcreate($_[0])
Truth table33%1/3
A // B
A= $_[1]B= "PDL"->nullcreate($_[0])
| |||||||||||||||||||||||||||||
| 2280 | 26 | PDL::_r2C_int($_[0], $r); | |||||||||||||||||||||||||||
| 2281 | 26 | $r; | |||||||||||||||||||||||||||
| 2282 | } | ||||||||||||||||||||||||||||
| 2283 | |||||||||||||||||||||||||||||
| 2284 | |||||||||||||||||||||||||||||
| 2285 | |||||||||||||||||||||||||||||
| 2286 | 70 | *r2C = \&PDL::r2C; | |||||||||||||||||||||||||||
| 2287 | |||||||||||||||||||||||||||||
| 2288 | |||||||||||||||||||||||||||||
| 2289 | |||||||||||||||||||||||||||||
| 2290 | |||||||||||||||||||||||||||||
| 2291 | |||||||||||||||||||||||||||||
| 2292 | |||||||||||||||||||||||||||||
| 2293 | =head2 i2C | ||||||||||||||||||||||||||||
| 2294 | |||||||||||||||||||||||||||||
| 2295 | =for sig | ||||||||||||||||||||||||||||
| 2296 | |||||||||||||||||||||||||||||
| 2297 | Signature: (i(); complex [o]c()) | ||||||||||||||||||||||||||||
| 2298 | Types: (float ldouble cfloat cdouble cldouble double) | ||||||||||||||||||||||||||||
| 2299 | |||||||||||||||||||||||||||||
| 2300 | =for usage | ||||||||||||||||||||||||||||
| 2301 | |||||||||||||||||||||||||||||
| 2302 | $c = i2C($i); | ||||||||||||||||||||||||||||
| 2303 | i2C($i, $c); # all arguments given | ||||||||||||||||||||||||||||
| 2304 | $c = $i->i2C; # method call | ||||||||||||||||||||||||||||
| 2305 | $i->i2C($c); | ||||||||||||||||||||||||||||
| 2306 | |||||||||||||||||||||||||||||
| 2307 | =for ref | ||||||||||||||||||||||||||||
| 2308 | |||||||||||||||||||||||||||||
| 2309 | convert imaginary to native complex, with a real part of zero | ||||||||||||||||||||||||||||
| 2310 | |||||||||||||||||||||||||||||
| 2311 | =pod | ||||||||||||||||||||||||||||
| 2312 | |||||||||||||||||||||||||||||
| 2313 | Broadcasts over its inputs. | ||||||||||||||||||||||||||||
| 2314 | |||||||||||||||||||||||||||||
| 2315 | =for bad | ||||||||||||||||||||||||||||
| 2316 | |||||||||||||||||||||||||||||
| 2317 | C<i2C> does not process bad values. | ||||||||||||||||||||||||||||
| 2318 | It will set the bad-value flag of all output ndarrays if the flag is set for any of the input ndarrays. | ||||||||||||||||||||||||||||
| 2319 | |||||||||||||||||||||||||||||
| 2320 | =cut | ||||||||||||||||||||||||||||
| 2321 | |||||||||||||||||||||||||||||
| 2322 | |||||||||||||||||||||||||||||
| 2323 | |||||||||||||||||||||||||||||
| 2324 | |||||||||||||||||||||||||||||
| 2325 | sub PDL::i2C ($) { | ||||||||||||||||||||||||||||
| 2326 | 3 | ▶ | return $_[0] if UNIVERSAL::isa($_[0], 'PDL') and !$_[0]->type->real; | ||||||||||||||||||||||||||
|
Subroutine
i2C: called CC=4 SCAR=16.4
Pod
undocumented
Branch: 1 branch
Condition33%1/3
UNIVERSAL::isa($_[0], "PDL") and CORE::not $_[0]->type->real
MC/DC0%0/2
UNIVERSAL::isa($_[0], "PDL") and CORE::not $_[0]->type->real
UNIVERSAL::isa($_[0], "PDL")
CORE::not $_[0]->type->real
Truth table33%1/3
A and not(B)
A= UNIVERSAL::isa($_[0], "PDL")B= CORE::not $_[0]->type->real
| |||||||||||||||||||||||||||||
| 2327 | 3 | ▶ | my $r = $_[1] // PDL->nullcreate($_[0]); | ||||||||||||||||||||||||||
|
Condition33%1/3
$_[1] // "PDL"->nullcreate($_[0])
MC/DC0%0/2
$_[1] // "PDL"->nullcreate($_[0])
$_[1]
"PDL"->nullcreate($_[0])
Truth table33%1/3
A // B
A= $_[1]B= "PDL"->nullcreate($_[0])
| |||||||||||||||||||||||||||||
| 2328 | 3 | PDL::_i2C_int($_[0], $r); | |||||||||||||||||||||||||||
| 2329 | 3 | $r; | |||||||||||||||||||||||||||
| 2330 | } | ||||||||||||||||||||||||||||
| 2331 | |||||||||||||||||||||||||||||
| 2332 | |||||||||||||||||||||||||||||
| 2333 | |||||||||||||||||||||||||||||
| 2334 | 70 | *i2C = \&PDL::i2C; | |||||||||||||||||||||||||||
| 2335 | |||||||||||||||||||||||||||||
| 2336 | |||||||||||||||||||||||||||||
| 2337 | |||||||||||||||||||||||||||||
| 2338 | |||||||||||||||||||||||||||||
| 2339 | |||||||||||||||||||||||||||||
| 2340 | #line 535 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 2341 | |||||||||||||||||||||||||||||
| 2342 | # This is to used warn if an operand is non-numeric or non-PDL. | ||||||||||||||||||||||||||||
| 2343 | sub warn_non_numeric_op_wrapper { | ||||||||||||||||||||||||||||
| 2344 | require Scalar::Util; | ||||||||||||||||||||||||||||
| 2345 | my ($cb, $op_name) = @_; | ||||||||||||||||||||||||||||
| 2346 | return sub { | ||||||||||||||||||||||||||||
| 2347 | my ($op1, $op2) = @_; | ||||||||||||||||||||||||||||
| 2348 | warn "'$op2' is not numeric nor a PDL in operator $op_name" | ||||||||||||||||||||||||||||
| 2349 | unless Scalar::Util::looks_like_number($op2) | ||||||||||||||||||||||||||||
| 2350 | || ( Scalar::Util::blessed($op2) && $op2->isa('PDL') ); | ||||||||||||||||||||||||||||
| 2351 | $cb->(@_); | ||||||||||||||||||||||||||||
| 2352 | } | ||||||||||||||||||||||||||||
| 2353 | } | ||||||||||||||||||||||||||||
| 2354 | |||||||||||||||||||||||||||||
| 2355 | { package # hide from MetaCPAN | ||||||||||||||||||||||||||||
| 2356 | PDL; | ||||||||||||||||||||||||||||
| 2357 | sub overload_dotequals { | ||||||||||||||||||||||||||||
| 2358 | my @args = !$_[2] ? @_[1,0] : @_[0,1]; | ||||||||||||||||||||||||||||
| 2359 | PDL::Ops::assgn(@args); | ||||||||||||||||||||||||||||
| 2360 | return $args[1]; | ||||||||||||||||||||||||||||
| 2361 | } | ||||||||||||||||||||||||||||
| 2362 | sub overload_abs { PDL::abs($_[0]) } | ||||||||||||||||||||||||||||
| 2363 | sub overload_plusplus { | ||||||||||||||||||||||||||||
| 2364 | $_[0] += ($PDL::Core::pdl_ones[$_[0]->get_datatype] | ||||||||||||||||||||||||||||
| 2365 | // barf "Couldn't find 'one' for type ", $_[0]->get_datatype | ||||||||||||||||||||||||||||
| 2366 | ) | ||||||||||||||||||||||||||||
| 2367 | } | ||||||||||||||||||||||||||||
| 2368 | sub overload_minusminus { | ||||||||||||||||||||||||||||
| 2369 | $_[0] -= ($PDL::Core::pdl_ones[$_[0]->get_datatype] | ||||||||||||||||||||||||||||
| 2370 | // barf "Couldn't find 'one' for type ", $_[0]->get_datatype | ||||||||||||||||||||||||||||
| 2371 | ) | ||||||||||||||||||||||||||||
| 2372 | } | ||||||||||||||||||||||||||||
| 2373 | use overload | ||||||||||||||||||||||||||||
| 2374 | "eq" => PDL::Ops::warn_non_numeric_op_wrapper(\&PDL::eq, 'eq'), | ||||||||||||||||||||||||||||
| 2375 | ".=" => \&overload_dotequals, | ||||||||||||||||||||||||||||
| 2376 | 'abs' => \&overload_abs, | ||||||||||||||||||||||||||||
| 2377 | '++' => \&overload_plusplus, | ||||||||||||||||||||||||||||
| 2378 | '--' => \&overload_minusminus, | ||||||||||||||||||||||||||||
| 2379 | ; | ||||||||||||||||||||||||||||
| 2380 | } | ||||||||||||||||||||||||||||
| 2381 | |||||||||||||||||||||||||||||
| 2382 | #line 50 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 2383 | |||||||||||||||||||||||||||||
| 2384 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 2385 | |||||||||||||||||||||||||||||
| 2386 | Tuomas J. Lukka (lukka@fas.harvard.edu), | ||||||||||||||||||||||||||||
| 2387 | Karl Glazebrook (kgb@aaoepp.aao.gov.au), | ||||||||||||||||||||||||||||
| 2388 | Doug Hunt (dhunt@ucar.edu), | ||||||||||||||||||||||||||||
| 2389 | Christian Soeller (c.soeller@auckland.ac.nz), | ||||||||||||||||||||||||||||
| 2390 | Doug Burke (burke@ifa.hawaii.edu), | ||||||||||||||||||||||||||||
| 2391 | and Craig DeForest (deforest@boulder.swri.edu). | ||||||||||||||||||||||||||||
| 2392 | |||||||||||||||||||||||||||||
| 2393 | =cut | ||||||||||||||||||||||||||||
| 2394 | |||||||||||||||||||||||||||||
| 2395 | #line 580 "lib/PDL/Ops.pd" | ||||||||||||||||||||||||||||
| 2396 | our %got_complex = ( | ||||||||||||||||||||||||||||
| 2397 | atan2 => 0, | ||||||||||||||||||||||||||||
| 2398 | cos => 1, | ||||||||||||||||||||||||||||
| 2399 | exp => 1, | ||||||||||||||||||||||||||||
| 2400 | log => 1, | ||||||||||||||||||||||||||||
| 2401 | log10 => 1, | ||||||||||||||||||||||||||||
| 2402 | pow => 1, | ||||||||||||||||||||||||||||
| 2403 | sin => 1, | ||||||||||||||||||||||||||||
| 2404 | sqrt => 1, | ||||||||||||||||||||||||||||
| 2405 | ); | ||||||||||||||||||||||||||||
| 2406 | #line 2407 "lib/PDL/Ops.pm" | ||||||||||||||||||||||||||||
| 2407 | |||||||||||||||||||||||||||||
| 2408 | # Exit with OK status | ||||||||||||||||||||||||||||
| 2409 | |||||||||||||||||||||||||||||
| 2410 | 70 | 1; | |||||||||||||||||||||||||||