private void buildPTR(){
  double[] temp_row;
  double[][] PTRA;
  int k;
  PivotTransform pt;
  PTR=Matrix.identity(n,n);
  PTRA=PTR.getArray();
  k=pivotTransformQueue.size();
  while (k-- > 0) {
    pt=pivotTransformQueue.removeLast();
    temp_row=PTRA[pt.pos1];
    PTRA[pt.pos1]=PTRA[pt.pos2];
    PTRA[pt.pos2]=temp_row;
  }
}

private void buildPTR ( ) { double [ ] temp_row ; double [ ] [ ] PTRA ; int k ; PivotTransform pt ; PTR = Matrix . identity ( n , n ) ; PTRA = PTR . getArray ( ) ; k = pivotTransformQueue . size ( ) ; while ( k -- > 0 ) { pt = pivotTransformQueue . removeLast ( ) ; temp_row = PTRA [ pt . pos1 ] ; PTRA [ pt . pos1 ] = PTRA [ pt . pos2 ] ; PTRA [ pt . pos2 ] = temp_row ; } }
build the pivot - transform - reverse matrix ptr . we start with a n x n identity matrix and for each recorded pivot transformation swap the according rows , reversing the sequence and starting with the last pivot transformation .
