Examples of reduce()


Examples of org.apache.lucene.util.automaton.Automaton.reduce()

     
      if (random().nextBoolean()) {
        if (VERBOSE) {
          System.out.println("TEST: reduce the automaton");
        }
        a.reduce();
      }

      final CompiledAutomaton c = new CompiledAutomaton(a, true, false);

      final BytesRef[] acceptTermsArray = new BytesRef[acceptTerms.size()];
View Full Code Here

Examples of org.apache.lucene.util.automaton.Automaton.reduce()

     
      if (random().nextBoolean()) {
        if (VERBOSE) {
          System.out.println("TEST: reduce the automaton");
        }
        a.reduce();
      }

      final CompiledAutomaton c = new CompiledAutomaton(a, true, false);

      final BytesRef[] acceptTermsArray = new BytesRef[acceptTerms.size()];
View Full Code Here

Examples of org.apache.lucene.util.automaton.Automaton.reduce()

      if (Character.isLetter(i)) {
        initial.addTransition(new Transition(i, i, accept));
      }
    }
    Automaton single = new Automaton(initial);
    single.reduce();
    Automaton repeat = BasicOperations.repeat(single);
    jvmLetter = new CharacterRunAutomaton(repeat);
  }
 
  public void testLetterAscii() throws Exception {
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.mapreduce.common.BayesFeatureReducer.reduce()

    Collection<StringTuple> keySet = new TreeSet<StringTuple>(cmp);
    keySet.addAll(mapperOutput.getKeys());
   
    for (StringTuple k: keySet) {
      List<DoubleWritable> v = outputData.get(k);
      reducer.reduce(k, v.iterator(), reducerOutput, Reporter.NULL);
    }

    return reducerOutput;
  }
View Full Code Here

Examples of org.apache.mahout.classifier.bayes.mapreduce.common.BayesFeatureReducer.reduce()

    Collection<StringTuple> keySet = new TreeSet<StringTuple>(cmp);
    keySet.addAll(mapperOutput.getKeys());
   
    for (StringTuple k: keySet) {
      List<DoubleWritable> v = outputData.get(k);
      reducer.reduce(k, v.iterator(), reducerOutput, Reporter.NULL);
    }

    return reducerOutput;
  }
View Full Code Here

Examples of org.apache.mahout.clustering.spectral.MatrixDiagonalizeJob.MatrixDiagonalizeReducer.reduce()

    Reducer<NullWritable, IntDoublePairWritable, NullWritable, VectorWritable>.Context
      redContext = DummyRecordWriter.build(reducer, conf, redWriter,
      NullWritable.class, IntDoublePairWritable.class);
   
    // only need one reduction
    reducer.reduce(NullWritable.get(), mapWriter.getValue(NullWritable.get()), redContext);
   
    // first, make sure there's only one result
    List<VectorWritable> list = redWriter.getValue(NullWritable.get());
    assertEquals("Only a single resulting vector", 1, list.size());
    Vector v = list.get(0).get();
View Full Code Here

Examples of org.apache.mahout.clustering.spectral.common.MatrixDiagonalizeJob.MatrixDiagonalizeReducer.reduce()

    Reducer<NullWritable, IntDoublePairWritable, NullWritable, VectorWritable>.Context
      redContext = DummyRecordWriter.build(reducer, conf, redWriter,
      NullWritable.class, IntDoublePairWritable.class);
   
    // only need one reduction
    reducer.reduce(NullWritable.get(), mapWriter.getValue(NullWritable.get()), redContext);
   
    // first, make sure there's only one result
    List<VectorWritable> list = redWriter.getValue(NullWritable.get());
    assertEquals("Only a single resulting vector", 1, list.size());
    Vector v = list.get(0).get();
View Full Code Here

Examples of org.apache.mahout.clustering.spectral.eigencuts.EigencutsAffinityCutsJob.EigencutsAffinityCutsCombiner.reduce()

      redContext = DummyRecordWriter.build(combiner, conf, redWriter, Text.class,
      VertexWritable.class);
   
    // perform the combining
    for (Map.Entry<Text, List<VertexWritable>> entry : data.entrySet()) {
      combiner.reduce(entry.getKey(), entry.getValue(), redContext);
    }
   
    // test the number of cuts, there should be 2
    assertEquals("Number of cuts detected", 4,
        redContext.getCounter(EigencutsAffinityCutsJob.CUTSCOUNTER.NUM_CUTS).getValue());
View Full Code Here

Examples of org.apache.mahout.clustering.spectral.eigencuts.EigencutsAffinityCutsJob.EigencutsAffinityCutsCombiner.reduce()

      comContext = DummyRecordWriter.build(combiner, conf, comWriter, Text.class,
      VertexWritable.class);
   
    // perform the combining
    for (Map.Entry<Text, List<VertexWritable>> entry : data.entrySet()) {
      combiner.reduce(entry.getKey(), entry.getValue(), comContext);
    }
   
    // finally, set up the reduction writers
    EigencutsAffinityCutsReducer reducer = new EigencutsAffinityCutsReducer();
    DummyRecordWriter<IntWritable, VectorWritable> redWriter = new
View Full Code Here

Examples of org.apache.mahout.clustering.spectral.eigencuts.EigencutsAffinityCutsJob.EigencutsAffinityCutsReducer.reduce()

      redContext = DummyRecordWriter.build(reducer, conf, redWriter,
      Text.class, VertexWritable.class);
   
    // perform the reduction
    for (Text key : comWriter.getKeys()) {
      reducer.reduce(key, comWriter.getValue(key), redContext);
    }
   
    // now, check that the affinity matrix is correctly formed
    for (IntWritable row : redWriter.getKeys()) {
      List<VectorWritable> results = redWriter.getValue(row);
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.