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

Value class tweaks #300

Merged
merged 11 commits into from
Feb 28, 2024
Merged

Value class tweaks #300

merged 11 commits into from
Feb 28, 2024

Conversation

mabruzzo
Copy link
Contributor

@mabruzzo mabruzzo commented Mar 26, 2023

This PR tweaks the Value class (and consequently the ScalarExpr class), so that it's easier to work with instances of the class more easily (rather than always working with pointers to instances). These changes mainly involve tweaks to the constructors/destructors.

It also adds a minor optimization to ScalarExpr (relevant for inflow boundaries).

Finally, the test_Value unit tests were refactored and extended to explicitly test this new functionality.

The main motivating factor was to make it easier to work directly with instances of the ``Value`` class, rather than always working with pointers to it.
…code is that that the destructors always run.
…nt operation, and that the destructor isn't doing anything funky.
…p-allocations in certain cases (relevant for inflow-boundaries).

Also added two new test-cases to test_Value.cpp that check previously untested code-paths (including the new micro-optimization).
@mabruzzo mabruzzo requested a review from jobordner July 26, 2023 17:36
Copy link
Contributor

@jobordner jobordner left a comment

Choose a reason for hiding this comment

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

Looks good, just a couple suggestions.

src/Cello/problem_ScalarExpr.cpp Show resolved Hide resolved
src/Cello/problem_ScalarExpr.cpp Outdated Show resolved Hide resolved
@mabruzzo mabruzzo merged commit b32f1cf into enzo-project:main Feb 28, 2024
7 checks passed
@mabruzzo mabruzzo deleted the value-class-tweaks branch February 28, 2024 00:56
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

3 participants