I'm having some issues overriding a function and I don't know why it's not working. I keep looking online, but I haven't found anything. I should probably add that I'm using the c++11 standard right now just in case. Here is my code:
class SupervisedLearner {
public:
...
virtual double measureAccuracy(Matrix& features, Matrix& labels, Matrix* pOutStats = NULL);
}
class NeuralNet: public SupervisedLearner {
public:
...
double measureAccuracy(Matrix& features, Matrix& labels, Matrix* pOutStats = NULL) override;
}
The method measureAccuracy is then being called via a pointer to the generic SupervisedLearner class:
SupervisedLearner* learner = getLearner(model, r, parser.getLearnerExtra());
...
double accuracy = learner->measureAccuracy(trainFeatures, trainLabels, &stats);
Note that both the base class and the child class have implementations of the method. The program for some reason always goes to the SupervisedLearner::measureAccuracy function.
Can anyone see anything obviously wrong?