Popular recipes tagged "meta:requires=whrandom" and "graphics"http://code.activestate.com/recipes/tags/meta:requires=whrandom+graphics/2002-04-15T18:22:16-07:00ActiveState Code Recipesvector: A list based vector class supporting elementwise operations (Python)
2002-04-15T18:22:16-07:00Alexander Pletzerhttp://code.activestate.com/recipes/users/98107/http://code.activestate.com/recipes/52272-vector-a-list-based-vector-class-supporting-elemen/
<p style="color: grey">
Python
recipe 52272
by <a href="/recipes/users/98107/">Alexander Pletzer</a>
(<a href="/recipes/tags/graphics/">graphics</a>).
Revision 3.
</p>
<p>This vector class stores elements in a list and hence allows the 'vector' to grow
dynamically. Common mathematical functions (sin, cosh, etc) are supported elementwise
and so are a number of 'external' operations (dot for the inner product between vectors,
norm, sum etc.). This class does not rely on NumPy but can be used in conjunction with
a 'sparse' matrix class to solve linear systems. Tested using Python 2.0 and Jython 2.0.</p>