This repository has been archived by the owner on Aug 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Add interface for word related functions #57
Open
mariatsalakou
wants to merge
10
commits into
libsemigroups:master
Choose a base branch
from
mariatsalakou:words
base: master
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
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e745f93
Add interface for word related functions
mariatsalakou fc4da58
Updated __init__.py
mariatsalakou 004ab11
Updated __init__.py
mariatsalakou b453aaf
Updated __init__.py
mariatsalakou 90c8086
added test for siso
mariatsalakou 3d6f644
added tests for wil
mariatsalakou d7ddb1a
tests for wislo
mariatsalakou 8209bde
fixed syntax mistakes
mariatsalakou e249c6d
fixed syntax errors
mariatsalakou c72e760
Merge branch 'master' into words
james-d-mitchell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,6 +107,9 @@ def cppyy_version(): | |
cppyy.cppdef("#define HPCOMBI_CONSTEXPR_FUN_ARGS") | ||
|
||
cppyy.include("libsemigroups/libsemigroups.hpp") | ||
cppyy.include("libsemigroups/wilo.hpp") | ||
cppyy.include("libsemigroups/wislo.hpp") | ||
cppyy.include("libsemigroups/siso.hpp") | ||
|
||
cppyy.gbl.libsemigroups | ||
|
||
|
@@ -126,6 +129,7 @@ def cppyy_version(): | |
from libsemigroups_cppyy.schreier_sims import SchreierSims | ||
from libsemigroups_cppyy.transf import * | ||
from libsemigroups_cppyy.todd_coxeter import ToddCoxeter | ||
from libsemigroups_cppyy.word import number_of_words, cbegin_wilo, cend_wilo, wilo, cbegin_wislo, cend_wislo, wislo, cbegin_sislo, cend_sislo, sislo, cbegin_silo, cend_silo, silo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also put these lines inside an "if" |
||
|
||
microseconds = cppyy.gbl.std.chrono.microseconds | ||
milliseconds = cppyy.gbl.std.chrono.milliseconds | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
""" | ||
This file contains the interface to libsemigroups actions; see | ||
|
||
https://libsemigroups.readthedocs.io/en/latest/words.html | ||
|
||
for further details. | ||
""" | ||
|
||
import cppyy | ||
|
||
from cppyy.gbl.libsemigroups import number_of_words | ||
|
||
from libsemigroups_cppyy.detail import ForwardRange | ||
|
||
from cppyy.gbl.libsemigroups import cbegin_wilo, cend_wilo | ||
|
||
from cppyy.gbl.libsemigroups import cbegin_wislo, cend_wislo | ||
|
||
from cppyy.gbl.libsemigroups import cbegin_sislo, cend_sislo | ||
|
||
from cppyy.gbl.libsemigroups import cbegin_silo, cend_silo | ||
|
||
def wilo(n, upper_bound, first, last): | ||
return ForwardRange( | ||
cppyy.gbl.libsemigroups.cbegin_wilo(n, upper_bound, first, last), | ||
cppyy.gbl.libsemigroups.cend_wilo(n, upper_bound, first, last),) | ||
|
||
def wislo(n, first, last): | ||
return ForwardRange( | ||
cppyy.gbl.libsemigroups.cbegin_wislo(n, first, last), | ||
cppyy.gbl.libsemigroups.cend_wislo(n, first, last),) | ||
|
||
def sislo(alphabet, first, last): | ||
return ForwardRange( | ||
cppyy.gbl.libsemigroups.cbegin_sislo(alphabet, first, last), | ||
cppyy.gbl.libsemigroups.cend_sislo(alphabet, first, last),) | ||
|
||
def silo(alphabet, upper_bound, first, last): | ||
return ForwardRange( | ||
cppyy.gbl.libsemigroups.cbegin_silo(alphabet, upper_bound, first, last), | ||
cppyy.gbl.libsemigroups.cend_silo(alphabet, upper_bound, first, last),) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can fix this by doing: