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

Konrad Hinsen hinsen@cnrs-orleans.fr
Tue, 22 Jun 1999 14:08:55 +0200


> 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 ?

I'd say 16. The logic is that for the special case of a list index
equivalent to a range or slice, the result should be the same as
for a range or slice, i.e.

    a[[0, 1, 2], [2, 4, 6]]

should be equivalent to

    a[0:3, 2:8:2]

However, there is an implementation problem: if the result should
really be equivalent, then sequence indexing should also produce an
array that shares its data space with the original array. And that
is impossible with the current array type implementation. But perhaps
an additional type is not that difficult to implement.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen@cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.55.69
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------