John Cremona on Thu, 06 Sep 2012 10:23:20 +0200

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: number of lines of matrices

In English one normally speaks of the number of rows (not lines) of a
matrix, so I would expect such a function to be called nrows() and
similarly ncols() for the number of columns (= width).  This matches
other systems (e.g. mine).


On 6 September 2012 06:49, Loïc Grenié <> wrote:
> 2012/9/5 Bill Allombert <>:
>> Dear PARI Developers,
>> Maybe we should add a function to query the number of lines of a non-empty matrix.
>> There are lot of instances of lg(x[1]) in the code, and this should be replaced
>> by lg(gel(x,1)) because it causes problem with strict aliasing.
>> something like
>> INLINE long
>> nblin(GEN x) { return lg(gel(x,1))-1; }
>> But how should we call it ? widthmat() ?
>   heightmat maybe ? In that case widthmat should also be implemented I
>   think. matwidth/height sound better (most matrix functions start with mat)
>   but degpol is degpol and not poldeg.
>          Thanks,
>                  Loïc