class DoubleMatrixUtils {

  public static DoubleMatrix2D getTranspose(final DoubleMatrix2D matrix) {
    final int rows = matrix.getNumberOfRows();
    final int columns = matrix.getNumberOfColumns();
    final double[][] primitives = new double[columns][rows];
    for (int i = 0; i < columns; i++) {
      for (int j = 0; j < rows; j++) {
        primitives[i][j] = matrix.getEntry(j, i);
      }
    }
    return new DoubleMatrix2D(primitives);
  }

  private  DoubleMatrixUtils();

}