

Įxample 7-2 is one of the longest examples in the running text, but do not be scared as we will explain line-by-line and variable-by-variable what is there and why.Įxample 7-2. For the mathematics behind the operation, the reader is referred to.
#Call a function with no parameter scilab manual
For a detailed description please consult the Lapack User Guide, or the appropriate manual pages. Function dcopy copies N elements (of type Float) of the vector X in increments of IncX to the vector Y using increments of IncY on that side. The dgeqrf- and zgeqrf-functions compute a QR-factorization of a real or complex m-by- n matrix a, while the dorgqr-, and zungqr-functions generate an m-by- n real or complex matrix q with orthonormal columns, relying on the QR-factorization of dgeqrf or zgeqrf. ( N : in Natural - number of elements to copy Tau : out ComplexVector - scalar factors of elementary reflectors K : in Natural - number of elementary reflectorsĪ : in out ComplexMatrix - M-by-N matrix Lwork : in Integer - size of workspace Work Tau : out FloatVector - scalar factors of elementary reflectors Lda : in Natural - leading dimension of A Type ComplexMatrix is array (1.Lda, Positive range ) of Complex Type FloatMatrix is array (1.Lda, Positive range ) of Float Type ComplexVector is array ( Positive range ) of Complex Type FloatVector is array ( Positive range ) of Float The duty of ortho is to transform the columns of the input matrix into orthonormal form to achieve this we employ the following Lapack functions: The single output parameter is a matrix of the same shape and type as is the input matrix.

It takes exactly one argument a, that is a real or complex m times n matrix. Now that the general outline is clear, we are ready to dissect a simple function: ortho. If necessary, allocate space for the return value(s) on the Scilab stack, and copy result(s) to this space. Perform the calculations or transformations that really make up the procedure.Īs in Step 4, it might be necessary to transform the results, now from the worker routine's format back into Scilab format. This is happens for example if the worker routine uses Fortran-77's double complex (or equivalently complex*16) variables. It might be necessary to translate the input variables which are in Scilab format into the appropriate format for the worker routine. Get the "pointers" to actual input parameters supply default values for optional parameters issue warnings or errors as appropriate if too many or too few parameters are supplied.Īllocate space for temporary variables, "workspace(s)", etc. A typical native Scilab function proceeds as follows:Ĭheck the number of input and output parameters.
