[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Casting a Matrix object as a single dimensional array
From: |
Jaroslav Hajek |
Subject: |
Re: Casting a Matrix object as a single dimensional array |
Date: |
Tue, 8 Jun 2010 14:23:25 +0200 |
On Tue, Jun 8, 2010 at 2:16 PM, Chidambaram Annamalai
<address@hidden> wrote:
> I still don't see how I can access the internal double* pointer. Could
> you please elaborate? (That is, show a simple example?)
>
> Thanks,
> Chillu
>
Calling data(), or fortran_vec() on a const variable gets you a
readable (const) pointer.
Call fortran_vec() on a non-const variable to obtain a writable pointer.
ColumnVector c(n);
double *cx = c.fortran_vec ();
cx[0] = 0.0;
--
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz