Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow 0 length vectors in data readers #683

Closed
syclik opened this issue Jun 13, 2014 · 4 comments
Closed

Allow 0 length vectors in data readers #683

syclik opened this issue Jun 13, 2014 · 4 comments
Assignees
Labels
Milestone

Comments

@syclik
Copy link
Member

syclik commented Jun 13, 2014

Currently, we don't allow zero length vectors. For example, see the bernoulli.stan model. Want:

N <- 0
y <- c()
@syclik syclik added this to the v2.3.0++ milestone Jun 13, 2014
@bob-carpenter bob-carpenter modified the milestones: v2.4.0++, v2.4.0 Jul 7, 2014
@syclik syclik self-assigned this Jul 29, 2014
@bob-carpenter bob-carpenter assigned bob-carpenter and unassigned syclik Aug 1, 2014
@bob-carpenter
Copy link
Contributor

We are definitely going to need this one in order to deal with ode solvers, because some of the vectors might need to be zero length.

I also don't think we initialize them properly even if they're not data.

Hopefully, it's just a matter of calling the constructor for std::vector more carefully.

I also re-assigned it to me.

@syclik
Copy link
Member Author

syclik commented Aug 1, 2014

Thanks, Bob. I can help when I'm not buried. Hopefully I beat you to it.

On Fri, Aug 1, 2014 at 1:02 PM, Bob Carpenter notifications@github.com
wrote:

We are definitely going to need this one in order to deal with ode
solvers, because some of the vectors might need to be zero.

I also don't think we initialize them properly even if they're not data.

Hopefully, it's just a matter of calling the constructor for std::vector
more carefully.

I also re-assigned it to me.


Reply to this email directly or view it on GitHub
#683 (comment).

@bob-carpenter
Copy link
Contributor

  • zero-size matrices
  • zero-size vectors and row vectors
  • zero-size arrays

Only really need the zero-size arrays to deal with general ODE functions.

@mbrubake
Copy link
Member

mbrubake commented Aug 6, 2014

I've run into use-cases for zero-size arrays when writing more configurable
models. This is useful beyond just ODE functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants