Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

modify elements of arb.dimensionality matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77218] modify elements of arb.dimensionality matrices
  • From: "alexxx.magni at gmail.com" <alexxx.magni at gmail.com>
  • Date: Tue, 5 Jun 2007 07:04:56 -0400 (EDT)

I was able to write an interface to deal with matrices having
dimension defined at runtime (see
http://groups.google.it/group/comp.soft-sys.math.mathematica/browse_frm/thread/f286f5bdafba4195/c85eaca115f18a46?lnk=st&q=+%22Alessandro+Magni%22&rnum=2&hl=it#c85eaca115f18a46).

My last problem - more a performance problem - is modify access to
those matrices:

reading access  at a given index location i (where i is the location
{x,y,z,...}) is made with:

>Extract[h, i]

while to increment h[[]] at i I use:

>h = ReplacePart[h, i ->  Extract[h, i] + 1]

but I really miss the possibility to write h[[x,y]]=h[[x,y]]+1, and
I'm user there are serious performance issues with my solution.

The nearest I came to a solution was with:

>h[[##]] & @@ i = "x"

but I immediately get:

>Set::write: Tag Apply in (s[[##1]]&)@@{1,2,1} is Protected. >>

Do you have any idea on this?

thank you!

Alessandro Magni



  • Prev by Date: Re: Fun with zero sums
  • Next by Date: NDSolve, Do loop, and Plot
  • Previous by thread: Re: Iterate through a list help
  • Next by thread: Re: modify elements of arb.dimensionality matrices