FileDocCategorySizeDatePackage
GuidedLoopInterchanged1000.javaAPI DocExample2014Wed Jul 07 11:55:40 BST 2004javathreads.examples.ch15.example13

GuidedLoopInterchanged

public class GuidedLoopInterchanged extends Object implements ScaleTester

Fields Summary
private float[]
lookupValues
private int
nRows
private int
nCols
private int
nThreads
private LoopPrinter
lp
Constructors Summary
Methods Summary
public float[][]doCalc()

        GuidedLoopInterchangedHandler loop =
                    new GuidedLoopInterchangedHandler(nCols, nThreads);
        loop.loopProcess();
	try {
	    lp.send2stream(new PrintStream(new FileOutputStream("/dev/null")));
	} catch (Exception e) {
	    throw new IllegalArgumentException("Can't write to devnull " + e);
	}
        return lookupValues;
    
public voidinit(int nRows, int nCols, int nThreads)

        this.nRows = nRows;
        this.nCols = nCols;
        this.nThreads = nThreads;
	lp = new LoopPrinter(nCols*nRows, 0);
        lookupValues = new float[nRows][];
        for (int j = 0; j < nRows; j++) {
            lookupValues[j] = new float[nCols];
        }