Package org.apache.mahout.math

Examples of org.apache.mahout.math.VectorWritable.readFields()


    this.combinerState = in.readInt();
    this.s0 = in.readDouble();
    VectorWritable temp = new VectorWritable();
    temp.readFields(in);
    this.s1 = temp.get();
    temp.readFields(in);
    this.s2 = temp.get();
  }

  @Override
  public void write(DataOutput out) throws IOException {
View Full Code Here


        if (!fs.exists(meanVectorFile.get())) {
          throw new FileNotFoundException(meanVectorFile.get().toString());
        }
        DataInputStream in = fs.open(meanVectorFile.get());
        try {
          meanVector.readFields(in);
        } finally {
          Closeables.closeQuietly(in);
        }
        this.meanVector = meanVector.get();
        Preconditions.checkArgument(this.meanVector != null, "meanVector not initialized");
View Full Code Here

        MatrixWritable w = new MatrixWritable();
        w.readFields(ois);
        ret = (T) w.get();
      } else {
        VectorWritable w = new VectorWritable();
        w.readFields(ois);
        ret = (T) w.get();
      }
    } catch (java.io.IOException e) {
      System.out.println("Caught exception: " + e);
    }
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.