View unanswered posts | View active topics It is currently Mon Nov 24, 2014 4:35 pm






Reply to topic  [ 2 posts ] 
[solved:] structure operations working faulty 
Author Message
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post [solved:] structure operations working faulty
hi,
structure operations occasionally still seem to work faulty (1.30Beta).
in line 314 of the following code, a global variable is assigned to a structure variable:
Code:
teachOut=Neuron0[0].out;     //

there is never another assignment to "teachOut",
and if Neuron0[0].out is going to be changed, it's assigned to teachOut immediately,
so both values always should be equal to each other:
in the display, both values are shown at any time;
but as you can observe, both values often are different (the first time when the 4th input pattern (1,1) appears):

[EDIT:]
problem solved,
the reason for the faulty assignments was the too slowly working in->net->out calculating thread.
I added a wait command after every new "IN" pattern generation in order to wait for the slower thread, and now the code is working fine.

Thx to all !

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Last edited by Ford Prefect on Sun May 25, 2008 1:46 pm, edited 3 times in total.



Wed May 14, 2008 3:21 pm
Profile
Expert
User avatar

Joined: Fri Nov 09, 2007 4:51 am
Posts: 121
Location: Hungary, Europe
Post Re: structure operations still seem to work faulty
did you check disassembly view?
what code is generated?


Thu May 15, 2008 4:34 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: lleeoo66 and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.