{"action":"created","issue":{"url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/23","repository_url":"https://api.github.com/repos/HPCE/hpce-2016-cw2","labels_url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/23/comments","events_url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/23/events","html_url":"https://github.com/HPCE/hpce-2016-cw2/issues/23","id":185628883,"number":23,"title":"Setting K at construction time, any tips?","user":{"login":"lloydabbott","id":22688566,"avatar_url":"https://avatars.githubusercontent.com/u/22688566?v=3","gravatar_id":"","url":"https://api.github.com/users/lloydabbott","html_url":"https://github.com/lloydabbott","followers_url":"https://api.github.com/users/lloydabbott/followers","following_url":"https://api.github.com/users/lloydabbott/following{/other_user}","gists_url":"https://api.github.com/users/lloydabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/lloydabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloydabbott/subscriptions","organizations_url":"https://api.github.com/users/lloydabbott/orgs","repos_url":"https://api.github.com/users/lloydabbott/repos","events_url":"https://api.github.com/users/lloydabbott/events{/privacy}","received_events_url":"https://api.github.com/users/lloydabbott/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-27T10:20:54Z","updated_at":"2016-10-27T11:42:42Z","closed_at":"2016-10-27T11:42:42Z","body":"So in section 6 there's this advice:\r\n> You don't want the overhead of calling getenv all over the place, so I would suggest calling it once at construction time and caching it in a member variable for the lifetime of the FFT instance.\r\n> \r\n> Note: this is an in-place modification, rather than a new class.\r\n\r\nI'm not super familiar with C++, especially classes etc, so I'm having a bit of trouble getting through this. I would add a member variable `K` to the class `hpce::la1613::fast_fourier_transform_taskgroup` to hold the value of `HPCE_FFT_RECURSION_K`. That much I'm ok with because that can be accessed as `this.K` when working through the transform.\r\n\r\nSetting it at construction time is what I'm struggling with. I was thinking to add a member function which then reads `HPCE_FFT_RECURSION_K` into `this.K`. This would then be called in the main function after `transform=fourier_transform::CreateTransform(name);` (line 63). Something like `transform->read_K();` would do it.\r\nThe trouble with this is that in the main function in `time_fourier_transform` a generic form transform is used so with what I've described above, I would have to create a `K` and `read_K()` for each transform implementation, specifying which environment `K` variable to read.\r\n\r\nAm I following the right lines here?"},"comment":{"url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/comments/256618455","html_url":"https://github.com/HPCE/hpce-2016-cw2/issues/23#issuecomment-256618455","issue_url":"https://api.github.com/repos/HPCE/hpce-2016-cw2/issues/23","id":256618455,"user":{"login":"lloydabbott","id":22688566,"avatar_url":"https://avatars.githubusercontent.com/u/22688566?v=3","gravatar_id":"","url":"https://api.github.com/users/lloydabbott","html_url":"https://github.com/lloydabbott","followers_url":"https://api.github.com/users/lloydabbott/followers","following_url":"https://api.github.com/users/lloydabbott/following{/other_user}","gists_url":"https://api.github.com/users/lloydabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/lloydabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lloydabbott/subscriptions","organizations_url":"https://api.github.com/users/lloydabbott/orgs","repos_url":"https://api.github.com/users/lloydabbott/repos","events_url":"https://api.github.com/users/lloydabbott/events{/privacy}","received_events_url":"https://api.github.com/users/lloydabbott/received_events","type":"User","site_admin":false},"created_at":"2016-10-27T11:42:42Z","updated_at":"2016-10-27T11:42:42Z","body":"Ok I have a thing working now, the K variable assignment function is just included in the member variable definition. The only changes are in the header and the transform source files"}}
{"actor":{"display_login":"lloydabbott"}}