Class KDTreePositions.Nested

    • Field Detail

      • positions

        private final double[][] positions
    • Constructor Detail

      • Nested

        Nested​(double[][] positions)
    • Method Detail

      • get

        public double get​(int i,
                          int d)
        Description copied from class: KDTreePositions
        Get the coordinates of the node i in dimension d.
        Specified by:
        get in class KDTreePositions
        Returns:
        the coordinate
      • asFlatArray

        public double[] asFlatArray()
        Description copied from class: KDTreePositions
        Get positions of points in the tree as a flat double[] array where positions[d + i*n] is dimension d of the i-th point.

        For serialisation and usage by the tree.

        Internal storage may be a NESTED double[][] array. In this case, flatPositions() returns null.

        Specified by:
        asFlatArray in class KDTreePositions
      • asNestedArray

        public double[][] asNestedArray()
        Description copied from class: KDTreePositions
        Get positions of points in the tree as a nested double[][] array where positions[d][i] is dimension d of the i-th point.

        For serialisation and usage by the tree.

        Internal storage may be flattened into single double[] array. In this case, the nested double[][] array is created here.

        Specified by:
        asNestedArray in class KDTreePositions
      • layout

        public KDTreePositions.PositionsLayout layout()
        Description copied from class: KDTreePositions
        Get the internal layout of positions.

        Positions are stored in either FLAT or NESTED layout. With NESTED layout, positions are stored as a nested double[][] array where positions[d][i] is dimension d of the i-th point. With FLAT layout, positions are stored as a flat double[] array, where positions[d + i*n] is dimension d of the i-th point, with n the number of dimensions.

        Specified by:
        layout in class KDTreePositions