Class WeightSelection

java.lang.Object
com.irurueta.numerical.robust.WeightSelection

public class WeightSelection extends Object
Class containing the selection that was made on a weighted algorithm. This is used internally by weighted estimators.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private int
    Number of correspondences that have been selected.
    private boolean[]
    Array indicating which correspondences have been selected (i.e.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns number of correspondences that have been selected.
    boolean[]
    Returns array indicating which correspondences have been selected (i.e.
    selectWeights(double[] weights, boolean sortWeights, int maxPoints)
    Selects correspondences based on provided weights and creates a weight selection instance.
    void
    setNumSelected(int numSelected)
    Sets number of correspondences that have been selected.
    void
    setSelected(boolean[] selected)
    Sets array indicating which correspondences have been selected (i.e.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • selected

      private boolean[] selected
      Array indicating which correspondences have been selected (i.e. have a true value), and which ones hasn't (have a false value).
    • numSelected

      private int numSelected
      Number of correspondences that have been selected.
  • Constructor Details

    • WeightSelection

      private WeightSelection()
      Constructor.
  • Method Details

    • getSelected

      public boolean[] getSelected()
      Returns array indicating which correspondences have been selected (i.e. have a true value), and which ones hasn't (have a false value).
      Returns:
      array indicating which correspondences have been selected.
    • setSelected

      public void setSelected(boolean[] selected)
      Sets array indicating which correspondences have been selected (i.e. have a true value), and which ones hasn't (have a false value).
      Parameters:
      selected - array indicating which correspondences have been selected.
    • getNumSelected

      public int getNumSelected()
      Returns number of correspondences that have been selected.
      Returns:
      number of correspondences that have been selected.
    • setNumSelected

      public void setNumSelected(int numSelected)
      Sets number of correspondences that have been selected.
      Parameters:
      numSelected - number of correspondences that have been selected.
    • selectWeights

      public static WeightSelection selectWeights(double[] weights, boolean sortWeights, int maxPoints) throws com.irurueta.sorting.SortingException
      Selects correspondences based on provided weights and creates a weight selection instance.
      Parameters:
      weights - weights. The larger its value the more important a correspondence is.
      sortWeights - indicates whether weights must be sorted so that largest weights are taken into account first.
      maxPoints - maximum number of correspondences to pick
      Returns:
      instance containing the selection that was made.
      Throws:
      com.irurueta.sorting.SortingException - if weights couldn't be sorted.