Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
Maps every element of to its position.

        def numbering(v):
  """ Maps every element of to its position."""
  return zip(range(len(v)), v)
        


src/p/y/py-pod-1.0/pod/linalg.py   py-pod(Download)
 
from util import NullHandler
from util import numbering
from util import prod_scalar
 
    dr = self.get_dim_row()
    dc = self.get_dim_col()
    for k, i in numbering(range(0, r) + range(r+1, dr)):
      for l, j in numbering(range(0, c) + range(c+1, dc)):
        v = self.get_value(i, j)
  def set_values(self, *values):
    """ Using specified values to initialize the vector. """
    for n, v in numbering(values):
      self.set_component(n, v)
    return self