| 78 | |
| 79 | |
| 80 | void cv__setitem__(cv& c, long p, double val) |
| 81 | { |
| 82 | if (p < 0) { |
| 83 | p = c.size() + p; // negative index |
| 84 | } |
| 85 | if (p > c.size()-1) { |
| 86 | PyErr_SetString( PyExc_IndexError, "index out of range" |
| 87 | ); |
| 88 | throw py::error_already_set(); |
| 89 | } |
| 90 | c(p) = val; |
| 91 | } |
| 92 | |
| 93 | double cv__getitem__(cv& m, long r) |
| 94 | { |