[Top][All Lists]

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

Re: Compiling octave with MSVC

From: Michael Goffioul
Subject: Re: Compiling octave with MSVC
Date: Wed, 11 Oct 2006 08:29:50 +0200
User-agent: Thunderbird (Windows/20060909)

John W. Eaton a écrit :
On 10-Oct-2006, Michael Goffioul wrote:

| #define NDS_CMP_OP2(F, OP, ND, NDC, S, SC, SPEC1, SPEC2) \
|   boolNDArray \
|   F (const ND& m, const S& s) \
|   { \
|     boolNDArray r; \
|  \
|     int len = m.length (); \
|  \
|     r.resize (m.dims ()); \
|  \
|     for (int i = 0; i < len; i++) \
|       r.elem(i) = operator OP <SPEC1,SPEC2> (NDC (m.elem(i)), SC (s)); \
|  \
|     return r; \
|   }

Another thought.  If SPEC1 and SPEC2 are the types of the operands to
OP, then does it work to write

  operator OP <typeof(m.elem(i)), typeof(s)> (NDC (m.elem(i)), SC (s));

instead?  If so, then I think we can avoid changing the interface of
the macro.
I don't think so because 's' is of type octave_int<T> and you need 'T' for SPEC2. However, I
think another solution is to use:

        NDC (m.elem(i)) OP SC (s.value())

but then you don't use templates for OP, because s.value() is not a template type. So you really
change the code executed.


reply via email to

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