Exemple #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));
 }
Exemple #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));
        }