[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
.oct files calling .oct files...
From: |
Stef Pillaert |
Subject: |
.oct files calling .oct files... |
Date: |
Sat, 18 Oct 1997 15:40:49 +0200 |
I managed to translate a lot of my octave-scripts to C++-code, and there is
indeed a very significant increase in speed....
But I have this little question...
Suppose I have a function1 (let's assume it needs two arguments, say A and
B: retval=function1(A,B)) I have a .cc version of it, (and the
corresponding oct-file...)
Next, I have a function2 (with tree arguments, say A, C and B).
I want to call function1 from function2, and I do it like this:
DEFUNDLD (function2,args,nargout,
"usage: retval=function(A,C,B) ")
{
octave_value_list tmp
tmp(1)=args(2);
tmp(0)=args(0);
octave_value_list tmp_ret = Ffunction1 (tmp,1);
....
}
But doing things this way, I'm making extra copies of A and B, no?
Is there a way of passing A and B to function1 without making those
unwanted copies? If it is of any importance, I just want to read the values
of A and B in function1, I don't need to change them there...
Thanks,
Stef.
BTW, when writing something like:
...
Matrix Y=args(0).matrix_value()
...
I suppose here also is made a copy of args(0)? Can I avoid this copy (but I
still want to read the values in args(0) of course...) So can I do
something like :
double a=args(0).elem(5,6);
?
- .oct files calling .oct files...,
Stef Pillaert <=