Exemplo n.º 1
0
        public void EigenValsTestManaged()
        {
            var w = new NComplexMatrix(2, 2);
            var vl = new NComplexMatrix(2, 2);
            var vr = new NComplexMatrix(2, 2);

            var lib = new NLapackLib();

            var matrix1 = new NRealMatrix(2, 2);
            matrix1[0, 0] = 1;
            matrix1[0, 1] = 2;
            matrix1[1, 0] = 3;
            matrix1[1, 1] = 4;

            lib.EigenVals(matrix1, w, vl, vr);

            Console.WriteLine("w=\n" + w);
            Console.WriteLine("vl=\n" + vl);
            Console.WriteLine("vr=\n" + vl);
        }
Exemplo n.º 2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="balancec"></param>
 /// <param name="a"></param>
 /// <param name="w"></param>
 /// <param name="vl"></param>
 /// <param name="vr"></param>
 /// <param name="rconde"></param>
 /// <param name="rcondv"></param>
 public void EigenValsX(BalanceType balancec, NRealMatrix a, NComplexMatrix w, NComplexMatrix vl, NComplexMatrix vr, NRealMatrix rconde, NRealMatrix rcondv)
 {
     _lib.eigenValsX(Convert.ToInt16(balancec), a.ManagedMatrix, w.ManagedMatrix, vl.ManagedMatrix, vr.ManagedMatrix, rconde.ManagedMatrix, rcondv.ManagedMatrix);
 }
Exemplo n.º 3
0
        public void EigenValsXTest()
        {
            var matrix1 = new NRealMatrix(2, 2);
            matrix1[0, 0] = 1;
            matrix1[0, 1] = 2;
            matrix1[1, 0] = 3;
            matrix1[1, 1] = 4;

            var w = new NComplexMatrix(2, 2);
            var vl = new NComplexMatrix(2, 2);
            var vr = new NComplexMatrix(2, 2);

            var rconde = new NRealMatrix(2, 2);
            var rcondv = new NRealMatrix(2, 2);

            //var lib = new MLapackLib();
            //lib.eigenValsX(Convert.ToInt16(BalanceType.None), matrix1, w, vl, vr, rconde, rcondv);

            var nlib = new NLapackLib();
            nlib.EigenValsX(BalanceType.None, matrix1, w, vl, vr, rconde, rcondv);

            Console.WriteLine("w=");
            Console.WriteLine(w);

            Console.WriteLine("vl=");
            Console.WriteLine(vl);

            Console.WriteLine("vr=");
            Console.WriteLine(vr);

            Console.WriteLine("rconde=");
            Console.WriteLine(rconde);

            Console.WriteLine("rcondv=");
            Console.WriteLine(rcondv);
        }
Exemplo n.º 4
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="matrix"></param>
 /// <param name="w"></param>
 /// <param name="vl"></param>
 /// <param name="vr"></param>
 public void EigenVals(NRealMatrix matrix, NComplexMatrix w, NComplexMatrix vl, NComplexMatrix vr)
 {
     _lib.eigenVals(matrix.ManagedMatrix, w.ManagedMatrix, vl.ManagedMatrix, vr.ManagedMatrix);
 }