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

adds is_vt_complex and is_not_vt_complex type traits #2694

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

SteveBronder
Copy link
Collaborator

Summary

Adds two type traits is_vt_complex and is_vt_not_complex that checks whether the value type of a type T is complex or not. This will mostly be used in the stanc compiler when generating C++ functions from user defined functions.

Tests

Tests added to test both traits can be run with

./runTests.py test/unit/math/mix/meta/is_complex_test.cpp

Side Effects

Nope

Release notes

Adds type traits for detecting whether a type has a value type that is complex

Checklist

  • Math issue

  • Copyright holder: Steve Bronder

    The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
    - Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
    - Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

  • the basic tests are passing

    • unit tests pass (to run, use: ./runTests.py test/unit)
    • header checks pass, (make test-headers)
    • dependencies checks pass, (make test-math-dependencies)
    • docs build, (make doxygen)
    • code passes the built in C++ standards checks (make cpplint)
  • the code is written in idiomatic C++ and changes are documented in the doxygen

  • the new changes are tested

@WardBrian
Copy link
Member

As an elaboration on what this allows, the following comparison:

WardBrian/stanc3@complex-containers...WardBrian:requires_all

This allows us to change a chain of stan::require_...s into one big require_all_t

@SteveBronder
Copy link
Collaborator Author

@rok-cesnovar would you mind taking a look at this?

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool beans!

@WardBrian WardBrian merged commit 1c759d5 into develop Apr 1, 2022
@WardBrian WardBrian deleted the feature/is_not_vt_complex branch April 1, 2022 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants