Generic calculation method
184203
function calculate(side, otherSide, type, adjustment, side1, side2, lengthName, targetLength, elemLength) {
		var initialPos = position[side1],
			mySide = my[side],
			atSide = at[side],
			isShift = type === SHIFT,
			myLength = mySide === side1 ? elemLength : mySide === side2 ? -elemLength : -elemLength / 2,
			atLength = atSide === side1 ? targetLength : atSide === side2 ? -targetLength : -targetLength / 2,
			sideOffset = viewportScroll[side1] + viewportOffset[side1] - (containerStatic ? 0 : containerOffset[side1]),
			overflow1 = sideOffset - initialPos,
			overflow2 = initialPos + elemLength - (lengthName === WIDTH ? viewportWidth : viewportHeight) - sideOffset,
			offset = myLength - (my.precedance === side || mySide === my[otherSide] ? atLength : 0) - (atSide === CENTER ? targetLength / 2 : 0);

		// shift
		if(isShift) {
			offset = (mySide === side1 ? 1 : -1) * myLength;

			// Adjust position but keep it within viewport dimensions
			position[side1] += overflow1 > 0 ? overflow1 : overflow2 > 0 ? -overflow2 : 0;
			position[side1] = Math.max(
				-containerOffset[side1] + viewportOffset[side1],
				initialPos - offset,
				Math.min(
					Math.max(
						-containerOffset[side1] + viewportOffset[side1] + (lengthName === WIDTH ? viewportWidth : viewportHeight),
						initialPos + offset
					),
					position[side1],

					// Make sure we don't adjust complete off the element when using 'center'
					mySide === 'center' ? initialPos - myLength : 1E9
				)
			);

		}

		// flip/flipinvert
		else {
			// Update adjustment amount depending on if using flipinvert or flip
			adjustment *= type === FLIPINVERT ? 2 : 0;

			// Check for overflow on the left/top
			if(overflow1 > 0 && (mySide !== side1 || overflow2 > 0)) {
				position[side1] -= offset + adjustment;
				newMy.invert(side, side1);
			}

			// Check for overflow on the bottom/right
			else if(overflow2 > 0 && (mySide !== side2 || overflow1 > 0)  ) {
				position[side1] -= (mySide === CENTER ? -offset : offset) + adjustment;
				newMy.invert(side, side2);
			}

			// Make sure we haven't made things worse with the adjustment and reset if so
			if(position[side1] < viewportScroll[side1] && -position[side1] > overflow2) {
				position[side1] = initialPos; newMy = my.clone();
			}
		}

		return position[side1] - initialPos;
	}
