Singular
https://www.singular.uni-kl.de/forum/

Get size of bigintmat
https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2557
Page 1 of 1

Author:  monomial [ Tue Sep 27, 2016 4:19 pm ]
Post subject:  Get size of bigintmat

Hi all,

if I call size for a bigintmat, it will cause an error.

Code:
> bigintmat mymat[2][4] = 1,2,3,4,5,6,8;
> size(mymat);                                                                                                                                               
   ? size(`bigintmat`) failed                                                                                                                               
   ? expected size(`bigint`)
   ? expected size(`number`)
   ? expected size(`resolution`)
   ? expected size(`string`)
   ? expected size(`poly`)
   ? expected size(`vector`)
   ? expected size(`ideal`)
   ? expected size(`module`)
   ? expected size(`matrix`)
   ? expected size(`intvec`)
   ? expected size(`intmat`)
   ? expected size(`list`)
   ? expected size(`ring`)
How can I get the total number of entries of a bigintmat besides explicit conversion to intmat? I'd like to be able to call size(mymat) where mymat is of type bigintmat.

Author:  vinay [ Wed Sep 28, 2016 9:23 am ]
Post subject:  Re: Get size of bigintmat

The size function in Singular for a matrix is very misleading, though may be useful is some situations. Further as per the man page of size, it does not accept bigintmat.

The best way to get the size of a matrix / intmat / bigintmat is to use nrows and ncols functions.

Code:
> bigintmat mymat[2][4] = 1,2,3,4,5,6,8;
> nrows (mymat);
> ncols (mymat);



VInay

Page 1 of 1 All times are UTC + 1 hour [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/