--- Log opened Thu Jan 11 00:00:14 2018 | ||
-!- witness [uid10044@gateway/web/irccloud.com/x-lzbqopswhunfgnhq] has joined #shogun | 08:40 | |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has joined #shogun | 10:16 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 10:16 | |
@HeikoS | lisitsyn: | 10:16 |
---|---|---|
@HeikoS | I have become a troll that stalks you! | 10:16 |
lisitsyn | HeikoS: yeah yeah | 10:17 |
lisitsyn | :) | 10:17 |
@HeikoS | lisitsyn: hehe | 10:17 |
@HeikoS | lisitsyn: so i didnt submit workshop in the end | 10:17 |
lisitsyn | yeah it is clear | 10:17 |
@HeikoS | i got too busy the last few days and then realised it would be a shitty application | 10:17 |
@HeikoS | but lets do nips | 10:17 |
lisitsyn | HeikoS: that's true, lets do nips | 10:18 |
@HeikoS | and lets do it befiore it is a rus h:) | 10:18 |
lisitsyn | HeikoS: what is nips deadline? | 10:18 |
@HeikoS | dont know | 10:18 |
@HeikoS | but nips is in december | 10:18 |
@HeikoS | so deadline for submission paper will be may | 10:18 |
@HeikoS | so thats the time we should be prepared | 10:18 |
@HeikoS | mlpack peeps offered help as well | 10:18 |
@HeikoS | so the 4 of us could do that | 10:18 |
@HeikoS | would be fun | 10:19 |
@HeikoS | lisitsyn: I also have another question for you | 10:19 |
@HeikoS | clone | 10:19 |
@HeikoS | you said, there is a clone already | 10:19 |
lisitsyn | yeah what's with clone? | 10:19 |
@HeikoS | but I dont see/find it | 10:19 |
lisitsyn | did I? | 10:19 |
@HeikoS | I feel it has to be the same decltype as for equals | 10:19 |
@HeikoS | same idea | 10:19 |
lisitsyn | ah any? | 10:19 |
@HeikoS | try ->clone then .clone then = | 10:19 |
lisitsyn | aah you mean deep clone for sgobject | 10:19 |
@HeikoS | yep | 10:19 |
lisitsyn | no I didn't do that | 10:19 |
lisitsyn | that's true | 10:19 |
@HeikoS | ok | 10:20 |
@HeikoS | so I will just copy your equals stuff | 10:20 |
lisitsyn | but do you need to? | 10:20 |
@HeikoS | need what? | 10:20 |
lisitsyn | ah yes you have to | 10:20 |
lisitsyn | nevermind | 10:20 |
@HeikoS | yes we need a clone | 10:20 |
lisitsyn | yeah just do something similar | 10:20 |
@HeikoS | unfortunately | 10:20 |
@HeikoS | ok cool | 10:20 |
@HeikoS | lisitsyn: just wondering | 10:20 |
@HeikoS | the crucial part of the old clone was actually not copying the data | 10:20 |
@HeikoS | but more allocating an appropriate amount of memory | 10:21 |
@HeikoS | because newly created objects are all empty | 10:21 |
lisitsyn | don't get it yet | 10:21 |
@HeikoS | operator== is easy in some sense | 10:22 |
@HeikoS | as I just need to compare two pieces of memory | 10:22 |
@HeikoS | just cast them to the right type and all good | 10:22 |
@HeikoS | but clone is different. I first create a new empty object | 10:22 |
@HeikoS | then I clone each (tag,any) entry in the map | 10:23 |
@HeikoS | the newly created object already has a map | 10:23 |
@HeikoS | but the any objects in there all point to null | 10:23 |
@HeikoS | as the member variables of the newly created thing are not instantiated | 10:23 |
@HeikoS | so previously I just called operator== on any | 10:24 |
@HeikoS | now I need something like | 10:24 |
@HeikoS | any_a.copy_from(any_b) | 10:24 |
lisitsyn | kind of | 10:24 |
lisitsyn | yes | 10:24 |
@HeikoS | or better any_b = any_a | 10:24 |
@HeikoS | but I think that is taken already | 10:25 |
lisitsyn | it does copy | 10:25 |
lisitsyn | in some cases | 10:25 |
@HeikoS | but it keeps the pointer no? | 10:25 |
lisitsyn | HeikoS: check the policies | 10:25 |
@HeikoS | I am a bit confused where to look for that | 10:25 |
@HeikoS | you mean this one Any& operator=(const Any& other) | 10:26 |
lisitsyn | https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/lib/any.h#L263 | 10:26 |
@HeikoS | if (empty()) | 10:26 |
@HeikoS | { | 10:26 |
@HeikoS | policy = other.policy; | 10:26 |
@HeikoS | set_or_inherit(other); | 10:26 |
@HeikoS | return *(this); | 10:26 |
@HeikoS | } | 10:26 |
lisitsyn | HeikoS: ^ this is where copy happens | 10:26 |
lisitsyn | it is called by set_or_inherit yes | 10:26 |
@HeikoS | ok | 10:26 |
@HeikoS | so for basic types, this works | 10:27 |
@HeikoS | but if T is SGObject | 10:27 |
lisitsyn | then it should call clone | 10:27 |
@HeikoS | yeah | 10:27 |
@HeikoS | shall I put this logic in the operator= ? | 10:27 |
lisitsyn | HeikoS: https://github.com/shogun-toolbox/shogun/blob/develop/src/shogun/lib/any.h#L343 | 10:28 |
lisitsyn | here I think | 10:28 |
@HeikoS | mmh | 10:28 |
@HeikoS | you mind having a start with that? | 10:28 |
@HeikoS | just for the ->clone? | 10:28 |
@HeikoS | and then I fill in the gaps | 10:28 |
lisitsyn | HeikoS: but actually there is a tricky problem | 10:28 |
@HeikoS | as for equals? | 10:28 |
lisitsyn | yeah I can later today | 10:28 |
@HeikoS | whats the problem? | 10:29 |
lisitsyn | HeikoS: if we assign non-owning we just copy the pointer | 10:29 |
lisitsyn | but we don't call 'set' | 10:29 |
@HeikoS | yeah | 10:29 |
lisitsyn | so this thing is not even called | 10:29 |
@HeikoS | I mean this has to happen before in my eyes | 10:29 |
lisitsyn | I'd not change operator= | 10:29 |
@HeikoS | in this "if(is_empty()) | 10:29 |
lisitsyn | but add clone | 10:29 |
@HeikoS | ah ok | 10:29 |
@HeikoS | add clone method | 10:29 |
@HeikoS | I mean we can assume that policies are the same | 10:29 |
@HeikoS | so we want a method void Any::clone_from(const Any& other) | 10:30 |
lisitsyn | yeah | 10:31 |
@HeikoS | ok let me see if I can get that | 10:31 |
@HeikoS | Ill let you know how it goes and if I confuse myself Ill leave it to you :) | 10:32 |
lisitsyn | ok sure | 10:32 |
lisitsyn | https://github.com/shogun-toolbox/shogun/pull/4072 HeikoS I can't get it working still | 10:32 |
lisitsyn | it works for get_vector but does not generate the typemap for put | 10:32 |
@HeikoS | whats the problem with that? | 10:32 |
@HeikoS | mmmh no idea | 10:32 |
lisitsyn | yeah me neither | 10:32 |
@HeikoS | but seems like a small patch | 10:32 |
lisitsyn | I was debugging swig to understand why the hell it does not generate the typemap | 10:33 |
lisitsyn | no success yet | 10:33 |
@HeikoS | yeah I once went into that but left if confiused | 10:35 |
@HeikoS | lisitsyn: one more q about clone | 10:35 |
@HeikoS | lisitsyn: I will add a method to Any class | 10:35 |
@HeikoS | void Any::clone_from(cont Any& other) | 10:35 |
lisitsyn | yes | 10:35 |
@HeikoS | and then in there I will call clone_from_impl using decltype | 10:35 |
lisitsyn | HeikoS: no I think you call it from policy | 10:36 |
lisitsyn | otherwise you don't know the type | 10:36 |
lisitsyn | HeikoS: so you add virtual function to policy (clone) | 10:36 |
lisitsyn | and in there you call appropriate clone function | 10:36 |
lisitsyn | if it supports clone decltype(obj->clone()) then you do that | 10:36 |
lisitsyn | otherwise just new T(..) | 10:37 |
@HeikoS | It doesnt need to be purely virtual and then specialized in the sub-policies right? | 10:38 |
@HeikoS | I can just put it in base class | 10:38 |
@HeikoS | just looking at equals, the code in both owning and non owning seems the same | 10:39 |
@HeikoS | lisitsyn: I think I will leave the first steps to you | 10:41 |
@HeikoS | lisitsyn: will take me too much time to backengineer all the any stuff | 10:42 |
@HeikoS | lisitsyn: if you could add a minimal version (doesnt even need to work) then I can take it from there | 10:42 |
lisitsyn | HeikoS: ok :) hopefully tonight | 10:46 |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has quit [Ping timeout: 276 seconds] | 12:32 | |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has joined #shogun | 14:02 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 14:02 | |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has quit [Quit: Leaving.] | 14:38 | |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has joined #shogun | 14:38 | |
-!- mode/#shogun [+o HeikoS] by ChanServ | 14:38 | |
-shogun-buildbot:#shogun- Build deb1 - libshogun #234 is complete: Failure [failed update shogun (failure)] - http://buildbot.shogun-toolbox.org:8080/#builders/10/builds/234 | 18:35 | |
-shogun-buildbot:#shogun- Build trusty - libshogun - viennacl #253 is complete: Failure [failed update shogun (failure)] - http://buildbot.shogun-toolbox.org:8080/#builders/6/builds/253 | 18:36 | |
-!- HeikoS [~heiko@host213-122-246-7.range213-122.btcentralplus.com] has quit [Ping timeout: 276 seconds] | 18:58 | |
--- Log closed Fri Jan 12 00:00:16 2018 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!