Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > dynamical dimensions

Reply
Thread Tools

dynamical dimensions

 
 
blabla
Guest
Posts: n/a
 
      05-26-2004
hey!
anybody any idea how it can be arranged to dynamically add dimensions to an array

this means i want to add an undefined (say n) number of dimensions to a boolean
e.g.
boolean[][][][][][].....[](n-times) = new boolean[1][1][1]....[1]

ok, i suppose its not possible?
anyway, i'ld like to implement a sort of factor analysation...

thanks,
brt
 
Reply With Quote
 
 
 
 
John Davison
Guest
Posts: n/a
 
      05-26-2004
blabla wrote:

> hey!
> anybody any idea how it can be arranged to dynamically add dimensions to an array
>
> this means i want to add an undefined (say n) number of dimensions to a boolean
> e.g.
> boolean[][][][][][].....[](n-times) = new boolean[1][1][1]....[1]
>
> ok, i suppose its not possible?
> anyway, i'ld like to implement a sort of factor analysation...
>
> thanks,
> brt


Prepare for the OutOfMemoryError.

java.lang.reflect.Array.newInstance(
Class componentType,
int[] dimensions);

- john
 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      05-26-2004
On 26 May 2004 06:44:04 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (blabla) wrote
or quoted :

>ok, i suppose its not possible?
>anyway, i'ld like to implement a sort of factor analysation...


you can write DynaArray class that implements with a single vector and
takes arrays of indexs an parameters.

You do the multiplications to figure out where in the single vector to
look.

Watch out. Even tiny multidensional arrays can have huge numbers of
elements and you will run out of ram.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
 
Reply With Quote
 
Jezuch
Guest
Posts: n/a
 
      05-26-2004
Użytkownik blabla napisał:
> this means i want to add an undefined (say n) number of dimensions to a boolean
> e.g.
> boolean[][][][][][].....[](n-times) = new boolean[1][1][1]....[1]


boolean[][][][][][][][] is on Object. So if you create Object[] and put all
boolean[][][][][][][][]'s in it, you'll have "virtual"
boolean[][][][][][][][][]
--
Ecce Jezuch
"But I want to, I want to, oh I want to but my hands were always tied up
And I wish I had myself a dime for every time I cursed your Goddamn name"
- P. Keenan
 
Reply With Quote
 
blabla
Guest
Posts: n/a
 
      06-14-2004
thanks a lot guys,
now i have to figure out, why i want to do this...

-always looking for problems-
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamical linking problem wab104 Python 0 11-30-2004 01:17 PM
Fonts in dynamical build html Michael Schrading HTML 4 02-10-2004 07:44 PM
Click-Event by dynamical Button Liqun Xu ASP .Net 2 12-05-2003 02:29 PM
Dynamical update of the CLASSPATH MARTIN Herve \(EXT\) Java 4 11-06-2003 09:39 AM
How to determine the size of dynamical arrays? FraterQ C Programming 4 07-03-2003 04:00 AM



Advertisments