py_fun_obj

View page source

Python Function Object

Syntax

      fun_obj.setup ( option )
      n = fun_obj.domain ( )
      m = fun_obj.range ( )
      option = fun_obj.option ()
      y = fun_obj ( x )

fun_obj

This is the function object. The corresponding function call, y = fun ( x ), computes y as a function of x .

Scalar Type

We call this a Scalar function object where Scalar is defined as follows. If all of the elements of x and y have the type float , Scalar is float . Otherwise, there can be at most one other type for elements of x and y and Scalar is that type.

domain

The return value is the dimension of the domain space for this function; i.e. the size of x. It likely depends on the value of option.

range

The return value is the dimension of the range space for this function; i.e. the size of y. It likely depends on the value of option.

setup

The function object is initialized using this syntax.

option

This interface does not place any restrictions on the content of option .

n

This return value is the dimension of the domain space for this function; i.e. the length of x. It likely depends on the value of option.

m

This return value is the dimension of the range space for this function; i.e. the length of y. It likely depends on the value of option.

x

is a vector like object such that n is equal len(x) . In addition is supports x[i] for indices i less than n .

y

is a vector like object that contains the function value corresponding to the argument x . It supports y[i] for indices i less than m .