Thread: [Dev-C++] 6-dimensional Array
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: sigit h. <rms...@ya...> - 2006-02-01 14:35:51
|
Hallo to all of you, Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this. Could any of you help me how to make 6-D array? I haven't seen any examples of how to do this. thank you in advance. Himawan --------------------------------- What are the most popular cars? Find out at Yahoo! Autos |
|
From: Per W. <pw...@ia...> - 2006-02-01 15:07:25
|
Start by informing us if all dimensions are of fixed size, or if they should have dynamic size. For fixed size, this is enough: int my_array[10][10][10][10][10][10]; For dynamic size, a lot of extra code is needed, to allocate vector arrays of vector arrays of vector arrays of ... /Per W On Wed, 1 Feb 2006, sigit himawan wrote: > Hallo to all of you, > > Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this. > Could any of you help me how to make 6-D array? I haven't seen any examples of how to do this. > thank you in advance. > > Himawan > > > --------------------------------- > > What are the most popular cars? Find out at Yahoo! Autos |
|
From: sigit h. <rms...@ya...> - 2006-02-01 16:08:21
|
Halo, Thank you for the reply. The condition is like this: I have database which is already converted into .txt file. Inside this .txt file has 6 parameters, these parameters should be classified into range of classes. For example parameter A, it should be classified into range of classes from 0-0.5, 0.5-0.8, 0.8-0.9, etc. There are 30 classes for parameter A, 31 classes for parameter B, 24 classes for parameter C, 21 classes for parameter D, and 2 other parameters shouldn't be classified because they are independent to time (the value doesn't change). And each parameter has different range of classes. So, after classifying into the classes, we make the 6-Dimensional array. So, I guess the dimensions of the size are fixed, if i am not mistaken, they are the amount of classes for each parameter. How is it to programm the 6-D? I have additional question regarding how to sort the value of each parameters from .txt files to the classes. Please teach me or give me the clue. thank you, Himawan. Per Westermark <pw...@ia...> wrote: Start by informing us if all dimensions are of fixed size, or if they should have dynamic size. For fixed size, this is enough: int my_array[10][10][10][10][10][10]; For dynamic size, a lot of extra code is needed, to allocate vector arrays of vector arrays of vector arrays of ... /Per W On Wed, 1 Feb 2006, sigit himawan wrote: > Hallo to all of you, > > Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this. > Could any of you help me how to make 6-D array? I haven't seen any examples of how to do this. > thank you in advance. > > Himawan > > > --------------------------------- > > What are the most popular cars? Find out at Yahoo! Autos --------------------------------- What are the most popular cars? Find out at Yahoo! Autos |
|
From: Eric E. <eri...@sb...> - 2006-02-01 16:50:23
|
Just out of curiosity, is this for a school class project? =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of sigit himawan Sent: Wednesday, February 01, 2006 10:08 AM To: Per Westermark Cc: dev...@li... Subject: Re: [Dev-C++] 6-dimensional Array =20 Halo,=20 =20 Thank you for the reply. =20 The condition is like this: I have database which is already converted into .txt file. Inside this = .txt file has 6 parameters, these parameters should be classified into range = of classes. For example parameter A, it should be classified into range of classes = from 0-0.5, 0.5-0.8, 0.8-0.9, etc.=20 There are 30 classes for parameter A, 31 classes for parameter B, 24 = classes for parameter C, 21 classes for parameter D, and 2 other parameters shouldn't be classified because they are independent to time (the value doesn't change). And each parameter has different range of classes.=20 So, after classifying into the classes, we make the 6-Dimensional array. = So, I guess the dimensions of the size are fixed, if i am not mistaken, = they are the amount of classes for each parameter. How is it to programm the 6-D? I have additional question regarding how to sort the value of each parameters from .txt files to the classes. Please teach me or give me = the clue.=20 =20 thank you, =20 Himawan. Per Westermark <pw...@ia...> wrote: Start by informing us if all dimensions are of fixed size, or if they should have dynamic size. For fixed size, this is enough: int my_array[10][10][10][10][10][10]; For dynamic size, a lot of extra code is needed, to allocate vector = arrays of vector arrays of vector arrays of ... /Per W On Wed, 1 Feb 2006, sigit himawan wrote: > Hallo to all of you, > > Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this.< BR>> Could any of you help me how to make 6-D array? I haven't seen any examples of how to do this. > thank you in advance. > > Himawan > > > --------------------------------- > > What are the most popular cars? Find out at Yahoo! Autos =20 _____ =20 What are the most popular cars? Find out at Yahoo! <http://us.rd.yahoo.com/evt=3D38382/_ylc=3DX3oDMTEzNWFva2Y2BF9TAzk3MTA3MD= c2BHNlY wNtYWlsdGFncwRzbGsDMmF1dG9z/*http:/autos.yahoo.com/newcars/popular/thiswe= ek. html%20%0d%0a> Autos=20 |
|
From: Alfred P. R. <al...@ya...> - 2006-02-01 23:31:49
|
BTW, this will be a big array, 10^6 addresses, x 8 bytes in Per's example. It will get ridiculous quickly. If n is the size of the dimension in the array, and there are d is the number of dimensions S = (n^d)*8, so by size, n, of 20, for 6 dimensions you'll be at 512MB and right around 2GB by size 25. Expect slow execution times at best. Per Westermark <pw...@ia...> wrote: Start by informing us if all dimensions are of fixed size, or if they should have dynamic size. For fixed size, this is enough: int my_array[10][10][10][10][10][10]; For dynamic size, a lot of extra code is needed, to allocate vector arrays of vector arrays of vector arrays of ... /Per W On Wed, 1 Feb 2006, sigit himawan wrote: > Hallo to all of you, > > Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this. > Could any of you help me how to make 6-D array? I haven't seen any examples of how to do this. > thank you in advance. > > Himawan <snip> Alfred P. Reaud |
|
From: <au...@gm...> - 2006-02-01 15:58:30
|
Hi,
> Honestly, I am a newbie for programming. But now I have to make
> 6-dimensional array in my project. I am very confuse to implement this.
> Could any of you help me how to make 6-D array? I haven't seen any
> examples of how to do this.
This would look pretty nice :)
type array[size][size][size][size][size][size];
Even more nice it looks when creating array on free store:
type ******array = new type*****[size];
for(int i = 0; i < size; ++i)
array[i] = new type****[size];
for(int i = 0; i < size; ++i)
for(int j = 0; j < size; ++j)
array[i][j] = new type***[size];
and so on :)
Also don't forget to delete it after all :)
I think this is enaugh for understanding it.
/Aurimas
|
|
From: Dimiter D. <dim...@gm...> - 2006-02-01 18:50:41
|
Hehehe, I also think this is for school or university project. I can give you only one advise when you work with so big arrays. Be very careful because this arrays like yours take a lot of memory. On 2/1/06, sigit himawan <rms...@ya...> wrote: > > Hallo to all of you, > > Honestly, I am a newbie for programming. But now I have to make > 6-dimensional array in my project. I am very confuse to implement this. > Could any of you help me how to make 6-D array? I haven't seen any > examples of how to do this. > thank you in advance. > > Himawan > > ------------------------------ > > What are the most popular cars? Find out at Yahoo! Autos<http://us.rd.yah= oo.com/evt=3D38382/_ylc=3DX3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFnc= wRzbGsDMmF1dG9z/*http://autos.yahoo.com/newcars/popular/thisweek.html+%0A> > > -- Dimitar Dimitrov ICQ:106627618 Mobile Bulgaria: +359 898 633 704 (online now) |
|
From: Per W. <pw...@ia...> - 2006-02-01 19:28:14
|
When the arrays gets too large and all cells doesn't contain any data, it's time to use sparse matrices, where the entry data is located through hashes. /pwm On Wed, 1 Feb 2006, Dimiter Dimitrov wrote: > Hehehe, I also think this is for school or university project. I can give > you only one advise when you work with so big arrays. Be very careful > because this arrays like yours take a lot of memory. > > On 2/1/06, sigit himawan <rms...@ya...> wrote: > > > > Hallo to all of you, > > > > Honestly, I am a newbie for programming. But now I have to make > > 6-dimensional array in my project. I am very confuse to implement this. > > Could any of you help me how to make 6-D array? I haven't seen any > > examples of how to do this. > > thank you in advance. > > > > Himawan > > > > ------------------------------ > > > > What are the most popular cars? Find out at Yahoo! Autos<http://us.rd.yahoo.com/evt=38382/_ylc=X3oDMTEzNWFva2Y2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDMmF1dG9z/*http://autos.yahoo.com/newcars/popular/thisweek.html+%0A> > > > > > > > -- > Dimitar Dimitrov > ICQ:106627618 > Mobile Bulgaria: +359 898 633 704 (online now) > |
|
From: Eric E. <eri...@sb...> - 2006-02-01 19:30:46
|
We had some "crazy" projects in school, but this one beats them all. =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Dimiter Dimitrov Sent: Wednesday, February 01, 2006 12:51 PM To: dev...@li... Subject: Re: [Dev-C++] 6-dimensional Array =20 Hehehe, I also think this is for school or university project. I can = give you only one advise when you work with so big arrays. Be very careful because this arrays like yours take a lot of memory. On 2/1/06, sigit himawan <rms...@ya...> wrote: Hallo to all of you, =20 Honestly, I am a newbie for programming. But now I have to make 6-dimensional array in my project. I am very confuse to implement this. Could any of you help me how to make 6-D array? I haven't seen any = examples of how to do this.=20 thank you in advance. =20 Himawan _____ =20 What are the most popular cars? Find out at Yahoo! <http://us.rd.yahoo.com/evt=3D38382/_ylc=3DX3oDMTEzNWFva2Y2BF9TAzk3MTA3MD= c2BHNlY wNtYWlsdGFncwRzbGsDMmF1dG9z/*http:/autos.yahoo.com/newcars/popular/thiswe= ek. html+%0A> Autos=20 --=20 Dimitar Dimitrov ICQ:106627618 Mobile Bulgaria: +359 898 633 704 (online now)=20 |