716422
@Override
    public Object calculate(int[] coeff, int inPos, int[] quant, int[] out, int outOffset, int width, int height) {
        int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
        int tmp10, tmp11, tmp12, tmp13;
        int z5, z10, z11, z12, z13;

        int[] workspace = new int[64];

        int inptr = 0;
        int wsptr = 0;
        int[] outbuf = (out != null ? out : new int[DCTSIZE2]);
        int outptr = 0;
        short[] rangeLimitMap = sampleRangeLimitTable;
        int rangeLimitOffset = sampleRangeLimitOffset + 128;
        int dcval = 0, DCTSIZE = 8;

        int quantptr = 0;

        for (int ctr = 8; ctr > 0; ctr--) {
            int basis = 0;
            for (int n = 1; n < 8; n++) {
                basis |= coeff[inptr + DCTSIZE * n];
            }

            if (basis == 0) {
                dcval = coeff[inptr + DCTSIZE * 0] * quant[quantptr + DCTSIZE * 0];

                workspace[wsptr + DCTSIZE * 0] = dcval;
                workspace[wsptr + DCTSIZE * 1] = dcval;
                workspace[wsptr + DCTSIZE * 2] = dcval;
                workspace[wsptr + DCTSIZE * 3] = dcval;
                workspace[wsptr + DCTSIZE * 4] = dcval;
                workspace[wsptr + DCTSIZE * 5] = dcval;
                workspace[wsptr + DCTSIZE * 6] = dcval;
                workspace[wsptr + DCTSIZE * 7] = dcval;

                inptr++;
                quantptr++;
                wsptr++;

                continue;
            }

            tmp0 = coeff[inptr + DCTSIZE * 0] * quant[quantptr + DCTSIZE * 0];
            tmp1 = coeff[inptr + DCTSIZE * 2] * quant[quantptr + DCTSIZE * 2];
            tmp2 = coeff[inptr + DCTSIZE * 4] * quant[quantptr + DCTSIZE * 4];
            tmp3 = coeff[inptr + DCTSIZE * 6] * quant[quantptr + DCTSIZE * 6];
            tmp10 = tmp0 + tmp2;
            tmp11 = tmp0 - tmp2;

            tmp13 = tmp1 + tmp3;

            tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13;

            tmp0 = tmp10 + tmp13;
            tmp3 = tmp10 - tmp13;
            tmp1 = tmp11 + tmp12;
            tmp2 = tmp11 - tmp12;

            tmp4 = coeff[inptr + DCTSIZE * 1] * quant[quantptr + DCTSIZE * 1];
            tmp5 = coeff[inptr + DCTSIZE * 3] * quant[quantptr + DCTSIZE * 3];
            tmp6 = coeff[inptr + DCTSIZE * 5] * quant[quantptr + DCTSIZE * 5];
            tmp7 = coeff[inptr + DCTSIZE * 7] * quant[quantptr + DCTSIZE * 7];

            z13 = tmp6 + tmp5;
            z10 = tmp6 - tmp5;
            z11 = tmp4 + tmp7;
            z12 = tmp4 - tmp7;

            tmp7 = z11 + z13;
            tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);

            z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
            tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
            tmp12 = MULTIPLY(z10, -FIX_2_613125930) + z5;

            tmp6 = tmp12 - tmp7;
            tmp5 = tmp11 - tmp6;
            tmp4 = tmp10 + tmp5;

            workspace[wsptr + DCTSIZE * 0] = (tmp0 + tmp7);
            workspace[wsptr + DCTSIZE * 7] = (tmp0 - tmp7);
            workspace[wsptr + DCTSIZE * 1] = (tmp1 + tmp6);
            workspace[wsptr + DCTSIZE * 6] = (tmp1 - tmp6);
            workspace[wsptr + DCTSIZE * 2] = (tmp2 + tmp5);
            workspace[wsptr + DCTSIZE * 5] = (tmp2 - tmp5);
            workspace[wsptr + DCTSIZE * 4] = (tmp3 + tmp4);
            workspace[wsptr + DCTSIZE * 3] = (tmp3 - tmp4);

            inptr++;
            quantptr++;
            wsptr++;
        }

        wsptr = 0;
        for (int ctr = 0; ctr < DCTSIZE; ctr++) {
            outptr = ctr * 8;

            int basis = 0;
            for (int u = wsptr + 1; u < wsptr + 8; u++) {
                basis |= workspace[u];
            }
            if (basis == 0) {
                // AC terms all zero
                dcval = rangeLimitMap[rangeLimitOffset + ((workspace[wsptr] >> 5) & RANGE_MASK)];

                outbuf[outptr + 0] = dcval;
                outbuf[outptr + 1] = dcval;
                outbuf[outptr + 2] = dcval;
                outbuf[outptr + 3] = dcval;
                outbuf[outptr + 4] = dcval;
                outbuf[outptr + 5] = dcval;
                outbuf[outptr + 6] = dcval;
                outbuf[outptr + 7] = dcval;

                wsptr += DCTSIZE;
                continue;
            }

            tmp10 = (workspace[wsptr + 0] + workspace[wsptr + 4]);
            tmp11 = (workspace[wsptr + 0] - workspace[wsptr + 4]);

            tmp13 = (workspace[wsptr + 2] + workspace[wsptr + 6]);
            tmp12 = MULTIPLY(workspace[wsptr + 2] - workspace[wsptr + 6], FIX_1_414213562) - tmp13;

            tmp0 = tmp10 + tmp13;
            tmp3 = tmp10 - tmp13;
            tmp1 = tmp11 + tmp12;
            tmp2 = tmp11 - tmp12;

            z13 = workspace[wsptr + 5] + workspace[wsptr + 3];
            z10 = workspace[wsptr + 5] - workspace[wsptr + 3];
            z11 = workspace[wsptr + 1] + workspace[wsptr + 7];
            z12 = workspace[wsptr + 1] - workspace[wsptr + 7];

            tmp7 = z11 + z13;
            tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562);

            z5 = MULTIPLY(z10 + z12, FIX_1_847759065);
            tmp10 = MULTIPLY(z12, FIX_1_082392200) - z5;
            tmp12 = MULTIPLY(z10, (-FIX_2_613125930)) + z5;

            tmp6 = tmp12 - tmp7;
            tmp5 = tmp11 - tmp6;
            tmp4 = tmp10 + tmp5;

            outbuf[outptr + 0] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp0 + tmp7, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 7] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp0 - tmp7, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 1] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp1 + tmp6, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 6] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp1 - tmp6, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 2] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp2 + tmp5, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 5] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp2 - tmp5, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 4] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp3 + tmp4, PASS1_BITS + 3) & RANGE_MASK)];
            outbuf[outptr + 3] = rangeLimitMap[rangeLimitOffset + (IDESCALE(tmp3 - tmp4, PASS1_BITS + 3) & RANGE_MASK)];

            wsptr += DCTSIZE;
        }

        return outbuf;
    }
