{"action":"created","issue":{"url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/232","repository_url":"https://api.github.com/repos/viennacl/viennacl-dev","labels_url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/232/labels{/name}","comments_url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/232/comments","events_url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/232/events","html_url":"https://github.com/viennacl/viennacl-dev/issues/232","id":227389945,"number":232,"title":"Copying Complex Objects to Eigen Objects?","user":{"login":"cdeterman","id":3091179,"avatar_url":"https://avatars1.githubusercontent.com/u/3091179?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeterman","html_url":"https://github.com/cdeterman","followers_url":"https://api.github.com/users/cdeterman/followers","following_url":"https://api.github.com/users/cdeterman/following{/other_user}","gists_url":"https://api.github.com/users/cdeterman/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeterman/subscriptions","organizations_url":"https://api.github.com/users/cdeterman/orgs","repos_url":"https://api.github.com/users/cdeterman/repos","events_url":"https://api.github.com/users/cdeterman/events{/privacy}","received_events_url":"https://api.github.com/users/cdeterman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-09T14:41:20Z","updated_at":"2017-05-09T18:09:52Z","closed_at":null,"body":"I am working on implementing some conversions from complex Eigen matrices to/from viennacl matrices.  I understand there is no native complex data types but instead expanded to have real/imaginary components in every other column.\r\n\r\nThat said, I have run in to a problem when trying to use the copy command.  If I want to copy a matrix_slice object I am able to do it directly to a Eigen::Matrix object\r\n\r\n```c++\r\nEigen::MatrixXf Am;\r\nviennacl::matrix_slice<viennacl::matrix<float> > Av;\r\n\r\nviennacl::copy(Av, Am);\r\n```\r\n\r\nHowever, if I try to copy to a 'real' component of a complex Eigen Matrix object I get an error.\r\n\r\n```c++\r\nEigen::MatrixXcf Am;\r\nviennacl::matrix_slice<viennacl::matrix<float> > Av;\r\n\r\nviennacl::copy(Av, Am.real());\r\n```\r\n\r\neven explicitly casting the object as Eigen Matrix type results in error:\r\n\r\n```c++\r\nviennacl::copy(Av, (Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic>)Am.real());\r\n\r\nerror: no matching function for call to ‘copy(viennacl::matrix_slice<viennacl::matrix<float, viennacl::row_major> >&, Eigen::Matrix<float, -1, -1>)’\r\n     viennacl::copy(A_sub, (Eigen::Matrix<float, Eigen::Dynamic, Eigen::Dynamic>)(Am.real()));\r\n```\r\n\r\nAny thoughts why this would be the case or how I can accomplish this?"},"comment":{"url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/comments/300253883","html_url":"https://github.com/viennacl/viennacl-dev/issues/232#issuecomment-300253883","issue_url":"https://api.github.com/repos/viennacl/viennacl-dev/issues/232","id":300253883,"user":{"login":"cdeterman","id":3091179,"avatar_url":"https://avatars1.githubusercontent.com/u/3091179?v=3","gravatar_id":"","url":"https://api.github.com/users/cdeterman","html_url":"https://github.com/cdeterman","followers_url":"https://api.github.com/users/cdeterman/followers","following_url":"https://api.github.com/users/cdeterman/following{/other_user}","gists_url":"https://api.github.com/users/cdeterman/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeterman/subscriptions","organizations_url":"https://api.github.com/users/cdeterman/orgs","repos_url":"https://api.github.com/users/cdeterman/repos","events_url":"https://api.github.com/users/cdeterman/events{/privacy}","received_events_url":"https://api.github.com/users/cdeterman/received_events","type":"User","site_admin":false},"created_at":"2017-05-09T18:09:52Z","updated_at":"2017-05-09T18:09:52Z","body":"Ok, thanks, I will see what I can do.  Could you help clarify why copying from the 'real' matrix to a `viennacl::matrix` does happen to work without a problem whereas GPU->CPU fails (as above)?\r\n\r\n```c++\r\nEigen::MatrixXcf Am;\r\nviennacl::matrix_slice<viennacl::matrix<float> > Av;\r\n\r\nviennacl::copy(Am.real(), Av);\r\n```"}}
{"actor":{"display_login":"cdeterman"}}