help-octave
[Top][All Lists]
Advanced

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

Re: Sparse matrices operators in C++ using liboctave


From: David Bateman
Subject: Re: Sparse matrices operators in C++ using liboctave
Date: Thu, 12 Nov 2009 19:47:35 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706)

Basilio wrote:
Hi all,
I'm trying to use a Sparse-to-scalar comparison operator (==) between
Sparse<uint8_t> and uint8_t, and I would like to use one of the operators in
the macros from Sparse-op-defs.h,
like SPARSE_SMS_CMP_OP_DECLS(M, S, API) or SPARSE_SMS_CMP_OP(M, S, API).
I tried to do
SPARSE_SMS_CMP_OP_DECLS (Sparse<uint8_t>, uint8_t, OCTAVE_API)
in my code, and used mx_el_eq to make the desired comparison and get the
resulting sparse bool matrix.
Note that DECLS stands for "declaration". So that macro gives you the declaration for the header but not the code itself that must be compiled. Try adding

SPARSE_SMS_CMP_OPS (Sparse<uint8_t>, static_cast<uint8_t>(0), , uint8_t, static_cast<uint8_t>(0), )

to a file that is compiled once only
When I try to compile, it gives me a linker error, like

ca2d.cc:(.text+0x1364): undefined reference to `mx_el_eq(Sparse<unsigned
char> const&, unsigned char const&)'
ca2d.cc:(.text+0x15d4): undefined reference to `mx_el_eq(Sparse<unsigned
char> const&, unsigned char const&)'
collect2: ld returned 1 exit status

I used boolean operators mx_el_and, mx_el_or without any problem.
Can anyone help me in using == and other comparison operators with
Sparse<uint8_t>?
Thanks!

bas


--
David Bateman                                address@hidden
35 rue Gambetta                              +33 1 46 04 02 18 (Home)
92100 Boulogne-Billancourt FRANCE            +33 6 72 01 06 33 (Mob)



reply via email to

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