@Test(expected = IllegalArgumentException.class) public void testCheckNumberOfBands() throws Exception { fuAlgo.getTristimulusValue(new double[4], xFactor); }
double getTristimulusValue(double[] spectrum, double[] factors) { if (spectrum.length != factors.length) { throw new IllegalArgumentException("The spectrum must have equal length as factors."); } double summation = 0; for (int i = 0; i < spectrum.length; i++) { summation = (spectrum[i] * factors[i]) + summation; } return summation; }
FuAlgo { double getTristimulusValue(double[] spectrum, double[] factors) { if (spectrum.length != factors.length) { throw new IllegalArgumentException("The spectrum must have equal length as factors."); } double summation = 0; for (int i = 0; i < spectrum.length; i++) { summation = (spectrum[i] * factors[i]) + summation; } return summation; } }
FuAlgo { double getTristimulusValue(double[] spectrum, double[] factors) { if (spectrum.length != factors.length) { throw new IllegalArgumentException("The spectrum must have equal length as factors."); } double summation = 0; for (int i = 0; i < spectrum.length; i++) { summation = (spectrum[i] * factors[i]) + summation; } return summation; } FuAlgo(Instrument instrument);   FuAlgo(); }
FuAlgo { double getTristimulusValue(double[] spectrum, double[] factors) { if (spectrum.length != factors.length) { throw new IllegalArgumentException("The spectrum must have equal length as factors."); } double summation = 0; for (int i = 0; i < spectrum.length; i++) { summation = (spectrum[i] * factors[i]) + summation; } return summation; } FuAlgo(Instrument instrument);   FuAlgo(); FuResult compute(double[] spectrum); }
FuAlgo { double getTristimulusValue(double[] spectrum, double[] factors) { if (spectrum.length != factors.length) { throw new IllegalArgumentException("The spectrum must have equal length as factors."); } double summation = 0; for (int i = 0; i < spectrum.length; i++) { summation = (spectrum[i] * factors[i]) + summation; } return summation; } FuAlgo(Instrument instrument);   FuAlgo(); FuResult compute(double[] spectrum); static final byte MAX_FU_VALUE; }