Class HyperSpherePtr


  • public class HyperSpherePtr
    extends java.lang.Object
    Ptr stores a pointer and optionally takes ownership of the value.
    • Constructor Detail

      • HyperSpherePtr

        public HyperSpherePtr​(long cPtr,
                              boolean cMemoryOwn)
      • HyperSpherePtr

        public HyperSpherePtr()
        Default constructor yielding a NULL-pointer.
      • HyperSpherePtr

        public HyperSpherePtr​(HyperSphere ptr)
        Do not take ownership of ptr.

        ptr can be null.

        The constructor is implicit on purpose.
    • Method Detail

      • delete

        public void delete()
      • deref

        public HyperSphere deref()
        The pointer stored in the object.
      • __ref__

        public HyperSphere __ref__()
        Dereferencing operator.
      • getDeref

        public HyperSphere getDeref()
        Member access operator.
      • isShared

        public boolean isShared()
        check if this Ptr has shared ownership or none
        ownership
        Returns:
        true if Ptr has shared ownership, false if it has no ownership.
      • isNull

        public boolean isNull()
        checks if the pointer is null
        Returns:
        Returns true if the pointer is null
      • uniformDistributionCartesian

        public SWIGTYPE_p_std__vectorT_Eigen__VectorXd_t uniformDistributionCartesian​(double delta)
        Create a uniform distribution in Cartesian coordinates.

        This uses #uniformDistributionSpherical and maps the spherical coordinates to Cartesian
        coordinates. The mapping is documented in [1], section 2.1.

        Parameters:
        delta - [in] the resolution.
        Returns:
        unit vectors, [x_1 x_2 \dots x_K]^T , in Cartesian coordinates with
        dimension K.
        Note: This function is only implemented for 2 \leq K \leq 6 .
      • uniformDistributionSpherical

        public SWIGTYPE_p_std__vectorT_Eigen__VectorXd_t uniformDistributionSpherical​(double delta)
        Create a uniform distribution in spherical coordinates.

        This implements the algorithm in [1], section 2.1, for dimensions 2 \leq K \leq 6.

        Parameters:
        delta - [in] the resolution.
        Returns:
        list of vectors, [\theta_1 \theta_2 \dots \theta_{K-1}]^T , in spherical
        coordinates with dimension K-1.
        Note: This function is only implemented for 2 \leq K \leq 6 .
      • getDimensions

        public long getDimensions()
        Get the number of dimensions of the hyper-sphere.
        Returns:
        the number of dimensions, 2 \leq K \leq 6 .
      • area

        public double area()
        Calculate the surface area of a hyper-sphere.

        Calculated for even dimensionality as \frac{K \pi^{K/2}}{(K/2)!}

        Calculated for odd dimensionality as \frac{K 2^K \pi^{(K-1)/2}}{K!}

        Returns:
        the surface area.
      • volume

        public double volume()
        The volume of a hyper-sphere.

        Calculated for even dimensionality as \frac{\pi^{K/2}}{(K/2)!}

        Calculated for odd dimensionality as \frac{2 (2 \pi)^{(K-1)/2}}{K!!}
        where the double factorial for odd K means 1 \cdot 3 \cdot 5 \dots K

        Returns:
        the volume.