Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

    1. AIDATutorial.py
  1. this is a comment
  1. this is a function
    def someExternalFunction(y,

...

  1. x):

...


  1. return

...

  1. y+x

...

  1. 0

...

  1. Code Block