[ADMB Users] Printing a vector in a row format

23 views
Skip to first unread message

Naji Nassar

unread,
Mar 7, 2012, 3:38:59 AM3/7/12
to us...@admb-project.org

Hi all

 

 

I’m looking for an elegant way in ADMB to print a vector in a column format, just to avoid loop

  {

    ofstream ofs("llik1.txt");

     for (t=1;t<=nobs;t+=1)

      {

        ofs << llik(t) << endl;

      }

  }

 

ADMB DLL with MSVC.. I still don’t find a solution.. Any help is highly appreciated

 

 

Naji

Weihai Liu

unread,
Mar 7, 2012, 9:14:40 AM3/7/12
to Naji Nassar, us...@admb-project.org
try ofs<< column_vector( yourVector);


_______________________________________________
Users mailing list
Us...@admb-project.org
http://lists.admb-project.org/mailman/listinfo/users


bigA

unread,
Mar 7, 2012, 3:14:40 PM3/7/12
to Weihai Liu, us...@admb-project.org
Perhaps I am missing something, but using dlls with admb is still a work in progress?
I don't have my copy of the user manual with me, but my recolection is that dlls are not well documented and are not well supported.  I think there have been some emails circulated about dlls with R, they are probably on this list?

Ian Taylor

unread,
Mar 7, 2012, 5:37:51 PM3/7/12
to bigA, us...@admb-project.org, Weihai Liu

dave fournier

unread,
Mar 7, 2012, 7:50:53 PM3/7/12
to us...@admb-project.org
I checked out the bimix DLL example with the current admb sofware and R.

Thing to do is to add -fPIC option when building the libraries and also when
creating the shared library under gcc.

To create a shared library add the --shared option and get the bimix.so
library
with the -o$1.so option

g++ --shared -fPIC -ggdb -w -fpermissive -DUSE_LAPLACE -Dlinux
-D__GNUDOS__ -o$1.so $1.cpp
etc.

The code seems to be reentrant for this example.

Naji Nassar

unread,
Mar 8, 2012, 1:38:08 PM3/8/12
to Weihai Liu, us...@admb-project.org

Thanks Liu

 

 

The column_vector command is giving me what I want.

I forgot to say that a third party program (Gauss) is creating the bat files, and reading back the results files. The start command allows GAUSS to run other commands even if the ADMB applications hadn’t finished their estimation.. So I still have to use dos windows and their pop-up..

 

I still hadn’t succeed getting ADMB dll

 

Naji

De : weih...@gmail.com [mailto:weih...@gmail.com] De la part de Weihai Liu
Envoyé : mercredi 7 mars 2012 15:15
À : Naji Nassar
Cc : us...@admb-project.org
Objet : Re: [ADMB Users] Printing a vector in a row format

Naji Nassar

unread,
Mar 8, 2012, 1:46:57 PM3/8/12
to bigA, Weihai Liu, us...@admb-project.org

Hi BigA

 

 

In the early versions on ADMB (2004 and earlier), ADMB dll worked quite fine and I had been able to use them with third party programs.

For simulations, EM algorithms, where one has to run several times  ADMB optimizations, and multithreading issues, I’d appreciate having DLL

 

Does anyone has the older version of ADMB/bin files for MSVC compliler?

 

Best

Naji

 

De : bigA [mailto:jaguar...@gmail.com]
Envoyé : mercredi 7 mars 2012 21:15
À : Weihai Liu
Cc : Naji Nassar; us...@admb-project.org


Objet : Re: [ADMB Users] Printing a vector in a row format

 

Perhaps I am missing something, but using dlls with admb is still a work in progress?

bigA

unread,
Mar 8, 2012, 2:19:39 PM3/8/12
to Naji Nassar, us...@admb-project.org
I don't have a copy of the old source code.  
I suppose the long term solution is to try to dust off admb's dll support. 
I am sure that if you wanted to spearhead fixing and documenting dlls with admb; the admb developers would be supportive.
 
I think it would be really cool for admb to be able to make dll's, however as was pointed out that feature lacks a maintainer. 
Certainly, the source code is available. 

svn checkout http://www.admb-project.org/svn/trunk admb-trunk-read-only

Aaron


On Thu, Mar 8, 2012 at 10:46 AM, Naji Nassar <nassa...@orange.fr> wrote:

Hi BigA

 

 

In the early versions on ADMB (2004 and earlier), ADMB dll worked quite fine and I had been able to use them with third party programs.

For simulations, EM algorithms, where one has to run several times  ADMB optimizations, and multithreading issues, I’d appreciate having DLL

 

Does anyone has the older version of ADMB/bin files for MSVC compliler?

 

Best

Naji

 

De : bigA [mailto:jaguar...@gmail.com]
Envoyé : mercredi 7 mars 2012 21:15
À : Weihai Liu
Cc : Naji Nassar; us...@admb-project.org


Objet : Re: [ADMB Users] Printing a vector in a row format

 

Perhaps I am missing something, but using dlls with admb is still a work in progress?

dave fournier

unread,
Mar 8, 2012, 3:05:10 PM3/8/12
to us...@admb-project.org
Why do I bother?

As I already posted the bimix example seems to compile and run fine with
R on Linux with gcc.

Reply all
Reply to author
Forward
0 new messages