File weight_vector_equal.hpp¶
-
class EqualWeightVector : public IWeightVector¶
- #include <weight_vector_equal.hpp>
An one-dimensional vector that provides random access to a fixed number of equal weights.
Public Types
-
using weight_type = bool¶
The type of the weights, the vector provides access to.
-
using const_iterator = EqualIterator<weight_type>¶
An iterator that provides read-only access to the elements in the vector.
Public Functions
-
EqualWeightVector(uint32 numElements)¶
- Parameters:
numElements – The number of elements in the vector
-
const_iterator cbegin() const¶
Returns a
const_iteratorto the beginning of the vector.- Returns:
A
const_iteratorto the beginning
-
const_iterator cend() const¶
Returns a
const_iteratorto the end of the vector.- Returns:
A
const_iteratorto the end
-
uint32 getNumElements() const¶
Returns the number of elements in the vector.
- Returns:
The number of elements
-
uint32 getNumNonZeroWeights() const¶
Returns the number of non-zero weights.
- Returns:
The number of non-zero weights
-
weight_type operator[](uint32 pos) const¶
Returns the weight at a specific position.
- Parameters:
pos – The position
- Returns:
The weight at the specified position
-
virtual bool hasZeroWeights() const override¶
Returns whether the vector contains any zero weights or not.
- Returns:
True, if the vector contains any zero weights, false otherwise
-
virtual std::unique_ptr<IFeatureSubspace> createFeatureSubspace(IFeatureSpace &featureSpace) const override¶
Creates and returns a new instance of type
IFeatureSubspacethat uses the weights in this vector for the training examples it includes.- Parameters:
featureSpace – A reference to an object of type
IFeatureSpacethat should be used to create the instance- Returns:
An unique pointer to an object of type
IFeatureSubspacethat has been created
-
using weight_type = bool¶