Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #16676

Re: Mapping tag-value lists to a third

From carlos.felippa%colorado.edu@gtempaccount.com
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Mapping tag-value lists to a third
Date 2014-03-20 09:28 +0000
Message-ID <lgecb6$7om$1@smc.vnet.net> (permalink)
References <lg64l7$gm1$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw



Thanks to all who replied.  For now I have implemented it as

tagval=If [$VersionNumber>=5.1,Pick[val,tag,1],val*tag/. 0:>Sequence[]];

For big lists, Pick is slightly faster. Eg, for 10^7 length, on a MacPro:

     Pick 1.45 sec    Sequence: 1.72 sec

The reason for $VersionNumber is that Pick appeared in 5.1. Some
users of my Mathematica codes are colleagues living overseas who run
version 4 on old computers.  

Back to comp.soft-sys.math.mathematica | Previous | NextPrevious in thread | Find similar


Thread

Mapping tag-value lists to a third carlos.felippa%colorado.edu@gtempaccount.com - 2014-03-17 06:27 +0000
  Re: Mapping tag-value lists to a third carlos.felippa%colorado.edu@gtempaccount.com - 2014-03-20 09:28 +0000

csiph-web