From: Mathieu D. <mat...@li...> - 2009-03-19 09:49:18
|
Hello Dejan, Under Python I would like to invoke getLinearInput like this: inp_pop = SimObjectPopulation(net, inp_model, 1); nrn_pop = SpatialSimObjectPopulation(net, , CuboidIntegerGrid3D(SIZE, ORIGIN)); syn_proj = ConnectionsProjection(inp_pop, nrn_pop, syn_model, RandomConnections(1.0)); N = 5; for i in range(N): net.advance( i ); print "Linear input: ", net.object(nrn_pop[0]).getLinearInput(); I get the following error: ArgumentError: Python argument types in SquashingNeuron.getLinearInput(SquashingNeuron) did not match C++ signature: getLinearInput(SquashingNeuron {lvalue}) Please find attached the code. Compilation is fine (though some warnings) and the C++ unit test are passed (though the call to getLinearInput() seems to return wrong values). I have tried to write a PyUnit test but I don't know how to launch it. There is a simple python test: launch test_SquashingNeuron.py (the error message comes when executing this file). Thank you so much. Mathieu > Hi, > > Mathieu Dubois wrote: >> However, I would like to create a member function double >> getLinearInput(void) that returns the value of the member "linear_input" >> (in the same vein as getAnalogOutput()). How do I have to declare it? >> >> I have tried the following declaration double getLinearInput(void) { >> return this->linear_input;}; (see attachments) but when I try to use it >> I get the following error: >> >> ArgumentError: Python argument types in >> >> SquashingNeuron.getLinearInput(SquashingNeuron) >> >> did not match C++ signature: >> >> getLinearInput(SquashingNeuron {lvalue}) >> >> >> I have seen that AnalogPointNeuron::getAnalogOutput is declared as >> follows: >> >> virtual double >> <http://www.lsm.tugraz.at/pcsim/cppclassreference/html/classdouble.html> >> getAnalogOutput >> <http://www.lsm.tugraz.at/pcsim/cppclassreference/html/classAnalogPointNeuron.html#a6e02306ef9cd057f844615691b9293f> >> (analog_port_id_t >> <http://www.lsm.tugraz.at/pcsim/cppclassreference/html/globaldefinitions_8h.html#40dfc683bdf73c81c9c73726fc834feb> >> port=0) const >> > How do you invoke the getLinearInput function from Python? > You can try the virtual keyword, but I'm not sure that causes the problem. > > rgds, > Dejan >> >> Is it necessary to declare the function virtual (I'm not a C++ expert :) >> ? >> >> Thank you again & sorry for the trouble, >> Mathieu >> >> >> >> ------------------------------------------------------------------------------ >> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are >> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and >> easily build your RIAs with Flex Builder, the Eclipse(TM)based >> development >> software that enables intelligent coding and step-through debugging. >> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com >> _______________________________________________ >> Pcsim-users mailing list >> Pcs...@li... >> https://lists.sourceforge.net/lists/listinfo/pcsim-users >> > > > -- > _______________________________________________ > Dejan Pecevski > Institute for Theoretical Computer Science > Graz University of Technology > Inffeldgasse 16b, A-8010 Graz, Austria > Tel. +43 316 873 5849 > > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > Pcsim-users mailing list > Pcs...@li... > https://lists.sourceforge.net/lists/listinfo/pcsim-users > |