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 Functions

EqualWeightVector(uint32 numElements)
Parameters:

numElements – The number of elements in the vector

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

uint32 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 IFeatureSubspace that uses the weights in this vector for the training examples it includes.

Parameters:

featureSpace – A reference to an object of type IFeatureSpace that should be used to create the instance

Returns:

An unique pointer to an object of type IFeatureSubspace that has been created

Private Members

const uint32 numElements_