Interface VectorSet

All Known Implementing Classes:
VectorSetUsingBuffer

public interface VectorSet
A collection of Vector3f values without duplicates.

When determining duplicates, -0 is distinguished from 0.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(float x, float y, float z)
    Add the specified value to this set, if it's not already present.
    void
    add(Vector3f vector)
    Add the value of the specified Vector3f to this set, if it's not already present.
    void
    Add the specified values to this set, to the extent that they're not already present.
    void
    Reset this set to its initial (empty) state without altering its capacity.
    boolean
    contains(float x, float y, float z)
    Test whether this set contains the specified value.
    boolean
    Test whether this set contains the value of the specified Vector3f.
    covariance(Matrix3f storeResult)
    Determine the sample covariance of the values in this set.
    maxAbs(Vector3f storeResult)
    Find the maximum absolute coordinate for each axis among the Vector3f values in this set.
    float
    Find the magnitude of the longest vector in this set.
    void
    maxMin(Vector3f storeMaxima, Vector3f storeMinima)
    Find the maximum and minimum coordinates for each axis among the values in this set.
    mean(Vector3f storeResult)
    Determine the sample mean for each axis among the values in this set.
    int
    Determine the number of values in this set.
    Access a Buffer containing all values in this set.
    float[]
    Create an array of floats containing all values in this set.
    Create an array of vectors containing all values in this set.
  • Method Details

    • add

      void add(float x, float y, float z)
      Add the specified value to this set, if it's not already present.
      Parameters:
      x - the X component of the new value
      y - the Y component of the new value
      z - the Z component of the new value
    • add

      void add(Vector3f vector)
      Add the value of the specified Vector3f to this set, if it's not already present.
      Parameters:
      vector - the value to add (not null, unaffected)
    • addAll

      void addAll(Iterable<Vector3f> vectors)
      Add the specified values to this set, to the extent that they're not already present.
      Parameters:
      vectors - the values to add (not null, unaffected)
    • clear

      void clear()
      Reset this set to its initial (empty) state without altering its capacity.
    • contains

      boolean contains(float x, float y, float z)
      Test whether this set contains the specified value.
      Parameters:
      x - the X component of the value to find
      y - the Y component of the value to find
      z - the Z component of the value to find
      Returns:
      true if found, otherwise false
    • contains

      boolean contains(Vector3f vector)
      Test whether this set contains the value of the specified Vector3f.
      Parameters:
      vector - the value to find (not null, unaffected)
      Returns:
      true if found, otherwise false
    • covariance

      Matrix3f covariance(Matrix3f storeResult)
      Determine the sample covariance of the values in this set.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the unbiased sample covariance (either storeResult or a new matrix, not null)
    • maxAbs

      Vector3f maxAbs(Vector3f storeResult)
      Find the maximum absolute coordinate for each axis among the Vector3f values in this set.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the half extent for each axis (either storeResult or a new instance)
    • maxLength

      float maxLength()
      Find the magnitude of the longest vector in this set.
      Returns:
      the magnitude (≥0)
    • maxMin

      void maxMin(Vector3f storeMaxima, Vector3f storeMinima)
      Find the maximum and minimum coordinates for each axis among the values in this set.
      Parameters:
      storeMaxima - storage for the maxima (not null, modified)
      storeMinima - storage for the minima (not null, modified)
    • mean

      Vector3f mean(Vector3f storeResult)
      Determine the sample mean for each axis among the values in this set.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the sample mean for each axis (either storeResult or a new Vector3f)
    • numVectors

      int numVectors()
      Determine the number of values in this set.
      Returns:
      the count (≥0)
    • toBuffer

      FloatBuffer toBuffer()
      Access a Buffer containing all values in this set. No further add() is allowed.
      Returns:
      a Buffer, flipped but possibly not rewound
    • toFloatArray

      float[] toFloatArray()
      Create an array of floats containing all values in this set.
      Returns:
      a new array
    • toVectorArray

      Vector3f[] toVectorArray()
      Create an array of vectors containing all values in this set.
      Returns:
      a new array of new vectors