Skip to content
Browse files

adapted some files to newer api

  • Loading branch information...
1 parent 7ab3613 commit ca5fe209d604c106b9565dda4e48f1c489595fb1 basti committed
View
8 tests/speed_comparison_PyADOLC_ADOLC/benchmark.py
@@ -15,15 +15,13 @@ def benchmark(f,N,M,message):
print message
x = numpy.array([1./(i+1) for i in range(N)])
y = numpy.zeros(M)
- ax = numpy.array([adouble(0.) for i in range(N)])
+ ax = adouble(x)
start_time = time.time()
trace_on(1)
- for n in range(N):
- ax[n].is_independent(x[n])
+ independent(ax)
ay = f(ax)
- for m in range(M):
- y[m] = depends_on(ay[m])
+ dependent(ay)
trace_off()
#tape_to_latex(1,x,y)
runtime_taping = time.time() - start_time
View
4 tests/tape_equivalence_PyADOLC_ADOLC/pyadolc.py
@@ -10,12 +10,12 @@
# usual way: leads to increasing locints
trace_on(9)
-ax.is_independent(x)
+independent(ax)
ay = ax
for i in range(N):
ay = ay * ay
-depends_on(ay)
+dependent(ay)
trace_off()
View
2 tests/tape_equivalence_PyADOLC_ADOLC/tape_11.tex
@@ -10,7 +10,7 @@
\begin{tabular}{|r|l|r|r|r|r||r|r||r|r|r|r|} \hline
code & op & loc & loc & loc & loc & double & double & value & value & value & value \\ \hline
33 & start of tape & & & & & & & & & & \\ \hline
-39 & take stock op & & & 2 & 0 & &$ 6.908828e-310 $& & &$ nan $&$ 6.908828e-310 $\\ \hline
+39 & take stock op & & & 2 & 0 & &$ 6.908924e-310 $& & &$ nan $&$ 6.908924e-310 $\\ \hline
1 & assign ind & & & & 0 & &$ 1.000000e+00 $& & & &$ 1.000000e+00 $\\ \hline
3 & assign a & & & 0 & 1 & & & & &$ 1.000000e+00 $&$ 1.000000e+00 $\\ \hline
15 & mult a a & & 1 & 1 & 1 & & & &$ 1.000000e+00 $&$ 1.000000e+00 $&$ 1.000000e+00 $\\ \hline
View
5 tests/utility_and_helper_functions_explained/utility.py
@@ -20,10 +20,9 @@ def f(avec):
ax = numpy.array([adouble(0.),adouble(0.)])
trace_on(1)
- for n in range(N):
- ax[n].is_independent(x[n])
+ independent(ax)
ay = f(ax)
- depends_on(ay)
+ dependent(ay)
trace_off()
tape_to_latex(1,x,numpy.array([0]))

0 comments on commit ca5fe20

Please sign in to comment.
Something went wrong with that request. Please try again.