Examples of aggregate()


Examples of cern.colt.matrix.DoubleMatrix3D.aggregate()

DoubleMatrix3D x = cern.colt.matrix.DoubleFactory3D.dense.ascending(2,2,2);
System.out.println(x);

// Sum( x[slice,row,col]*x[slice,row,col] )
System.out.println(x.aggregate(F.plus,F.square));
//--> 140


DoubleMatrix3D y = x.copy();
// Sum( (x[i]+y[i])^2 )
View Full Code Here

Examples of co.nubetech.crux.server.functions.CruxAggregator.aggregate()

  public static Object getResultByApplyingAllFunctions(Object value, Stack<CruxFunction> functions) throws CruxException {
    Object returnVal = value;
    for (CruxFunction fn : functions) {
      if (fn.isAggregate()) {
        CruxAggregator aggregator = (CruxAggregator) fn;
        aggregator.aggregate(returnVal);
        returnVal = ((CruxAggregator)fn).getAggregate();
        }
      else {
        returnVal = ((CruxNonAggregator)fn).execute(returnVal);     
      }
View Full Code Here

Examples of co.nubetech.crux.server.functions.SumDoubleAggregator.aggregate()

 
  @Test
  public void testGetSemiAggregatedResultNonAggregateFirst() throws CruxException{
    Stack<CruxFunction> xFnStack = new Stack<CruxFunction>();
    SumDoubleAggregator summer = new SumDoubleAggregator();
    summer.aggregate(Bytes.toBytes(new Double(54.5d)));
    xFnStack.push(new Ceil());
    xFnStack.push(summer);
    assertEquals(54.5d, FunctionUtil.getSemiAggregatedResult(xFnStack));
  }
 
View Full Code Here

Examples of com.cloud.info.RunningHostInfoAgregator.aggregate()

        List<RunningHostCountInfo> l = _hostDao.getRunningHostCounts(new Date(cutTime.getTime() - _clusterMgr.getHeartbeatThreshold()));

        RunningHostInfoAgregator aggregator = new RunningHostInfoAgregator();
        if (l.size() > 0) {
            for (RunningHostCountInfo countInfo : l) {
                aggregator.aggregate(countInfo);
            }
        }

        return aggregator.getZoneHostInfoMap();
    }
View Full Code Here

Examples of com.cloud.info.RunningHostInfoAgregator.aggregate()

        List<RunningHostCountInfo> l = _hostDao.getRunningHostCounts(new Date(cutTime.getTime() - ClusterManager.DEFAULT_HEARTBEAT_THRESHOLD));

        RunningHostInfoAgregator aggregator = new RunningHostInfoAgregator();
        if (l.size() > 0) {
            for (RunningHostCountInfo countInfo : l) {
                aggregator.aggregate(countInfo);
            }
        }

        return aggregator.getZoneHostInfoMap();
    }
View Full Code Here

Examples of com.facebook.presto.metadata.FunctionListBuilder.aggregate()

    public static GenericAggregationFunctionFactory fromAggregationDefinition(Class<?> clazz, TypeManager typeManager)
    {
        FunctionListBuilder builder = new FunctionListBuilder(typeManager);
        for (InternalAggregationFunction aggregation : new AggregationCompiler(typeManager).generateAggregationFunctions(clazz)) {
            builder.aggregate(aggregation);
        }

        return new GenericAggregationFunctionFactory(builder.getFunctions());
    }
View Full Code Here

Examples of com.mongodb.DBCollection.aggregate()

        // Allow body to be a pipeline
        // @see http://docs.mongodb.org/manual/core/aggregation/
        if (query instanceof BasicDBList) {
            BasicDBList queryList = (BasicDBList)query;
            aggregationResult = dbCol.aggregate((DBObject)queryList.get(0), queryList
                .subList(1, queryList.size()).toArray(new BasicDBObject[queryList.size() - 1]));
        } else {
            aggregationResult = dbCol.aggregate(query);
        }
View Full Code Here

Examples of com.mongodb.DBCollection.aggregate()

        if (query instanceof BasicDBList) {
            BasicDBList queryList = (BasicDBList)query;
            aggregationResult = dbCol.aggregate((DBObject)queryList.get(0), queryList
                .subList(1, queryList.size()).toArray(new BasicDBObject[queryList.size() - 1]));
        } else {
            aggregationResult = dbCol.aggregate(query);
        }

        dbIterator = aggregationResult.results();
        Message resultMessage = prepareResponseMessage(exchange, MongoDbOperation.aggregate);
        resultMessage.setBody(dbIterator);
View Full Code Here

Examples of com.opengamma.engine.function.config.FunctionConfigurationDefinitionAggregator.aggregate()

 
  //-------------------------------------------------------------------------
  @Override
  protected FunctionConfigurationSource initSource() {
    FunctionConfigurationDefinitionAggregator definitionAggregator = new FunctionConfigurationDefinitionAggregator(new MasterConfigSource(getConfigMaster()));
    List<FunctionConfigurationSource> underlying = Lists.newArrayList(definitionAggregator.aggregate(_functionDefinitionName));
    underlying.addAll(curveAndSurfaceSources());
   
    final FunctionConfigurationSource[] array = underlying.toArray(new FunctionConfigurationSource[underlying.size()]);
    return CombiningFunctionConfigurationSource.of(array);
  }
View Full Code Here

Examples of com.opengamma.financial.aggregation.PortfolioAggregator.aggregate()

        throw new OpenGammaRuntimeException("Unknown aggregator '" + aggregatorName + "'");
      }
      aggregationFunctions.add(aggregationFunction);
    }
    PortfolioAggregator aggregator = new PortfolioAggregator(aggregationFunctions);
    Portfolio aggregatedPortfolio = aggregator.aggregate(resolvedPortfolio);
    return _portfolioSaver.savePortfolio(aggregatedPortfolio, false);
  }
 
  //-------------------------------------------------------------------------
  private static class PortfolioReference {
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.