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

MathGroup Archive 2004

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

Search the Archive

Re: Direct Memory Replacing in Array

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46835] Re: Direct Memory Replacing in Array
  • From: "Mariusz Jankowski" <mjankowski at usm.maine.edu>
  • Date: Tue, 9 Mar 2004 19:57:49 -0500 (EST)
  • Organization: University of Southern Maine
  • References: <c2k4q5$qq0$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Jeremy, use

mat[[i,j]] = new;

See Part for details.

Mariusz

>>> Jeremy Fox<jeremytfox at yahoo.com> 3/9/2004 5:03:49 AM >>>
The Mathematica syntax 

mat = ReplacePart[mat,new,index]

is clean. However, it probably involves a complete replacing of the
entire, old mat with the entire new mat, in memory. This operation is
expensive if the user is interested in changing only a small part of a
large array mat.

Is there a way to change small numbers of elements in an array without
requiring the other elements to be copied again? This is how low-level
languages such a C and Fortran work.

Jeremy




  • Prev by Date: Re: Accounting of downloads
  • Next by Date: RE: Direct Memory Replacing in Array
  • Previous by thread: Direct Memory Replacing in Array
  • Next by thread: RE: Direct Memory Replacing in Array