MathGroup Archive 2009

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

Search the Archive

How to remove all cycles

  • To: mathgroup at smc.vnet.net
  • Subject: [mg98269] How to remove all cycles
  • From: buts <manger31 at yahoo.com>
  • Date: Fri, 3 Apr 2009 20:12:10 -0500 (EST)

Hello, 
I want to write the following code using functional
programming, i.e. to remove all Do's.
There are two arrays: 

A[[i]], i=1,...,2^(n+1)
B[[j,k]], j=1,2;  k=1,...,2^n.

I need to assign B to A setting the first bit of the index i
to be the index j. Explicitly

Do[Do[A[[ j + BitShiftLeft[k-1,1] ]]= B[[j,k]],
{j,1,2}],{k,1,2^n}]

I need to do it for multi-dimensional large arrays.
Is it possible to write it without Do's ?

Thanks.


  • Prev by Date: Re: Map to nested list
  • Next by Date: Re: Styling the selected Tab's label in TabView
  • Previous by thread: Re: Problem with Import[] and math.exe
  • Next by thread: How to remove all cycles