<?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>switch(ZZ,ZZ,VisibleList) -- copy a list, switching two elements</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Symbol.html">next</a> | <a href="___S__V__D_lp..._cm_sp__Divide__Conquer_sp_eq_gt_sp..._rp.html">previous</a> | <a href="___Symbol.html">forward</a> | <a href="___S__V__D_lp..._cm_sp__Divide__Conquer_sp_eq_gt_sp..._rp.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>switch(ZZ,ZZ,VisibleList) -- copy a list, switching two elements</h1> <div class="single"><h2>Synopsis</h2> <ul><li><div class="list"><dl class="element"><dt class="heading">Usage: </dt><dd class="value"><div><tt>switch(i,j,x)</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_switch_lp__Z__Z_cm__Z__Z_cm__Visible__List_rp.html" title="copy a list, switching two elements">switch</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>i</tt>, <span>an <a href="___Z__Z.html">integer</a></span></span></li> <li><span><tt>j</tt>, <span>an <a href="___Z__Z.html">integer</a></span></span></li> <li><span><tt>x</tt>, <span>a <a href="___Visible__List.html">visible list</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Visible__List.html">visible list</a></span>, a copy of the list <tt>x</tt> in which the elements at positions <tt>i</tt> and <tt>j</tt> have been interchanged. A negative value of <tt>i</tt> or <tt>j</tt> is taken relative to the end of the list.</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div><table class="examples"><tr><td><pre>i1 : switch(3,9,0..10) o1 = (0, 1, 2, 9, 4, 5, 6, 7, 8, 3, 10) o1 : Sequence</pre> </td></tr> <tr><td><pre>i2 : switch(0,-1,0..10) o2 = (10, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0) o2 : Sequence</pre> </td></tr> </table> </div> </div> </div> </body> </html>