Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: functionalserver.compiled - Function Up: functionalserver - Tool Previous: functionalserver.combi - Function


functionalserver.compound - Function



Package utility
Module functionals
Tool functionalserver


Create a compound function


Synopsis
compound()


Arguments



Returns
Functional


Description

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.



Example
- 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
-





next up previous contents index
Next: functionalserver.compiled - Function Up: functionalserver - Tool Previous: functionalserver.combi - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15