Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Get size of bigintmat
PostPosted: Tue Sep 27, 2016 4:19 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject: Re: Get size of bigintmat
PostPosted: Wed Sep 28, 2016 9:23 am 

Joined: Sat Oct 01, 2005 11:40 am
Posts: 35
Location: IIT Guwahati, Guwahati, Assam, INDIA
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


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

It is currently Wed Dec 13, 2017 1:27 am
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group