| 478 | } |
| 479 | template <class T> |
| 480 | void |
| 481 | FixedVArray<T>::setitem_vector (PyObject* index, const FixedVArray<T>& data) |
| 482 | { |
| 483 | if (!_writable) |
| 484 | throw std::invalid_argument ("Fixed V-array is read-only."); |
| 485 | |
| 486 | size_t start = 0; |
| 487 | size_t end = 0; |
| 488 | size_t sliceLength = 0; |
| 489 | Py_ssize_t step; |
| 490 | extract_slice_indices (index, start, end, step, sliceLength, _length); |
| 491 | |
| 492 | if ((size_t) data.len() != sliceLength) |
| 493 | { |
| 494 | PyErr_SetString (PyExc_IndexError, |
| 495 | "Dimensions of source do not match destination"); |
| 496 | boost::python::throw_error_already_set(); |
| 497 | } |
| 498 | |
| 499 | if (_indices) |
| 500 | { |
| 501 | for (size_t i = 0; i < sliceLength; ++i) |
| 502 | { |
| 503 | _ptr[raw_ptr_index(start + i*step)*_stride] = data[i]; |
| 504 | } |
| 505 | } |
| 506 | else |
| 507 | { |
| 508 | for (size_t i = 0; i < sliceLength; ++i) |
| 509 | { |
| 510 | _ptr[(start + i*step)*_stride] = data[i]; |
| 511 | } |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | template <class T> |
| 516 | void |
nothing calls this directly
no test coverage detected