Good catch! I've fixed this in
https://github.com/PDLPorters/pdl-linearalgebra/commit/a2d680992c1cd4a46a3009b8ae0b2f3e6ebf601e. In fact, to aid broadcasting, I used (using two PDL::LinearAlgebra utility functions recently added):
my $di = $_[0]->dims_internal;
my @dims = $m->dims;
# ...
$ret = identity($dims[$di]);
$ret = $ret->r2C if $m->_is_complex;
This has now been released as 0.30.
Please do report problems like this at https://github.com/PDLPorters/pdl-linearalgebra/issues, we really do care! As an example, #10 (the wrapper functions didn't work on native complex, though the underlying LAPACK-bindings did) turned into a bit of a death-march because it revealed lots of copy-paste (~6800 lines ended up as ~3400), and very minimal tests. But I felt this module was important enough to justify the effort.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.