Class ALOCI.Node

    • Field Detail

      • code

        final int code
        Position code
      • count

        final int count
        Number of elements
      • level

        final int level
        Level of node
      • children

        java.util.List<ALOCI.Node> children
        Child nodes, may be null
      • center

        double[] center
        Center vector
    • Constructor Detail

      • Node

        protected Node​(int code,
                       double[] center,
                       int count,
                       int level,
                       java.util.List<ALOCI.Node> children)
        Constructor.
        Parameters:
        code - Node code
        center - Center vector
        count - Element count
        level - Node level
        children - Children list
    • Method Detail

      • getLevel

        public int getLevel()
        Get level of node.
        Returns:
        Level of node
      • getCount

        public int getCount()
        Get count of subtree
        Returns:
        subtree count
      • getSquareSum

        public long getSquareSum​(int levels)
        Get sum of squares, recursively
        Parameters:
        levels - Depth to collect
        Returns:
        Sum of squares
      • getCubicSum

        public long getCubicSum​(int levels)
        Get cubic sum.
        Parameters:
        levels - Level to collect
        Returns:
        sum of cubes
      • getDimensionality

        public int getDimensionality()
        Description copied from interface: FeatureVector
        The dimensionality of the vector space where of this FeatureVector of V is an element.
        Specified by:
        getDimensionality in interface FeatureVector<java.lang.Number>
        Specified by:
        getDimensionality in interface SpatialComparable
        Returns:
        the number of dimensions of this FeatureVector of V
      • doubleValue

        public double doubleValue​(int dimension)
        Description copied from interface: NumberVector
        Returns the value in the specified dimension as double.

        Note: this might seem redundant with respect to getValue(dim).doubleValue(), but usually this is much more efficient due to boxing/unboxing cost.

        Specified by:
        doubleValue in interface NumberVector
        Parameters:
        dimension - the desired dimension, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the value in the specified dimension
      • longValue

        public long longValue​(int dimension)
        Description copied from interface: NumberVector
        Returns the value in the specified dimension as long.

        Note: this might seem redundant with respect to getValue(dim).longValue(), but usually this is much more efficient due to boxing/unboxing cost.

        Specified by:
        longValue in interface NumberVector
        Parameters:
        dimension - the desired dimension, where 0 ≤ dimension < this.getDimensionality()
        Returns:
        the value in the specified dimension
      • toArray

        public double[] toArray()
        Description copied from interface: NumberVector
        Returns a double array copy of this vector.
        Specified by:
        toArray in interface NumberVector
        Returns:
        Copy as double[]