Bill Allombert on Sun, 09 Sep 2012 23:46:22 +0200

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

Re: number of lines of matrices

On Thu, Sep 06, 2012 at 09:23:14AM +0100, John Cremona wrote:
> 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). 

Well, as a start I added two functions:
lgcols(x): lg(x[1])
nbrows(x): lg(x[1])-1

The reason for the two functions is that there are more than 200 uses of
them which is too much to do a review and replace uses of lgcols() by 
nbrows()+1 without introducing bugs.

> This matches other systems (e.g. mine).

.. which is not necessarily an advantage, alas. The C language having a single
namespace, if PARI were to define a symbol with an name identical to the name
used in a user program or in a library that is used in conjunction with libpari,
there would be a symbol conflict.