Why I got Exception was thrown: System.NotImplementedException for this example? Is there a list or the namespace which I can use? Is this not supported use custom namespace yet?

Jan 15, 2016 at 2:09 AM
Edited Jan 15, 2016 at 2:18 AM
Hi,
I made a matrix multiplication program. I could run in IL normal way.
When compile it using IL2C and execute the generated exe file, after enter the first value from keyboard, I got this exception.
Unhandled exception: System.NotImplementedException: Exception was thrown: System.NotImplementedException
I think in this example there is no strange namespace or library, just System namespace. Or is it because I use Double-Class's methods such as GetLength(i)?
using System;

namespace BenchMark
{
    public partial class Matrix
    {
        /****************************************************************************/
        public static void Main(String[] args)
        {
            int m, n, p;
            Console.WriteLine("Enter m (rows of A): ");
            m = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter n (cols of A): ");
            n = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter p (cols of B): ");
            p = int.Parse(Console.ReadLine());
            Console.WriteLine("Enter matrix value for A");
            double[,] a = enterMatrix(m, n);
            Console.WriteLine("Enter matrix value for B");
            double[,] b = enterMatrix(n, p);
            var r = mul(a, b);
            //Print result
            Console.WriteLine("A x B = R: ");
            print(r);
            Console.ReadLine();

        }

         static void print(double[,] a)
        {
            int m = a.GetLength(0);
            int n = a.Length / a.GetLength(0);
            for (int i = 0; i < m; i++)
            {
                for (int j = 0; j < n; j++) {
                    Console.Write("{0,-10}", a[i, j]);
                }
                Console.WriteLine();
            }
        }

        static double[,] enterMatrix(int m, int n)
        {
            double[,] a = new double[m, n];
            for (int i = 0; i < m; i++)
            {
                for (int j = 0; j < n; j++)
                {
                    while (true)
                    {
                        try {
                            Console.Write("Enter A[{0},{1}]", i, j);
                            double v = double.Parse(Console.ReadLine());
                            a[i, j] = v;
                            break;
                        }
                        catch (Exception ex) {

                        }
                    }
                }
            }
            return a;
        }

        static double[,] mul(double[,] a, double[,] b)
        {
            int m = a.GetLength(0);
            int n =a.Length/ a.GetLength(0);
            int p =b.Length/ b.GetLength(0);
            double[,] r = new double[m, p];
            for (int i = 0; i < m; i++)
            {
                for (int j = 0; j < p; j++)
                {
                    //Tinh vi tri r[i,j]
                    r[i, j] = 0;
                    for (int k = 0; k < n; k++)
                    {
                        r[i, j] += a[i, k] * b[k, j];
                    }
                }
            }
            return r;
        }


        /****************************************************************************/
    }
}
Coordinator
Jan 15, 2016 at 8:30 AM
if you are using CoreLib then Console.ReadLine() not implemented. Mscorlib I have not tested as well.