-//============================
-// Allan CORNET
-// INRIA 2007
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
//============================
// Example How to do and use a librarie
//============================
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
//============================
// Example How to do a function
//============================
+
function [x]=f(y)
x=y+10;
endfunction
-//============================
\ No newline at end of file
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
//============================
// Example How to do a function
//============================
+
function [z]=g(x,y)
z=x+y;
endfunction
-//============================
\ No newline at end of file
-//------------------------------------
-// Allan CORNET INRIA 2005
-//------------------------------------
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2005-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
if (isdef('genlib') == %f) then
exec(SCI+'/modules/functions/scripts/buildmacros/loadgenlib.sce');
end
-//------------------------------------
+
genlib('functionslib','SCI/modules/functions/macros',%f,%t);
-//------------------------------------
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
//------------------------------------
// Allan CORNET INRIA 2007
//------------------------------------
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2003-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function %fun=createfun(t)
//given t a string vector where first line gives the function calling
//sequence and the following the function instructions, it returns et
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function txt=fun2string(fun,nam)
-// Copyright INRIA
-// Author Serge Steer
+
// form syntax to scilab of a compiled function
//%Parameters
// lst : list, represents the interpreted code of the Scilab function given by macr2lst
// traduit un ensemble d'instructions debutant a l'adresse ilst de la
// liste courante lst
//!
-// Copyright INRIA
// Author Serge Steer
nlst=size(lst)
level;level(2)=0;
function txt=cla2sci(clause)
// traduit une clause (if while for select)
//!
-// Copyright INRIA
// Author Serge Steer
typ=clause(1)
txt=''
function [txt,ilst]=cod2sci(lst,ilst)
//
//!
-// Copyright INRIA
// Author Serge Steer
nlst=size(lst)
txt=''
endfunction
function [stk,txt,ilst]=exp2sci(lst,ilst)
-// Copyright INRIA
// Author Serge Steer
nlst=size(lst)
top=0
function [stk,top]=func2sci(op,stk)
// translate all functions calls
-// Copyright INRIA
// Author Serge Steer
lhs=evstr(op(4))
rhs=max(evstr(op(3)) ,0)
endfunction
function [stk,txt,top]=_a2sci()
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);
function [stk,top,txt]=get2sci(nam,stk,top)
// Translate the named variable acquisition
-// Copyright INRIA
// Author Serge Steer
txt=[]
top=top+1
endfunction
function [stk,top]=sci_gener(nam)
-// Copyright INRIA
// Author Serge Steer
RHS=[]
for k=1:rhs
endfunction
function [stk,txt,top]=_c2sci()
-// Copyright INRIA
// Author Serge Steer
txt=[]
m=evstr(op(3));n=evstr(op(4))
endfunction
function opstable()
-// Copyright INRIA
// Author Serge Steer
quote=''''
logics=['==','<','>','<=','>=','<>']
function [stk,top]=num2sci(val,stk)
// traduit la definition d'un nombre
-// Copyright INRIA
// Author Serge Steer
top=top+1
stk(top)=list(val,'0')
endfunction
function txt=rhsargs(args)
-// Copyright INRIA
// Author Serge Steer
txt='('+strcat(args,', ')+')'
endfunction
function txt=lhsargs(args)
-// Copyright INRIA
// Author Serge Steer
txt='['+strcat(args,', ')+']'
endfunction
function [stk,txt,top]=_p2sci()
// ^
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);
endfunction
function [txt]=indentsci(txt)
-// Copyright INRIA
// Author Serge Steer
k=find(txt<>'')
if k<>[] then
// [[a,b],c]
// [[a;b];c]
// to a single one whenever possible
-// Copyright INRIA
// Author Serge Steer
void=['0','0','0','0']
nlst=size(lst);top=0
function [stk,txt,top]=_02sci()
// translate .'
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top)
function [stk,txt,top]=_52sci()
// generate code for ~
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top)
function [stk,txt,top]=_d2sci()
// ./
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);top=top-1;
function [stk,txt,top]=_e2sci()
// generate code for extraction
-// Copyright INRIA
// Author Serge Steer
txt=[]
rhs=maxi(0,abs(evstr(op(3)))-1)
function [stk,txt,top]=_g2sci()
// Generate code for |
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);
function [stk,txt,top]=_h2sci()
// Generate code for &
-// Copyright INRIA
// Author Serge Steer
s2=stk(top);s1=stk(top-1);
txt=[]
function [stk,txt,top]=_i2sci()
// Generate code for insertion
-// Copyright INRIA
// Author Serge Steer
txt=[]
rhs=abs(evstr(op(3)))-2
function [stk,txt,top]=_imp2sci()
//code for 1:n
-// Copyright INRIA
// Author Serge Steer
txt=[]
if op(3)=='2' then
function [stk,txt,top]=_j2sci()
// Generates code for .^
-// Copyright INRIA
// Author Serge Steer
s2=stk(top);s1=stk(top-1);
function [stk,txt,top]=_l2sci()
// \
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);top=top-1;
function [stk,txt,top]=_q2sci()
// .\
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);top=top-1;
function [stk,txt,top]=_r2sci()
// /
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top);s1=stk(top-1);top=top-1;
function [stk,txt,top]=_s2sci()
// Generates code for substraction and sign change -
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top)
function [stk,txt,top]=_t2sci()
// Generates code for transposition
-// Copyright INRIA
// Author Serge Steer
txt=[]
s2=stk(top)
function [stk,txt,top]=_x2sci()
// Generates code for .*
-// Copyright INRIA
// Author Serge Steer
txt=[]
s1=stk(top-1)
endfunction
function t=catcode(a,b)
-// Copyright INRIA
// Author Serge Steer
if a==[] then
endfunction
function T=splitexp(t)
-// Copyright INRIA
// Author Serge Steer
T=[]
for i=1:size(t,'*')
endfunction
function [stk,txt,top]=_u2sci()
-// Copyright INRIA
// Author Serge Steer
txt=[]
s1=stk(top-1)
function [stk,txt,top]=_k2sci()
//generates code for .*.
-// Copyright INRIA
// Author Serge Steer
txt=[]
s1=stk(top-1)
function [stk,txt,top]=_v2sci()
//generates code for /.
-// Copyright INRIA
// Author Serge Steer
txt=[]
function [stk,txt,top]=_y2sci()
//generates code for ./.
-// Copyright INRIA
// Author Serge Steer
txt=[]
s1=stk(top-1)
function [stk,txt,top]=_z2sci()
//generates code for .\.
-// Copyright INRIA
// Author Serge Steer
txt=[]
function [stk,txt,top]=_w2sci()
//generates code for .\
-// Copyright INRIA
// Author Serge Steer
txt=[]
s1=stk(top-1)
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+// Copyright (C) ENPC
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function genlib(nam,path,force,verbose,names)
// get all .sci files in the specified directory
- // Copyright Inria/Enpc
if exists('force','local')==0 then force = %f,end
if exists('verbose','local')==0 then verbose = %f,end
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2006-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function genlib_old(nam,path,force,verbose,names)
// Similar to genlib.
// This function is only for compatibilty for old toolboxes where
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function path=get_function_path(name)
libname=whereis(name)
if libname==[] then
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function count=get_profile(lst,ilst)
count=[]
ops=0
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+// Copyright (C) ENPC
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function getd(path)
// get all .sci files in the specified directory
-// Copyright INRIA/Enpc
[lhs,rhs]=argn(0)
if rhs<=0 then path='./',end
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2004-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function head_comments(name,%paths)
//displays the first comments of a function
if exists('%paths')==0 then %paths='./',end
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 1992-2008 - INRIA - Serge STEER <serge.steer@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function vars=macrovar(macro)
// Returns in a list the set of varibles used by a macro
// mac : macro
// called : macros called
// locals : local variables
//!
-//origin S Steer inria 1992
-// Copyright INRIA
if type(macro)==11 then comp(macro),end
if type(macro)<>13 then error(gettext("Argument to macrovars must be a macro!")),end
lst=macr2lst(macro);
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function plotprofile(fun)
sep="="
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function count=profile(fun)
if type(fun)==13 then
lst=macr2lst(fun)
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) INRIA
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
function showprofile(fun)
lst=macr2lst(fun)
count=profile(lst)
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2008 - INRIA - Bruno JOFRET <bruno.jofret@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
//
// -*- Scilab -*-
//
// Started on Thu Feb 14 10:33:50 2008 bruno
// Last update Thu Feb 14 11:06:16 2008 bruno
//
-// Copyright INRIA 2008
-//
// This function is to warn user that he's using a deprecated function
-// ------------------------------------
-// Allan CORNET
-// INRIA 2006
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2006-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
// ------------------------------------
//warning('off'); // disable warnings
// ------------------------------------
+
if (isdef('genlib') == %f) then
exec(SCI+'/modules/functions/scripts/buildmacros/loadgenlib.sce');
end
-// ------------------------------------
-// Allan CORNET
-// INRIA 2006
-// ------------------------------------
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2006-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
lines(0);
CurrentDirectory=pwd();
-// ------------------------------------
-// Allan CORNET
-// INRIA 2007
-// ------------------------------------
+
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2007-2008 - INRIA - Allan CORNET <allan.cornet@inria.fr>
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
// Warning : order !!
// list of : filename , module
+
listmacrostoload = ['fileparts','fileio';
'getshell','core';
'pathconvert','fileio';