This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Passing matrices from c++ to fortran
- From: Erik Edelmann <erik dot edelmann at iki dot fi>
- To: Americo Junior <americojunior at mec dot puc-rio dot br>
- Cc: gcc-help at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Tue, 31 Oct 2006 21:59:52 +0200
- Subject: Re: Passing matrices from c++ to fortran
- References: <54215.139.82.183.60.1162321373.squirrel@139.82.183.60>
On Tue, Oct 31, 2006 at 04:02:53PM -0300, Americo Junior wrote:
> I want to pass a dynamically aloccated matrix from c++ code to a fortran
> subroutine.
>
> I know how to do this with a static matrix, but with dynamical matrix
> there are some difficulties.
It's some time ago I did anything like this, so I might be
overlooking/forgetting something now, but I think that if you make sure
your matrix is one big contiguous pice of memory, and take into account
that the matrix will appear transposed in your fortran code, it ought to
work.
Erik