View unanswered posts | View active topics It is currently Wed Aug 27, 2014 11:22 pm






Reply to topic  [ 5 posts ] 
Maximum Array Size...? 
Author Message
Rookie

Joined: Sat Mar 01, 2008 3:44 am
Posts: 5
Post Maximum Array Size...?
Hi All,
Could anyone please tell about the maximum array size allowed By RobotC?
I wanted to define 100*100 2D arrays by pre allocating the memory:

Code:
float ogMap[100][100]; // to store the map


but I got this error:
**Severe*:Out of memory for variable allocation.

Thanks in advance
asma


Tue Apr 01, 2008 9:31 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
I just asked asked that before, also for a map :-)

variable memory is limited to 15 k

for me, this limit was too low... :(
If you would like more, too: please ask the developers ;-)

_________________
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)}


Tue Apr 01, 2008 11:11 am
Profile
Rookie

Joined: Sat Mar 01, 2008 3:44 am
Posts: 5
Post 
So, what could be a best solution to values that should be indexed using x and y?
• Will pointer help out?
• Or is writing values to a file directly a good solution considering that we have lines number(y) and columns number (x)?
• Could datalog be a good solution?

Regards,
Asma


Tue Apr 01, 2008 11:42 am
Profile
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
pointer won't help, cause there is no heap available.

writing a file to NXT file system is very slow and stops program execution during file I/O - and how do you want to read the values it if you don't have that memory?

with data logging I don't know how to solve this either.

look at these threads, where I asked about this memory problem before:

viewtopic.php?t=445

viewtopic.php?t=486

_________________
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)}


Tue Apr 01, 2008 5:51 pm
Profile
Rookie

Joined: Sat Mar 01, 2008 3:44 am
Posts: 5
Post 
Well, I was thinking to export the datalog file to Excel or to write a small application in C or Java such that I could display the data as a map.


Any good suggestion to overcome memory limitation?

Regards,
Asma


Thu Apr 03, 2008 2:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users 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:  
cron



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