The best explanation I could make was this:

There exists MatAdd class, which can have ImmutableDenseMatrix as 
arguments, thus representing unevaluated matrix addition.
Therefore, ImmutableDenseMatrix subclasses Expr since it can form matrix 
expression.

However, ImmutableSparseMatrix isn't designed to be argument of MatAdd 
class.
(When I put it as argument of MatAdd, pretty printing raises error, saying 
they don't have `as_coeff_mmul` attribute).
This makes ImmutableSparseMatrix not to subclass Expr. Why this can't be 
argument of MatAdd I don't know.

Likewise, there exists no class such as 'NDimArrayAdd' class, making 
NDimArray subclass of Basic only.


But, seeing that Relational subclasses Expr as you exemplified, I belive 
that obviously there have been some confusion subclassing Basic and Expr.


2019년 12월 2일 월요일 오전 11시 42분 30초 UTC+9, Oscar 님의 말:
>
> On Mon, 2 Dec 2019 at 01:59, JS S <[email protected] <javascript:>> 
> wrote: 
> > 
> > But what confuses me is this: 
> > 
> > - ImmutableDenseMatrix is subclass of Expr 
> > - ImmutableSparseMatrix is subclass of Basic, but not Expr. 
> > - ImmutableDenseNDimArray is, unlike its Matrix counterpart, subclass of 
> Basic but not Expr. 
>
> I don't think there is a good reason for the discrepancy here apart 
> from the fact that there is some confusion about what should subclass 
> from what. Another example is that Relational is a subclass of Expr 
> and that makes no sense at all. 
>
> Probably all of these should be Expr or none of them should. 
>
> -- 
> Oscar 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/855bffec-1cb7-4e3c-8b7b-4d1a5255efd0%40googlegroups.com.

Reply via email to