Drexel dragonThe Math ForumDonate to the Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: convert mwsize * to int *
Replies: 10   Last Post: Jan 8, 2013 2:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
James Tursa

Posts: 2,232
Registered: 8/5/09
Re: convert mwsize * to int *
Posted: Jan 8, 2013 2:37 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Thomas Meinguet" <thomas.meinguet@skynet.be> wrote in message <kcgfbp$v9$1@newscl01ah.mathworks.com>...
> Thank you James.
> To prevent any cast issue at no operational cost I suggest to check, for sparse martices, whether nnz <= INT_MAX which in turn implies n < INT_MAX.

This will not work. nnz simply tells you how many non-zeros there are ... it doesn't tell you anything about their values, and it is their values that your are interested in. You could have nnz = 1 and at the same time that one index value could overflow an int.

James Tursa

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2015. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.