On 23 October 2015 at 20:01, William Stein <wst...@gmail.com> wrote:
> Hi Nathann,
>
> What problem are you solving by using immutable matrices/vectors?  Why
> is anything immutable for what you are doing?
>
> For reference, I explained above the actual problem which motivated my
> writing immutable matrices/vectors for Sage in the first place.
>
>  -- William
>
> On Fri, Oct 23, 2015 at 10:33 AM, Nathann Cohen <nathann.co...@gmail.com> 
> wrote:
>>>> I do not see why matrix.row(0) should return a *copy* of the row when
>>>> the matrix is immutable.
>>>
>>>
>>> It depends on the implementation.
>>
>> I agree, and that was my point. As you say, under different
>> circumstances (different implementation of matrices) we may have
>> chosen to return 'views' on the rows of an immutable matrix instead. I
>> am not proposing to do this in Sage: this would indeed require a heavy
>> amount of changes.
>>
>> What I wanted to show is that there is nothing in the semantics of
>> matrix.row(i) that says that it is necessarily a copy. In different
>> software people did it differently, and that is fine too.
>>
>> Thus, I claim that nothing in the semantics of .row( i ) hints at a
>> copy (especially for immutable matrices), and thus I do not believe
>> that .row() should follow the behaviour of copy(a_matrix).
>>
>> In particular, I still believe that the behaviour of our objects should be 
>> [1]:
>> - immutable+immutable = immutable
>> - immutable*immutable = immutable
>> - immutable_matrix.row( i ) is an immutable vector.
>>
>> As two examples showed, we have to get out of our way to set "back" to
>> immutable objects which we expect to be from the start. Otherwise it
>> is indeed very (very) hard to work with sets of immutable objects.
>>
>> Nathann
>>
>> [1] As it is the case in Python, as illustrated above with tuples.
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+unsubscr...@googlegroups.com.
>> To post to this group, send email to sage-devel@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sage-devel.
>> For more options, visit https://groups.google.com/d/optout.
>
>
>
> --
> William (http://wstein.org)
>
> --
> You received this message because you are subscribed to a topic in the Google 
> Groups "sage-devel" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sage-devel/ddzJj4cceqI/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to