[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] iterator selections and logic short-circuiting
From: |
Gábor Csárdi |
Subject: |
Re: [igraph] iterator selections and logic short-circuiting |
Date: |
Sun, 23 Sep 2012 18:26:04 -0400 |
Carl,
just a comment. I think the expression
E(g)[!a && b]
does not make much sense, because '&&' is _not_ an element-wise operator. E.g.:
a <- c(FALSE, TRUE, TRUE)
b <- c(FALSE, FALSE, TRUE)
a && b
# [1] FALSE
a & b
# [1] FALSE FALSE TRUE
'&&' is actually only evaluates the second argument is the first one
evaluates to TRUE.
Best,
Gabor
On Tue, Sep 11, 2012 at 11:30 AM, Carl Pearson <address@hidden> wrote:
> Using the iterator function, with a logical query
>
> E(g)[!a && b]
>
> is causing complaints when '!a' evaluates FALSE (i.e., the expression
> should be short-circuited) and 'b' is null. I'm working around this
> currently, but this struck me as indicating an opportunity to trim
> some unnecessary operations under the iterator hood (no clue how it
> actually works, however, so can't suggest anything).
>
> Also, provided there isn't some gross performance trade, clearly I'd
> like to use the iterator query this way.
>
> C
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
--
Gabor Csardi <address@hidden> MTA KFKI RMKI