public void SolverCoreTestMatrixNd()
        {
            const int N = 50;
            var       a = new DoubleMatrix(N, N);

            // Make matrix diagonal
            for (int i = 0; i < N; i++)
            {
                a[i, i] = 1;
            }
            // Apply random rotations around each pair of axes. This will keep det(A) ~ 1
            var rand = new Random();

            for (int i = 0; i < N; i++)
            {
                for (int j = i + 1; j < N; j++)
                {
                    double angle = rand.NextDouble() * 2 * Math.PI;
                    var    r     = new DoubleMatrix(N, N);
                    for (int k = 0; k < N; k++)
                    {
                        r[k, k] = 1;
                    }
                    r[i, i] = r[j, j] = Math.Cos(angle);
                    r[i, j] = Math.Sin(angle);
                    r[j, i] = -Math.Sin(angle);
                    a       = a * r;
                }
            }

            // Generate random vector
            var b = DoubleVector.Zeros(N);

            for (int i = 0; i < N; i++)
            {
                b[i] = rand.NextDouble();
            }

            // Solve system
            var sw = new Stopwatch();

            sw.Start();
            var x = solver.Solve(a, b, (len) => new DoubleVector(len));

            sw.Stop();
            Trace.WriteLine("Gaussian elimination took: " + sw.ElapsedTicks);

            // Solve system
            sw.Start();
            var x2 = solver.Solve(a, b, (l) => new DoubleVector(l));

            sw.Stop();
            Trace.WriteLine("Jama solve elimination took: " + sw.ElapsedTicks);

            Trace.WriteLine("Difference is " + VectorMath.LInfinityNorm(x, x2));

            // Put solution into system
            var b2 = a * x;

            // Verify result is the same
            Assert.IsTrue(VectorMath.LInfinityNorm(b, b2) < 1e-6);
        }