MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: MathLink and Vectors

  • To: mathgroup at smc.vnet.net
  • Subject: [mg35259] Re: MathLink and Vectors
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Fri, 5 Jul 2002 02:19:14 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <afugsl$rsc$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Manual works perfect. I have several programs that send
a 2d arrays to Mathematica, of course I have no "objects", and
I don't know how your vector/matrix class is defined but

MLPutFunction(stdlink,"Partition",2);
  MLPutRealList(stdlink,yourArray,n*m);
  MLPutInteger(stdlink,n);

will work with a one-dimensional adress scheme
and

MLPutFunction(stdlink,"List",n);
for(i=0; i<n; i++)
  MLPutRealList(stdlink,yourRows[i],m);

works for a array of pointers to rows.

Regards
  Jens


"Mark T. Gordon" wrote:
> 
> I am working on a research project and need to use MathLink
> with Vectors.  I am mostly using vector<double> but I am
> also using vector< vector< double > >.  The functions seem
> to work except I am encountering a problem when entering the
> type of object the C++ code is returning in the template.
> I've tried Manual but that does not seem to work.  I'm using
> Visual C++ and Mathematica 4.1.  Any help would be
> appreciated.
> 
> mgordo76 at calvin.edu


  • Prev by Date: Thanks to all --Re: non integer exponents in ContourPlot[]?
  • Next by Date: RE: Corrupted Files & Version 4.2 Problems
  • Previous by thread: MathLink and Vectors
  • Next by thread: Parametric surface