#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12

    C++, Matrix Max Length


    Hello,
    I have a small problem. I am currently creating a 2 dimensional array (or matrix) of size 100 by 100. Now I get errors when I make my matrix larger than 210 by 210.
    The problem is is that I need a matrix 10000 by 10000.

    example code:
    double data[1000][1000]; //this gives errors


    Okay, which would be the best way to go and will work?
    First, don't do 2 dim array, do a 2 dim vector.
    Second, don't do 2 dim array, do pointers in two directions.
    Or Third do the 2 dim array but go in another direction.


    Thanks for the thoughts
    Sincerely,
    Ronald
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    Please see this thread:
    Maximum matrix size
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12

    Max size of array


    Hello,
    You link is very much like my question. It was a great deal of help.
    I am currently running on Windows 2000 Service Pack 3.
    Now you mentioned in your response to change the max heap size to 0x1000000, but you told him how to do it on the Borland. I am running Micorsoft Visual C++ 5.0(which has the C++ compilier incorporated as I am sure you know), Microsoft® Developer Studio. Where do I change the max heap size?

    Another question for you. Can you have a dynamic matrix? or vector of vectors? If so, can you show me how?
    Thanks
    Sincerely,
    Ronald
  6. #4
  7. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,648
    Rep Power
    4248
    http://msdn.microsoft.com/library/de...core_.2f.f.asp for adjusting stack size.

    http://msdn.microsoft.com/library/de....HEAP_link.asp for adjusting heap size.

    As for dynamically allocating arrays:
    http://www.eskimo.com/~scs/C-faq/q6.16.html

    or use the C++ STL library's vector class

    [edit]Dunno if you read page 2 of the thread I'd posted above. You might want to read the thread entirely, if you haven't done so already.[/edit]
    Last edited by Scorpions4ever; September 12th, 2003 at 03:04 PM.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    60
    Rep Power
    12
    Okay,
    The data is going to be read in from a file. It is actually a docuement that is about 800 pages in length. My program parses the data, and stores all the necessary information. I believe I am going to store the data into a 2D Vector. The problem is that I have no examples that are functioning, so I cannot see what I am going wrong. If you could help me out in this area (providing me an example of a working 2D Vector), I would be most appreciative.

    I have never dealt with these so be as explicit as possible thanks.
    ~Ronald

IMN logo majestic logo threadwatch logo seochat tools logo