Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: no room to add more double literals


From   Sergiy Radyakin <[email protected]>
To   [email protected]
Subject   Re: st: no room to add more double literals
Date   Mon, 17 Jan 2011 22:25:36 -0500

Dear All,

I am having the same problem as Adrian (see his post Nov. 1 2010,
quoted below).

I am getting an error message

no room to add more double literals
r(3000);

while running the following code:

mata mata clear
mata
numeric matrix GetA() {
a=J(792,1,.)
a[1,1]=32
//...skipped...
a[99,1]=100
a[100,1]=56
a[101,1]=56
//...continues....
}

the skipped part contains assignments for each index. There are total
792 assignments in the function - one for each matrix element.

Background: I need to define a large matrix inside my Mata code. I can
do it with assignment element-by-element, direct input or reading from
a file.
I would like to avoid reading from a file.

What is the best way to define, e.g. 100000x1 matrix in the Mata code?
(Another software is writing the Mata program, so I am not concerned
about the amount of labor).

Thank you, Sergiy Radyakin

PS: I couldn't find any reply to his question and also the email from
2007 that he quoted. Sorry if this was already discussed before.




On Mon, Nov 1, 2010 at 8:13 AM, Adrian Mander
<[email protected]> wrote:
> There was a post on the statalist in 2007 about this error message.
>
> I am hitting this limit and wondered what the current advice is.
>
>
> Thanks
> Adrian
>
>
> --
> Dr Adrian Mander
> Leader of Cambridge Hub in Trials Methodology Research
> MRC Biostatistics Unit    Institute of Public Health University Forvie Site
>    Cambridge CB2 0SR
>
> Tel: 01223 760728       Fax: 01223 760727
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index