Examples of Tuple


Examples of com.adventuresinsoftware.tuple.Tuple

  /*
   * Allocate more measurements according to the algorithm, and put them into
   * the measurementsToGive list in round-robin fashion.
   */
  public void AllocateMore() {
    Tuple D[] = new Tuple[M()];
    int i, b = MathPF.argmax(belief.mu);

    // System.out.println("AllocateMore");

    /*
     * Compute D[i] for each alternative according to the procedure in the
     * left hand column on page 958 of the paper. We compute D[i] when i<>b
     * in a straightforward fashion in the loop. D[b] is more complicated,
     * being computed as the sum of terms over i<>b. Also see notes on
     * 10/9/2007, p3.
     */
    double Db = 0;
    for (i = 0; i < M(); i++) {
      double s2bi, s2bii, s2bib; // standard deviations.
      double fbi, fbii, fbib; // values for bf.
      if (i == b)
        continue;
      s2bi = Math.sqrt(1 / belief.beta[b] + 1 / belief.beta[i]);
      s2bii = Math.sqrt(1 / belief.beta[b] + 1
          / (belief.beta[i] + belief.noiseBeta[i]));
      s2bib = Math.sqrt(1 / belief.beta[i] + 1
          / (belief.beta[b] + belief.noiseBeta[b]));
      fbi = bf(belief.mu[b] - belief.mu[i], s2bi);
      fbii = bf(belief.mu[b] - belief.mu[i], s2bii);
      fbib = bf(belief.mu[b] - belief.mu[i], s2bib);
      D[i] = new Tuple().add(fbii - fbi).add(i);
      Db += fbib - fbi;
    }
    D[b] = new Tuple().add(Db).add(b);

    // System.out.println(Arrays.toString(D));

    /*
     * Now find the mHeChCh best (minimum) values of D and allocate tau each
View Full Code Here

Examples of com.aptana.shared_core.structure.Tuple

            }
        }
        boolean force = false;
        if (info.argsToReparse != null && info.argsToReparse.length > 0) {
            if (info.argsToReparse[0] instanceof Tuple) {
                Tuple t = (Tuple) info.argsToReparse[0];
                if (t.o1 instanceof String && t.o2 instanceof Boolean) {
                    if (t.o1.equals(ANALYSIS_PARSER_OBSERVER_FORCE)) {
                        //if this message is passed, it will decide whether we will force the analysis or not
                        force = (Boolean) t.o2;
                    }
View Full Code Here

Examples of com.datasalt.pangool.io.Tuple

 
  private static CachedTuples createCachedTuples(TupleMRConfig config){
    SerializationInfo serInfo = config.getSerializationInfo();
    boolean multipleSources = config.getNumIntermediateSchemas() >= 2;
    CachedTuples r = new CachedTuples();
    r.commonTuple = new Tuple(serInfo.getCommonSchema());
    for (Schema sourceSchema : config.getIntermediateSchemas()){
      r.resultTuples.add(new Tuple(sourceSchema));
    }
   
    if (multipleSources){
      for(Schema specificSchema : serInfo.getSpecificSchemas()){
        r.specificTuples.add(new Tuple(specificSchema));
      }
    }
    return r;
  }
View Full Code Here

Examples of com.ebay.erl.mobius.core.model.Tuple

    @Override
    public List<TupleToBuffer> fill()
    {
      while ( this.buffer.size()<this.bufferSize && this.currentReadTuples<totalTuples )
      {         
        Tuple t = new Tuple();
        try
        {
          t.readFields(this.reader);
          t.setSchema(this.schema)
        }
        catch (IOException e)
        {
          throw new RuntimeException("Cannot deserialize tuples from underline file:"+source.toString(), e);
        }       
View Full Code Here

Examples of com.enigmastation.collections.Tuple

    public List<Tuple> getTopMatches(NestedDictionaryStringStringDouble dict, Object person, int matches) {
        List<Tuple> scores = new FastList<Tuple>();
        for (Object other : dict.keySet()) {
            if (!other.equals(person)) {
                Tuple t = new Tuple(other, this.getDistance(dict, other, person));
                //System.out.println(t);
                scores.add(t);
            }
        }
        Collections.sort(scores, new Comparator<Tuple>() {
View Full Code Here

Examples of com.facebook.presto.tuple.Tuple

        while (cursor.advanceNextPosition()) {
            Aggregator function = createAggregator(aggregation(getFunction(), new Input(0, 0)), Step.PARTIAL);
            function.addValue(cursor);
            BlockCursor result = function.getResult().cursor();
            assertTrue(result.advanceNextPosition());
            Tuple tuple = result.getTuple();
            blockBuilder.append(tuple);
        }
        return blockBuilder.build();
    }
View Full Code Here

Examples of com.mysema.query.Tuple

        StringPath name = new StringPath("name");
        StringPath id = new StringPath("id");
        QBean<Entity2> entity2Bean = new QBean<Entity2>(Entity2.class, name, id);
        QTuple tupleExpr = new QTuple(entity2Bean);

        Tuple tuple = FactoryExpressionUtils.wrap(tupleExpr).newInstance("nameX","idX");
        assertEquals("nameX", tuple.get(entity2Bean).getName());
        assertEquals("idX", tuple.get(entity2Bean).getId());
    }
View Full Code Here

Examples of com.onionnetworks.util.Tuple

     * one.
     */
    public synchronized FECCode createFECCode(int k, int n) {
        Integer K = new Integer(k);
        Integer N = new Integer(n);
        Tuple t = new Tuple(K,N);

        // See if there is a cached code.
        FECCode result = null; //(FECCode) codeCache.get(t);
        if (result == null) {
            if (k < 1 || k > 65536 || n < k || n > 65536) {
View Full Code Here

Examples of com.salesforce.phoenix.schema.tuple.Tuple

                            byte[] uuidValue = cache.getId();
                            context.getScan().setAttribute(PhoenixIndexCodec.INDEX_UUID, uuidValue);
                        }
                        ResultIterator iterator = aggPlan.iterator();
                        try {
                            Tuple row = iterator.next();
                            final long mutationCount = (Long)projector.getColumnProjector(0).getValue(row, PDataType.LONG, ptr);
                            return new MutationState(maxSize, connection) {
                                @Override
                                public long getUpdateCount() {
                                    return mutationCount;
                                }
                            };
                        } finally {
                            iterator.close();
                        }
                    } finally {
                        if (cache != null) {
                            cache.close();
                        }
                    }
                }

                @Override
                public ExplainPlan getExplainPlan() throws SQLException {
                    List<String> queryPlanSteps =  aggPlan.getExplainPlan().getPlanSteps();
                    List<String> planSteps = Lists.newArrayListWithExpectedSize(queryPlanSteps.size()+1);
                    planSteps.add("DELETE ROWS");
                    planSteps.addAll(queryPlanSteps);
                    return new ExplainPlan(planSteps);
                }
            };
        } else {
            if (parallelIteratorFactory != null) {
                parallelIteratorFactory.setRowProjector(plan.getProjector());
            }
            return new MutationPlan() {

                @Override
                public PhoenixConnection getConnection() {
                    return connection;
                }

                @Override
                public ParameterMetaData getParameterMetaData() {
                    return context.getBindManager().getParameterMetaData();
                }

                @Override
                public MutationState execute() throws SQLException {
                    ResultIterator iterator = plan.iterator();
                    if (!hasLimit) {
                        Tuple tuple;
                        long totalRowCount = 0;
                        while ((tuple=iterator.next()) != null) {// Runs query
                            KeyValue kv = tuple.getValue(0);
                            totalRowCount += PDataType.LONG.getCodec().decodeLong(kv.getBuffer(), kv.getValueOffset(), null);
                        }
                        // Return total number of rows that have been delete. In the case of auto commit being off
                        // the mutations will all be in the mutation state of the current connection.
                        return new MutationState(maxSize, connection, totalRowCount);
View Full Code Here

Examples of eu.admire.dispel.parser.expression.Tuple

            mExpressions.add(ListMarker.END);
            break;
        }
        case TUPLE:
        {
            Tuple expression = ((TupleStrategy)strategy).getTupleExpression();
            Object value = expression.evaluate(mExecutionState.getVariables());
            mExpressions.add(value);
            break;
        }
        case STYPE:
            mStype = ((STypeStrategy)strategy).getType();
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.