{"action":"created","issue":{"url":"https://api.github.com/repos/stan-dev/stan/issues/1342","labels_url":"https://api.github.com/repos/stan-dev/stan/issues/1342/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/stan/issues/1342/comments","events_url":"https://api.github.com/repos/stan-dev/stan/issues/1342/events","html_url":"https://github.com/stan-dev/stan/issues/1342","id":59958753,"number":1342,"title":"indexing error issue in transformed data","user":{"login":"bob-carpenter","id":3383807,"avatar_url":"https://avatars.githubusercontent.com/u/3383807?v=3","gravatar_id":"","url":"https://api.github.com/users/bob-carpenter","html_url":"https://github.com/bob-carpenter","followers_url":"https://api.github.com/users/bob-carpenter/followers","following_url":"https://api.github.com/users/bob-carpenter/following{/other_user}","gists_url":"https://api.github.com/users/bob-carpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/bob-carpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bob-carpenter/subscriptions","organizations_url":"https://api.github.com/users/bob-carpenter/orgs","repos_url":"https://api.github.com/users/bob-carpenter/repos","events_url":"https://api.github.com/users/bob-carpenter/events{/privacy}","received_events_url":"https://api.github.com/users/bob-carpenter/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/stan-dev/stan/labels/Bug","name":"Bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"syclik","id":425751,"avatar_url":"https://avatars.githubusercontent.com/u/425751?v=3","gravatar_id":"","url":"https://api.github.com/users/syclik","html_url":"https://github.com/syclik","followers_url":"https://api.github.com/users/syclik/followers","following_url":"https://api.github.com/users/syclik/following{/other_user}","gists_url":"https://api.github.com/users/syclik/gists{/gist_id}","starred_url":"https://api.github.com/users/syclik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syclik/subscriptions","organizations_url":"https://api.github.com/users/syclik/orgs","repos_url":"https://api.github.com/users/syclik/repos","events_url":"https://api.github.com/users/syclik/events{/privacy}","received_events_url":"https://api.github.com/users/syclik/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/stan-dev/stan/milestones/14","html_url":"https://github.com/stan-dev/stan/milestones/v2.6.2","labels_url":"https://api.github.com/repos/stan-dev/stan/milestones/14/labels","id":1004310,"number":14,"title":"v2.6.2","description":"Next version after 2.6.1.","creator":{"login":"syclik","id":425751,"avatar_url":"https://avatars.githubusercontent.com/u/425751?v=3","gravatar_id":"","url":"https://api.github.com/users/syclik","html_url":"https://github.com/syclik","followers_url":"https://api.github.com/users/syclik/followers","following_url":"https://api.github.com/users/syclik/following{/other_user}","gists_url":"https://api.github.com/users/syclik/gists{/gist_id}","starred_url":"https://api.github.com/users/syclik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syclik/subscriptions","organizations_url":"https://api.github.com/users/syclik/orgs","repos_url":"https://api.github.com/users/syclik/repos","events_url":"https://api.github.com/users/syclik/events{/privacy}","received_events_url":"https://api.github.com/users/syclik/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":6,"state":"open","created_at":"2015-03-03T16:55:40Z","updated_at":"2015-03-05T16:03:04Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-03-05T14:29:39Z","updated_at":"2015-03-05T21:17:00Z","closed_at":null,"body":"Here's a minimal version of an error Aki pointed out on stan-users that causes an issue in the current develop branch of CmdStan/Stan:\r\n\r\nmodel3.stan\r\n```\r\ndata {\r\n  int<lower=1> M;\r\n  int<lower=1> N;\r\n  matrix[M,N] x;\r\n} \r\ntransformed data {\r\n  matrix[M,N] z;\r\n\r\n  print(\"M=\",M);\r\n  print(\"N=\",N);\r\n  print(\"x=\",x);\r\n\r\n  for (n in 1:N)\r\n    for (m in 1:M)\r\n      z[m,n] <- x[m,n];\r\n}\r\nparameters {\r\n  real<lower=0,upper=1> theta;\r\n}\r\nmodel {\r\n}\r\n```\r\n\r\ndata1.R\r\n```\r\nM <- 3\r\nN <- 3\r\nx <- structure(c(1, 2, 3, 4, 5, 6, 7, 8, 9), .Dim = c(3,3))\r\n```\r\n\r\ndata2.R\r\n```\r\nM <- 2\r\nN <- 3\r\nx <- structure(c(1, 2, 3, 4, 5, 6), .Dim = c(2,3))\r\n```\r\n\r\nOutput for data1.R:\r\n\r\n```\r\n~/temp2/aki$ ./model3 sample data file=data1.R\r\nM=3\r\nN=3\r\nx=[[1,4,7],[2,5,8],[3,6,9]]\r\n...\r\nIteration: 2000 / 2000 [100%]  (Sampling)\r\n\r\n#  Elapsed Time: 0.046009 seconds (Warm-up)\r\n#                0.064697 seconds (Sampling)\r\n#                0.110706 seconds (Total)\r\n\r\n~/temp2/aki$\r\n```\r\n\r\nOutput for data2.R\r\n```\r\n~/temp2/aki$ ./model3 sample data file=data2.R\r\nM=2\r\nN=3\r\nx=[[1,3,5],[2,4,6]]\r\n\r\nException: []: accessing element out of range. index 3 out of range; expecting index to be between 1 and 2; index position = 2z\r\nDiagnostic information: \r\nDynamic exception type: St12out_of_range\r\nstd::exception::what: []: accessing element out of range. index 3 out of range; expecting index to be between 1 and 2; index position = 2z\r\n```\r\n\r\nI have no clue what's going on, but it sure looks like a bug.\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/stan-dev/stan/issues/comments/77453516","html_url":"https://github.com/stan-dev/stan/issues/1342#issuecomment-77453516","issue_url":"https://api.github.com/repos/stan-dev/stan/issues/1342","id":77453516,"user":{"login":"bob-carpenter","id":3383807,"avatar_url":"https://avatars.githubusercontent.com/u/3383807?v=3","gravatar_id":"","url":"https://api.github.com/users/bob-carpenter","html_url":"https://github.com/bob-carpenter","followers_url":"https://api.github.com/users/bob-carpenter/followers","following_url":"https://api.github.com/users/bob-carpenter/following{/other_user}","gists_url":"https://api.github.com/users/bob-carpenter/gists{/gist_id}","starred_url":"https://api.github.com/users/bob-carpenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bob-carpenter/subscriptions","organizations_url":"https://api.github.com/users/bob-carpenter/orgs","repos_url":"https://api.github.com/users/bob-carpenter/repos","events_url":"https://api.github.com/users/bob-carpenter/events{/privacy}","received_events_url":"https://api.github.com/users/bob-carpenter/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T21:16:59Z","updated_at":"2015-03-05T21:16:59Z","body":"OK, tracked this down to get_base1_lhs.  I'm working on it in branch bugfix/issue-1342-get-base-index-except"}}