Example #1
0
 public Matrix(int Size)
 {
     this.m        = Size;
     this.n        = Size;
     this.elements = new double[Size, Size];
     this.diagonal = new MatrixDiag(this);
 }
Example #2
0
		public void Assign(MatrixDiag matrixDiag)
		{
			if (!Matrix.AreComparable(this.matrix, matrixDiag.matrix))
				return;
			for (int index = 0; index < this.NDiag; ++index)
				this[index] = matrixDiag[index];
		}
Example #3
0
 public Matrix(int m, int n)
 {
     this.m        = m;
     this.n        = n;
     this.elements = new double[m, n];
     this.diagonal = new MatrixDiag(this);
 }
Example #4
0
 public void Assign(MatrixDiag matrixDiag)
 {
     if (!Matrix.AreComparable(this.matrix, matrixDiag.matrix))
     {
         return;
     }
     for (int index = 0; index < this.NDiag; ++index)
     {
         this[index] = matrixDiag[index];
     }
 }
Example #5
0
 public Matrix(double[] values)
 {
     this.m        = 1;
     this.n        = values.Length;
     this.elements = new double[this.M, this.N];
     this.diagonal = new MatrixDiag(this);
     for (int i = 0; i < this.N; ++i)
     {
         this.elements[0, i] = values[i];
     }
 }
Example #6
0
 public Matrix(double[,] values)
 {
     this.m        = values.GetLength(0);
     this.n        = values.GetLength(1);
     this.elements = new double[this.M, this.N];
     this.diagonal = new MatrixDiag(this);
     for (int i = 0; i < this.m; ++i)
     {
         for (int j = 0; j < this.n; ++j)
         {
             this.elements[i, j] = values[i, j];
         }
     }
 }
Example #7
0
 public Matrix(int m, int n, double val)
 {
     this.m        = m;
     this.n        = n;
     this.elements = new double[m, n];
     this.diagonal = new MatrixDiag(this);
     for (int i = 0; i < m; ++i)
     {
         for (int j = 0; j < n; ++j)
         {
             this.elements[i, j] = val;
         }
     }
 }
Example #8
0
 public Matrix(Matrix matrix)
 {
     this.elements = new double[matrix.M, matrix.N];
     this.diagonal = new MatrixDiag(this);
     this.m        = matrix.m;
     this.n        = matrix.n;
     for (int i = 0; i < this.M; ++i)
     {
         for (int j = 0; j < this.N; ++j)
         {
             this.elements[i, j] = matrix.elements[i, j];
         }
     }
 }
Example #9
0
		public Matrix(double[,] values)
		{
			this.m = values.GetLength(0);
			this.n = values.GetLength(1);
			this.elements = new double[this.M, this.N];
			this.diagonal = new MatrixDiag(this);
			for (int i = 0; i < this.m; ++i)
			{
				for (int j = 0; j < this.n; ++j)
					this.elements[i, j] = values[i, j];
			}
		}
Example #10
0
		public Matrix(double[] values)
		{
			this.m = 1;
			this.n = values.Length;
			this.elements = new double[this.M, this.N];
			this.diagonal = new MatrixDiag(this);
			for (int i = 0; i < this.N; ++i)
				this.elements[0, i] = values[i];
		}
Example #11
0
		public Matrix(int m, int n, double val)
		{

			this.m = m;
			this.n = n;
			this.elements = new double[m, n];
			this.diagonal = new MatrixDiag(this);
			for (int i = 0; i < m; ++i)
			{
				for (int j = 0; j < n; ++j)
					this.elements[i, j] = val;
			}
		}
Example #12
0
		public Matrix(int Size)
		{
			this.m = Size;
			this.n = Size;
			this.elements = new double[Size, Size];
			this.diagonal = new MatrixDiag(this);
		}
Example #13
0
		public Matrix(int m, int n)
		{

			this.m = m;
			this.n = n;
			this.elements = new double[m, n];
			this.diagonal = new MatrixDiag(this);
		}
Example #14
0
		public Matrix(Matrix matrix)
		{

			this.elements = new double[matrix.M, matrix.N];
			this.diagonal = new MatrixDiag(this);
			this.m = matrix.m;
			this.n = matrix.n;
			for (int i = 0; i < this.M; ++i)
			{
				for (int j = 0; j < this.N; ++j)
					this.elements[i, j] = matrix.elements[i, j];
			}
		}