summaryrefslogtreecommitdiff
path: root/modules/functions/help/en_US/comp.xml
blob: b46b854131b539027e560b347cb8d0ba8ed05fc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0" encoding="UTF-8"?>
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="comp" xml:lang="en">
    <refnamediv>
        <refname>comp</refname>
        <refpurpose>scilab function compilation</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>Calling Sequence</title>
        <synopsis>comp(function [,opt])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>Arguments</title>
        <variablelist>
            <varlistentry>
                <term>function</term>
                <listitem>
                    <para>a scilab function, not compiled (type 11)</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>opt</term>
                <listitem>
                    <para>flag with value 0 (default), 1 or 2.</para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>Description</title>
        <para>
            <literal>comp(function)</literal> compiles the function
            <literal>function</literal>. Compiled and interpreted functions are
            equivalent but usually compiled functions are much faster. The functions
            provided in the standard libraries are compiled.
        </para>
        <para>The online definition as well as the short syntax of the commands
            <literal>exec</literal> and <literal>deff</literal> generate compiled
            functions. So <literal>comp</literal> has to be used in very particular cases. To produce
            uncompiled functions one must use <link linkend="exec">exec</link> or
            <link linkend="deff">deff</link> with the option <literal>"n"</literal>.
        </para>
        <para>
            The value <literal>opt==2</literal> causes the function to be compiled "for profiling".
            Note that now it is possible to add profiling instruction after
            compilation using the <link linkend="add_profiling">add_profiling</link> function.
        </para>
        <para>
            The obsolete <literal>opt==1</literal> option was specific to code analysis purposes and
            is now ignored, i.e treated as <literal>opt==0</literal>.
        </para>
        <para>Note: the compilation takes part "in place", i.e the original
            function is modified and no new object is created.
        </para>
    </refsection>
    <refsection role="see also">
        <title>See Also</title>
        <simplelist type="inline">
            <member>
                <link linkend="type">type</link>
            </member>
            <member>
                <link linkend="deff">deff</link>
            </member>
            <member>
                <link linkend="exec">exec</link>
            </member>
            <member>
                <link linkend="function">function</link>
            </member>
            <member>
                <link linkend="add_profiling">add_profiling</link>
            </member>
            <member>
                <link linkend="profile">profile</link>
            </member>
        </simplelist>
    </refsection>
</refentry>