public Sorting(double[] array,boolean copyArray){
  if (copyArray) {
    A=new double[array.length];
    System.arraycopy(array,0,A,0,array.length);
  }
 else {
    A=array;
  }
  order=new int[A.length];
  for (int i=0; i < A.length; i++) {
    order[i]=i;
  }
  sort(A);
}

public Sorting ( double [ ] array , boolean copyArray ) { if ( copyArray ) { A = new double [ array . length ] ; System . arraycopy ( array , 0 , A , 0 , array . length ) ; } else { A = array ; } order = new int [ A . length ] ; for ( int i = 0 ; i < A . length ; i ++ ) { order [ i ] = i ; } sort ( A ) ; }
construct an ascending order .
