Path: news.mathworks.com!not-for-mail
From: "Tim Davis" <davis@cise.ufl.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Sparse matrix product again
Date: Wed, 7 May 2008 15:41:05 +0000 (UTC)
Organization: University of Florida
Lines: 11
Message-ID: <fvsiih$m48$1@fred.mathworks.com>
References: <67rg20F2pn19mU1@mid.dfncis.de> <fvfd1n$1dc$1@fred.mathworks.com> <688agnF2rcjvjU1@mid.dfncis.de> <fvmtmc$k80$1@fred.mathworks.com> <68dnitF2soa18U1@mid.dfncis.de>
Reply-To: "Tim Davis" <davis@cise.ufl.edu>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210174865 22664 172.30.248.38 (7 May 2008 15:41:05 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 May 2008 15:41:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 45902
Xref: news.mathworks.com comp.soft-sys.matlab:467186


Instead of "int" you should use mwSignedIndex.  It's safer,
if you ever go to a 64-bit platform.  I also recommend not
using mwIndex at all, but mwSignedIndex in its place.  The
problemis that mwIndex is unsigned, so codes like this:

mwIndex i, n ;
...

for (i = n-1 ; i >= 0 ; i--)  { do something }

fail in an infinite loop, since i is always >= 0.