[sage-devel] Re: floor division for integer matrices
On Thursday, November 2, 2017 at 8:30:59 AM UTC+10, Simon King wrote: > > On 2017-11-01, David Roe > wrote: > > I don't think you're missing anything, and I would support adding this > > feature to matrices. > > I wouldn't support it. > > If you have an integral domain R, then the quotient x/y for x,y in R > will live in the fraction field of R, whereas floor division x//y > (I think) is only defined if R is a euclidean ring (division x//y > with remainder x%y). > > The situation that this thread is about is different. Here, > we have a module, not an integral domain nor a euclidean ring. > If M is a matrix and c a skalar, then M/c is just syntactical > sugar for (1/c)*M. > > Should M//c become syntactical sugar for "conversion of (1/c)*M > into M.parent()"? I don't see why it should. > > That said: I also don't say that I would oppose to making M//c work. > I just wouldn't support it... > > The module "operation" of do floor division on every coefficient is well-defined, at least when programming, I think of v / x as do division on each coefficient of v. So I do not see any theoretical objection, but maybe I am missing something. I do see the practical issue of wanting to divide a ZZ-vector by, e.g. 2 and having it still be in my ZZ-module. Best, Travis -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] Giac fails to build
Le vendredi 20 octobre 2017 05:38:57 UTC+2, Timo Kaufmann a écrit : > > After adding one more depencency (hevea) the compilation succeeds. Thank > you for your help. > > It needs quite some dependencies that are not mentioned on the README's > instructions though (like hevea and texlive). Are those just undocumented > or does it depend on some build options? > Hello, My experience is the following: In the giac source archive the doc is prebuilt (ie the html files built from the tex files are already in the archive) so after a configure if you cd in the doc dir make does nothing and don't need all these dependencies (hevea...) and make install just copy files. But your sed changed the Makefiles in the doc dir so now your built try to recreate all these html files from the tex files and you need many more dependencies. -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] Re: floor division for integer matrices
On 2017-11-01, David Roe wrote: > I don't think you're missing anything, and I would support adding this > feature to matrices. I wouldn't support it. If you have an integral domain R, then the quotient x/y for x,y in R will live in the fraction field of R, whereas floor division x//y (I think) is only defined if R is a euclidean ring (division x//y with remainder x%y). The situation that this thread is about is different. Here, we have a module, not an integral domain nor a euclidean ring. If M is a matrix and c a skalar, then M/c is just syntactical sugar for (1/c)*M. Should M//c become syntactical sugar for "conversion of (1/c)*M into M.parent()"? I don't see why it should. That said: I also don't say that I would oppose to making M//c work. I just wouldn't support it... Best regards, Simon -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
Re: [sage-devel] floor division for integer matrices
I don't think you're missing anything, and I would support adding this feature to matrices. David On Wed, Nov 1, 2017 at 5:36 PM, Simon Brandhorst wrote: > sage: A = Matrix(ZZ,2,[3,3,3,3]) > sage: A > [3 3] > [3 3] > sage: A//3 > > --- > TypeError Traceback (most recent call last > ) > ... > > TypeError: unsupported operand parent(s) for //: 'Full MatrixSpace of 2 > by 2 dense matrices over Integer Ring' and 'Full MatrixSpace of 2 by 2 > dense matrices over Integer Ring' > sage: A/3 > [1 1] > [1 1] > sage: (A/3).base_ring() > Rational Field > > > What I would like is a matrix over the Integers. Not an integral matrix > over the rationals. > This seems so elementary that I wonder if I am missing something? > > (A/3).change_ring(ZZ) > > is too ugly. Ticket? > > And similar for p-adic integers, polynomial rings in one variable etc. > > -- > 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 https://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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.
[sage-devel] floor division for integer matrices
sage: A = Matrix(ZZ,2,[3,3,3,3]) sage: A [3 3] [3 3] sage: A//3 --- TypeError Traceback (most recent call last) ... TypeError: unsupported operand parent(s) for //: 'Full MatrixSpace of 2 by 2 dense matrices over Integer Ring' and 'Full MatrixSpace of 2 by 2 dense matrices over Integer Ring' sage: A/3 [1 1] [1 1] sage: (A/3).base_ring() Rational Field What I would like is a matrix over the Integers. Not an integral matrix over the rationals. This seems so elementary that I wonder if I am missing something? (A/3).change_ring(ZZ) is too ugly. Ticket? And similar for p-adic integers, polynomial rings in one variable etc. -- 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 https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.