Services & Resources / Wolfram Forums
MathGroup Archive
*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
  • Subject: [mg77218] modify elements of arb.dimensionality matrices
  • From: "alexxx.magni at" <alexxx.magni at>
  • 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

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