コード例 #1
0
ファイル: arm_test.py プロジェクト: NobukoYoshida/pgcd
 def check0(self, ch, w, debug=False):
     env = Env(w, [])
     visitor = Projection()
     visitor.execute(ch, env, debug)
     chor = visitor.choreography
     vectorize(chor, w)
     checker = CompatibilityCheck(chor, w)
     checker.localChoiceChecks()
     checker.generateTotalGuardsChecks()
     checker.computePreds(debug)
     checker.generateCompatibilityChecks(debug)
     for i in range(0, len(checker.vcs)):
         vc = checker.vcs[i]
         if not vc.discharge(debug=debug):
             print(i, "inFP", vc.title)
             if vc.hasModel():
                 print(vc.modelStr())
             return False
     return True
コード例 #2
0
ファイル: static_process_test.py プロジェクト: MPI-SWS/pgcd
 def check(self, P1, P2):
     w = World()
     p1 = P1(w, 0)
     p2 = P2(w, 1)
     env = Env(w, [])
     ch = choreo()
     visitor = Projection()
     visitor.execute(ch, env)
     chor = visitor.choreography
     vectorize(chor, w)
     checker = CompatibilityCheck(chor, w)
     checker.localChoiceChecks()
     checker.generateTotalGuardsChecks()
     checker.computePreds()
     checker.generateCompatibilityChecks()
     for i in range(0, len(checker.vcs)):
         vc = checker.vcs[i]
         if not vc.discharge():
             print(i, "inFP", vc.title)
             if vc.hasModel():
                 print(vc.modelStr())
             return False
     return True
コード例 #3
0
ks = np.empty_like(xs)
lams = np.empty_like(xs)
dnetas = np.empty_like(xs)
dks = np.empty_like(xs)
dfs = np.empty_like(xs)

print('Number of points: %d' % len(xs))
xnew = sym.initial(la.fem.density.copy())

for i, p in enumerate(xs):

    xnew[index] = p

    x1 = sym.execute(xnew)
    x2 = density_filter.execute(x1)
    x3 = projection.execute(x2)
    dens = x3

    la.execute_analysis(dens)

    ddn = la.dneta1 @ projection.sensitivity(
        x2) @ density_filter.sensitivity() @ sym.sensitivity()
    ddk = la.dk1 @ projection.sensitivity(
        x2) @ density_filter.sensitivity() @ sym.sensitivity()
    ddf = la.df1 @ projection.sensitivity(
        x2) @ density_filter.sensitivity() @ sym.sensitivity()

    lams[i] = la.f1
    netas[i] = la.neta1
    ks[i] = la.k1
    dnetas[i] = ddn[index]