array size limitation is too small

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Roy Gourgi
    New Member
    • Jul 2011
    • 5

    array size limitation is too small

    Hi,

    I am having difficulty with arrays because of the limitation of the size of the arrays that I can declare.
    I need sizes that are very large and windows or C# does not allow me to create bigger than the following for example:

    public static int[] gaPoints = new int[200000000000000 00000 + 1];

    I get an error message saying that "integral size is too large".

    I need to be able to declare sizes that are even much larger than the abovementioned size.

    How can I circumvent this problem?

    Do I have to use something other than arrays?


    TIA
    Roy
  • anugrahbala10
    New Member
    • Mar 2013
    • 13

    #2
    Cant you try with using for loops?

    Comment

    • Roy Gourgi
      New Member
      • Jul 2011
      • 5

      #3
      Originally posted by anugrahbala10
      Cant you try with using for loops?
      I could but it would slow it down drastically!

      Therein lies the problem!

      Speed!!!! :)

      Roy

      Comment

      • Rabbit
        Recognized Expert MVP
        • Jan 2007
        • 12517

        #4
        What are you doing that requires an array of that size?

        Comment

        • Roy Gourgi
          New Member
          • Jul 2011
          • 5

          #5
          Originally posted by Rabbit
          What are you doing that requires an array of that size?
          I am doing Graph Isomorphism (G.I.P.).

          Actually those sizes are quite small! :)

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            C# will be a lot easier to code in if you solve most problems using object oriented programming principles.
            Consider a class, called say ListAggregate that holds one List of List. When you run out of numbers in the one List you just add another List to the collection of lists and continue from there.
            That way you have at least N*N values that you can store where N is the maximum number of items that a C# list can hold. If this runs out there are other ways of extending it as well.

            Comment

            Working...