{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/13130","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/13130/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/13130/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/13130/events","html_url":"https://github.com/JuliaLang/julia/issues/13130","id":106460086,"number":13130,"title":"Should hcat of dense and sparse matrix be sparse?","user":{"login":"pkofod","id":8431156,"avatar_url":"https://avatars.githubusercontent.com/u/8431156?v=3","gravatar_id":"","url":"https://api.github.com/users/pkofod","html_url":"https://github.com/pkofod","followers_url":"https://api.github.com/users/pkofod/followers","following_url":"https://api.github.com/users/pkofod/following{/other_user}","gists_url":"https://api.github.com/users/pkofod/gists{/gist_id}","starred_url":"https://api.github.com/users/pkofod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkofod/subscriptions","organizations_url":"https://api.github.com/users/pkofod/orgs","repos_url":"https://api.github.com/users/pkofod/repos","events_url":"https://api.github.com/users/pkofod/events{/privacy}","received_events_url":"https://api.github.com/users/pkofod/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/JuliaLang/julia/labels/sparse","name":"sparse","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-15T01:47:33Z","updated_at":"2015-10-13T17:14:51Z","closed_at":null,"body":"I wanted to hcat a dense vector B and a sparse matrix A. I expected \r\n\r\n```julia\r\nn = 5\r\nA = speye(n)\r\nB = ones(n)\r\nC = [B A]\r\n```\r\nTo return a sparse matrix C, but instead A is converted to it's dense representation, and this means C is obviously also dense. I then did \r\n```julia\r\nC = sparse([B A])\r\n```\r\nBut as @tavert pointed out over at [reddit](https://www.reddit.com/r/Julia/comments/3kz9ev/avoid_conversion_from_sparse_to_dense_and_back_to/), it is better to.\r\n\r\n```julia\r\nC = [sparse(B) A]\r\n``` \r\n\r\nMy question is, it is intended that users should do the latter, or is the current behaviour a _bug_ or at least unintended?"},"comment":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/comments/147781599","html_url":"https://github.com/JuliaLang/julia/issues/13130#issuecomment-147781599","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/13130","id":147781599,"user":{"login":"pkofod","id":8431156,"avatar_url":"https://avatars.githubusercontent.com/u/8431156?v=3","gravatar_id":"","url":"https://api.github.com/users/pkofod","html_url":"https://github.com/pkofod","followers_url":"https://api.github.com/users/pkofod/followers","following_url":"https://api.github.com/users/pkofod/following{/other_user}","gists_url":"https://api.github.com/users/pkofod/gists{/gist_id}","starred_url":"https://api.github.com/users/pkofod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkofod/subscriptions","organizations_url":"https://api.github.com/users/pkofod/orgs","repos_url":"https://api.github.com/users/pkofod/repos","events_url":"https://api.github.com/users/pkofod/events{/privacy}","received_events_url":"https://api.github.com/users/pkofod/received_events","type":"User","site_admin":false},"created_at":"2015-10-13T17:14:51Z","updated_at":"2015-10-13T17:14:51Z","body":"Well, of course :) I'll have a go at it."}}