octave-maintainers
[Top][All Lists]
Advanced

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

Re: Extending octave_value::is_bool_type()


From: John W. Eaton
Subject: Re: Extending octave_value::is_bool_type()
Date: Wed, 4 May 2011 09:34:22 -0400

On  4-May-2011, Jordi Gutiérrez Hermoso wrote:

| 2011/5/4 Olaf Till <address@hidden>:
| > On Tue, May 03, 2011 at 01:12:23PM -0500, Jordi Gutiérrez Hermoso wrote:
| >> I'm running into this in my bwlabeln implementation. It would be
| >> convenient if is_bool_type() returned true for matrices of type double
| >> that only have zeros and ones.  Is this a bad idea? Can I implement
| >> it?
| >
| > But doesn't one need e.g. to discriminate between matrices of numeric
| > indices, which can be all ones, and logical indices?
| 
| Ah, I see, yes. I hadn't considered this case. In which case my
| proposed extension is a bad idea. Never mind, then, I'll do my work
| another way.

Do the any_element_not_one_or_zero functions defined in the NDArray,
Matrix, Sparse, floatMatrix, floatNDArray, and intNDArray<T> classes
help you?

jwe


reply via email to

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