I took a look at the documentation for the PDL::LinearAlgebra module and
saw the minv() routine which calculates either the real or complex matrix
inverse depending on the input. This pdl2 session seems to work:
pdl> use
> PDL::Complex
>
> pdl> use
> PDL::LinearAlgebra
>
> pdl> $A =
> random(2,5,5);
>
> pdl> $cA =
> cplx($A);
>
> pdl> p
> $cA
>
>
> [
> [ 0.648021 +0.221663i 0.793256 +0.588205i 0.28706 +0.918206i
> 0.504137 +0.260584i 0.527557 +0.10499i]
> [ 0.388552 +0.404901i 0.537276 +0.531932i 0.314593 +0.209973i
> 0.0828364 +0.95625i 0.593174+0.0143707i]
> [ 0.630699 +0.4122i 0.379448 +0.895322i 0.795139 +0.351844i
> 0.497338 +0.900724i 0.884001 +0.78247i]
> [0.0803632 +0.201913i 0.801213 +0.80519i 0.68765 +0.723879i
> 0.831798 +0.644938i 0.504724 +0.208855i]
> [ 0.295086 +0.222764i 0.0040192 +0.84586i 0.842631+0.0657471i
> 0.978252 +0.47564i 0.389874 +0.277407i]
> ]
>
> pdl> p
> minv($cA)
>
>
> [
> [ 0.889801 -0.40207i 0.403404 -0.612824i 0.184086 +0.54255i
> -1.40804 +0.372943i 0.444733 -0.422639i]
> [ -0.353338 -0.173588i 0.360513 -0.489879i 0.241815 +0.663846i
> 0.744675 +0.102151i -0.862411 -0.845977i]
> [-0.0207381 -0.796744i 0.34137 +0.488185i -0.302943 +0.296069i
> -0.110737 -0.162525i 0.683827+0.0482191i]
> [-0.0997267 +0.670967i -0.690927 -0.585443i 0.171827 -0.226967i
> 0.376287 -0.294396i 0.0855393 +0.323581i]
> [ 0.146725 +0.623492i -0.592009 +1.07667i 0.462729 -1.60548i
> 0.0563088 -0.48494i -0.36726 +1.07107i]
> ]
> 0
> pdl>
> q
>
>
>
On Thu, Jun 25, 2015 at 3:38 PM, Chris Marshall <[email protected]>
wrote:
> Hi Ben-
>
> I don't have experience with the PDL::LinearAlgebra::Complex routines so
> I'm forwarding your message to the pdl-general mailing list at sf.net
> which is where PDL support is handled. Maybe another PDL user will have
> experience using the cgtri() routine for complex matrix inversions. Please
> see http://lists.sourceforge.net/lists/listinfo/pdl-general
> to sign up for the mailing list.
>
> Regards,
> Chris
>
>
> On Thu, Jun 25, 2015 at 1:07 AM, Benjamin Silva <[email protected]>
> wrote:
>
>> Hi Chris,
>>
>> I hope that you don't mind me contacting you directly, but I'm a bit
>> stuck and I don't really know where else to turn. Years ago, I had written
>> some subroutines in perl that did inversion of complex matrices, but
>> they're of course very slow. I mean VERY slow. I have recently been
>> trying to get PDL to work just to see how terrible my previous work was,
>> and I've got it working for real matrices. It's very fast, as expected.
>> However, when I try to implement the PDL module for complex matrices, I
>> cannot get it to work.
>>
>> I've attached two files here. The first one is for real matrices, and
>> I'm comparing PDL::Slatec with PDL::LinearAlgebra with my old subroutine
>> that was written for complex numbers, but should still work for real as
>> well (please don't laugh at my code too hard!). The second file is my best
>> attempt at getting complex to work using the 'cgetri' subroutine, but it
>> just crashes perl on me when I run it.
>>
>> Do you have any insight or can you send me some examples of how to use
>> PDL to do matrix inversion on matrices of complex numbers? Failing that,
>> any links or documents you can point me to? I've been using perl for a
>> while, but I'd say my skills are quite sub-par. I'm not really a coder, so
>> it's hard for me to understand a lot of the code I see.
>>
>> Thanks for any help or guidance you can lend!
>> -Ben
>>
>>
>
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
pdl-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pdl-general