1142090
@Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        IAtomContainer container;
        try {
            container = (IAtomContainer) atomContainer.clone();
            container = AtomContainerManipulator.removeHydrogens(container);
        } catch (CloneNotSupportedException e) {
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (int i = 0; i < 5; i++)
                result.add(Double.NaN);
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames(), new CDKException("Error during cloner: " + e.getMessage(), e));
        }

        try {
            double[] w = listConvertion(container);
            int natom = container.getAtomCount();
            int[][] distancematrix = TopologicalMatrix.getMatrix(container);
            double[] masSum = new double[5];

            for (int k = 0; k < 5; k++) {
                for (int i = 0; i < natom; i++) {
                    for (int j = 0; j < natom; j++) {

                        if (distancematrix[i][j] == k) {
                            masSum[k] += w[i] * w[j];
                        } else
                            masSum[k] += 0.0;
                    }
                }
                if (k > 0) masSum[k] = masSum[k] / 2;

            }
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (double aMasSum : masSum) {
                result.add(aMasSum);
            }

            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames());

        } catch (IOException | ClassNotFoundException ex) {
            DoubleArrayResult result = new DoubleArrayResult(5);
            for (int i = 0; i < 5; i++)
                result.add(Double.NaN);
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), result,
                    getDescriptorNames(), new CDKException("Error while calculating the ATS_mass descriptor: "
                            + ex.getMessage(), ex));
        }
    }
471114
public Point2D.Double calc(double t, Point2D.Double... controlPoints)
    {
        if (controlPoints.length != length)
        {
            throw new IllegalArgumentException("control-points length not "+length);
        }
        double[] cp = convert(controlPoints);
        Point2D.Double point = new Point2D.Double();
        calc(t, point::setLocation, cp);
        return point;
    }
1117957
@Override
    public DescriptorValue calculate(IAtomContainer atomContainer) {
        IAtomContainer ac = null;
        try {
            ac = (IAtomContainer) atomContainer.clone();
        } catch (CloneNotSupportedException e) {
            return getDummyDescriptorValue(e);
        }

        int carbonCount = 0;
        int heteroCount = 0;
        for (IAtom atom : ac.atoms()) {
            if (!Elements.HYDROGEN.getSymbol().equals(atom.getSymbol())) {
                if (Elements.CARBON.getSymbol().equals(atom.getSymbol())) {
                    carbonCount++;
                } else {
                    heteroCount++;
                }
            }
        }
        double mLogP = 1.46 + 0.11 * carbonCount - 0.11 * heteroCount;

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(mLogP),
                getDescriptorNames());
    }
