...
Code Block |
---|
from hep.aida import IFunction import AIDATutorial import math class MyFunc(IFunction): def __init__(self, track): self.title = "My Own Function" return def providesGradient(self): return false # This Function returns the value f(x) # x can be multi-dimensional def value(self, x): y = x[0] + math.exp(x[1]) + x[0]*x[1] externalValue = AIDATutorial.someExternalFunction(y, x) return externalValue-y # This tells AIDA the dimension of the function def dimension(self): return 2 def annotation(self): ann = IAnnotation() ann.addItem('Title', self.title) return ann |
Tuples
Flat Tuples
Nested Tuples
...
Code Block |
---|
h2. Tuples
h3. Flat Tuples
h3. Nested Tuples
|
- AIDATutorial.py
- this is a comment
- this is a function
def someExternalFunction(y,
...
- x):
...
return
...
- y+x
...
...
Code Block