The error that im getting is randm.cpp:42:52: error: no matching function for call to ‘Neuron::activationFunc(double&, double&)’ neu.activationFunc(feature[2][4], predicted[2][1]);
Is it possible to pass arrays or will i have to find another way of doing it? Here is my code. Its been a few years since i used classes so im a tad bit rusty.
#include <fstream>
#include <sstream>
#include <iostream>
#include <cstdlib>
using namespace std;
int correct = 0;
class Neuron {
//double (&features)[150][4];
public:
double alpha = 0.5;
double w1 = 1.0;
double w2 = -1;
double w3 = 0.5;
double w4 = 0;
double x = 0;
int theta = 1;
int hardLim = 0;
int track = 0;
//void testClass();
void activationFunc(double feature[2][4], double predicted[2][1]);
};
void Neuron::activationFunc (double feature[2][4], double predicted[2][1]) {
for (int i = 0; i < 2; i++) {
x = (w1*feature[i][0]) + (w2*feature[i][1]) + (w3*feature[i][2]) + (w4*feature[i][3]) + predicted[2][1];
cout <<"\n X value is: " << x << endl;
//hardLimit(x);
//track = i;
}
}
int main(int argc, char* argv[])
{
//feature = col 1-4, predicted = col 5
double feature[2][4]={1,2,3,4,5,6,7,8};
double predicted[2][1]={4,5};
Neuron neu;
neu.activationFunc(feature[2][4], predicted[2][1]);
}
Thanks. P.S. I know there are a few things in my code that arent used yet.