11944
public double calculateValue(double value) {
		JexlContext context = new MapContext();
		context.set(getArg(), value);
		return (double) expression.evaluate(context);
	}
636945
public static <T extends Number> double getAverage(Collection<T> values, AVERAGE_TYPE type) {
		switch(type) {
			case ARITHMETIC:
				double sum = 0.0;
				for(T t: values) {
					sum += t.doubleValue();
				}
				return sum/values.size();
			default: throw new IllegalArgumentException("\""+type+"\" is not a valid verage-type!");
		}
	}
681353
@Override
    public DescriptorValue calculate(IAtomContainer container) {
        int atomCount = 0;

        if (container == null) {
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                    (int) Double.NaN), getDescriptorNames(), new CDKException("The supplied AtomContainer was NULL"));
        }

        if (container.getAtomCount() == 0) {
            return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                    (int) Double.NaN), getDescriptorNames(), new CDKException(
                    "The supplied AtomContainer did not have any atoms"));
        }

        if (elementName.equals("*")) {
            for (int i = 0; i < container.getAtomCount(); i++) {
                // we assume that UNSET is equivalent to 0 implicit H's
                Integer hcount = container.getAtom(i).getImplicitHydrogenCount();
                if (hcount != CDKConstants.UNSET) atomCount += hcount;
            }
            atomCount += container.getAtomCount();
        } else if (elementName.equals("H")) {
            for (int i = 0; i < container.getAtomCount(); i++) {
                if (container.getAtom(i).getSymbol().equals(elementName)) {
                    atomCount += 1;
                } else {
                    // we assume that UNSET is equivalent to 0 implicit H's
                    Integer hcount = container.getAtom(i).getImplicitHydrogenCount();
                    if (hcount != CDKConstants.UNSET) atomCount += hcount;
                }
            }
        } else {
            for (int i = 0; i < container.getAtomCount(); i++) {
                if (container.getAtom(i).getSymbol().equals(elementName)) {
                    atomCount += 1;
                }
            }
        }

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new IntegerResult(
                atomCount), getDescriptorNames());
    }
595361
final public void Math() throws ParseException {
    Multiplication();
    label_12:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
      case MINUS:
        ;
        break;
      default:
        jj_la1[25] = jj_gen;
        break label_12;
      }
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case PLUS:
        jj_consume_token(PLUS);
                  AstPlus jjtn001 = new AstPlus(JJTPLUS);
                  boolean jjtc001 = true;
                  jjtree.openNodeScope(jjtn001);
        try {
          Multiplication();
        } catch (Throwable jjte001) {
                  if (jjtc001) {
                    jjtree.clearNodeScope(jjtn001);
                    jjtc001 = false;
                  } else {
                    jjtree.popNode();
                  }
                  if (jjte001 instanceof RuntimeException) {
                    {if (true) throw (RuntimeException)jjte001;}
                  }
                  if (jjte001 instanceof ParseException) {
                    {if (true) throw (ParseException)jjte001;}
                  }
                  {if (true) throw (Error)jjte001;}
        } finally {
                  if (jjtc001) {
                    jjtree.closeNodeScope(jjtn001,  2);
                  }
        }
        break;
      case MINUS:
        jj_consume_token(MINUS);
                   AstMinus jjtn002 = new AstMinus(JJTMINUS);
                   boolean jjtc002 = true;
                   jjtree.openNodeScope(jjtn002);
        try {
          Multiplication();
        } catch (Throwable jjte002) {
                   if (jjtc002) {
                     jjtree.clearNodeScope(jjtn002);
                     jjtc002 = false;
                   } else {
                     jjtree.popNode();
                   }
                   if (jjte002 instanceof RuntimeException) {
                     {if (true) throw (RuntimeException)jjte002;}
                   }
                   if (jjte002 instanceof ParseException) {
                     {if (true) throw (ParseException)jjte002;}
                   }
                   {if (true) throw (Error)jjte002;}
        } finally {
                   if (jjtc002) {
                     jjtree.closeNodeScope(jjtn002,  2);
                   }
        }
        break;
      default:
        jj_la1[26] = jj_gen;
        jj_consume_token(-1);
        throw new ParseException();
      }
    }
  }
