dynamical dimensions

Discussion in 'Java' started by blabla, May 26, 2004.

  1. blabla

    blabla Guest

    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
     
    blabla, May 26, 2004
    #1
    1. Advertising

  2. blabla

    John Davison Guest

    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
     
    John Davison, May 26, 2004
    #2
    1. Advertising

  3. blabla

    Roedy Green Guest

    On 26 May 2004 06:44:04 -0700, (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.
     
    Roedy Green, May 26, 2004
    #3
  4. blabla

    Jezuch Guest

    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
     
    Jezuch, May 26, 2004
    #4
  5. blabla

    blabla Guest

    thanks a lot guys,
    now i have to figure out, why i want to do this...;)

    -always looking for problems-
     
    blabla, Jun 14, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Liqun Xu

    Click-Event by dynamical Button

    Liqun Xu, Dec 5, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    384
    Munsifali Rashid
    Dec 5, 2003
  2. MARTIN Herve \(EXT\)

    Dynamical update of the CLASSPATH

    MARTIN Herve \(EXT\), Nov 5, 2003, in forum: Java
    Replies:
    4
    Views:
    353
    MARTIN Herve \(EXT\)
    Nov 6, 2003
  3. Michael Schrading

    Fonts in dynamical build html

    Michael Schrading, Feb 9, 2004, in forum: HTML
    Replies:
    4
    Views:
    415
  4. FraterQ
    Replies:
    4
    Views:
    834
    Martin Ambuhl
    Jul 3, 2003
  5. wab104

    dynamical linking problem

    wab104, Nov 30, 2004, in forum: Python
    Replies:
    0
    Views:
    271
    wab104
    Nov 30, 2004
Loading...

Share This Page