octave-maintainers
[Top][All Lists]
Advanced

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

Re: indexing expression performance


From: John W. Eaton
Subject: Re: indexing expression performance
Date: Sat, 17 Jan 2009 14:51:36 -0500

On 17-Jan-2009, Jaroslav Hajek wrote:

| For using them from Fortran, no, you can use the implicit interface
| generated for every call. For using them from C, a header file can be
| written. So far I didn't do it, because it appears that providing it
| is actually inconvenient for C++; in C++, it's more convenient to use
| references than pointers (as in Octave's sources).

You could write a header with some macro goo something like this:

  #if defined __cplusplus && defined (QRUPDATE_USE_REFERENCES)
  #define QRUPDATE_PTR_ARG(T) T&
  #else
  #define QRUPDATE_PTR_ARG(T) T*
  #endif

  #if defined (__cplusplus)
  extern "C" {
  #endif

  F77_FUNC_RET_T
  F77_FUNC (qrupdatefcn, QRUPDATEFCN) (const QRUPDATE_PTR_ARG (double),
                                       QRUPDATE_PTR_ARG (double), int)
  ...

  #if defined (__cplusplus)
  }
  #endif

But I'm not sure it is really worth it.

jwe


reply via email to

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