Force std::size_t to use UInt64 (unsigned long)

Discussion in 'C++' started by greg.ruthenbeck@gmail.com, Jan 23, 2007.

  1. Guest

    Hi,

    I'm using Boost::uBLAS::mapped_matrix for working with sparse matrices.
    At the moment, the maximum dimension of mapped_matrix is 65535x65535
    since std::size_t compiles as unsigned int (UInt32).

    I'm looking for a way of increasing this limit. The best way I can
    think of would be to ensure that size_t uses a bigger (64-bit) type
    rather than the current UInt32.

    Can I force std::size_t to be defined as unsigned long? How/where?
    I'm using VC 2005 (VC8) on Windows.

    Thanks for your support.

    Cheers,
    Greg
     
    , Jan 23, 2007
    #1
    1. Advertising

  2. wrote:
    > I'm using Boost::uBLAS::mapped_matrix for working with sparse
    > matrices. At the moment, the maximum dimension of mapped_matrix is
    > 65535x65535 since std::size_t compiles as unsigned int (UInt32).
    >
    > I'm looking for a way of increasing this limit. The best way I can
    > think of would be to ensure that size_t uses a bigger (64-bit) type
    > rather than the current UInt32.
    >
    > Can I force std::size_t to be defined as unsigned long?


    Usually that's compiler-dependent. But what would be the point?
    'unsigned long' is 32 bits on Windows.

    > How/where?
    > I'm using VC 2005 (VC8) on Windows.


    You need to ask in 'microsoft.public.vc.language' or other relevant
    newsgroup. My suspicion is that you need to go 64 bits.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jan 23, 2007
    #2
    1. Advertising

  3. Guest

    Can I use template arguments to force the use of std::map<double,
    unsigned long> ?


    wrote:
    > Hi,
    >
    > I'm using Boost::uBLAS::mapped_matrix for working with sparse matrices.
    > At the moment, the maximum dimension of mapped_matrix is 65535x65535
    > since std::size_t compiles as unsigned int (UInt32).
    >
    > I'm looking for a way of increasing this limit. The best way I can
    > think of would be to ensure that size_t uses a bigger (64-bit) type
    > rather than the current UInt32.
    >
    > Can I force std::size_t to be defined as unsigned long? How/where?
    > I'm using VC 2005 (VC8) on Windows.
    >
    > Thanks for your support.
    >
    > Cheers,
    > Greg
     
    , Jan 23, 2007
    #3
  4. Guest

    Victor Bazarov wrote:
    > > Can I force std::size_t to be defined as unsigned long?

    >
    > Usually that's compiler-dependent. But what would be the point?
    > 'unsigned long' is 32 bits on Windows.


    Sorry, I meant to say 'unsigned long long' which is equivalent to
    __uint64

    Victor Bazarov wrote:
    > > How/where?
    > > I'm using VC 2005 (VC8) on Windows.

    >
    > You need to ask in 'microsoft.public.vc.language' or other relevant
    > newsgroup. My suspicion is that you need to go 64 bits.


    Will try them. If anyone who sees this post who knows how to force
    size_t to use __uint64 please post.

    Greg
     
    , Jan 23, 2007
    #4
  5. Guest

    Victor Bazarov wrote:
    > > Can I force std::size_t to be defined as unsigned long?

    >
    > Usually that's compiler-dependent. But what would be the point?
    > 'unsigned long' is 32 bits on Windows.


    Sorry, I meant to say 'unsigned long long' which is equivalent to
    __uint64

    Victor Bazarov wrote:
    > > How/where?
    > > I'm using VC 2005 (VC8) on Windows.

    >
    > You need to ask in 'microsoft.public.vc.language' or other relevant
    > newsgroup. My suspicion is that you need to go 64 bits.


    Will try them. If anyone who sees this post who knows how to force
    size_t to use __uint64 please post.

    Greg
     
    , Jan 23, 2007
    #5
  6. wrote:
    > Victor Bazarov wrote:
    >>> Can I force std::size_t to be defined as unsigned long?

    >>
    >> Usually that's compiler-dependent. But what would be the point?
    >> 'unsigned long' is 32 bits on Windows.

    >
    > Sorry, I meant to say 'unsigned long long' which is equivalent to
    > __uint64


    There is no "unsigned long long" in C++.

    > Victor Bazarov wrote:
    >>> How/where?
    >>> I'm using VC 2005 (VC8) on Windows.

    >>
    >> You need to ask in 'microsoft.public.vc.language' or other relevant
    >> newsgroup. My suspicion is that you need to go 64 bits.

    >
    > Will try them. If anyone who sees this post who knows how to force
    > size_t to use __uint64 please post.


    Whatever 'size_t' is defined to is governed by the implementation,
    not by the programmer. You need to go to the newsgroup that deals
    with your implementation.

    V
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Jan 23, 2007
    #6
    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. George Marsaglia

    Assigning unsigned long to unsigned long long

    George Marsaglia, Jul 8, 2003, in forum: C Programming
    Replies:
    1
    Views:
    682
    Eric Sosman
    Jul 8, 2003
  2. Daniel Rudy

    unsigned long long int to long double

    Daniel Rudy, Sep 19, 2005, in forum: C Programming
    Replies:
    5
    Views:
    1,194
    Peter Shaggy Haywood
    Sep 20, 2005
  3. Paulo Matos

    Assuming size_t is unsigned long

    Paulo Matos, Apr 9, 2007, in forum: C Programming
    Replies:
    24
    Views:
    803
    Keith Thompson
    Apr 10, 2007
  4. Alex Vinokur
    Replies:
    9
    Views:
    798
    James Kanze
    Oct 13, 2008
  5. Alex Vinokur
    Replies:
    1
    Views:
    580
Loading...

Share This Page