stan-dev / stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.
https://mc-stan.org
BSD 3-Clause "New" or "Revised" License
2.57k stars 368 forks source link

Add validate_dims include #3106

Closed andrjohns closed 2 years ago

andrjohns commented 2 years ago

Summary

The stan source included in StanHeaders 2.26 does not have an #include statement for the validate_dims header, causing compile errors in some instances. This PR adds the necessary USE_STANC3 conditional include

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Andrew Johnson

By submitting this pull request, the copyright holder is agreeing to license the submitted work under the following licenses:

andrjohns commented 2 years ago

@hsbadr I merged before I saw your recommendations sorry! I'll open another PR now

hsbadr commented 2 years ago

@hsbadr I merged before I saw your recommendations sorry! I'll open another PR now

No worries. I see the same order in the development branch.

#include <stan/io/validate_zero_buf.hpp>
#include <stan/io/validate_dims.hpp>

Does validate_dims.hpp include or need validate_zero_buf.hpp?

hsbadr commented 2 years ago

I also see redundancy in the headers: validate_dims.hpp includes var_context.hpp, which is included again in dump.hpp. It isn't a problem since the headers are guarded, though. This isn't specific to this branch.

andrjohns commented 2 years ago

Does validate_dims.hpp include or need validate_zero_buf.hpp?

No, the two appear distinct (from what I can tell)