Example #1
0
 public static MethodMemory Read(MethodInfo m)
 {
     // Note that this is just POC; to really read the method properly,
     //one must know where it ends, and I'm not sure if that can be done
     //without cracking open the method table of the PE file...
     return(MethodMemory.ReadUntil(m, NatSpan.Alloc <N32, byte>(), 0xc3, 0xe0));
 }
Example #2
0
        public static EigenResult <N, double> geev <N>(BlockMatrix <N, double> A)
            where N : ITypeNat, new()
        {
            var n        = nati <N>();
            var lda      = n;
            var ldvl     = n;
            var ldvr     = n;
            var wslen    = n * n;
            var exitcode = 0;
            var v        = 'V';
            var wr       = NatSpan.Alloc <N, double>();
            var wi       = NatSpan.Alloc <N, double>();
            var lVec     = A.Replicate(true);
            var rVec     = A.Replicate(true);

            exitcode = LAPACK.LAPACKE_dgeev(RowMajor, v, v, n, ref head(A), lda, ref head(wr), ref head(wi),
                                            ref head(lVec), ldvl, ref head(rVec), ldvr);

            if (exitcode != 0)
            {
                MklException.Throw(exitcode);
            }

            return(EigenResult.Define(ComplexNumber.FromPaired <N, double>(wr, wi), lVec, rVec));
        }
Example #3
0
File: geev.cs Project: 0xCM/z0
        static NatSpan <N, Complex <T> > FromPaired <N, T>(NatSpan <N, T> re, NatSpan <N, T> im)
            where N : unmanaged, ITypeNat
            where T : unmanaged
        {
            Span <Complex <T> > dst = new Complex <T> [nat32i <N>()];

            for (var i = 0; i < dst.Length; i++)
            {
                dst[i] = (re[i], im[i]);
            }
            return(dst);
        }