Reshape() public static method

Reshapes the supplied matrix into a new matrix shape.
public static Reshape ( Matrix m, int rows, int cols ) : Matrix
m Matrix Matrix to reshape.
rows int Number of rows of the new matrix.
cols int Number of columns of the new matrix.
return Matrix
Example #1
0
 /// <summary>
 /// Reshapes the given Vector into a Matrix form given the specified dimension.
 /// <para>Reads from the source vector and repopulates from left to right when <paramref name="vectorType"/> equals 'Col' otherwise uses top down approach.</para>
 /// </summary>
 /// <param name="source"></param>
 /// <param name="dimension">If the <paramref name="vectorType"/> equals 'Col' the <paramref name="dimension"/> becomes the column width otherwise it is row height.</param>
 /// <param name="vectorType">Unit type of the dimension to use when rebuilding the Matrix.</param>
 /// <param name="fillType">Direction to process, i.e. Row = Fill Down then Right, or Col = Fill Right then Down</param>
 /// <returns>Matrix.</returns>
 public static Matrix Reshape(this Vector source, int dimension, VectorType vectorType = VectorType.Col, VectorType fillType = VectorType.Row)
 {
     return(Matrix.Reshape(source, dimension, vectorType, fillType));
 }