Commit 4dbc3513 authored by Laurent Belcour's avatar Laurent Belcour

[Python] Correction of bugs and compile issues on Windows

parent b5d5caae
......@@ -287,7 +287,7 @@ static void brdf2data(const ptr<function>& f, ptr<data>& d) {
x[d->parametrization().dimX() + j] = y[j];
}
d->set(i, y);
d->set(i, x);
}
}
......@@ -399,4 +399,4 @@ PYBIND11_MODULE(alta, m) {
m.def("data2data", data2data);
m.def("data2stats", data2stats);
m.def("brdf2data", brdf2data);
}
\ No newline at end of file
}
......@@ -37,6 +37,12 @@ static vec vec_sub(const vec& a, const vec& b) {
return a - b;
}
/* Size of vec
*/
static size_t vec_size(const vec& a) {
return a.size();
}
/* Specific convert a vec to a string
*/
static std::string vec_str(const vec& x) {
......@@ -63,7 +69,7 @@ inline void register_vec(py::module& m) {
}))
.def("__add__", &vec_add)
.def("__sub__", &vec_sub)
.def("__len__", &vec::size)
.def("__len__", &vec_size)
.def("__getitem__", [](const vec &s, unsigned int i) {
if (i >= s.size()) throw py::index_error();
return s[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment