[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## accessing Matrix and ComplexMatrix objects

**From**: |
John W. Eaton |

**Subject**: |
accessing Matrix and ComplexMatrix objects |

**Date**: |
Mon, 2 Nov 1998 12:39:25 -0600 (CST) |

On 2-Nov-1998, Michael J Ursiak <address@hidden> wrote:
| I am interfacing a lanczos fortran subroutine with octave and have a
| question about Matrix and ComplexMatrix objects. The fortran subroutine
| may will return a Matrix or ComplexMatrix of size m by n, but I it may
| only have m by k (k < n) significant elements which I want to return from
| the wrapper function to the octave environment. How can I access the
| m by n Matrix (or ComplexMatrix) and copy its elements to a m by k Matrix
| (or ComplexMatrix) to return from the wrapper function to the octave
| environment. Thanks.
If I understand the question, something like this should work:
Matrix M (m, n);
double *pM = M.fortran_vec;
F77_FCN (fcn, FCN) (..., pM, ...);
M.resize (m, k);
jwe