-
Notifications
You must be signed in to change notification settings - Fork 4
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
164 algebra tests #195
Open
alexallmont
wants to merge
23
commits into
main
Choose a base branch
from
164-algebra-tests
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
164 algebra tests #195
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Added a fixture for constructing free tensors with rational polynomial coefficients for running precise tests on free tensors. (cherry picked from commit e691b0c)
(cherry picked from commit 6d24755)
- 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. (cherry picked from commit 2f32c0e)
- 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. (cherry picked from commit 08a834d)
- 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. (cherry picked from commit 1aeae2f)
- 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. (cherry picked from commit ce4b842)
- Rename DenseTensorFixture to TestDenseTensor. - Use CamelCase for test names. - Add ASSERT_TENSOR_EQ helper function that prints the values of result and expected if difference. - Split context out of TensorFixture into TensorBuilder to allow for tests to easily instantiate types of context where needed. - Check the return results of any inplace operations (search for inplace_copy)
- Bug found whilst adding test as method was not making any changes. - Add unit tests for add_scal_mul with same matching and differing indeterminates, and check it throws exception if context is not valid.
- After adding free tensor unit tests, Windows builds failed on CI with messages like `error LNK2001: unresolved external symbol __gmpq_set`, most likely because it needs dllimport/export defined. - It should be OK to add this explicitly here as GMP will be statically linked only to this test exe. More caution is necessary with GMP in broader linkage of libs to avoid duplicate symbols.
- Also add unit test based on TestAddScalMulDiffIndeterminate
- Includes three cases for: 1) a valid rational division; 2) an invalid division by zero raises an exception; 3) attempting to divide by an indeterminate cannot be computed and also raises an exception.
- This test checking the 'is_zero' code paths in the multiplication.
- Recreates the old lib algebra lite accessor methods using the new RoughPy interface. - Primarily will be used in multiplication tests to recreate expected values.
- Includes naive implementation of polynomial expansion by combination of split words that make up each possible polynomial in free tensor blob.
- Helper class moved out in anticipation of moving size/start methods in test_dense_tensor
- Added make_mul_tensor equivalent of make_tensor in anticipation of remaining multiplication tests.
- Duplicates of constructor tests but using operator=. - Use is_zero to check for valid/invalid state after copy/move.
- Check mul_implace behaves same as mul as in other tests. - Confirm that different widths multiplies raise error.
- borrow and dense data methods are implicitly checked from other tests.
- Simple case of null implementation along with checking actual value.
- Unlike scal_div, it is valid to operate on an indeterminate scalar value.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.