code: public static void convert(DMatrix input , FMatrix output ) {
          if( input.getNumRows() != output.getNumRows() )
              throw new IllegalArgumentException("Number of rows do not match");
          if( input.getNumCols() != output.getNumCols() )
              throw new IllegalArgumentException("Number of columns do not match");
  
          for( int i = 0; i < input.getNumRows(); i++  ) {
              for( int j = 0; j < input.getNumCols(); j++ ) {
                  output.unsafe_set(i,j, (float)input.unsafe_get(i,j));
              }
          }
      }
docs: Generic, but slow, conversion function.
  
  @param input Input matrix.
  @param output Output matrix.