Author: srowen Date: Mon Jan 18 09:47:05 2010 New Revision: 900319 URL: http://svn.apache.org/viewvc?rev=900319&view=rev Log: Fix compile error in DisplayOutputState
Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java?rev=900319&r1=900318&r2=900319&view=diff ============================================================================== --- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java (original) +++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletDriver.java Mon Jan 18 09:47:05 2010 @@ -197,7 +197,7 @@ * * @param modelFactory a String which is the class name of the model factory * @param modelPrototype a String which is the class name of the Vector used to initialize the factory - * @param prototypeSie an int number of dimensions of the model prototype vector + * @param prototypeSize an int number of dimensions of the model prototype vector * @param numModels an int number of models to be created * @param alpha_0 the double alpha_0 argument to the algorithm * @return an initialized DirichletState @@ -214,7 +214,7 @@ SecurityException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException { ClassLoader ccl = Thread.currentThread().getContextClassLoader(); Class<? extends VectorModelDistribution> cl = ccl.loadClass(modelFactory).asSubclass(VectorModelDistribution.class); - VectorModelDistribution factory = (VectorModelDistribution) cl.newInstance(); + VectorModelDistribution factory = cl.newInstance(); Class<? extends Vector> vcl = ccl.loadClass(modelPrototype).asSubclass(Vector.class); Constructor<? extends Vector> v = vcl.getConstructor(int.class); Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java?rev=900319&r1=900318&r2=900319&view=diff ============================================================================== --- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java (original) +++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/clustering/dirichlet/DirichletMapper.java Mon Jan 18 09:47:05 2010 @@ -76,7 +76,8 @@ } } - public static DirichletState<VectorWritable> getDirichletState(JobConf job) throws NumberFormatException, SecurityException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException { + public static DirichletState<VectorWritable> getDirichletState(JobConf job) + throws SecurityException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException { String statePath = job.get(DirichletDriver.STATE_IN_KEY); String modelFactory = job.get(DirichletDriver.MODEL_FACTORY_KEY); String modelPrototype = job.get(DirichletDriver.MODEL_PROTOTYPE_KEY); Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java?rev=900319&r1=900318&r2=900319&view=diff ============================================================================== --- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java (original) +++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayDirichlet.java Mon Jan 18 09:47:05 2010 @@ -27,6 +27,7 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Ellipse2D; import java.awt.geom.Rectangle2D; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; import java.io.IOException; @@ -97,7 +98,7 @@ }); } - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws IOException, InvocationTargetException, NoSuchMethodException { RandomUtils.useTestSeed(); generateSamples(); new DisplayDirichlet(); Modified: lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java?rev=900319&r1=900318&r2=900319&view=diff ============================================================================== --- lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java (original) +++ lucene/mahout/trunk/examples/src/main/java/org/apache/mahout/clustering/dirichlet/DisplayOutputState.java Mon Jan 18 09:47:05 2010 @@ -22,6 +22,7 @@ import java.awt.Graphics2D; import java.io.File; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.List; @@ -86,7 +87,7 @@ sampleData.addAll(readFile(g.getCanonicalPath())); } - private static void getResults() throws IOException { + private static void getResults() throws IOException, InvocationTargetException, NoSuchMethodException { result = new ArrayList<Model<VectorWritable>[]>(); JobConf conf = new JobConf(KMeansDriver.class); conf.set(DirichletDriver.MODEL_FACTORY_KEY, @@ -101,7 +102,7 @@ } } - public static void main(String[] args) throws IOException { + public static void main(String[] args) throws IOException, InvocationTargetException, NoSuchMethodException { RandomUtils.useTestSeed(); getSamples(); getResults();