for (int i=0; i<numPartialRows; i++) { for (int j=0; j<numPartialCols; j++) { newMatrix.setElement(i,j,oldMatrix.getElement(oldPeek-numPartialRows+i, oldPush-numPartialCols+j));
for (int j=0; j<numPartialCols; j++) {  for (int i=0; i<numPartialRows;i++) {  int oldRow = oldPeek-(numPartialRows-i); int oldCol = oldPush-(numPartialCols-j);  newMatrix.setElement(i,j,oldMatrix.getElement(oldRow, oldCol));
    public LinearFilterRepresentation expand(int newPeek, int newPop, int newPush) {	// do some argument checks	if (newPeek < this.getPeekCount()) {	    throw new IllegalArgumentException("newPeek is less than old peek");	}	if (newPop < this.getPopCount()) {	    throw new IllegalArgumentException("newPop is less than old push");	}	if (newPush < this.getPushCount()) {	    throw new IllegalArgumentException("newPush is less than old push");	}	// pull out old values for ease in understanding the code.	int oldPush = this.getPushCount();	int oldPeek = this.getPeekCount();	int oldPop  = this.getPopCount();	FilterMatrix oldMatrix = this.getA();	FilterMatrix newMatrix = new FilterMatrix(newPeek, newPush);	// now, populate the new matrix with the appropriate copies of the old matrix	// (eg the As). We will be copying numCompleteCopies starting from lower left	int numCompleteCopies = (newPush/oldPush);	for (int i=0; i<numCompleteCopies; i++) {	    // copy the matrix starting at row: e' - e - (i*o)	    // col = u'-(i+1)u	    newMatrix.copyAt(newPeek - oldPeek - i*(oldPop),			     newPush - (i+1)*oldPush,			     oldMatrix);	}	// do housecleaning for any fractional copies of A that we need to make	// (first, calculate the number of rows and columns that need to be filled with	// parts of the old matrix).	int numPartialRows = newPeek - oldPeek - (numCompleteCopies - 1)*oldPop;	int numPartialCols = newPush - numCompleteCopies * oldPush;	// sanity checks	if (numPartialRows < 0) {throw new RuntimeException("partial rows < 0!");}	if (numPartialCols < 0) {throw new RuntimeException("partial cols < 0!");}	// now, copy over the missing parts of A	for (int i=0; i<numPartialRows; i++) {	    for (int j=0; j<numPartialCols; j++) {		newMatrix.setElement(i,j,oldMatrix.getElement(oldPeek-numPartialRows+i,							      oldPush-numPartialCols+j));	    }	}		// now copy all elements of the new vector	FilterVector oldVector = this.getb();	FilterVector newVector = new FilterVector(newPush);	for (int i=0; i<newPush; i++) {	    newVector.setElement(i,oldVector.getElement(oldPush-1-((newPush-i-1)%oldPush)));	}	// create a new Linear rep for the expanded filter	LinearFilterRepresentation newRep;	newRep = new LinearFilterRepresentation(newMatrix, newVector, newPop);	return newRep;    }