Skip to content

Add support for BMat8#48

Open
james-d-mitchell wants to merge 4 commits intolibsemigroups:mainfrom
james-d-mitchell:bmat8
Open

Add support for BMat8#48
james-d-mitchell wants to merge 4 commits intolibsemigroups:mainfrom
james-d-mitchell:bmat8

Conversation

@james-d-mitchell
Copy link
Member

No description provided.

@james-d-mitchell james-d-mitchell marked this pull request as draft February 21, 2026 19:48
@james-d-mitchell
Copy link
Member Author

I think all the functionality is there, I just have to finish adding the documentation.

@jswent
Copy link
Member

jswent commented Feb 22, 2026

@james-d-mitchell I think your fork is behind since the tests are out of sync with main. Just merged in, everything should pass now.

EDIT: Nevermind, hadn't seen that you modified transf. Will do a full review later.

@codecov-commenter
Copy link

codecov-commenter commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 7.54717% with 49 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (main@531f6d4). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/elements/bmat8.jl 0.00% 49 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #48   +/-   ##
=======================================
  Coverage        ?   56.69%           
=======================================
  Files           ?       10           
  Lines           ?      448           
  Branches        ?        0           
=======================================
  Hits            ?      254           
  Misses          ?      194           
  Partials        ?        0           

☔ 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.

@james-d-mitchell
Copy link
Member Author

I just need to add tests and this should be good to go (note everything is tested in the docs, so it's just a matter of extracting the code examples and putting them in a test file).

@james-d-mitchell
Copy link
Member Author

@jswent Any idea why the docs are failing?

@jswent
Copy link
Member

jswent commented Feb 24, 2026

@jswent Any idea why the docs are failing?

not sure, haven't seen a segfault before. just tested on a throwaway PR and got the same result, which was passing before. will look into it later.

@jswent
Copy link
Member

jswent commented Feb 24, 2026

@james-d-mitchell should be fixed, appears to be a problem with the latest version of julia so I pinned a stable version to the CI checks

@james-d-mitchell
Copy link
Member Author

Thanks @jswent!

@james-d-mitchell james-d-mitchell marked this pull request as ready for review February 25, 2026 10:39
@james-d-mitchell
Copy link
Member Author

This is now good to go

Copy link
Member

Choose a reason for hiding this comment

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

can be deleted

Comment on lines +66 to +75
type.method("multiply", [](BMat8 const& self, BMat8 const& that) {
return self * that;
});
type.method("multiply",
[](BMat8 const& self, bool scalar) { return self * scalar; });
type.method("multiply", [](BMat8& self, bool val) { return self * val; });
type.method("multiply", [](bool val, BMat8& self) { return val * self; });
type.method("multiply!",
[](BMat8& self, BMat8 const& that) { self *= that; });
type.method("multiply!", [](BMat8& self, bool scalar) { self *= scalar; });
Copy link
Member

Choose a reason for hiding this comment

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

CxxWrap overloads are unreliable, should be disambiguated

end

Base.:(==)(x::BMat8, y::BMat8) = LibSemigroups.is_equal(x, y)
Base.:(<)(x::BMat8, y::BMat8) = LibSemigroups.is_less(x, y)
Copy link
Member

Choose a reason for hiding this comment

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

Base.isless needs to be defined as well for sort() to work

Copy link
Member Author

Choose a reason for hiding this comment

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

is_less or isless?

Copy link
Member

Choose a reason for hiding this comment

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

is_less or isless?

Base.isless, source docs can be seen here

Comment on lines +128 to +134
function Base.getindex(x::BMat8, r::Int64, c::Int64)::Bool
return LibSemigroups.at(x, UInt(r - 1), UInt(c - 1))
end

function Base.getindex(x::BMat8, r::Int64)::Vector{Bool}
return LibSemigroups.at(x, UInt(r - 1))
end
Copy link
Member

Choose a reason for hiding this comment

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

these should be wrapped with @wrap_libsemigroups_call for error handling


Returns the degree of a [`BMat8`](@ref).

This function returns the degree of `x` which is always returns `8`.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
This function returns the degree of `x` which is always returns `8`.
This function returns the degree of `x` which always returns `8`.

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