<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>sum -- compute the sum</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_sum_lp__Chain__Complex_rp.html">next</a> | <a href="___Sum.html">previous</a> | <a href="_sum_lp__Chain__Complex_rp.html">forward</a> | <a href="___Sum.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>sum -- compute the sum</h1> <div class="single"><h2>Description</h2> <div><tt>sum</tt> provides the sum of the members of a list, set, or chain complex, optionally with a function applied to each one.</div> </div> <div class="waystouse"><h2>Ways to use <tt>sum</tt> :</h2> <ul><li><span><a href="_sum_lp__Chain__Complex_rp.html" title="direct sum of the components of a chain complex">sum(ChainComplex)</a> -- direct sum of the components of a chain complex</span></li> <li><span><a href="_sum_lp__Chain__Complex__Map_rp.html" title="direct sum of the components of a chain map">sum(ChainComplexMap)</a> -- direct sum of the components of a chain map</span></li> <li><span><a href="_sum_lp__List_rp.html" title="sum the elements of a list">sum(List)</a> -- sum the elements of a list</span></li> <li><span><a href="_sum_lp__Set_rp.html" title="sum of elements">sum(Set)</a> -- sum of elements</span></li> <li><span><a href="_sum_lp__Tally_rp.html" title="sum of elements">sum(Tally)</a> -- sum of elements</span></li> <li><span><a href="_sum_lp__Visible__List_cm__Function_rp.html" title="sum results of applying a function">sum(VisibleList,Function)</a> -- sum results of applying a function</span></li> <li><span><a href="_sum_lp__Visible__List_cm__Visible__List_cm__Function_rp.html" title="sum results of applying a function pairwise">sum(VisibleList,VisibleList,Function)</a> -- sum results of applying a function pairwise</span></li> <li><span><a href="_sum_lp__Z__Z_cm__Function_rp.html" title="sum consecutive values of a function">sum(ZZ,Function)</a> -- sum consecutive values of a function</span></li> </ul> </div> </div> </body> </html>