예제 #1
0
 /**
  * Checks the size of inputs to the standard size function. Throws exception if B is incorrect. Reshapes X.
  *
  * @param numRowsA Number of rows in A matrix
  * @param numColsA Number of columns in A matrix
  */
 public static void checkReshapeSolve(int numRowsA, int numColsA, ReshapeMatrix B, ReshapeMatrix X)
 {
     if (B.NumRows != numRowsA)
     {
         throw new ArgumentException("Unexpected number of rows in B based on shape of A. Found=" +
                                     B.NumRows + " Expected=" + numRowsA);
     }
     X.reshape(numColsA, B.NumCols);
 }
예제 #2
0
        public int[][] MatrixReshape(int[][] nums, int r, int c)
        {
            var sol = new ReshapeMatrix(nums, r, c);

            return(sol.GetRashapedMatrix());
        }