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

G

greg.ruthenbeck

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
 
V

Victor Bazarov

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
 
G

greg.ruthenbeck

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

greg.ruthenbeck

Victor said:
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 said:
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
 
G

greg.ruthenbeck

Victor said:
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 said:
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
 
V

Victor Bazarov

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

There is no "unsigned long long" in C++.
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top