Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
df2a03c6
Commit
df2a03c6
authored
2 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Document pyfaust.tools.bitrev and bitrev_perm.
parent
987da1f9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wrapper/python/pyfaust/tools.py
+20
-1
20 additions, 1 deletion
wrapper/python/pyfaust/tools.py
with
20 additions
and
1 deletion
wrapper/python/pyfaust/tools.py
+
20
−
1
View file @
df2a03c6
...
...
@@ -235,7 +235,21 @@ greed_omp_chol = omp
def
bitrev
(
inds
):
"""
Bitreversal indices.
Bitreversal permutation.
Args:
inds: the list of indices to bit-reverse.
Returns:
The bit-reversal permutation of inds.
Example:
>>>
import
numpy
as
np
>>>
from
pyfaust.tools
import
bitrev
>>>
bitrev
(
np
.
arange
(
4
))
>>>
array
([
0
,
2
,
1
,
3
])
See also: https://en.wikipedia.org/wiki/Bit-reversal_permutation.
"""
n
=
len
(
inds
)
if
n
==
1
:
...
...
@@ -248,6 +262,11 @@ def bitrev(inds):
def
bitrev_perm
(
N
):
"""
Bitreversal permutation.
Returns:
B: a scipy csr_matrix defining the bit-reversal permutation.
See also: bitrev.
"""
if
np
.
log2
(
N
)
>
np
.
log2
(
np
.
floor
(
N
)):
raise
ValueError
(
'
N must be a power of two
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment