MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

comparing two lists

  • To: mathgroup at
  • Subject: [mg54284] comparing two lists
  • From: Curt Fischer <tentrillion at>
  • Date: Wed, 16 Feb 2005 14:36:02 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dear Group:

I want to write a function that accepts a n-vector and an n x m matrix. 
It should return a list of positions in the matrix where mat[[i,j]] > 
vec[[i]].  For example,





I would like myFunc[] to return {{2},{1,2,3}}.

How could I write this as a pure function?  Ideally I would like to be 
able to Map or Apply my function to the list {mat, vec} and get my result.

Something like


is doomed to fail because the PatternTest required in Position[] messes 
up the slotting of the other arguments.

Ideas?  How do you nest pure functions?

Curt Fischer

  • Prev by Date: Re: Missing Graphics
  • Next by Date: Re: Missing Graphics
  • Previous by thread: EulerianCycle in graphs
  • Next by thread: Re: comparing two lists