Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
df568482
Commit
df568482
authored
Jul 18, 2021
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and enforce a couple of code formatting issues.
parent
7528ff8f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
Cython/Distutils/old_build_ext.py
Cython/Distutils/old_build_ext.py
+1
-1
Demos/benchmarks/spectralnorm.py
Demos/benchmarks/spectralnorm.py
+11
-11
setup.cfg
setup.cfg
+1
-1
No files found.
Cython/Distutils/old_build_ext.py
View file @
df568482
...
...
@@ -169,7 +169,7 @@ class old_build_ext(_build_ext.build_ext):
# _build_ext.build_ext.__setattr__(self, name, value)
self
.
__dict__
[
name
]
=
value
def
finalize_options
(
self
):
def
finalize_options
(
self
):
_build_ext
.
build_ext
.
finalize_options
(
self
)
if
self
.
cython_include_dirs
is
None
:
self
.
cython_include_dirs
=
[]
...
...
Demos/benchmarks/spectralnorm.py
View file @
df568482
...
...
@@ -11,28 +11,28 @@ from time import time
import
util
import
optparse
def
eval_A
(
i
,
j
):
def
eval_A
(
i
,
j
):
return
1.0
/
((
i
+
j
)
*
(
i
+
j
+
1
)
/
2
+
i
+
1
)
def
eval_A_times_u
(
u
):
def
eval_A_times_u
(
u
):
return
[
part_A_times_u
(
i
,
u
)
for
i
in
range
(
len
(
u
))
]
def
eval_At_times_u
(
u
):
def
eval_At_times_u
(
u
):
return
[
part_At_times_u
(
i
,
u
)
for
i
in
range
(
len
(
u
))
]
def
eval_AtA_times_u
(
u
):
return
eval_At_times_u
(
eval_A_times_u
(
u
))
def
eval_AtA_times_u
(
u
):
return
eval_At_times_u
(
eval_A_times_u
(
u
))
def
part_A_times_u
(
i
,
u
):
partial_sum
=
0
for
j
,
u_j
in
enumerate
(
u
):
partial_sum
+=
eval_A
(
i
,
j
)
*
u_j
partial_sum
+=
eval_A
(
i
,
j
)
*
u_j
return
partial_sum
def
part_At_times_u
(
i
,
u
):
partial_sum
=
0
for
j
,
u_j
in
enumerate
(
u
):
partial_sum
+=
eval_A
(
j
,
i
)
*
u_j
partial_sum
+=
eval_A
(
j
,
i
)
*
u_j
return
partial_sum
DEFAULT_N
=
130
...
...
@@ -43,13 +43,13 @@ def main(n):
t0
=
time
()
u
=
[
1
]
*
DEFAULT_N
for
dummy
in
range
(
10
):
v
=
eval_AtA_times_u
(
u
)
u
=
eval_AtA_times_u
(
v
)
for
dummy
in
range
(
10
):
v
=
eval_AtA_times_u
(
u
)
u
=
eval_AtA_times_u
(
v
)
vBv
=
vv
=
0
for
ue
,
ve
in
zip
(
u
,
v
):
for
ue
,
ve
in
zip
(
u
,
v
):
vBv
+=
ue
*
ve
vv
+=
ve
*
ve
tk
=
time
()
...
...
setup.cfg
View file @
df568482
...
...
@@ -13,7 +13,7 @@ select =
E121, E125, E129,
# E114, E115, E116, E122,
# whitespace
E2
23, E224, E228
, E261, E273, E274, E275,
E2
11, E223, E224, E227, E228, E242
, E261, E273, E274, E275,
# E201, E202, E203, E211, E265
# E303, E306,
W1, W2, W3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment