From: James <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: 64bits and memory problem
Date: Mon, 29 Mar 2010 10:28:44 -0700 (PDT)
Lines: 34
Message-ID: <>
References: <hif89a$p3q$> <> 
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: 1269883725 15091 (29 Mar 2010 17:28:45 GMT)
NNTP-Posting-Date: Mon, 29 Mar 2010 17:28:45 +0000 (UTC)
Injection-Info:; posting-host=; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_8; en-us) 
	AppleWebKit/531.22.7 (KHTML, like Gecko) Version/4.0.5 Safari/531.22.7,gzip(gfe)
Xref: comp.soft-sys.matlab:621588

Hi Evan,
The problem is probably b/c you're on a Linux or Mac and they gcc,
which is slightly more finicky than other compilers. You need to
modify the lines in the Gibbs Sampler code where they randomly
generate a number and add "ULL" (without quotes). So a problematic
line such as the one below becomes (notice the ULL after 4294967296)
i_pick = i_start + (int) ( (double) randomMT() * (double) nauthors /
(double) (4294967296 + 1.0) );
i_pick = i_start + (int) ( (double) randomMT() * (double) nauthors /
(double) (4294967296ULL + 1.0) );

I am assuming you have a 32-bit machine.

On Mar 8, 4:08 pm, "evan Rosen" <> wrote:
> James <> wrote in message <>...
> > Hi guys,
> > Thanks for the replies.
> > I managed to solve this problem by simply converting all problematic mwIndex* arrays to int* arrays.
> > Took me about a day, but at least it works now.
> I was looking through this discussion due to an issue with the Griffiths andSteyverstopic modelingtoolboxand your errors look almost identical to mine.  I am trying to use the GibbsSamplerLDA function and I thought I'd see if were possible to use your updated version or at least give me some pointers.
> thanks