Home Online Manual
Top
Back: sppprint
Forward: spsub
FastBack:
FastForward:
Up: gmssing_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.6.13.14 spadd

Procedure from library gmssing.lib (see gmssing_lib).

Usage:
spadd(sp1,sp2); list sp1, list sp2

Return:
list sp; sum of spectra sp1 and sp2

Example:
 
LIB "gmssing.lib";
ring R=0,(x,y),ds;
list sp1=list(ideal(-1/2,-3/10,-1/10,0,1/10,3/10,1/2),intvec(1,2,2,1,2,2,1));
spprint(sp1);
==> (-1/2,1),(-3/10,2),(-1/10,2),(0,1),(1/10,2),(3/10,2),(1/2,1)
list sp2=list(ideal(-1/6,1/6),intvec(1,1));
spprint(sp2);
==> (-1/6,1),(1/6,1)
spprint(spadd(sp1,sp2));
==> (-1/2,1),(-3/10,2),(-1/6,1),(-1/10,2),(0,1),(1/10,2),(1/6,1),(3/10,2),(1/\
   2,1)