Loads the slice data, start, stop, and step into our C++ linOp. The semantics of the slice operator is treated exactly the same as in Python. Note that the 'None' cases had to be handled at the wrapper level, since we must load integers into our vector.
(linC, linPy)
| 187 | |
| 188 | |
| 189 | def set_slice_data(linC, linPy) -> None: |
| 190 | """ |
| 191 | Loads the slice data, start, stop, and step into our C++ linOp. |
| 192 | The semantics of the slice operator is treated exactly the same as in |
| 193 | Python. Note that the 'None' cases had to be handled at the wrapper level, |
| 194 | since we must load integers into our vector. |
| 195 | """ |
| 196 | |
| 197 | for sl in linPy.data: |
| 198 | slice_vec = cvxcore.IntVector() |
| 199 | for var in [sl.start, sl.stop, sl.step]: |
| 200 | slice_vec.push_back(int(var)) |
| 201 | linC.push_back_slice_vec(slice_vec) |
| 202 | |
| 203 | |
| 204 | def build_lin_op_tree(root_linPy, linPy_to_linC) -> None: |
no test coverage detected