The function Value() is part of a class (FinalNeuralNet) that gets recognized by Root. I have included “FinalNeuralNet.h” at the beggining of my script
Here is the part where I’m declaring the class and where I’m calling the function in the code:
Is the implementation of double FinalNeuralNet::Value(int,double,double) on the same script you are loading on the interpreter? Otherwise, you will need to compile the .cxx file for your class as a shared library and load it at runtime using .L library.so in root.
Here is the main code I’m running. FirstNN.c (9.3 KB)
As you can see line 256, I use mlp->export(“FinalNeuralNet”,“C++”), this will create a .cxx and .h file where the function Value() is declared.
All the code related to my problem is located between line 256 and line 275, don’t bother reading the rest.
if I understand correctly your code, you have a C++ macro which dumps on disk sources. You then want to use the entities defined in these sources in the macro which dumped them: is this correct?
If yes, this is not possible.
This is not a limitation of ROOT but rather something logically not well defined. I think the best option you have is to break your code in two pieces: one that generates the NN and the other that picks up (somehow) the code.
I get the following error: Error: << Illegal operator for pointer 3 C:\root\Source1.cpp(126)
I have just copied and pasted the second part of the code to a new file and ran it. I have included all the libraries (probably more than I need but too lazy to put them off now).