-
-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2430 from stan-dev/bugfix/2416-qualify-local-xfor…
…med-data-vars-as-data Bugfix/2416 qualify local xformed data vars as data
- Loading branch information
Showing
5 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/test/test-models/good/parser-generator/data_qualifier_scope_xformed_data.stan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
functions { | ||
vector target(vector y, vector theta, real[] x_r, int[] x_i) { | ||
vector[2] deltas; | ||
deltas[1] = y[1] - theta[1] - x_r[1]; | ||
return deltas; | ||
} | ||
} | ||
|
||
transformed data { | ||
vector[1] td_y; | ||
{ | ||
vector[1] td_y_guess = [1]'; | ||
vector[1] td_theta = [1]'; | ||
real td_x_r[0] = {1.0}; | ||
int td_x_i[0]; | ||
td_y = algebra_solver(target, td_y_guess, td_theta, td_x_r, td_x_i); | ||
} | ||
} | ||
generated quantities { | ||
vector[1] gq_y; | ||
{ | ||
vector[1] gq_y_guess = [1]'; | ||
vector[1] gq_theta = [1]'; | ||
real gq_x_r[0] = {1.0}; | ||
int gq_x_i[0]; | ||
gq_y = algebra_solver(target, gq_y_guess, gq_theta, gq_x_r, gq_x_i); | ||
} | ||
} |