--- Log opened Sat Jul 02 00:00:38 2011 | ||
f-x | sonney2k: still around? | 00:10 |
---|---|---|
@sonney2k | f-x, yes | 00:13 |
f-x | sonney2k: a bit of a doubt with the templating | 00:13 |
@sonney2k | listening | 00:13 |
f-x | right now StreamingFile (topmost base class) has | 00:14 |
f-x | dummy implementations of all the get_*_vector functions | 00:14 |
@sonney2k | yes | 00:14 |
f-x | and the derived classes implement whichever functions are apt for that particular feature | 00:14 |
f-x | so the base class function is called if left unimplemented in the derived class | 00:15 |
@sonney2k | ok | 00:15 |
f-x | now if we template the derived class, say StreamingFileFromSimpleFeatures<T> | 00:15 |
f-x | for T==int, we'd need to call get_int_vector etc | 00:15 |
f-x | but for say T==float64_t, we'd call get_real_vector | 00:16 |
f-x | right? | 00:16 |
@sonney2k | yes | 00:16 |
f-x | so here's my doubt: | 00:16 |
f-x | in the class definition, all the appropriate get_*_vector functions must be present, shouldn't they? | 00:16 |
f-x | i mean, T==int implements get_int_vector | 00:16 |
f-x | T==double implements get_real_vector etc | 00:17 |
f-x | so the class must contain the declarations for ALL these functions | 00:17 |
f-x | and the specialized version must be defined depending on the type | 00:17 |
@sonney2k | yes | 00:18 |
f-x | sonney2k: say, for example that we call get_real_vector() on a class with type==int | 00:18 |
f-x | that should be an SG_ERROR or something similar | 00:18 |
f-x | but if we call get_real_vector on a class with type==float64_t, it should work | 00:19 |
f-x | am i being somewhat understandable? | 00:19 |
@sonney2k | yes | 00:19 |
f-x | sonney2k: so basically each function's implementation should depend on type T? | 00:20 |
@sonney2k | yeah and since we don't have tempalted get_*vector stuff we have a problem | 00:21 |
f-x | sonney2k: right.. | 00:21 |
f-x | i mean we can specialize get_int_vector for T==int | 00:22 |
f-x | but the other functions still need to be defined somehow | 00:22 |
f-x | we can have a trivial implementation for each function saying something like | 00:22 |
f-x | base::get_int_vector() | 00:22 |
@sonney2k | f-x, but then you could again use macros to resolve this or? | 00:22 |
f-x | or void get_*_vector() { base_get_*_vector() } | 00:22 |
f-x | base::get_*_vector() i mean | 00:23 |
f-x | sonney2k: yes, that's possible.. so is this implementation alright? | 00:23 |
f-x | calling the base class function? | 00:23 |
f-x | i'm asking because it looks a bit dirty.. maybe there's a cleaner solution i'm not seeing | 00:24 |
@sonney2k | f-x, say if get_vector was templated - then we wouldn't have this problem or? | 00:24 |
f-x | sonney2k: exactly - that would solve everything | 00:24 |
f-x | but we would need to template the base class too | 00:24 |
@sonney2k | f-x, but with get_vector being templated - we cannot do the inheritance nicely... | 00:25 |
f-x | sonney2k: yes.. the code would be dirty, but the design would be nice | 00:25 |
f-x | it is possible to make it work, but not without some ugly-looking code | 00:26 |
@sonney2k | but if you would add a private get_vector etc function in the derived class that is specialized the problem would be solved for that class right? | 00:26 |
@sonney2k | or wait even better | 00:26 |
@sonney2k | you can do that in the base class | 00:26 |
@sonney2k | I mean you just define that function templated | 00:26 |
@sonney2k | and make it call the specialized variants depending on type | 00:27 |
@sonney2k | since this function is never overloaded it will work | 00:28 |
f-x | sonney2k: a single get_vector() function | 00:28 |
f-x | which specializes based on class type T | 00:28 |
@sonney2k | f-x, in addition to all these get_*_vector functions | 00:28 |
@sonney2k | yes | 00:28 |
@sonney2k | just a templated function not class | 00:29 |
f-x | sonney2k: i'm beginning to see your point | 00:29 |
@sonney2k | f-x, I would suggest to try this out just for vectors | 00:33 |
@sonney2k | if it works it would even make sense to use this principle for file interfaces etc | 00:34 |
f-x | sonney2k: okay.. sounds like a great idea.. will need to try it first to get a hang of it | 00:35 |
f-x | i'll do it now | 00:35 |
alesis_ | sonney2k, is shogun currently fully working (and are SimpleFeatures still supported)? | 00:44 |
-!- alesis_ is now known as alesis-novik | 00:44 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has quit [Quit: Leaving] | 00:44 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has joined #shogun | 00:45 | |
alesis-novik | sonney2k, is shogun currently fully working (and are SimpleFeatures still supported)? | 00:45 |
-!- blackburn [~blackburn@31.28.40.202] has quit [Quit: Leaving.] | 00:49 | |
@sonney2k | alesis-novik, sure | 00:50 |
alesis-novik | ah, I know where my mistake was. | 01:00 |
@sonney2k | nite everyone | 01:17 |
-!- serialhex [~quassel@99-101-148-183.lightspeed.wepbfl.sbcglobal.net] has joined #shogun | 02:01 | |
-!- f-x [~user@117.192.203.89] has quit [Remote host closed the connection] | 02:44 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has quit [Ping timeout: 240 seconds] | 02:49 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has joined #shogun | 02:51 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has quit [Ping timeout: 258 seconds] | 03:51 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has joined #shogun | 03:53 | |
-!- in3xes_ [~in3xes@180.149.49.230] has quit [Quit: Ooops..!!] | 05:01 | |
-!- alesis-novik [~alesis@cpat001.wlan.net.ed.ac.uk] has quit [Quit: I'll be Bach] | 05:07 | |
-!- in3xes_ [~in3xes@180.149.49.227] has joined #shogun | 08:22 | |
-!- in3xes [~in3xes@180.149.49.227] has quit [Ping timeout: 276 seconds] | 08:26 | |
-!- blackburn [~blackburn@31.28.40.202] has joined #shogun | 11:34 | |
-!- in3xes1 [~in3xes@210.212.58.111] has joined #shogun | 13:13 | |
-!- in3xes_ [~in3xes@180.149.49.227] has quit [Ping timeout: 240 seconds] | 13:16 | |
CIA-32 | shogun: Alesis Novik master * r45938db / (4 files in 2 dirs): Migrating to SG* - http://bit.ly/j6iPhg | 13:17 |
CIA-32 | shogun: Soeren Sonnenburg master * r9d54d81 / (4 files in 2 dirs): | 13:17 |
CIA-32 | shogun: Merge pull request #164 from alesis/gmm | 13:17 |
CIA-32 | shogun: GMM overhaul with SG* - http://bit.ly/jf0g05 | 13:17 |
CIA-32 | shogun: Alesis Novik master * rb489910 / src/libshogun/clustering/GMM.cpp : Bug fixes for GMM - http://bit.ly/jLk3oP | 13:17 |
-!- in3xes_ [~in3xes@180.149.49.227] has joined #shogun | 14:33 | |
-!- in3xes1 [~in3xes@210.212.58.111] has quit [Ping timeout: 240 seconds] | 14:36 | |
-!- in3xes1 [~in3xes@180.149.49.227] has joined #shogun | 15:36 | |
-!- in3xes_ [~in3xes@180.149.49.227] has quit [Ping timeout: 240 seconds] | 15:40 | |
-!- blackburn [~blackburn@31.28.40.202] has quit [Quit: Leaving.] | 16:33 | |
-!- in3xes1 is now known as in3xes | 16:40 | |
-!- f-x [~user@117.192.218.221] has joined #shogun | 16:48 | |
-!- in3xes [~in3xes@180.149.49.227] has quit [Quit: Leaving] | 18:46 | |
-!- in3xes [~in3xes@180.149.49.227] has joined #shogun | 18:52 | |
-!- f-x [~user@117.192.218.221] has quit [Remote host closed the connection] | 19:25 | |
-!- in3xes_ [~in3xes@59.163.196.162] has joined #shogun | 20:28 | |
-!- in3xes [~in3xes@180.149.49.227] has quit [Ping timeout: 258 seconds] | 20:31 | |
CIA-32 | shogun: Alesis Novik master * rdf56be0 / (2 files): Added set_* for GMM - http://bit.ly/iXeQTG | 20:47 |
CIA-32 | shogun: Soeren Sonnenburg master * r69e1291 / (2 files): | 20:47 |
CIA-32 | shogun: Merge pull request #165 from alesis/gmm | 20:47 |
CIA-32 | shogun: Added set_* for GMM and cluster methods - http://bit.ly/mcYLC0 | 20:47 |
-!- in3xes_ is now known as in3xes | 20:47 | |
-!- in3xes [~in3xes@59.163.196.162] has quit [Quit: Leaving] | 21:26 | |
-!- in3xes [~in3xes@180.149.49.227] has joined #shogun | 21:27 | |
-!- blackburn1 [~blackburn@188.122.238.13] has joined #shogun | 22:02 | |
-!- blackburn1 [~blackburn@188.122.238.13] has quit [Quit: Leaving.] | 22:05 | |
-!- blackburn [~blackburn@188.122.238.13] has joined #shogun | 22:05 | |
-!- f-x [~user@117.192.218.221] has joined #shogun | 22:56 | |
blackburn | нет | 23:02 |
blackburn | wrong window lol | 23:02 |
bettyboo | hoho!! | 23:02 |
--- Log closed Sun Jul 03 00:00:40 2011 |
Generated by irclog2html.py 2.10.0 by Marius Gedminas - find it at mg.pov.lt!