<?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>map(Module,Module,List) -- create a matrix by giving a sparse or dense list of entries</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_map_lp__Module_cm__Module_cm__Ring__Element_rp.html">next</a> | <a href="_map_lp__Module_cm__Module_cm__Function_rp.html">previous</a> | <a href="_map_lp__Module_cm__Module_cm__Ring__Element_rp.html">forward</a> | <a href="_map_lp__Module_cm__Module_cm__Function_rp.html">backward</a> | <a href="_map.html">up</a> | <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> <div><a href="_map.html" title="make a map">map</a> > <a href="_map_lp__Module_cm__Module_cm__List_rp.html" title="create a matrix by giving a sparse or dense list of entries">map(Module,Module,List)</a></div> <hr/> <div><h1>map(Module,Module,List) -- create a matrix by giving a sparse or dense list of entries</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>map(M,N,v)</tt></div> </dd></dl> </div> </li> <li><span>Function: <a href="_map.html" title="make a map">map</a></span></li> <li><div class="single">Inputs:<ul><li><span><tt>M</tt>, <span>a <a href="___Module.html">module</a></span></span></li> <li><span><tt>N</tt>, <span>a <a href="___Module.html">module</a></span></span></li> <li><span><tt>v</tt>, <span>a <a href="___List.html">list</a></span></span></li> </ul> </div> </li> <li><div class="single">Outputs:<ul><li><span><span>a <a href="___Matrix.html">matrix</a></span>, A matrix <tt>M <-- N</tt> whose entries are obtained from <tt>v</tt></span></li> </ul> </div> </li> <li><div class="single"><a href="_using_spfunctions_spwith_spoptional_spinputs.html">Optional inputs</a>:<ul><li><span><a href="_map_lp..._cm_sp__Degree_sp_eq_gt_sp..._rp.html">Degree => ...</a>, -- set the degree of a map</span></li> <li><span><a href="_map_lp__Ring_cm__Ring_cm__Matrix_rp.html">DegreeLift => ...</a>, -- make a ring map</span></li> <li><span><a href="_map_lp__Ring_cm__Ring_cm__Matrix_rp.html">DegreeMap => ...</a>, -- make a ring map</span></li> </ul> </div> </li> </ul> </div> <div class="single"><h2>Description</h2> <div>The list <tt>v</tt> is either a doubly nested list of ring elements, or a list of elements <tt>(i,j) => f</tt>. The first version provides all of the elements of the output matrix, row by row. The second form provides only the non-zero elements of the output matrix <tt>h: h_(i,j) = f</tt>, for every <tt>(i,j) => f</tt> in the list <tt>v</tt>.<p/> In each case, the modules <tt>M</tt> and <tt>N</tt> should have the same base ring <tt>R</tt>, and the ring elements appearing in <tt>v</tt> should be over <tt>R</tt>, or over a base ring of <tt>R</tt>.<p/> In the first form, each list in v gives a row of the matrix. The length of the list <tt>v</tt> should be the number of generators of <tt>M</tt>, and the length of each element of <tt>v</tt> (which is itself a list of ring elements) should be the number of generators of the source module <tt>N</tt>.<table class="examples"><tr><td><pre>i1 : R = ZZ/101[x,y,z];</pre> </td></tr> <tr><td><pre>i2 : p = map(R^2,R^{-2,-2,0},{{x^2,0,3},{0,y^2,5}}) o2 = | x2 0 3 | | 0 y2 5 | 2 3 o2 : Matrix R <--- R</pre> </td></tr> <tr><td><pre>i3 : isHomogeneous p o3 = true</pre> </td></tr> </table> In the second form, if an index (i,j) occurs more than once, only the last is taken.<table class="examples"><tr><td><pre>i4 : p = map(R^2,R^3,{(0,0) => x+y, (1,1) => x^2, (0,2) => x-1, (0,0) => x-y}) o4 = | x-y 0 x-1 | | 0 x2 0 | 2 3 o4 : Matrix R <--- R</pre> </td></tr> </table> </div> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="_matrix.html" title="make a matrix">matrix</a> -- make a matrix</span></li> <li><span><a href="_map_lp__Module_cm__Nothing_cm__List_rp.html" title="create a matrix by giving a doubly nested list of ring elements">map(Module,Nothing,List)</a> -- create a matrix by giving a doubly nested list of ring elements</span></li> <li><span><a href="_inputting_spa_spmatrix.html" title="">inputting a matrix</a></span></li> </ul> </div> </div> </body> </html>