[Matrix-SIG] About "put"...

Paul F. Dubois dubois1@llnl.gov
Mon, 21 Jun 1999 10:20:32 -0700


I was hoping that we could implement "put" as assignment, at least for 1-D
arrays, viz.,

ix = [1, 3, 9, 2]
v[ix] = ....

Unfortunately the coding for v[something] and v[something] = something is
particularly nasty and so it require more time than I was able to spend to be
sure that I was not breaking something while implementing this. For more than
1-D you have the additional question of what semantics should be. For example,
if v[ix, 3] = ... means the obvious thing, what does v[ix, [3,4, 2, 1]] mean?
Is this an assignment to four components of v or to 16 or ?

For the record, I think it has to mean four ([1,3], [3,4], [9,2], [2,1]). But
the logic is very convoluted. For example, if v is 2-D, is v[ix] allowed the
way it is when ix is a scalar? Implementing this would seem to need a whole new
kind of object.