1004853
@Override
    public DescriptorValue calculate(IAtom atom, IAtomContainer container) {
        double value;
        // FIXME: for now I'll cache a few modified atomic properties, and restore them at the end of this method
        String originalAtomtypeName = atom.getAtomTypeName();
        Integer originalNeighborCount = atom.getFormalNeighbourCount();
        Integer originalValency = atom.getValency();
        Double originalBondOrderSum = atom.getBondOrderSum();
        Order originalMaxBondOrder = atom.getMaxBondOrder();
        IAtomType.Hybridization originalHybridization = atom.getHybridization();

        if (!isCachedAtomContainer(container)) {
            try {
                AtomContainerManipulator.percieveAtomTypesAndConfigureAtoms(container);
                LonePairElectronChecker lpcheck = new LonePairElectronChecker();
                lpcheck.saturate(container);
            } catch (CDKException e) {
                return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(
                        Double.NaN), NAMES, e);
            }

        }
        value = db.extractIP(container, atom);
        // restore original props
        atom.setAtomTypeName(originalAtomtypeName);
        atom.setFormalNeighbourCount(originalNeighborCount);
        atom.setValency(originalValency);
        atom.setHybridization(originalHybridization);
        atom.setMaxBondOrder(originalMaxBondOrder);
        atom.setBondOrderSum(originalBondOrderSum);

        return new DescriptorValue(getSpecification(), getParameterNames(), getParameters(), new DoubleResult(value),
                                   NAMES);

    }
774025
@Override
    public void compute() {
        if (!Double.isNaN(getValue())) {
            // since the data cannot change, avoid re-doing the calculations
            return;
        }
        iniCompute();

        Map<U, List<Double>> data = processDataAsPredictedDifferencesToTest();
        int testItems = 0;
        for (U testUser : getTest().getUsers()) {
            int userItems = 0;
            double umse = 0.0;

            if (data.containsKey(testUser)) {
                for (double difference : data.get(testUser)) {
                    umse += difference * difference;
                    userItems++;
                }
            }

            testItems += userItems;
            setValue(getValue() + umse);
            if (userItems == 0) {
                umse = Double.NaN;
            } else {
                umse = Math.sqrt(umse / userItems);
            }
            getMetricPerUser().put(testUser, umse);
        }
        if (testItems == 0) {
            setValue(Double.NaN);
        } else {
            setValue(Math.sqrt(getValue() / testItems));
        }
    }
469715
function arithmEval(context) {
        // this = <tree.Operation object>
        // jshint validthis: true

        if (!context.isMathOn())
            return builtinArithmEval.call(this, context);
        
        var a = this.operands[0].eval(context),
            b = this.operands[1].eval(context),
            type, values, n;
            
        if (isArray(a.value)) {
            type   = a.type;
            a      = a.value;  
            n      = a.length; 
            values = a1bn; 
            if (isArray(b.value)) {
                b      = b.value;
                values = anbn;   
                if (n !== b.length) throw {
                    type:    "Evaluation",
                    message: "`" + this.op
                        + "` op, incompatible lists length ("
                        + n + " vs. " + b.length + ")"
                };
            }
        } else if (isArray(b.value)) {
            type   = b.type;
            b      = b.value;  
            n      = b.length;
            values = anb1;
        } else {
            return builtinArithmEval.call(this, context);    
        }

        var list = [], op = this.op, isSpaced = this.isSpaced;
        for (var i = 0; i < n; i++)
            list.push((new Operation(op,
                values(a, b, i), isSpaced)).eval(context));        
        
        return newLessList(list, type);
    }
