Max Alekseyev on Thu, 22 Oct 2015 16:09:56 +0200


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

Re: Using forvec as fordiv


Another variant:

apply(x->v[x],select(x->u[x]>0,vector(#u,i,i)))

On Wed, Oct 21, 2015 at 4:41 PM, Charles Greathouse <charles.greathouse@case.edu> wrote:
Given a vectors u and v with #v == #u, what's the easiest way to extract the elements of v for which the corresponding element of u is nonzero? (All elements from u will be 0 or 1.)

This is for constructing divisors of factorback(v) in their factored form.

Charles Greathouse
Analyst/Programmer
Case Western Reserve University