protected double std(Object param) { RetVal val = arg.eval(param); if(val.isMatrix()) { // FloatProcessor return (FloatStatistics.getStatistics((FloatProcessor)val.get(), Measurements.STD_DEV, null)).stdDev; } else if(val.isVector()) { return VectorMath.stddev((Number[])val.get()).doubleValue(); } else if(val.isValue()) { // Double return ((Double)val.get()).doubleValue(); } throw new FormulaParserException("Variables can be only scalars, vectors, or matrices!"); }
protected double mean(Object param) { RetVal val = arg.eval(param); if(val.isMatrix()) { // FloatProcessor return (FloatStatistics.getStatistics((FloatProcessor)val.get(), Measurements.MEAN, null)).mean; } else if(val.isVector()) { return VectorMath.mean((Number[])val.get()).doubleValue(); } else if(val.isValue()) { // Double return ((Double)val.get()).doubleValue(); } throw new FormulaParserException("Variables can be only scalars, vectors, or matrices!"); }
protected double median(Object param) { RetVal val = arg.eval(param); if(val.isMatrix()) { // FloatProcessor return (FloatStatistics.getStatistics((FloatProcessor)val.get(), Measurements.MEDIAN, null)).median; } else if(val.isVector()) { return VectorMath.median((Number[])val.get()).doubleValue(); } else if(val.isValue()) { // Double return ((Double)val.get()).doubleValue(); } throw new FormulaParserException("Variables can be only scalars, vectors, or matrices!"); }
protected double max(Object param) { RetVal val = arg.eval(param); if(val.isMatrix()) { // FloatProcessor return (FloatStatistics.getStatistics((FloatProcessor)val.get(), Measurements.MIN_MAX, null)).max; } else if(val.isVector()) { return VectorMath.max((Number[])val.get()).doubleValue(); } else if(val.isValue()) { // Double return ((Double)val.get()).doubleValue(); } throw new FormulaParserException("Variables can be only scalars, vectors, or matrices!"); }
protected double min(Object param) { RetVal val = arg.eval(param); if(val.isMatrix()) { // FloatProcessor return (FloatStatistics.getStatistics((FloatProcessor)val.get(), Measurements.MIN_MAX, null)).min; } else if(val.isVector()) { return VectorMath.min((Number[])val.get()).doubleValue(); } else if(val.isValue()) { // Double return ((Double)val.get()).doubleValue(); } throw new FormulaParserException("Variables can be only scalars, vectors, or matrices!"); }
getStatistics(ip, minThreshold, maxThreshold); if ((mOptions&MODE)!=0) getMode();
getStatistics(ip, minThreshold, maxThreshold); if ((mOptions&MODE)!=0) getMode();