MCPcopy Create free account
hub / github.com/cvanaret/Uno / to_owned_array

Function to_owned_array

interfaces/Python/python_modules/Result.cpp:14–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 // vectors safe from mutation and lets consumers such as pyOptSparse scale the returned arrays in place
13 template <typename DoubleContainer>
14 py::array_t<double> to_owned_array(const DoubleContainer& vector) {
15 return py::array_t<double>(static_cast<py::ssize_t>(vector.size()), vector.data());
16 }
17
18 void define_Result(py::module& module) {
19 py::class_<Result>(module, "Result")

Callers 1

define_ResultFunction · 0.85

Calls 2

sizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected