Hide minor edits - Show changes to markup
z=@(x) sum(x)
z = @(x) sum(x)
F.feval([1;1])
F.feval( [1; 1] )
F.feval([1;1])
F.feval( [1; 1] )
F1.feval([1;1])
F1.feval( [1; 1] )
F1 = AffFunction(-1) F1.feval(1)
F1 = AffFunction( -1 ) F1.feval( 1 )
F2.feval([0;-1])
F2.feval( [0; -1] )
F3 = InfNormFunction(diag([1,2]))
F3 = InfNormFunction( diag([1, 2]) )
F3.feval([-1;1])
F3.feval( [-1; 1] )
F4 = OneNormFunction(diag([2,3]))
F4 = OneNormFunction( diag([2, 3]) )
Back to Computational geometry overview.
Back to Computational geometry overview.
F4 = OneNormFunction(diag([-2,3]))
F4 = OneNormFunction(diag([2,3]))
and is useful for representing linear performance criteria.
The OneNormFunction object represents a function y = sum( abs(Q*x) ) that returns always positive values. The object can be constructed by providing the matrix Q as an argument
and is useful for representing a performance criterion. The evaluation of the function is achieved via feval method, i.e.
F4 = OneNormFunction(diag([-2,3]))
F3.feval([-1;1])
and is useful for representing linear performance criteria.
The OneNormFunction object represents a function y = sum( abs(Q*x) ) that returns always positive values. The object can be constructed by providing the matrix Q as an argument
F4 = OneNormFunction(diag([-2,3]))
and is useful for representing a performance criterion. Function evaluation proceeds via overloaded feval method that applies for all objects derived from Function class.
The InfNormFunction object represents a function y = max( abs(Q*x) ) that returns always positive values. The object can be constructed by providing the matrix Q as an argument
F3 = InfNormFunction(diag([1,2]))
and is useful for representing linear performance criteria.
The OneNormFunction object represents a function y = sum( abs(Q*x) ) that returns always positive values. The object can be constructed by providing the matrix Q as an argument
F4 = OneNormFunction(diag([-2,3]))
and is useful for representing linear performance criteria.
After construction of the object, the function can be evaluated using feval method inherited from Function class. For instance, the value of the function for the point x=[1;1] can be obtained as
The stored matrices are accessible in the appropriate fields:
F1.feval([1;1])
F1.F F1.g
Based on the dimensions of the input matrices F, and g, the domain and range of the affine function can be determined. The dimension of the domain space can be retrieved by referring to D property
After construction of the object, the function can be evaluated using feval method inherited from Function class. For instance, the value of the function for the point x=[1;1] can be obtained as
F1.D
F1.feval([1;1])
and the range by referring to R property
Based on the dimensions of the input matrices F, and g, the domain and range of the affine function can be determined. The dimension of the domain space can be retrieved by referring to D property
F1.R
F1.D
If no matrix g is provided as input, it is considered as zero-value, e.g.
and the range by referring to R property
F1 = AffFunction(-1) F1.feval(1)
F1.R
The QuadFunction object represents quadratic functions in the form y = x'*H*x + F*x + g. It stores data of the matrices H, F, and g as properties of the object. To create a quadratic function one has to provide the corresponding matrices, e.g.
If no matrix g is provided as input, it is considered as zero-value, e.g.
H = eye(2); F = [-2, 3]; g = 1; F2 = QuadFunction(H, F, g)
F1 = AffFunction(-1) F1.feval(1)
The QuadFunction object represents quadratic functions in the form y = x'*H*x + F*x + g. It stores data of the matrices H, F, and g as properties of the object. To create a quadratic function one has to provide the corresponding matrices, e.g.
H = eye(2); F = [-2, 3]; g = 1; F2 = QuadFunction(H, F, g)
The matrices can be accessed by referring to the properties with the same name:
(:source lang=MATLAB -getcode:)F2.H F2.F F2.g
Evaluation of the function is achieved by feval method for a particular value of a point, e.g.
F2.feval([0;-1])
The dimensions of the domain and range are accessible from D and R property:
F2.D F2.R
Object can be constructed without providing the matrices F, and g. In this case the values for the matrices F, and g are considered as zeros:
F2 = QuadFunction(-1) F2.H F2.F F2.g
The QuadFunction object represents quadratic functions in the form y = x'*H*x + F*x + g. It stores data of the matrices H, F, and g as properties of the object. To create a quadratic function one has to provide the corresponding matrices, e.g.
H = eye(2); F = [-2, 3]; g = 1; F2 = QuadFunction(H, F, g)
To evaluate the function stored in the Function, one can use an overloaded feval method
To evaluate the function stored in the Function for a particular value of the point x=[1;1], one can use an overloaded feval method
After construction of the object, the function can be evaluated using feval method inherited from Function class:
After construction of the object, the function can be evaluated using feval method inherited from Function class. For instance, the value of the function for the point x=[1;1] can be obtained as
The AffFunction object represents an affine function in the form y = F*x + g. It stores data of the matrices F, and g as properties of the object. To create an affine function one has to provide the corresponding matrices, e.g.
F = [1, 0]; g = 2; F1 = AffFunction(F, g)
After construction of the object, the function can be evaluated using feval method inherited from Function class:
F1.feval([1;1])
Based on the dimensions of the input matrices F, and g, the domain and range of the affine function can be determined. The dimension of the domain space can be retrieved by referring to D property
F1.D
and the range by referring to R property
F1.R
If no matrix g is provided as input, it is considered as zero-value, e.g.
F1 = AffFunction(-1) F1.feval(1)
Function object is the top-level class for representation of functions. It stores a function handle and the data corresponding to the function. The function handle is a Matlab concept for representing functions (see help function_handle) which has been adopted in the Function object.As an example, consider a function y = 2*x that can be represented as anonymous function y = @(x) 2*x in Matlab. The Function object can be created as follows
The Function object is the top-level class for representation of functions. It stores a function handle and the data corresponding to the function. The function handle is a Matlab concept for representing functions (see help function_handle) which has been adopted in the Function object.
As an example, consider a function y = 2*x that can be represented as anonymous function y = @(x) 2*x in Matlab. The Function object can be created as follows
The user data can be employed for parametrization of the function. Consider a function y=p(1)*x(1)^2 + p(2)*x(2) + p(3)@ that is parametrized in the variable "p" that can be modified. The Function@@ object can be constructed by pointing to the parameters in the user data. Note that the object must be constructed first in order to refer to the stored data as shown here:
The user data can be employed for parametrization of the function. Consider a function y=p(1)*x(1)^2 + p(2)*x(2) + p(3) that is parametrized in the variable "p" that can be modified. The Function object can be constructed by pointing to the parameters in the user data. Note that the object must be constructed first in order to refer to the stored data as shown here:
Function object is the top-level class for representation of functions. It stores a function handle and the data corresponding to the function. The function handle is a Matlab concept for representing functions (see help function_handle) which has been adopted in the Function object.As an example, consider a function y = 2*x that can be represented as anonymous function y = @(x) 2*x in Matlab. The Function object can be created as follows
y = @(x) 2*x F = Function(y)
which accepts the function handle as an argument. Arbitrary user data can be stored with the function which are provided as a second argument. For instance,
(:source lang=MATLAB -getcode:)z=@(x) sum(x) d.name = 'summation method'; d.date = date; F = Function(z, d)
The user data can be employed for parametrization of the function. Consider a function y=p(1)*x(1)^2 + p(2)*x(2) + p(3)@ that is parametrized in the variable "p" that can be modified. The Function@@ object can be constructed by pointing to the parameters in the user data. Note that the object must be constructed first in order to refer to the stored data as shown here:
d.p = [1, -0.5, 0.3]; F = Function([], d) F.setHandle(@(x) F.Data.p(1)*x(1)^2 + F.Data.p(2)*x(2) + F.Data.p(3))
To evaluate the function stored in the Function, one can use an overloaded feval method
F.feval([1;1])
By changing the parameters, the function value changes as well
(:source lang=MATLAB -getcode:)F.Data.p(3) = 0.5; F.feval([1;1])
Back to Computational geometry overview.