Skip to content

Miscellaneous fixes concerning vector and matrix objects#6369

Merged
fingolfin merged 6 commits into
gap-system:masterfrom
ThomasBreuer:TB_matobj_fixes
May 11, 2026
Merged

Miscellaneous fixes concerning vector and matrix objects#6369
fingolfin merged 6 commits into
gap-system:masterfrom
ThomasBreuer:TB_matobj_fixes

Conversation

@ThomasBreuer
Copy link
Copy Markdown
Contributor

This pull request consists of those changes from #6342 that are bugfixes.

  • add checks to NewVector, NewMatrix for the GF(2) and 8 bit representations, in order to catch fail results,
  • add a String method for the rings Integers mod n,
  • fix the default OneMutable method for IsMatrixObj (test that the input is square, as for list-of-lists matrices),
  • check the input list for IsPlistRep in MakeIsPlistVectorRep, and let NewVector turn the input to IsPlistRep if necessary (in fact, it had been possible to cause a segmentation fault by calling AddRowVector with two input vectors created from ranges),
  • forbid assignments into a IsPlistVectorRep vector beyond its length.

Test that the input is square, as for list-of-lists matrices.
- check the input list for `IsPlistRep` in `MakeIsPlistVectorRep`,
  let `NewVector` turn the input to `IsPlistRep` if necessary
- forbid assignments into a `IsPlistVectorRep` vector beyond its length
Conceptually, the solution must be in the same representation
as the given vector.
(Let us see which other bugs will come to the surface now.)
@ThomasBreuer ThomasBreuer added kind: bug Issues describing general bugs, and PRs fixing them kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes labels May 6, 2026
@ThomasBreuer ThomasBreuer requested a review from fingolfin May 6, 2026 13:21
@fingolfin fingolfin closed this May 11, 2026
@fingolfin fingolfin reopened this May 11, 2026
@fingolfin fingolfin enabled auto-merge (squash) May 11, 2026 08:53
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 73.07692% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.68%. Comparing base (aa52ee2) to head (5eaa3fe).
⚠️ Report is 9 commits behind head on master.

Files with missing lines Patch % Lines
lib/matobj.gi 0.00% 5 Missing ⚠️
hpcgap/lib/vec8bit.gi 80.00% 2 Missing ⚠️
hpcgap/lib/vecmat.gi 75.00% 2 Missing ⚠️
lib/vec8bit.gi 80.00% 2 Missing ⚠️
lib/vecmat.gi 75.00% 2 Missing ⚠️
lib/zmodnz.gi 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6369      +/-   ##
==========================================
- Coverage   78.69%   78.68%   -0.01%     
==========================================
  Files         684      684              
  Lines      292892   292925      +33     
  Branches     8660     8660              
==========================================
+ Hits       230497   230501       +4     
- Misses      60581    60608      +27     
- Partials     1814     1816       +2     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@fingolfin fingolfin merged commit a68f125 into gap-system:master May 11, 2026
83 of 96 checks passed
@ThomasBreuer ThomasBreuer deleted the TB_matobj_fixes branch May 11, 2026 11:22
cdwensley pushed a commit that referenced this pull request May 12, 2026
* add checks to `NewVector`, `NewMatrix` for the GF(2) and 8 bit repres.
  in order to catch `fail` results

* add a `String` method for rings `Integers mod n`

* fix the default `OneMutable` method for `IsMatrixObj`
  Test that the input is square, as for list-of-lists matrices.

* minor fixes for `IsPlistVectorRep`
  - check the input list for `IsPlistRep` in `MakeIsPlistVectorRep`,
    let `NewVector` turn the input to `IsPlistRep` if necessary
  - forbid assignments into a `IsPlistVectorRep` vector beyond its length

* fix `SolutionMatDestructive`
  Conceptually, the solution must be in the same representation
  as the given vector.
  (Let us see which other bugs will come to the surface now.)

* fix `TestPositionNonZeroInRow`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: bug: wrong result Issues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them kind: bug Issues describing general bugs, and PRs fixing them release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants