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

deleting an entry from intvec
http://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2514
Page 1 of 1

Author:  DZDjokovic [ Sat Dec 12, 2015 1:40 am ]
Post subject:  deleting an entry from intvec

How do I delete an entry from an intvec? Could not find any function that does it.

Author:  hannes [ Mon Dec 14, 2015 11:15 am ]
Post subject:  Re: deleting an entry from intvec

Assume you want to delete the ith entry from an intvec v of length >=2:
Code:
if(i==1) { v=v[2..size(v)]; }
else
{
  if(i==size(v))
  { v=v[1..i-1]; }
  else
  { v=v[1..i-1],v[i+1..size(v)]; }
}

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