Class VectorWritable

  • All Implemented Interfaces:
    java.lang.Comparable<VectorWritable>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<VectorWritable>

    public final class VectorWritable
    extends java.lang.Object
    implements org.apache.hadoop.io.WritableComparable<VectorWritable>
    New and updated VectorWritable class that has all the other fancy combinations of vectors that are possible in my math library.
    This class is not compatible to the one in the clustering package that has a totally different byte alignment in binary files.
    Author:
    thomas.jungblut
    • Constructor Detail

      • VectorWritable

        public VectorWritable()
      • VectorWritable

        public VectorWritable​(de.jungblut.math.DoubleVector v)
    • Method Detail

      • write

        public final void write​(java.io.DataOutput out)
                         throws java.io.IOException
        Specified by:
        write in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • readFields

        public final void readFields​(java.io.DataInput in)
                              throws java.io.IOException
        Specified by:
        readFields in interface org.apache.hadoop.io.Writable
        Throws:
        java.io.IOException
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getVector

        public de.jungblut.math.DoubleVector getVector()
        Returns:
        the embedded vector
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • writeVector

        public static void writeVector​(de.jungblut.math.DoubleVector vector,
                                       java.io.DataOutput out)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • readVector

        public static de.jungblut.math.DoubleVector readVector​(java.io.DataInput in)
                                                        throws java.io.IOException
        Throws:
        java.io.IOException
      • compareVector

        public static int compareVector​(de.jungblut.math.DoubleVector a,
                                        de.jungblut.math.DoubleVector o)
      • wrap

        public static VectorWritable wrap​(de.jungblut.math.DoubleVector a)