Skip to content

Conversation

@Mahmood-Sinan
Copy link
Contributor

This pr adds validation for the optional argument op in stdlib_specialmatrices.
When op is present and not one of N, T, or C, a LINALG_VALUE_ERROR is raised using linalg error handling.

@codecov
Copy link

codecov bot commented Jan 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.64%. Comparing base (17a320a) to head (b46c6a8).
⚠️ Report is 44 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1087      +/-   ##
==========================================
- Coverage   68.67%   68.64%   -0.04%     
==========================================
  Files         393      394       +1     
  Lines       12720    12730      +10     
  Branches     1376     1376              
==========================================
+ Hits         8736     8738       +2     
- Misses       3984     3992       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@loiseaujc
Copy link
Contributor

If I recall correctly, the sparse matrix-vector product accepts H as input as well for the complex-conjugate matrix-vector product. Maybe you could extend the validation to include it and internally handles the fact that H and C are equivalent.

@Mahmood-Sinan
Copy link
Contributor Author

If I recall correctly, the sparse matrix-vector product accepts H as input as well for the complex-conjugate matrix-vector product. Maybe you could extend the validation to include it and internally handles the fact that H and C are equivalent.

@loiseaujc I have made the changes. The routine now accepts H and maps it internally to C before calling lagtm, since only C is supported there.

@loiseaujc
Copy link
Contributor

LGTM.

@jalvesz
Copy link
Contributor

jalvesz commented Jan 16, 2026

this is looking good. It might be good to add a quick test to check that the error is properly catched when op is different than the expected options.

@Mahmood-Sinan
Copy link
Contributor Author

this is looking good. It might be good to add a quick test to check that the error is properly catched when op is different than the expected options.

Thanks for the suggestion!
I looked into adding a negative test, but spmv calls linalg_error_handling in case of invalid op, which triggers an error stop. I think since this aborts the test executable, the error path cannot be caught.

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.

3 participants