help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in compilint .oct file Complex and octave_value


From: pauljoseph
Subject: Error in compilint .oct file Complex and octave_value
Date: Fri, 19 Sep 2008 02:43:37 -0700 (PDT)

Hi
I tried to write octave extension, but obtained this error
----
error: no matching function for call to ‘acos(octave_value)’
/usr/include/bits/mathcalls.h:55: note: candidates are: double acos(double)
/home/kurniawano/Programs/Octave3.0.1/include/octave-3.0.1/octave/lo-mappers.h:49:
note:                 Complex acos(const Complex&)
----

The error seems to be caused by this line
ka=acos(1-(egrid(loopE)+eta-Ec(0))*0.5/t0); // This is the part that causes
error

The strange thing is that if I omit the '1' in front, it gives me no error. 
ka=acos((egrid(loopE)+eta-Ec(0))*0.5/t0);

It seems that the data is converted from Complex to octave_value, and acos
function does not support octave_value. Is there anyone know what is
happening. I attached below the source code

#include<octave/oct.h>
#define ETACONS 1e-8

DEFUN_DLD(testtest,args, ,
          "testtest.\n")
{
  int loopE,NE;
  ColumnVector egrid(args(0).vector_value());
  ColumnVector Ec(args(1).vector_value());
  double t0(args(2).scalar_value());
  Complex eta(0,ETACONS);
  Complex ka;
  Complex buf;
  for (loopE=0;loopE<NE;loopE++){
    ka=acos(1-(egrid(loopE)+eta-Ec(0))*0.5/t0); // This is the part that
causes error
  }
}

-- 
View this message in context: 
http://www.nabble.com/Error-in-compilint-.oct-file-Complex-and-octave_value-tp19569309p19569309.html
Sent from the Octave - General mailing list archive at Nabble.com.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]