The main use case I had in mind was making Distribution a base class. Methods like: float64_t CHMM::best_path(int32_t dimension); SGVector<float64_t> CGMM::cluster(SGVector<float64_t> point); can be translated easily, and still fall within the meaning of what a "get" method does. But on a second thought, I think I might have been a little rash/lazy ":D
On Sun, Jun 30, 2019 at 1:33 PM Heiko Strathmann <heiko.strathm...@gmail.com> wrote: > gmm.get_real_vector("cluster", point) > > Things like these should be done via a base interface, here simply :apply > > On Sun, 30 Jun 2019 at 13:31, Heiko Strathmann <heiko.strathm...@gmail.com> > wrote: > >> We could template the arguments. But I am unsure this really is a good >> idea with the functions. Where would be the use case where the getter >> doesn’t work? >> >> On Sat, 29 Jun 2019 at 20:26, Ahmed Essam <theartful...@gmail.com> wrote: >> >>> Hello all, >>> >>> Do you think it's worth considering extending the behaviour of get(name, >>> index) to try to run a function that accepts an integer parameter. >>> So for example we can run hmm.get("best_path", i) to call best_path with >>> i as a parameter. >>> >>> I believe we can also extend this to accept any number of parameters of >>> the same type by having something like get(std::string name, std::vector<T> >>> params). So in python we might do something like >>> get_sometype("some_lazy_parameter", [1, 2, 3, 4]). This can be done using >>> C++ function binding magic. So in GMM for example we might do >>> gmm.get_real_vector("cluster", point). And this can be made as fancy as we >>> like (to specify parameter names and having default values for example). >>> >>> Thanks, >>> Ahmed Essam. >>> >> -- >> Sent from my phone >> > -- > Sent from my phone >