style question
- To: mathgroup at smc.vnet.net
- Subject: [mg79315] style question
- From: Yaroslav Bulatov <yaroslavvb at gmail.com>
- Date: Tue, 24 Jul 2007 06:08:18 -0400 (EDT)
What is the recommended way of counting the number of matches in two lists? The natural way would be to thread over Equal, but Equal will evaluate before Thread gets to it. The method below works, but somehow feels wrong m1 = RandomInteger[{1}, {10^5, 2, 2}]; m2 = RandomInteger[{1}, {10^5, 2, 2}]; matches = Thread[temporary[m1, m2]] /. temporary -> Equal; Count[matches, True]
- Follow-Ups:
- Re: style question
- From: Carl Woll <carlw@wolfram.com>
- Re: style question
- From: Sseziwa Mukasa <mukasa@jeol.com>
- Re: style question