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. Each partaking function will be defined as a normal function with its own parameters. The combination function will have parameters equal to the number of functions added. I.e. the added functions are considered encapsulated simple functions. Only functions with the same number of dimensions can be combined. See also compound.
- 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.combi(); c.add(a); c.add(b) # combine them T T - c.f(1) # value is the sum (default parameters are 1) 11 - c.setpar(1, 2.5) # set the first parameter of combi to 2.5 [2.5 1] - c.f(1) # now value is 2.5*poly + 1*gauss 20 -