Commit df568482 authored by Stefan Behnel's avatar Stefan Behnel

Fix and enforce a couple of code formatting issues.

parent 7528ff8f
......@@ -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 = []
......
......@@ -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()
......
......@@ -13,7 +13,7 @@ select =
E121, E125, E129,
# E114, E115, E116, E122,
# whitespace
E223, E224, E228, E261, E273, E274, E275,
E211, E223, E224, E227, E228, E242, E261, E273, E274, E275,
# E201, E202, E203, E211, E265
# E303, E306,
W1, W2, W3
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment