Esempio n. 1
0
 public MatrixIterator(IMatrix <T> matrix, MatrixDirection matrixDirection)
 {
     _matrix          = matrix;
     _totalColumns    = _matrix.TotalColumns();
     _totalRows       = _matrix.TotalRows();
     _matrixDirection = matrixDirection;
     Reset();
 }
 /// <summary>
 /// Concats another matrix horizontally / vertically.
 /// </summary>
 public virtual Matrix Concat(double[,] matrix, MatrixDirection direction)
 {
     if (direction == MatrixDirection.Horizontal)
     {
         return(new Matrix(MatrixFunctions.ConcatHorizontally(this.InnerMatrix, matrix)));
     }
     else
     {
         return(new Matrix(MatrixFunctions.ConcatVertically(this.InnerMatrix, matrix)));
     }
 }
Esempio n. 3
0
 /// <summary>
 /// Mirrors matrix entries horizontally / vertically.
 /// </summary>
 public virtual Matrix Mirror(MatrixDirection direction)
 {
     if (direction == MatrixDirection.Horizontal)
     {
         return(new Linears.Matrix(MatrixFunctions.MirrorHorizontally(this.InnerMatrix)));
     }
     else
     {
         return(new Linears.Matrix(MatrixFunctions.MirrorVertically(this.InnerMatrix)));
     }
 }
Esempio n. 4
0
        private NumberMatrix SetupIterable(MatrixDirection direction)
        {
            var iterableObject = new NumberMatrix(direction, ROWS, COLUMNS);

            foreach (var element in GetMatrixValues(ROWS, COLUMNS))
            {
                iterableObject[element.row, element.col] = element.value;
            }
            // Iterable object data initialized to:
            // [ 1, 2, 3 ]
            // [ 4, 5, 6 ]

            return(iterableObject);
        }
 /// <summary>
 /// Concats another matrix horizontally / vertically.
 /// </summary>
 public virtual Matrix Concat(Matrix matrix, MatrixDirection direction)
 {
     return(Concat(matrix.InnerMatrix, direction));
 }
Esempio n. 6
0
 public NumberMatrix(MatrixDirection iteratorDirection, int width, int height)
 {
     _data             = new int[width, height];
     IteratorDirection = iteratorDirection;
 }