Skip to content
Snippets Groups Projects
Commit f91149dc authored by Philip Mueller, HS's avatar Philip Mueller, HS
Browse files

Added the new constructors to the sample array interface of pyYggdrasil.

parent bbd01ac2
No related branches found
No related tags found
No related merge requests found
......@@ -217,6 +217,16 @@ pyYggdrasil_sampleContainersWrapper(
"This constructor constructs a sample array by deep copying the sourc array src.",
py::arg("src")
)
.def(py::init([](const SampleList_t& sl) -> SampleArray_t
{return SampleArray_t(sl);}),
"This constructor performs a deep copy of the sample list src.",
py::arg("src")
)
.def(py::init([](const SampleCollection_t sc) -> SampleArray_t
{return SampleArray_t(sc);}),
"This constructor performs a deep copy of the sample collection src.",
py::arg("src")
)
.def(py::init([](const MatrixRef_t& mat, eMatrixViewRow view) -> SampleArray_t
{
//This will also check for infinity; according to the Eigen manual
......@@ -233,6 +243,12 @@ pyYggdrasil_sampleContainersWrapper(
py::arg("mat"),
py::arg("view")
)
.def("clone", [](const SampleArray_t& sa) -> SampleArray_t
{return sa.clone();},
"This function performs a deep copy of *this."
" This function allows to copy a container without the need of knowing its type."
" This is interesting when exploiting duck typing."
)
/*
* Operators
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment