| Sponsored Links | ||||||||||||||
|
| ||||||||||||||
|
Collapse All
|
||||||||||||||
| Software Name | Software Type | Category | Price | |||||||||||
| 1 | Xbox Xchg 1.1 |
windows | Windows Widgets->Widget Games | Free |
View Detail
|
|||||||||
|
||||||||||||||
| 2 | PDL::Ufunc 2.4.3 |
linux | Programming->Libraries | Free |
View Detail
|
|||||||||
PDL::Ufunc Perl module contains primitive ufunc operations for pdl. This module provides some primitive and useful functions defined using PDL::PP based on functionality of what are sometimes called ufuncs (for example NumPY and Mathematica talk about these). It collects all the functions generally used to reduce or accumulate along a dimension. These all do their job across the first dimension but by using the slicing functions you can do it on any dimension. The PDL::Reduce module provides an alternative interface to many of the functions in this module. SYNOPSIS use PDL::Ufunc; Project via $name to N-1 dimensions This function reduces the dimensionality of a piddle by one by taking the $name along the 1st dimension. By using xchg etc. it is possible to use any dimension. $a = $op($b); $spectrum = $op $image->xchg(0,1) $extras EOD } # sub: projectdocs() sub cumuprojectdocs { my $name = shift; my $op = shift; my $extras = shift; return < This function calculates the cumulative $name along the 1st dimension. By using xchg etc. it is possible to use any dimension. The sum is started so that the first element in the cumulative $name is the first element of the parameter. $a = $op($b); $spectrum = $op $image->xchg(0,1) $extras EOD } # sub: cumuprojectdocs() # its a bit unclear what to do with the comparison operators, # since the return value could be bad because all elements are bad, # which needs checking for since the bad value could evaluate to # true or false (eg if the user has set it to 0) # # by setting CopyBadStatusCode to , we stop the output piddle # from automatically being set bad if any of the input piddles are bad. # - we can set the flag within BadCode if necessary # # This may NOT be sensible. Only time, and comments, will tell... # my %over = ( sumover => { name => sum, op => +=, init => 0, }, prodover => { name => product, op => *=, init => 1, }, ); foreach my $func ( keys %over ) { # creates $func and cumu$func functions # and d$func and dcumu$func functions, which # perform the calculations in double precision my $name = $over{$func}{name}; my $op = $over{$func}{op}; my $init = $over{$func}{init}; pp_def( $func, HandleBad => 1, Pars => a(n); int+ [o]b();, Code => $GENERIC(b) tmp = . $init . ; loop(n) %{ tmp . $op . $a(); %} $b() = tmp;, BadCode => $GENERIC(b) tmp = . $init . ; int flag = 0; loop(n) %{ if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; } %} if ( flag ) { $b() = tmp; } else { $SETBAD(b()); }, Doc => projectdocs( $name, $func, ), ); # as above, but in double precision pp_def( "d$func", HandleBad => 1, Pars => a(n); double [o]b();, Code => double tmp = . $init . ; loop(n) %{ tmp . $op . $a(); %} $b() = tmp;, BadCode => double tmp = . $init . ; int flag = 0; loop(n) %{ if ( $ISGOOD(a()) ) { tmp . $op . $a(); flag = 1; } %} if ( flag ) { $b() = tmp; } else { $SETBAD(b()); }, Doc => projectdocs( $name, "d$func", "Unlike L<$func|/$func>, the calculations are performed in doublen" . "precision." ), ); my $cfunc = "cumu${func}"; pp_def( $cfunc, HandleBad => 1, Pars => a(n); int+ [o]b(n);, Code => $GENERIC(b) tmp = . $init . ; loop(n) %{ tmp . $op . $a(); $b() = tmp; %}, BadCode => $GENERIC(b) tmp = . $init . ; loop(n) %{ if ( $ISBAD(a()) ) { $SETBAD(b()); } else { tmp . $op . $a(); $b() = tmp; } %}, Doc => cumuprojectdocs( $name, $cfunc, ), ); # as above but in double precision pp_def( "d$cfunc", HandleBad => 1, Pars => a(n); double [o]b(n);, Code => double tmp = . $init . ; loop(n) %{ tmp . $op . $a(); $b() = tmp; %}, BadCode => double tmp = . $init . ; loop(n) %{ if ( $ISBAD(a()) ) { $SETBAD(b()); } else { tmp . $op . $a(); $b() = tmp; } %}, Doc => cumuprojectdocs( $name, $cfunc, "Unlike L "precision." ), ); |
||||||||||||||
| 3 | PDL::NiceSlice 2.4.3 |
linux | Programming->Libraries | Free |
View Detail
|
|||||||||
PDL::NiceSlice Perl module contains a nicer slicing syntax for PDL. SYNOPSYS use PDL::NiceSlice; $a(1:4) .= 2; # concise syntax for ranges print $b((0),1:$end); # use variables in the slice expression $a->xchg(0,1)->(($pos-1)) .= 0; # default method syntax $idx = long 1, 7, 3, 0; # a piddle of indices $a(-3:2:2,$idx) += 3; # mix explicit indexing and ranges $a->clump(1,2)->(0:30); # default method syntax $a(myfunc(0,$var),1:4)++; # when using functions in slice expressions # use parentheses around args! $b = $a(*3); # Add dummy dimension of order 3 # modifiers are specified in a ;-separated trailing block $a($a!=3;?)++; # short for $a->where($a!=3)++ $a(0:1114;_) .= 0; # short for $a->flat->(0:1114) $b = $a(0:-1:3;|); # short for $a(0:-1:3)->sever $n = sequence 3,1,4,1; $b = $n(;-); # drop all dimensions of size 1 (AKA squeeze) $b = $n(0,0;-|); # squeeze *and* sever $c = $a(0,3,0;-); # more compact way of saying $a((0),(3),(0)) # Use with perldl versions < v1.31 (or include these lines in .perldlrc) perldl> use PDL::NiceSlice; # next one is required, see below perldl> $PERLDL::PREPROCESS = &PDL::NiceSlice::perldlpp; perldl> $a(4:5) .= xvals(2); Slicing is a basic, extremely common operation, and PDLs slice method would be cumbersome to use in many cases. PDL::NiceSlice rectifies that by incorporating new slicing syntax directly into the language via a perl source filter (see the perlfilter man page). NiceSlice adds no new functionality, only convenient syntax. NiceSlice is loaded automatically in the perldl shell, but (to avoid conflicts with other modules) must be loaded automatically in standalone perl/PDL scripts (see below). If you prefer not to use a prefilter on your standalone scripts, you can use the slice method in those scripts, rather than the more compact NiceSlice constructs. |
||||||||||||||
| 4 | PDL::LinearAlgebra 0.03 |
linux | Programming->Libraries | Free |
View Detail
|
|||||||||
PDL::LinearAlgebra Perl module contains linear algebra utils for PDL. SYNOPSIS use PDL::LinearAlgebra; $a = random (100,100); ($U, $s, $V) = mdsvd($a); This module provides a convenient interface to PDL::LinearAlgebra::Real and PDL::LinearAlgebra::Complex. FUNCTIONS setlaerror Set action type when error is encountered, returns previous type. Available values are NO, WARN and BARF (predefined constants). If, for example, in computation of the inverse, singularity is detected, the routine can silently return values from computation (see manuals), warn about singularity or barf. BARF is the default value. $a = sequence(5,5); $err = setlaerror(NO); ($inv, $info)= minv($a); if ($info){ # Change the diagonal (the inverse doesnt exist but its an example) $a->diagonal(0,1)+=1e-8; ($inv, $info)= minv($a); } if ($info){ print "Cant compute the inversen"; } else{ print "Inverse of $a is $inv"; } setlaerror($err); getlaerror Get error type. 0 => NO, 1 => WARN, 2 => BARF t PDL = t(PDL, SCALAR(conj)) conj : Conjugate Transpose = 1 | Transpose = 0, default = 1; Convenient function for transposing real or complex 2D array(s). For PDL::Complex, if conj is true returns conjugate transpose array(s) and doesnt support dataflow. Supports threading. issym PDL = issym(PDL, SCALAR|PDL(tol),SCALAR(hermitian)) tol : tolerance value, default: 1e-8 for double else 1e-5 hermitian : Hermitian = 1 | Symmetric = 0, default = 1; Check symmetricity/Hermitianicity of matrix. Supports threading. diag Return i-th diagonal if matrix in entry or matrix with i-th diagonal with entry. I-th diagonal returned flows data back&forth. Can be used as lvalue subs if your perl supports it. Supports threading. PDL = diag(PDL, SCALAR(i), SCALAR(vector))) i : i-th diagonal, default = 0 vector : create diagonal matrices by threading over row vectors, default = 0 my $a = random(5,5); my $diag = diag($a,2); # If your perl support lvaluable subroutines. $a->diag(-2) .= pdl(1,2,3); # Construct a (5,5,5) PDL (5 matrices) with # diagonals from row vectors of $a $a->diag(0,1) tritosym Return symmetric or Hermitian matrix from lower or upper triangular matrix. Supports inplace and threading. Uses tricpy or ctricpy from Lapack. PDL = tritosym(PDL, SCALAR(uplo), SCALAR(conj)) uplo : UPPER = 0 | LOWER = 1, default = 0 conj : Hermitian = 1 | Symmetric = 0, default = 1; # Assume $a is symmetric triangular my $a = random(10,10); my $b = tritosym($a); positivise Return entry pdl with changed sign by row so that average of positive sign > 0. In other words thread among dimension 1 and row = -row if Sum(sign(row)) < 0. Works inplace. my $a = random(10,10); $a -= 0.5; $a->xchg(0,1)->inplace->positivise; mcrossprod Compute the cross-product of two matrix: A x B. If only one matrix is given, take B to be the same as A. Supports threading. Uses crossprod or ccrossprod. PDL = mcrossprod(PDL(A), (PDL(B)) my $a = random(10,10); my $crossproduct = mcrossprod($a); mrank Compute the rank of a matrix, using a singular value decomposition. from Lapack. SCALAR = mrank(PDL, SCALAR(TOL)) TOL: tolerance value, default : mnorm(dims(PDL),inf) * mnorm(PDL) * EPS my $a = random(10,10); my $b = mrank($a, 1e-5); mnorm Compute norm of real or complex matrix Supports threading. PDL(norm) = mnorm(PDL, SCALAR(ord)); ord : 0|inf : Infinity norm 1|one : One norm 2|two : norm 2 (default) 3|fro : frobenius norm my $a = random(10,10); my $norm = mnrom($a); mdet Compute determinant of a general square matrix using LU factorization. Supports threading. Uses getrf or cgetrf from Lapack. PDL(determinant) = mdet(PDL); my $a = random(10,10); my $det = mdet($a); mposdet Compute determinant of a symmetric or Hermitian positive definite square matrix using Cholesky factorization. Supports threading. Uses potrf or cpotrf from Lapack. (PDL, PDL) = mposdet(PDL, SCALAR) SCALAR : UPPER = 0 | LOWER = 1, default = 0 my $a = random(10,10); my $det = mposdet($a); mcond Compute the condition number (two-norm) of a general matrix. The condition number (two-norm) is defined: norm (a) * norm (inv (a)). Uses a singular value decomposition. Supports threading. PDL = mcond(PDL) my $a = random(10,10); my $cond = mcond($a); mrcond Estimate the reciprocal condition number of a general square matrix using LU factorization in either the 1-norm or the infinity-norm. The reciprocal condition number is defined: 1/(norm (a) * norm (inv (a))) Supports threading. PDL = mrcond(PDL, SCALAR(ord)) ord : 0 : Infinity norm (default) 1 : One norm my $a = random(10,10); my $rcond = mrcond($a,1); morth Return an orthonormal basis of the range space of matrix A. PDL = morth(PDL(A), SCALAR(tol)) tol : tolerance for determining rank, default: 1e-8 for double else 1e-5 my $a = random(10,10); my $ortho = morth($a, 1e-8); mnull Return an orthonormal basis of the null space of matrix A. PDL = mnull(PDL(A), SCALAR(tol)) tol : tolerance for determining rank, default: 1e-8 for double else 1e-5 my $a = random(10,10); my $null = mnull($a, 1e-8); minv Compute inverse of a general square matrix using LU factorization. Supports inplace and threading. Uses getrf and getri or cgetrf and cgetri from Lapack and return inverse, info in array context. PDL(inv) = minv(PDL) my $a = random(10,10); my $inv = minv($a); mtriinv Compute inverse of a triangular matrix. Supports inplace and threading. Uses trtri or ctrtri from Lapack. Returns inverse, info in array context. (PDL, PDL(info))) = mtriinv(PDL, SCALAR(uplo), SCALAR|PDL(diag)) uplo : UPPER = 0 | LOWER = 1, default = 0 diag : UNITARY DIAGONAL = 1, default = 0 # Assume $a is upper triangular my $a = random(10,10); my $inv = mtriinv($a); |
||||||||||||||
My Software
You have not saved any software. Click "Save" next to each software to save it to your software basket
