static private <E>List<E> toJavaList(List<E> values,int rows,int columns){
  List<E> result=new ArrayList<>(values.size());
  for (int i=0; i < values.size(); i++) {
    int row=i / columns;
    int column=i % columns;
    E value=values.get((column * rows) + row);
    result.add(value);
  }
  return result;
}

static private < E > List < E > toJavaList ( List < E > values , int rows , int columns ) { List < E > result = new ArrayList < > ( values . size ( ) ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { int row = i / columns ; int column = i % columns ; E value = values . get ( ( column * rows ) + row ) ; result . add ( value ) ; } return result ; }
translates a column - major ( ie . fortran - type ) array to a row - major ( ie . c - type ) array .
