[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## passing a matrix to a fortran subroutine

**From**: |
Michael J Ursiak |

**Subject**: |
passing a matrix to a fortran subroutine |

**Date**: |
Wed, 15 Jul 1998 14:12:20 -0400 (EDT) |

Can anybody help me with the following problem:
I am attempting to pass a matrix to fortran subroutine from octave.
I have written the following wrapper function based upon your svd.cc
function:
#include <octave/oct.h>
#include <config.h>
#include <iostream.h>
#include "defun-dld.h"
#include "error.h"
#include "gripes.h"
#include "help.h"
#include "mappers.h"
#include "oct-obj.h"
#include "pr-output.h"
#include "utils.h"
#include "f77-fcn.h"
#include "dDiagMatrix.h"
#include "dMatrix.h"
#include "ndbleSVD.h"
extern "C"
{
int F77_FCN (xstuff, XSTUFF) ( int&,int&,double*,int&);
}
DEFUN_DLD (newsvd, args, ,
"The `newsvd'.")
{
int z;
octave_value arg = args(0);
Matrix tmp = arg.matrix_value();
int m = tmp.rows ();
int n = tmp.cols ();
double *tmp_data = tmp.fortran_vec ();
F77_XFCN (xstuff, XSTUFF, (m,n,tmp_data,z));
return octave_value(z);
}
I get the following error when I try to execute this newvd in octave:
octave:2> y = newsvd(h)
ld.so.1: octave: fatal: relocation error: symbol not found: __f_open_nv:
referenced in /a/kenner/lime/homes/ursiak/octave/newstuff/newsvd.oct
Killed
I am running Octave, version 2.0.10 on SunOS 5.5.1
sun4m sparc SUNW,SPARCstation-20.

**passing a matrix to a fortran subroutine**,
*Michael J Ursiak* **<=**