~knarkles/pyeigen/trunk

« back to all changes in this revision

Viewing changes to source/templates/vector_impl.h

  • Committer: Jussi Lepistö
  • Date: 2010-05-16 12:36:53 UTC
  • Revision ID: jussi.lepisto@iki.fi-20100516123653-jezddgb9cbpmmkq8
Fix vector slicing bug, add unit tests for the error case

Show diffs side-by-side

added added

removed removed

Lines of Context:
841
841
                return -1;
842
842
        }
843
843
 
844
 
        for(Py_ssize_t index = index1; index < index2; ++index)
 
844
        for(Py_ssize_t index = 0; index < length; ++index)
845
845
        {
846
 
                self->matrix[(int)index] =
 
846
                self->matrix[(int)(index1 + index)] =
847
847
                        (Scalar)PyFloat_AsDouble(PySequence_GetItem(value, index));
848
848
                if(PyErr_Occurred())
849
849
                        return -1;