MCPcopy Create free account
hub / github.com/casadi/casadi / getP

Method getP

test/python/function.py:1336–1363  ·  view source on GitHub ↗
(indirect=True)

Source from the content-addressed store, hash-verified

1334
1335 # Simple syntax
1336 def getP(indirect=True):
1337
1338 class Fun(Callback):
1339
1340 def __init__(self):
1341 Callback.__init__(self)
1342 self.construct("Fun", {})
1343
1344 def get_n_in(self): return 2
1345 def get_n_out(self): return 1
1346
1347 def eval(self,arg):
1348 x = arg[0]
1349 y = arg[1]
1350
1351 z0 = 3*y
1352 z1 = x+z0
1353 z2 = sin(z1)
1354 return [z2]
1355
1356 self.cb = Fun()
1357
1358 if not indirect:
1359 return self.cb
1360
1361 f = Function("f", [x,y],[self.cb(x,y)])
1362
1363 return f
1364
1365 for indirect in [True,False]:
1366 f = getP(indirect=indirect)

Callers

nothing calls this directly

Calls 3

FunClass · 0.85
FunctionClass · 0.50
fFunction · 0.50

Tested by

no test coverage detected