Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | utility | |
Module | functionals | |
Tool | functionalserver |
Create a function consisting of a combination of one or more functions, creating a compound function. The compound resulting functions is a function with the sum of all the parameters of the partaking functions. If a parameter of the compound function is changed, the parameter of the constituting function is changed as well.
- a:=dfs.poly(2,[1,2,3]) # a polynomial - a.f(1) # its value at x=1 6 - b:=dfs.gaussian1d(10, 0.5, 1) # a Gaussian with height, center, width - b.f(1) 5 - c:=dfs.compound(); c.add(a); c.add(b) # compound them T T - c.f(1) # result is sum 11 - c.state() # the function description [type=11, order=-1, ndim=1, npar=6, params=[1 2 3 10 0.5 1] , nfunc=2, funcs=[__*0=[type=5, order=2, ndim=1, npar=3, params=[1 2 3] ], __*1=[type=0, order=-1, ndim=1, npar=3, params=[10 0.5 1] ]]] - c.setpar(1, 2.5) # set the first parameter of compound to 2.5 [2.5 2 3 10 0.5 1] - c.f(1) # now value is 1.5 greater since zeroeth # order of poly is now 2.5 i.s.o. 1 12.5 -