MathGroup Archive 2010

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

Search the Archive

Speed Up Routines

  • To: mathgroup at smc.vnet.net
  • Subject: [mg109361] Speed Up Routines
  • From: "Benedetto Bongiorno" <bongiob at sbcglobal.net>
  • Date: Fri, 23 Apr 2010 03:49:23 -0400 (EDT)

Mathgroup,

 

I have the following routines that take approx 5 minutes.

Can you give me suggestions to implement MAP in the areas of For

 

Length[data]

370161

Length[cntrlUnits}

456

 

n=Length[cntrlUnits]+1;

cntrlUnitsData=Table[0,{i,1,Length[cntrlUnits]}];

For[i=1,i<n,i++,cntrlUnitsData[[i]]=Position[data[[All,Flatten[Position[head
ings02,"GLICU"]][[1]]]],_?(#==cntrlUnits[[i]]&)]];

 

Length[cntrlUnitsData]

456

 

n=Length[cntrlUnits]+1;

cntrlUnitsTrans=Table[0,{i,1,Length[cntrlUnits]}];

For[i=1,i<n,i++,cntrlUnitsTrans[[i]]=Map[data[[#]]&,cntrlUnitsData[[i]]]];

 

Length[cntrlUnitsTrans]

456

 

Thank you,

 

Benedetto Bongiorno CPA CRE

Cell 214-707-6546

Land 972-470-9138

Fax 972-470-9748

bongiob at sbcglobal.net

 

This Email is covered by the Electronic Communications Privacy Act, 18
U.S.C. Sections 2510-2521 and is legally privileged. The information
contained in this Email is intended only for the use of the individual
or entity named above. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distributions
or copying of this communication is strictly prohibited. If you have
received this communication in error, please notify sender.

 


  • Prev by Date: Re: Unevaluated functions
  • Next by Date: Re: problems with NMinimize
  • Previous by thread: Re: Experimental`NumericalFunction::dimsl
  • Next by thread: Re: Speed Up Routines