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

Parameterize Constant on the type of its value #265

Merged
merged 1 commit into from Jan 18, 2019

Conversation

ararslan
Copy link
Contributor

@ararslan ararslan commented Jan 8, 2019

This allows for more expressive condition checking using dispatch, as complex numbers, real numbers, or arrays thereof can be handled as separate methods.

This also limits the types that can be accepted as constant values to scalars, vectors, and matrices. Previously this was assumed but not actually checked.

Fixes #264.

src/constant.jl Outdated Show resolved Hide resolved
src/constant.jl Outdated Show resolved Hide resolved
src/constant.jl Outdated Show resolved Hide resolved
@ararslan ararslan force-pushed the aa/parametric-constant branch 2 times, most recently from 95d8d73 to 9e14301 Compare January 8, 2019 23:32
test/test_utilities.jl Outdated Show resolved Hide resolved
@ararslan ararslan force-pushed the aa/parametric-constant branch 2 times, most recently from b8c8255 to 96e14cc Compare January 17, 2019 23:22
Copy link
Contributor

@rofinn rofinn left a comment

Choose a reason for hiding this comment

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

Seems fine to me. Left a couple readability suggestions.

src/constant.jl Outdated Show resolved Hide resolved
src/constant.jl Outdated Show resolved Hide resolved
src/constant.jl Outdated Show resolved Hide resolved
test/test_utilities.jl Show resolved Hide resolved
This allows for more expressive condition checking using dispatch, as
complex numbers, real numbers, or arrays thereof can be handled as
separate methods.

This also limits the types that can be accepted as constant values to
scalars, vectors, and matrices. Previously this was assumed but not
actually checked.
@ararslan ararslan merged commit 49dc90d into master Jan 18, 2019
@ararslan ararslan deleted the aa/parametric-constant branch January 18, 2019 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants