Examples of Sum


Examples of biz.smart.mdx.olap.function.Sum

   * converts List of MdxRange to MdxSet
   * @param ranges
   * @return MdxSet of named sums
   */
  public Member<H> getSum(RangeResolver rangeResolver){
    Sum sum = new Sum(this.getSet(rangeResolver));
    BracketName name = hierarchy.getMemberExpression(label).getDefinition();
    Member<H> member = new Member<H>(hierarchy, sum.getReturn());
    member.setName(name);
    return member;
  }
View Full Code Here

Examples of cascading.operation.aggregator.Sum

    pipe = new Each( pipe, new Fields( "line" ), new ExpressionFunction( new Fields( "hash" ), "line.hashCode() % " + modulo, String.class ), Fields.ALL ); // want some collisions

    pipe = new GroupBy( pipe, new Fields( "hash" ) );

    for( int i = 0; i < depth; i++ )
      pipe = new Every( pipe, new Fields( "count" ), new Sum( new Fields( "sum" + ( i + 1 ) ) ) );

    for( int i = 0; i < depth; i++ )
      {
      pipe = new Each( pipe, new Fields( "hash" ), new Identity( new Fields( 0 ) ), Fields.ALL );
      pipe = new Each( pipe, new Fields( "sum1" ), new Identity( new Fields( 0 ) ), Fields.ALL );
View Full Code Here

Examples of cc.redberry.core.tensor.Sum

        Tensor current;
        while ((current = iterator.next()) != null) {
            if (current instanceof Product)
                iterator.unsafeSet(expandProduct((Product) current, transformations));
            else if (ExpandUtils.isExpandablePower(current)) {
                Sum sum = (Sum) current.get(0);
                int exponent = ((Complex) current.get(1)).intValue();
                if (exponent == -1)
                    continue;
                boolean symbolic = TensorUtils.isSymbolic(sum),
                        reciprocal = exponent < 0;
View Full Code Here

Examples of cc.redberry.core.tensor.Sum

        return target;
    }

    private Tensor getDerivative(Tensor target, SimpleTensor var) {
        if (target instanceof Sum) {
            Sum sum = (Sum) target;
            TensorIterator it = sum.iterator();
            Tensor current, derivative;
            Sum res = new Sum();
            while (it.hasNext()) {
                current = it.next();
                derivative = getDerivative(current, var);
                if (derivative == null)
                    continue;// it.remove();
                else
                    res.add(derivative);//if (derivative != current)
                //it.set(derivative);
            }
            if (res.isEmpty())
                return null;
            return res.equivalent();
        } else if (target instanceof Product) {
            Product product = (Product) target;
            Tensor derivative;
            List<Tensor> resultProducts = new ArrayList<>();
            for (int i = 0; i < product.size(); ++i) {
                derivative = getDerivative(product.getElements().get(i), var);
                if (derivative == null)
                    continue;
                Product clone = (Product) product.clone();
                clone.getElements().remove(i);
                if (!isOne(derivative))
                    clone.add(derivative);
                resultProducts.add(clone.equivalent());
            }
            if (resultProducts.isEmpty())
                return null;
            if (resultProducts.size() == 1)
                return resultProducts.get(0);
            return new Sum(resultProducts);
        } else if (target.getClass() == SimpleTensor.class) {
            SimpleTensor sp = (SimpleTensor) target;
            if (sp.getName() != var.getName())
                return null;
            if (sp.getIndices().size() == 0)
View Full Code Here

Examples of cc.redberry.core.tensor.Sum

            return equals.result();
        if (!equals.initialized())
            return symbols.result();
        Tensor s1 = symbols.result();
        Tensor s2 = equals.result();
        return new Sum(s1, s2);
    }
View Full Code Here

Examples of cc.redberry.core.tensor.Sum

        return closed;
    }

    @Override
    public final Tensor result() {
        Sum sum = new Sum();
        for (Split sp : collectedTerms)
            sum.add(sp.tensorEquvivalent());
        Tensor result = sum.equivalent();
        result.setParent(CC.getRootParentTensor());
        return result;
    }
View Full Code Here

Examples of cc.redberry.core.tensor.Sum

    public Tensor randomScalarSum(int size, int maxProductsSize) {
        if (size <= 0 || maxProductsSize <= 0)
            throw new IllegalArgumentException("size <= 0");
        if (size == 1)
            return randomScalarProduct(maxProductsSize);
        Sum sum = new Sum();
        for (int i = 0; i < size; ++i) {
            int randomProductSize = (int) (1 + Math.random() * maxProductsSize);
            sum.add(randomScalarProduct(randomProductSize));
        }
        return sum;
    }
View Full Code Here

Examples of game.slot.Sum

      playerXStats.add(sixes);
      Bonus bonus = new Bonus(ones, twos, threes, fours, fives, sixes, "Upper bonus", 50);
      playerXStats.add(bonus);

      //Add the intermediate summing slot
      Sum intermediate = new Sum(1, "Intermediate sum", 105);
      playerXStats.add(intermediate);
     
      //Add the lower section score slots
      Pair onePair = new Pair("One pair", 12);
      playerXStats.add(onePair);
      TwoPair twoPair = new TwoPair("Two pairs", 22);
      playerXStats.add(twoPair);
      XOAK threeOfAKind = new XOAK(3, "Three of a kind", 18);
      playerXStats.add(threeOfAKind);
      XOAK fourOfAKind = new XOAK(4, "Four of a kind", 24);
      playerXStats.add(fourOfAKind);
      SmallStraight small = new SmallStraight("Small straight", 15);
      playerXStats.add(small);
      LargeStraight large = new LargeStraight("Large Straight", 20);
      playerXStats.add(large);
      House house = new House("House", 28);
      playerXStats.add(house);
      Chance chance = new Chance("Chance", 30);
      playerXStats.add(chance);
      Yahtzee yahtzee = new Yahtzee("Yahtzee", 50);
      playerXStats.add(yahtzee);
     
      //Add the final summing slot
      Sum total = new Sum(2, "Final sum", 374);
      playerXStats.add(total);
     
      gameSheetContents.add(playerXStats);
    }
  }
View Full Code Here

Examples of ivory.ltr.operator.Sum

         // document judgment
         double judgment = judgmentEntry.getValue();

         // set judgment feature
         docFeatures.put(JUDGMENT_FEATURE_NAME, new Sum());
         docFeatures.get(JUDGMENT_FEATURE_NAME).addScore(judgment);

         // initialize doc nodes
         for(DocumentNode node : docNodes) {
           node.setDocno(docid);
View Full Code Here

Examples of jmathexpr.arithmetic.op.Sum

       
        @Override
        public boolean matches(Expression expr) {
            target = expr;
           
            return new Equality(new Sum(ax, b), new Sum(cx, d)).matches(expr);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.