Bill Allombert on Thu, 30 Nov 2023 15:30:33 +0100
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: #matr~ vs ##matr (and: arity, questenian and !!)
|
- To: pari-dev@pari.math.u-bordeaux.fr
- Subject: Re: #matr~ vs ##matr (and: arity, questenian and !!)
- From: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
- Date: Thu, 30 Nov 2023 15:30:13 +0100
- Delivery-date: Thu, 30 Nov 2023 15:30:33 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=math.u-bordeaux.fr; s=2022; t=1701354614; bh=bzPcC4I9JXSX0NU1qFoWVtIi1iqKcSX7mDBHnidbtu0=; h=Date:From:To:Subject:References:In-Reply-To:From; b=c6cDCa7RRxK1mj/oPMU6MFH+lM3lsb3ZD095pOqxt/TpXr9+1X/9VW5be5vMQMtfU XoqSBmlVYNOy2WHyFA2rdxS+bSASMtqE5I5s1584+ZHc0OSIrQSyQXDw5GtRV5np5N WfjbeRcu1iLVz2HZ9MrmhEq92RlZUOVlPJkL70/MUpaMpDJ6UHZn3yF8kAdL1g/MZg 944V37T7u1cyXtzdItfC4o7CO4im5lF8A3dlO6n50Ljtx66oRj/2gUmThFNuUhssgN 2kopRgFDKXFLPahzImMsWtgaru8SVnecLKlKCvi9A23MJq97pCesZ6vsdZyXGsD2wD TyECLvD6Ba869CQid6T9nYpNOT8oHgnwmmIK6ll4yJo1E4KZ4Hb2hJKteB2HzTMtha x1Ozor/iz6G6Csc7H7Sfmjudy3JypmJS0nPzEX7NDfyWcBPWv132NEjB/TIups5s8H /tBwygWDmwRxDiLnlQQkoDK9qALF6SFWV1i8U4QudC9X30V6sc3q5676waCWdGsC+1 MRXnaY+ORaw4YVKMeSSM3x/a/A0sQS5tR+EIcXkFXQXBIW9qNvKE1+H2QE0ESgZOFS 25iUzlrXFmGuQH1kVxtpOhlLxTRTmuj6IQPVwopr3gVFkUXbnAax4O1N2t95V+adaM +BdczcHfMf5/OJrjUSnbgflY=
- In-reply-to: <ZWSVzkOJ8vxy29Q5@seventeen>
- Mail-followup-to: pari-dev@pari.math.u-bordeaux.fr
- References: <20210205134643.ihupkp7klxab4cxb@math.berkeley.edu> <20210205135448.rm5xdgmlsfjmty3z@math.berkeley.edu> <ZWQRkHqLoM9M3tN2@login.math.berkeley.edu> <ZWSVzkOJ8vxy29Q5@seventeen>
On Mon, Nov 27, 2023 at 02:12:46PM +0100, Bill Allombert wrote:
> On Sun, Nov 26, 2023 at 07:48:32PM -0800, Ilya Zakharevich wrote:
> > On Fri, Feb 05, 2021 at 05:54:48AM -0800, Ilya Zakharevich wrote:
> > > On Fri, Feb 05, 2021 at 05:46:43AM -0800, Ilya Zakharevich wrote:
> > > > Is not it desirable to implement ##matr as an (optimized) synonym for #matr~?
> > > >
> > > > If the answer to the second question is positive, then one can maybe
> > > > improve things by returning a special value (such as -1) for scalars…
> > >
> > > Well, to get things yet simpler, one can make ###x to return 0 for
> > > scalars, 1 for vectors/lists and 2 for matrices.
> >
> > Taking all these things together, I think that in the best of the
> > worlds one would have these:
> >
> > #mattr~ optimized in the compiler to (an equivalent to) (matsize(mattr))[1]
>
> This one will not break backward compatibility while being easy to do.
>
> See the new branch bill-translength.
>
> ? M=matrix(200,201,i,j,random(2^200));
> ? for(i=1,1000,#M~)
> *** last result computed in 0 ms.
> instead of
> *** last result: cpu time 485 ms, real time 486 ms.
I pushed my branch to master. Thanks for your suggestion.
Cheers,
Bill.