{"action":"created","issue":{"url":"https://api.github.com/repos/scalanlp/breeze/issues/637","repository_url":"https://api.github.com/repos/scalanlp/breeze","labels_url":"https://api.github.com/repos/scalanlp/breeze/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/scalanlp/breeze/issues/637/comments","events_url":"https://api.github.com/repos/scalanlp/breeze/issues/637/events","html_url":"https://github.com/scalanlp/breeze/issues/637","id":224535521,"number":637,"title":"The right way to use rank function?","user":{"login":"qiaoruntao","id":5846433,"avatar_url":"https://avatars0.githubusercontent.com/u/5846433?v=3","gravatar_id":"","url":"https://api.github.com/users/qiaoruntao","html_url":"https://github.com/qiaoruntao","followers_url":"https://api.github.com/users/qiaoruntao/followers","following_url":"https://api.github.com/users/qiaoruntao/following{/other_user}","gists_url":"https://api.github.com/users/qiaoruntao/gists{/gist_id}","starred_url":"https://api.github.com/users/qiaoruntao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiaoruntao/subscriptions","organizations_url":"https://api.github.com/users/qiaoruntao/orgs","repos_url":"https://api.github.com/users/qiaoruntao/repos","events_url":"https://api.github.com/users/qiaoruntao/events{/privacy}","received_events_url":"https://api.github.com/users/qiaoruntao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-04-26T17:00:12Z","updated_at":"2017-04-27T00:34:41Z","closed_at":null,"body":"Hello, \r\nI'm struggling with the usage of rank function.\r\nThe rank function is the one highlighted in the picture, it seems to take a Matrix type value and output an Int value.\r\n![_20170427004433](https://cloud.githubusercontent.com/assets/5846433/25446047/c93357a6-2ae2-11e7-8d81-b44c15787d1a.png)\r\nHowever I find it not possible to use it, when I try compiling following codes, it yields some errors with implicit value.\r\nFollowing are my test codes:\r\n```\r\n    var test:Int=rank[DenseMatrix[Int],Int](DenseMatrix.eye[Int](3))\r\n    test=rank(DenseMatrix.eye[Int](3))\r\n    test=rank(DenseMatrix.eye[Float](3))\r\n    test=rank(DenseVector.ones(1))\r\n```\r\n\r\nAnd these are the errors, none of four lines is passed:\r\n![image](https://cloud.githubusercontent.com/assets/5846433/25446246/8d2549e4-2ae3-11e7-9644-83bd49868918.png)\r\nI'm really confused why it cannot be compiled as it should be, simply take a DenseMatrix and return an Int or at least give the result since I provide enough type info.\r\n\r\nMy platform: win10 x64\r\nBreeze version: 0.12 both breeze and breeze_native are added\r\nScala version: 2.11.8\r\n\r\n\r\nthanks"},"comment":{"url":"https://api.github.com/repos/scalanlp/breeze/issues/comments/297578820","html_url":"https://github.com/scalanlp/breeze/issues/637#issuecomment-297578820","issue_url":"https://api.github.com/repos/scalanlp/breeze/issues/637","id":297578820,"user":{"login":"qiaoruntao","id":5846433,"avatar_url":"https://avatars0.githubusercontent.com/u/5846433?v=3","gravatar_id":"","url":"https://api.github.com/users/qiaoruntao","html_url":"https://github.com/qiaoruntao","followers_url":"https://api.github.com/users/qiaoruntao/followers","following_url":"https://api.github.com/users/qiaoruntao/following{/other_user}","gists_url":"https://api.github.com/users/qiaoruntao/gists{/gist_id}","starred_url":"https://api.github.com/users/qiaoruntao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiaoruntao/subscriptions","organizations_url":"https://api.github.com/users/qiaoruntao/orgs","repos_url":"https://api.github.com/users/qiaoruntao/repos","events_url":"https://api.github.com/users/qiaoruntao/events{/privacy}","received_events_url":"https://api.github.com/users/qiaoruntao/received_events","type":"User","site_admin":false},"created_at":"2017-04-27T00:34:41Z","updated_at":"2017-04-27T00:34:41Z","body":"Sorry, I may not make myself clear. I tried getting rank from DenseMatrix[Float].\r\nHowever the following code doesn't work:\r\n`var test:Int=rank(DenseMatrix.eye[Float](3))`\r\nThe error is implicit value not found:\r\n![image](https://cloud.githubusercontent.com/assets/5846433/25462711/7a4c3324-2b23-11e7-8f2b-b364a17a4bee.png)\r\n\r\nI tried adding some type info into it, using code:\r\n`var test:Int=rank[DenseMatrix[Float],Int](DenseMatrix.eye[Float](3))`\r\nHowever there was no luck:\r\n![image](https://cloud.githubusercontent.com/assets/5846433/25462748/a8f45d96-2b23-11e7-8e38-e5c9c2c3bb4a.png)\r\n\r\nAnd yes Double type works, my code is:\r\n`var test:Int=rank(DenseMatrix.eye[Double](3))`\r\n\r\nSo does this means rank function only supports Double? If this is true, support Float by default would be really great as they are different only by precision.\r\n\r\nthanks"}}
{"actor":{"display_login":"qiaoruntao"}}