FileDocCategorySizeDatePackage
Reduction.javaAPI DocExample2117Thu Feb 04 16:10:44 GMT 1999None

Reduction

public class Reduction extends Object implements ScaleTester

Fields Summary
private float[]
lookupValues
public float
sumValue
Constructors Summary
Methods Summary
public float[][]doCalc()

		sumValue = 0;
		for (int i = 0; i < lookupValues[0].length; i++) {
			lookupValues[0][i] = 0;
		}
		for (int j = 1; j < lookupValues.length; j++) {
			for (int i = 0; i < lookupValues[0].length; i++) {
				float sinValue = (float)Math.sin((i % 360)*Math.PI/180.0);
				lookupValues[j][i] = sinValue * (float)i / 180.0f;
				lookupValues[j][i] += lookupValues[j-1][i]*(float)j/180.0f;
				sumValue += lookupValues[j][i];
			}  
		}
		return lookupValues;
	
public voidinit(int nRows, int nCols, int nThreads)

		lookupValues = new float[nRows][];
		for (int j = 0; j < nRows; j++) {
			lookupValues[j] = new float[nCols];
		}