From help-octave-request at bevo dot che dot wisc dot edu Thu Dec 19 06:26:35 2002 Subject: Hi, another newbie ... From: "Andrzej M. Ostruszka" To: help-octave at bevo dot che dot wisc dot edu Date: Thu, 19 Dec 2002 13:26:10 +0100 Hi, I've just started to play more seriously with octave (I've used Matlab for long time) and I have couple of questions regarding "native code" functions (I have no problems with *.m files) -- I did run search in mail archive but somehow couldn't find anything relevant. 1. I can use in C++ methods which are internal to given objects for example DEFUN_DLD (testexpm, args, /* nargout */, "Some `testing' function") { ComplexMatrix m( args(0).complex_matrix_value() ); return octave_value( m.expm() ); } but how can I use other functions (including those defined in *.m) inside say this testexpm. I just realized that I could use feval (am I correct?), but the question is more general: how can I access variables defined in current context (or at least global) and how can I pass/register my local variables to the "rest of the world". 2. How can I use liboctave in separate programs? My problem is that I don't know why it doesn't find definitions of various functions. I've managed to reduce problem to finding say constructor and expm of ComplexMatrix when I link with: -lm -lg2c -lblas -llapack -lcruft -loctave -ldl -lfftw The above is on my home computer with PLD Linux 1.0 distribution while here in my work (RedHat 7.3) I had to supply additionally readline ncurses kpathsea (which I guess is incompatible with the one which liboctave was linked with since there's one unresolved symbol left -- but that doesn't matter I can run programs in home). The problem is that if I do `nm liboctave.so' than I can see something of the kind (I'm not that good in demangling so I might be wrong :)) 00126960 W __13ComplexMatrix 00126cd0 W __13ComplexMatrixPt7complex1Zdii 00109140 T __13ComplexMatrixRC10DiagMatrix 00109a80 T __13ComplexMatrixRC10boolMatrix 00109cf0 T __13ComplexMatrixRC10charMatrix 00108ee0 T __13ComplexMatrixRC12ColumnVector 00126b10 W __13ComplexMatrixRC13ComplexMatrix 00109390 T __13ComplexMatrixRC16ComplexRowVector 00109830 T __13ComplexMatrixRC17ComplexDiagMatrix 001095e0 T __13ComplexMatrixRC19ComplexColumnVector 00108970 T __13ComplexMatrixRC6Matrix 00108c80 T __13ComplexMatrixRC9RowVector .... 00114ec0 T expm__C13ComplexMatrix 00147990 T expm__C6Matrix which makes me think that I'm doing something wrong but I don't see what. Additionally I'd like to access other octave functions (defined as *.m or *.oct or even builtin) but I guess that the answer for my first question also aswers that one. Any help appreciated Best regards -- ____ _ ___ / | \_/ |/ _ \ Andrzej Marek Ostruszka / _ | | (_) | Instytut Fizyki, Uniwersytet Jagiellonski (Cracow) /_/ L|_|V|_|\___/ (PGP <-- finger ostruszk at order dot if dot uj dot edu dot pl) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------