public static Vector<Complex> GenerateRandomDenseVector(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
                         {
                             RandomSource = new Random.MersenneTwister(1)
                         };
            var v = new DenseVector(order);
            for (var i = 0; i < order; i++)
            {
                v[i] = new Complex(normal.Sample(), normal.Sample());
            }

            // Generate a matrix which is positive definite.
            return v;
        }
Example #2
0
        public static Vector <Complex> GenerateRandomUserDefinedVector(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
            {
                RandomSource = new Numerics.Random.MersenneTwister(1)
            };
            var v = new UserDefinedVector(order);

            for (var i = 0; i < order; i++)
            {
                v[i] = new Complex(normal.Sample(), normal.Sample());
            }

            // Generate a matrix which is positive definite.
            return(v);
        }
        public static Matrix<Complex> GenerateRandomDenseMatrix(int row, int col)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
                         {
                             RandomSource = new Random.MersenneTwister(1)
                         };
            var matrixA = new DenseMatrix(row, col);
            for (var i = 0; i < row; i++)
            {
                for (var j = 0; j < col; j++)
                {
                    matrixA[i, j] = new Complex(normal.Sample(), normal.Sample());
                }
            }

            // Generate a matrix which is positive definite.
            return matrixA;
        }
Example #4
0
        public static Matrix <Complex> GenerateRandomDenseMatrix(int row, int col)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
            {
                RandomSource = new Numerics.Random.MersenneTwister(1)
            };
            var matrixA = new DenseMatrix(row, col);

            for (var i = 0; i < row; i++)
            {
                for (var j = 0; j < col; j++)
                {
                    matrixA[i, j] = new Complex(normal.Sample(), normal.Sample());
                }
            }

            // Generate a matrix which is positive definite.
            return(matrixA);
        }
Example #5
0
        public static Matrix <Complex> GenerateRandomPositiveDefiniteHermitianUserDefinedMatrix(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
            {
                RandomSource = new Numerics.Random.MersenneTwister(1)
            };
            var matrixA = new UserDefinedMatrix(order);

            for (var i = 0; i < order; i++)
            {
                for (var j = 0; j < order; j++)
                {
                    matrixA[i, j] = new Complex(normal.Sample(), normal.Sample());
                }
            }

            // Generate a Hermitian matrix which is positive definite.
            return(matrixA.ConjugateTranspose() * matrixA);
        }
        public static Vector <float> GenerateRandomDenseVector(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();

            normal.RandomSource = new Numerics.Random.MersenneTwister(1);
            var v = new DenseVector(order);

            for (int i = 0; i < order; i++)
            {
                v[i] = (float)normal.Sample();
            }

            // Generate a matrix which is positive definite.
            return(v);
        }
        public static Matrix GenerateRandomDenseMatrix(int row, int col)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();
            normal.RandomSource = new Random.MersenneTwister(1);
            var A = new DenseMatrix(row, col);
            for (int i = 0; i < row; i++)
            {
                for (int j = 0; j < col; j++)
                {
                    A[i, j] = normal.Sample();
                }
            }

            // Generate a matrix which is positive definite.
            return A;
        }
        public static Matrix GenerateRandomPositiveDefiniteMatrix(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();
            normal.RandomSource = new Random.MersenneTwister(1);
            var A = new DenseMatrix(order);
            for (int i = 0; i < order; i++)
            {
                for (int j = 0; j < order; j++)
                {
                    A[i, j] = normal.Sample();
                }
            }

            // Generate a matrix which is positive definite.
            return A.Transpose() * A;
        }
        public static Matrix <float> GenerateRandomPositiveDefiniteUserDefinedMatrix(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();

            normal.RandomSource = new Numerics.Random.MersenneTwister(1);
            var matrixA = new UserDefinedMatrix(order);

            for (int i = 0; i < order; i++)
            {
                for (int j = 0; j < order; j++)
                {
                    matrixA[i, j] = (float)normal.Sample();
                }
            }

            // Generate a matrix which is positive definite.
            return(matrixA.Transpose() * matrixA);
        }
Example #10
0
        public static Matrix <double> GenerateRandomUserDefinedMatrix(int row, int col)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();

            normal.RandomSource = new Numerics.Random.MersenneTwister(1);
            var matrixA = new UserDefinedMatrix(row, col);

            for (int i = 0; i < row; i++)
            {
                for (int j = 0; j < col; j++)
                {
                    matrixA[i, j] = normal.Sample();
                }
            }

            // Generate a matrix which is positive definite.
            return(matrixA);
        }
        public static Vector GenerateRandomUserDefinedVector(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal();
            normal.RandomSource = new Random.MersenneTwister(1);
            var v = new UserDefinedVector(order);
            for (int i = 0; i < order; i++)
            {
                v[i] = normal.Sample();
            }

            // Generate a matrix which is positive definite.
            return v;
        }
Example #12
0
        public static Matrix<Complex> GenerateRandomPositiveDefiniteHermitianDenseMatrix(int order)
        {
            // Fill a matrix with standard random numbers.
            var normal = new Distributions.Normal
                         {
                             RandomSource = new Random.MersenneTwister(1)
                         };
            var matrixA = new DenseMatrix(order);
            for (var i = 0; i < order; i++)
            {
                for (var j = 0; j < order; j++)
                {
                    matrixA[i, j] = new Complex(normal.Sample(), normal.Sample());
                }
            }

            // Generate a Hermitian matrix which is positive definite.
            return matrixA.ConjugateTranspose() * matrixA;
        }