stan-dev / stan-dev/stan

virtual declarations missing for `get_constrained_sizedtypes()` and `get_constrained_sizedtypes()` in `model_base`

Open
#3,175 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature i/o language
Dominant language
C++
Stars
2.8k
Forks
388
Avg merge
2d 17h
Merged PRs (30d)
15

Description

Summary:

stanc outputs methods for returning a json-formatted string of the parameter metadata, like the following for the bernoulli model:

  inline std::string get_constrained_sizedtypes() const {
    return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]");
  }
  inline std::string get_unconstrained_sizedtypes() const {
    return std::string("[{\"name\":\"theta\",\"type\":{\"name\":\"real\"},\"block\":\"parameters\"}]");
  }

But these methods don't have corresponding virtual methods in src/model/model_base.hpp

Current Version:

v2.31.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/model/model_base.hpp and compare its model interface with the methods stanc generates for constrained and unconstrained sized types. Confirm the generated output using the bernoulli example or another stanc-generated model; done means both methods have corresponding virtual declarations in model_base.hpp and the relevant compilation checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.