374395
@Override
  public void evaluate(IntegerDoubleSolution solution) {
    int approximationToN;
    int approximationToM ;

    approximationToN = 0;
    approximationToM = 0;

    for (int i = 0; i < solution.getNumberOfIntegerVariables(); i++) {
      int value = solution.getVariableValue(i).intValue() ;
      approximationToN += Math.abs(valueN - value) ;
      approximationToM += Math.abs(valueM - value) ;
    }

    for (int i = solution.getNumberOfIntegerVariables(); i < (solution.getNumberOfIntegerVariables()+solution.getNumberOfDoubleVariables()); i++) {
      double value = solution.getVariableValue(i).doubleValue() ;
      approximationToN += Math.abs(valueN - value) ;
      approximationToM += Math.abs(valueM - value) ;
    }

    solution.setObjective(0, approximationToN);
    solution.setObjective(1, approximationToM);
  }
378509
private void calculate(final GeometryArrayFunction callback) {
		geometry.setPrecision(-1);
		splitLine.setPrecision(-1);
		GeometrySplitRequest request = new GeometrySplitRequest(geometry, splitLine);
		GwtCommand command = new GwtCommand(GeometrySplitRequest.COMMAND);
		command.setCommandRequest(request);
		GwtCommandDispatcher.getInstance().execute(command, new AbstractCommandCallback<GeometrySplitResponse>() {

			public void execute(GeometrySplitResponse response) {
				callback.execute(response.getGeometries().toArray(new Geometry[response.getGeometries().size()]));
			}
		});
	}
903444
@SuppressWarnings("unchecked")
	public static <T, R> Aggregator<T, R> create(Class<T> type) {
		if (type == Long.class) {
			return (Aggregator<T, R>) new LongSummaryAggregator();
		}
		else if (type == LongValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.LongValueSummaryAggregator();
		}
		else if (type == Integer.class) {
			return (Aggregator<T, R>) new IntegerSummaryAggregator();
		}
		else if (type == IntValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.IntegerValueSummaryAggregator();
		}
		else if (type == Double.class) {
			return (Aggregator<T, R>) new DoubleSummaryAggregator();
		}
		else if (type == DoubleValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.DoubleValueSummaryAggregator();
		}
		else if (type == Float.class) {
			return (Aggregator<T, R>) new FloatSummaryAggregator();
		}
		else if (type == FloatValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.FloatValueSummaryAggregator();
		}
		else if (type == Short.class) {
			return (Aggregator<T, R>) new ShortSummaryAggregator();
		}
		else if (type == ShortValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.ShortValueSummaryAggregator();
		}
		else if (type == Boolean.class) {
			return (Aggregator<T, R>) new BooleanSummaryAggregator();
		}
		else if (type == BooleanValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.BooleanValueSummaryAggregator();
		}
		else if (type == String.class) {
			return (Aggregator<T, R>) new StringSummaryAggregator();
		}
		else if (type == StringValue.class) {
			return (Aggregator<T, R>) new ValueSummaryAggregator.StringValueSummaryAggregator();
		}
		else {
			// rather than error for unsupported types do something very generic
			return (Aggregator<T, R>) new ObjectSummaryAggregator();
		}
	}
650817
public float[] calculateX(float[] t) {
    float[] x = new float[m];

    for (int i = 0; i < m - 1; i++) {
      x[i] = Math.max(t[m - 1], a[i]) * (t[i] - (float) 0.5) + (float) 0.5;
    }

    x[m - 1] = t[m - 1];

    return x;
  }
1152769
def generic_add(a, b):
    print
    """"""
    logger.info('Called generic_add({}, {})'.format(a, b))
    return a + b