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

Bolster algebra C++ unit tests #164

Open
alexallmont opened this issue Nov 21, 2024 · 0 comments
Open

Bolster algebra C++ unit tests #164

alexallmont opened this issue Nov 21, 2024 · 0 comments
Assignees

Comments

@alexallmont
Copy link
Contributor

The algebra code would benefit from the full suite of unit tests from libalgebra-lite, particularly to protect against local breakages leading up to refactoring/moving parts of the library. Also helpful as an onboarding task for me.

Task: add the fixtures and tests from libalgebra-lite to the project.

@alexallmont alexallmont self-assigned this Nov 21, 2024
alexallmont added a commit that referenced this issue Dec 10, 2024
- Added tests for constructors, add, sub, uminus, smul.
- Iterator test is work in progress with TODO where value needs to be checked. Need to confirm correct API here with Sam.
- Remaining tests are placeholder TEST_Fs to wrap before PR.
- tensor_fixture.h methods extended. `generic_tensor` replaced with more meaningful `make_ones_tensor`. Complementary functions `make_ns_tensor` used in new tests as LAL was only checking values where all coefficients were 1, but new tests check broader values. `make_tensor` takes a generic function for initialising each coefficient.
- `test_free_tensor` and `test_lie` updated with new fixture.
alexallmont added a commit that referenced this issue Dec 13, 2024
- For equality, the scalar must be created with the same coeff_type as the original tensor.
- Also fixed to compare number of iterations against dimension and not size. The latter reflects the size of the stored data - without null set - whereas dimension includes it.
alexallmont added a commit that referenced this issue Dec 13, 2024
- For brevity, consistency and locality, each inplace test is appended to the end of each corresponding non-inplace method. Otherwise we have duplicate code computing the expected value.
- Replaced make_ns_tensor with make_ones_tensor after discussing with Sam, as the former is technically testing a more nuanced case that we will pick up in other tests.
alexallmont added a commit that referenced this issue Dec 13, 2024
- Checks context, basis, dimension, size, width, depth, degree.
- Constructs custom tensor with zeros after cutoff point to confirm that size() does not count zero intermediate values.
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

When branches are created from issues, their pull requests are automatically linked.

1 participant