summaryrefslogtreecommitdiffstats
path: root/scilab/modules/overloading
diff options
context:
space:
mode:
Diffstat (limited to 'scilab/modules/overloading')
-rw-r--r--scilab/modules/overloading/Makefile.in2
-rw-r--r--scilab/modules/overloading/macros/%b_a_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_c_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_d_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_f_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_g_s.sci14
-rw-r--r--scilab/modules/overloading/macros/%b_h_s.sci14
-rw-r--r--scilab/modules/overloading/macros/%b_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_i.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_p.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_r.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_s.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_sp.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_k_spb.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_kron.sci13
-rw-r--r--scilab/modules/overloading/macros/%b_l_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_l_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_p_s.sci16
-rw-r--r--scilab/modules/overloading/macros/%b_r_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_r_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_s_s.sci15
-rw-r--r--scilab/modules/overloading/macros/%b_x_s.sci17
-rw-r--r--scilab/modules/overloading/macros/%c_b_c.sci16
-rw-r--r--scilab/modules/overloading/macros/%c_b_s.sci14
-rw-r--r--scilab/modules/overloading/macros/%i_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%l_issquare.sci11
-rw-r--r--scilab/modules/overloading/macros/%p_a_r.sci3
-rw-r--r--scilab/modules/overloading/macros/%p_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%p_kron.sci13
-rw-r--r--scilab/modules/overloading/macros/%p_s_r.sci38
-rw-r--r--scilab/modules/overloading/macros/%r_a_p.sci42
-rw-r--r--scilab/modules/overloading/macros/%r_issquare.sci11
-rw-r--r--scilab/modules/overloading/macros/%r_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%r_kron.sci13
-rw-r--r--scilab/modules/overloading/macros/%r_s_p.sci39
-rw-r--r--scilab/modules/overloading/macros/%r_simp.sci2
-rw-r--r--scilab/modules/overloading/macros/%r_x_p.sci19
-rw-r--r--scilab/modules/overloading/macros/%rp_k_generic.sci3
-rw-r--r--scilab/modules/overloading/macros/%s_a_b.sci16
-rw-r--r--scilab/modules/overloading/macros/%s_c_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_d_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_f_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_g_s.sci10
-rw-r--r--scilab/modules/overloading/macros/%s_h_b.sci14
-rw-r--r--scilab/modules/overloading/macros/%s_h_s.sci10
-rw-r--r--scilab/modules/overloading/macros/%s_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%s_k_spb.sci13
-rw-r--r--scilab/modules/overloading/macros/%s_kron.sci13
-rw-r--r--scilab/modules/overloading/macros/%s_l_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_p_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_r_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_s_b.sci15
-rw-r--r--scilab/modules/overloading/macros/%s_x_b.sci17
-rw-r--r--scilab/modules/overloading/macros/%sp_det.sci50
-rw-r--r--scilab/modules/overloading/macros/%sp_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%sp_k_spb.sci13
-rw-r--r--scilab/modules/overloading/macros/%sp_kron.sci13
-rw-r--r--scilab/modules/overloading/macros/%spb_k_b.sci13
-rw-r--r--scilab/modules/overloading/macros/%spb_k_s.sci13
-rw-r--r--scilab/modules/overloading/macros/%spb_k_sp.sci13
-rw-r--r--scilab/modules/overloading/macros/%spb_k_spb.sci13
-rw-r--r--scilab/modules/overloading/macros/%spb_kron.sci13
62 files changed, 775 insertions, 155 deletions
diff --git a/scilab/modules/overloading/Makefile.in b/scilab/modules/overloading/Makefile.in
index c79033e..da279b3 100644
--- a/scilab/modules/overloading/Makefile.in
+++ b/scilab/modules/overloading/Makefile.in
@@ -343,9 +343,11 @@ NMEDIT = @NMEDIT@
343OBJDUMP = @OBJDUMP@ 343OBJDUMP = @OBJDUMP@
344OBJEXT = @OBJEXT@ 344OBJEXT = @OBJEXT@
345OCAMLC = @OCAMLC@ 345OCAMLC = @OCAMLC@
346OCAMLCFLAGS = @OCAMLCFLAGS@
346OCAMLDEP = @OCAMLDEP@ 347OCAMLDEP = @OCAMLDEP@
347OCAMLLEX = @OCAMLLEX@ 348OCAMLLEX = @OCAMLLEX@
348OCAMLOPT = @OCAMLOPT@ 349OCAMLOPT = @OCAMLOPT@
350OCAMLOPTFLAGS = @OCAMLOPTFLAGS@
349OCAMLYACC = @OCAMLYACC@ 351OCAMLYACC = @OCAMLYACC@
350OPENMPI_CC = @OPENMPI_CC@ 352OPENMPI_CC = @OPENMPI_CC@
351OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ 353OPENMPI_CFLAGS = @OPENMPI_CFLAGS@
diff --git a/scilab/modules/overloading/macros/%b_a_s.sci b/scilab/modules/overloading/macros/%b_a_s.sci
new file mode 100644
index 0000000..94454c2
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_a_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %b_a_s(b, s)
14 r = [bool2s(b), s]
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_c_s.sci b/scilab/modules/overloading/macros/%b_c_s.sci
new file mode 100644
index 0000000..403a02e
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_c_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_c_s(b,s)
14 r = [bool2s(b), s]
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_d_s.sci b/scilab/modules/overloading/macros/%b_d_s.sci
new file mode 100644
index 0000000..8f36ad3
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_d_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %b_d_s(a, b)
14 r = bool2s(a) ./ b
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_f_s.sci b/scilab/modules/overloading/macros/%b_f_s.sci
new file mode 100644
index 0000000..8752e1c
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_f_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_f_s(b,s)
14 r = [bool2s(b) ; s]
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_g_s.sci b/scilab/modules/overloading/macros/%b_g_s.sci
new file mode 100644
index 0000000..97491a1
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_g_s.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function res = %b_g_s(b1, s2)
12 // bool | complex
13 res = b1 | (s2<>0);
14endfunction
diff --git a/scilab/modules/overloading/macros/%b_h_s.sci b/scilab/modules/overloading/macros/%b_h_s.sci
new file mode 100644
index 0000000..4f7526a
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_h_s.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function res = %b_h_s(b1, s2)
12 // boolean & complex
13 res = b1 & (s2<>0);
14endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_b.sci b/scilab/modules/overloading/macros/%b_k_b.sci
new file mode 100644
index 0000000..6f8a45c
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_b(b1, b2)
12 r = bool2s(b1) .*. bool2s(b2)
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_i.sci b/scilab/modules/overloading/macros/%b_k_i.sci
new file mode 100644
index 0000000..fe2eefb
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_i.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_i(b, i)
12 r = bool2s(b) .*. i
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_p.sci b/scilab/modules/overloading/macros/%b_k_p.sci
new file mode 100644
index 0000000..751c7d4
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_p.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_p(b, p)
12 r = bool2s(b) .*. p
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_r.sci b/scilab/modules/overloading/macros/%b_k_r.sci
new file mode 100644
index 0000000..98e512c
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_r.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_r(b, r)
12 r = bool2s(b) .*. r
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_s.sci b/scilab/modules/overloading/macros/%b_k_s.sci
new file mode 100644
index 0000000..c13ed7a
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_s.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_s(b, s)
12 r = bool2s(b) .*. s
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_sp.sci b/scilab/modules/overloading/macros/%b_k_sp.sci
new file mode 100644
index 0000000..a6a03e9
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_sp.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_sp(b, sp)
12 r = bool2s(b) .*. sp
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_k_spb.sci b/scilab/modules/overloading/macros/%b_k_spb.sci
new file mode 100644
index 0000000..4ba2e3d
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_k_spb.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_k_spb(b, spb)
12 r = bool2s(b) .*. bool2s(spb)
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_kron.sci b/scilab/modules/overloading/macros/%b_kron.sci
new file mode 100644
index 0000000..7d63baf
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %b_kron(b, op2)
12 r = bool2s(b) .*. op2
13endfunction
diff --git a/scilab/modules/overloading/macros/%b_l_b.sci b/scilab/modules/overloading/macros/%b_l_b.sci
new file mode 100644
index 0000000..659d58c
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_l_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_l_b(a,b)
14 r = bool2s(a) \ bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_l_s.sci b/scilab/modules/overloading/macros/%b_l_s.sci
new file mode 100644
index 0000000..a4fa488
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_l_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %b_l_s(a, b)
14 r = bool2s(a) \ b
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_p_s.sci b/scilab/modules/overloading/macros/%b_p_s.sci
new file mode 100644
index 0000000..6891e4f
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_p_s.sci
@@ -0,0 +1,16 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_p_s(a,b)
14 // Copyright INRIA
15 r = bool2s(a)^b
16endfunction
diff --git a/scilab/modules/overloading/macros/%b_r_b.sci b/scilab/modules/overloading/macros/%b_r_b.sci
new file mode 100644
index 0000000..8afe816
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_r_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %b_r_b(a, b)
14 r = bool2s(a) / bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_r_s.sci b/scilab/modules/overloading/macros/%b_r_s.sci
new file mode 100644
index 0000000..e11878f
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_r_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_r_s(a,b)
14 r = bool2s(a) / b
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_s_s.sci b/scilab/modules/overloading/macros/%b_s_s.sci
new file mode 100644
index 0000000..3a3e4f8
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_s_s.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_s_s(a,b)
14 r = bool2s(a) - b
15endfunction
diff --git a/scilab/modules/overloading/macros/%b_x_s.sci b/scilab/modules/overloading/macros/%b_x_s.sci
new file mode 100644
index 0000000..55aa591
--- /dev/null
+++ b/scilab/modules/overloading/macros/%b_x_s.sci
@@ -0,0 +1,17 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%b_x_s(a,b)
14 A = zeros(a)
15 A(a) = 1
16 r = A .* b
17endfunction
diff --git a/scilab/modules/overloading/macros/%c_b_c.sci b/scilab/modules/overloading/macros/%c_b_c.sci
index 89f5b92..f81c5a1 100644
--- a/scilab/modules/overloading/macros/%c_b_c.sci
+++ b/scilab/modules/overloading/macros/%c_b_c.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -10,17 +10,19 @@
10// For more information, see the COPYING file which you should have received 10// For more information, see the COPYING file which you should have received
11// along with this program. 11// along with this program.
12 12
13function r=%c_b_c(varargin) 13function r = %c_b_c(varargin)
14 if size(varargin)==2 then 14 if size(varargin)==2 then
15 if type(varargin(1))==10 & type(varargin(2))==10 then 15 if type(varargin(1))==10 & type(varargin(2))==10 then
16 r = asciimat(asciimat(varargin(1)):asciimat(varargin(2))) 16 s = ascii(varargin(1))
17 end 17 e = ascii(varargin(2))
18 elseif size(varargin)==3 then 18 if s>e, step = -1, else step = 1, end
19 if type(varargin(1))==10 & type(varargin(2))==10 & type(varargin(3))==10 then 19 r = ascii(s:step:e)
20 r = asciimat(asciimat(varargin(1)):asciimat(varargin(2)):asciimat(varargin(3)))
21 end 20 end
22 else 21 else
23 msg = _("%s: Non implemented feature.\n"); 22 msg = _("%s: Non implemented feature.\n");
24 error(msprintf(msg, "char:char")); 23 error(msprintf(msg, "char:char"));
25 end 24 end
26endfunction 25endfunction
26//assert_checkequal("a":"z", "abcdefghijklmnopqrstuvwxyz");
27//assert_checkequal("z":"a", "zyxwvutsrqponmlkjihgfedcba");
28
diff --git a/scilab/modules/overloading/macros/%c_b_s.sci b/scilab/modules/overloading/macros/%c_b_s.sci
index 10c54b0..2627bf0 100644
--- a/scilab/modules/overloading/macros/%c_b_s.sci
+++ b/scilab/modules/overloading/macros/%c_b_s.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -11,12 +11,16 @@
11// along with this program. 11// along with this program.
12 12
13function r = %c_b_s(varargin) 13function r = %c_b_s(varargin)
14 if size(varargin)==3 then 14 if size(varargin)==3 & type(varargin(3))==10 & ..
15 if type(varargin(1))==10 & type(varargin(2))==1 & type(varargin(3))==10 then 15 length(ascii(varargin(1)))==1 & length(ascii(varargin(3)))==1
16 r=asciimat(asciimat(varargin(1)):varargin(2):asciimat(varargin(3))) 16 r = ascii(ascii(varargin(1)):varargin(2):ascii(varargin(3)))
17 end
18 else 17 else
19 msg = _("%s: Non implemented feature.\n"); 18 msg = _("%s: Non implemented feature.\n");
20 error(msprintf(msg, "char:num")); 19 error(msprintf(msg, "char:num"));
21 end 20 end
22endfunction 21endfunction
22//assert_checkequal("a":2:"z", "acegikmoqsuwy");
23//assert_checkequal("z":-1:"a", "zyxwvutsrqponmlkjihgfedcba");
24//assert_checkequal("z":-2:"a", "zxvtrpnljhfdb");
25//assert_checkequal("a":-1:"z", "");
26//assert_checkequal("z":2:"a", "");
diff --git a/scilab/modules/overloading/macros/%i_k_b.sci b/scilab/modules/overloading/macros/%i_k_b.sci
new file mode 100644
index 0000000..fc243ef
--- /dev/null
+++ b/scilab/modules/overloading/macros/%i_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %i_k_b(i, b)
12 r = i .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%l_issquare.sci b/scilab/modules/overloading/macros/%l_issquare.sci
new file mode 100644
index 0000000..c45da9e
--- /dev/null
+++ b/scilab/modules/overloading/macros/%l_issquare.sci
@@ -0,0 +1,11 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2//
3// Copyright (C) 2021 - Clément DAVID
4//
5// This file is hereby licensed under the terms of the GNU GPL v2.0,
6// For more information, see the COPYING file which you should have received
7// along with this program.
8
9function b = %l_issquare(l)
10 b = length(l) == 1 && issquare(l(1))
11endfunction
diff --git a/scilab/modules/overloading/macros/%p_a_r.sci b/scilab/modules/overloading/macros/%p_a_r.sci
index 8126f9d..8ed93a3 100644
--- a/scilab/modules/overloading/macros/%p_a_r.sci
+++ b/scilab/modules/overloading/macros/%p_a_r.sci
@@ -33,7 +33,8 @@ function f=%p_a_r(m,f)
33 else 33 else
34 //at leat one matrix is eye*x 34 //at leat one matrix is eye*x
35 if size(szf,"*")>2 | size(szm,"*")>2 then 35 if size(szf,"*")>2 | size(szm,"*")>2 then
36 error(msprintf(_("%s: Inconsistent addition.\n"), "%p_a_r")) 36 msg = gettext("%s: Eye variable undefined in this context.\n")
37 error(msprintf(msg, "%p_a_r"));
37 end 38 end
38 if or(szf<0)&or(szm<0) then 39 if or(szf<0)&or(szm<0) then
39 [num,den]=simp(num+m.*den,den) 40 [num,den]=simp(num+m.*den,den)
diff --git a/scilab/modules/overloading/macros/%p_k_b.sci b/scilab/modules/overloading/macros/%p_k_b.sci
new file mode 100644
index 0000000..2e38945
--- /dev/null
+++ b/scilab/modules/overloading/macros/%p_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %p_k_b(p, b)
12 r = p .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%p_kron.sci b/scilab/modules/overloading/macros/%p_kron.sci
new file mode 100644
index 0000000..8793305
--- /dev/null
+++ b/scilab/modules/overloading/macros/%p_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %p_kron(p, op2)
12 r = p .*. op2
13endfunction
diff --git a/scilab/modules/overloading/macros/%p_s_r.sci b/scilab/modules/overloading/macros/%p_s_r.sci
index ead17f0..a1cf4be 100644
--- a/scilab/modules/overloading/macros/%p_s_r.sci
+++ b/scilab/modules/overloading/macros/%p_s_r.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -11,38 +11,6 @@
11// along with this program. 11// along with this program.
12 12
13function f = %p_s_r(m,f) 13function f = %p_s_r(m,f)
14 //f= m-f 14 f = m + (-f)
15 //author Serge Steer INRIA 15 // see %p_a_r()
16 //!
17 [num,den]=f(["num","den"])
18 szf=size(den)
19 szm=size(m)
20
21 if and(szf>=0)&and(szm>=0) then
22 if prod(szf)==1&prod(szm)>1 then
23 den=den(ones(m))
24 szf=szm
25 end
26
27 if size(szf,"*")>2 then
28 num=num(:);den=den(:);m=m(:)
29 end
30 [num,den]=simp(-num+m.*den,den)
31 num=matrix(num,szf)
32 den=matrix(den,szf)
33 else
34 //at leat one matrix is eye*x
35 if size(szf,"*")>2 | size(szm,"*")>2 then
36 msg = gettext("%s: Eye variable undefined in this context.\n")
37 error(msprintf(msg, "%p_s_r"));
38 end
39 if or(szf<0)&or(szm<0) then
40 [num,den]=simp(-num+m.*den,den)
41 elseif or(szf<0) then
42 [num,den]=simp(-num+m.*den,den*ones(m))
43 elseif or(szm<0) then
44 [num,den]=simp(-num+(m+0)*eye(den).*den,den)
45 end
46 end
47 f=rlist(num,den,f.dt)
48endfunction 16endfunction
diff --git a/scilab/modules/overloading/macros/%r_a_p.sci b/scilab/modules/overloading/macros/%r_a_p.sci
index 03137e1..46be8d9 100644
--- a/scilab/modules/overloading/macros/%r_a_p.sci
+++ b/scilab/modules/overloading/macros/%r_a_p.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -10,41 +10,7 @@
10// For more information, see the COPYING file which you should have received 10// For more information, see the COPYING file which you should have received
11// along with this program. 11// along with this program.
12 12
13function f=%r_a_p(f,m) 13function f = %r_a_p(f,m)
14 //f = f+m, 14 f = m + f
15 //f: transfer matrix, m : polynomial matrix 15 // see %p_a_r()
16 //author Serge Steer INRIA
17 //!
18 [num,den]=f(["num","den"])
19 szf=size(den)
20 szm=size(m)
21
22 if and(szf>=0)&and(szm>=0) then
23 if prod(szf)==1&prod(szm)>1 then
24 den=den(ones(m))
25 szf=szm
26 end
27
28 if size(szf,"*")>2 then
29 num=num(:);den=den(:);m=m(:)
30 end
31 [num,den]=simp(num+m.*den,den)
32 num=matrix(num,szf)
33 den=matrix(den,szf)
34 else
35 //at leat one matrix is eye*x
36 if size(szf,"*")>2 | size(szm,"*")>2 then
37 msg = _("%s: Inconsistent addition.\n")
38 error(msprintf(msg, "%r_a_p"))
39 end
40 if or(szf<0)&or(szm<0) then
41 [num,den]=simp(num+m.*den,den)
42 elseif or(szf<0) then
43 [num,den]=simp(num+m.*den,den*ones(m))
44 elseif or(szm<0) then
45 [num,den]=simp(num+(m+0)*eye(den).*den,den)
46 end
47 end
48 f=rlist(num,den,f.dt)
49
50endfunction 16endfunction
diff --git a/scilab/modules/overloading/macros/%r_issquare.sci b/scilab/modules/overloading/macros/%r_issquare.sci
new file mode 100644
index 0000000..f5f82d5
--- /dev/null
+++ b/scilab/modules/overloading/macros/%r_issquare.sci
@@ -0,0 +1,11 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2//
3// Copyright (C) 2020 - Stéphane MOTTELET
4//
5// This file is hereby licensed under the terms of the GNU GPL v2.0,
6// For more information, see the COPYING file which you should have received
7// along with this program.
8
9function b = %r_issquare(r)
10 b = issquare(r.num)
11endfunction
diff --git a/scilab/modules/overloading/macros/%r_k_b.sci b/scilab/modules/overloading/macros/%r_k_b.sci
new file mode 100644
index 0000000..0e21607
--- /dev/null
+++ b/scilab/modules/overloading/macros/%r_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %r_k_b(r, b)
12 r = r .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%r_kron.sci b/scilab/modules/overloading/macros/%r_kron.sci
new file mode 100644
index 0000000..37d7006
--- /dev/null
+++ b/scilab/modules/overloading/macros/%r_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %r_kron(r, op2)
12 r = r .*. op2
13endfunction
diff --git a/scilab/modules/overloading/macros/%r_s_p.sci b/scilab/modules/overloading/macros/%r_s_p.sci
index f465616..51d37a5 100644
--- a/scilab/modules/overloading/macros/%r_s_p.sci
+++ b/scilab/modules/overloading/macros/%r_s_p.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -11,39 +11,6 @@
11// along with this program. 11// along with this program.
12 12
13function f = %r_s_p(f,m) 13function f = %r_s_p(f,m)
14 //f = f-m, 14 f = f + (-m)
15 //f: transfer matrix, m : scalar or scalar matrix 15 // see %r_a_p
16 //author Serge Steer INRIA
17 //!
18 [num,den]=f(["num","den"])
19 szf=size(den)
20 szm=size(m)
21
22 if and(szf>=0)&and(szm>=0) then
23 if prod(szf)==1&prod(szm)>1 then
24 den=den(ones(m))
25 szf=szm
26 end
27
28 if size(szf,"*")>2 then
29 num=num(:);den=den(:);m=m(:)
30 end
31 [num,den]=simp(num-m.*den,den)
32 num=matrix(num,szf)
33 den=matrix(den,szf)
34 else
35 //at leat one matrix is eye*x
36 if size(szf,"*")>2 | size(szm,"*")>2 then
37 msg = gettext("%s: Eye variable undefined in this context.\n")
38 error(msprintf(msg, "%r_s_p"));
39 end
40 if or(szf<0)&or(szm<0) then
41 [num,den]=simp(num-m.*den,den)
42 elseif or(szf<0) then
43 [num,den]=simp(num-m.*den,den*ones(m))
44 elseif or(szm<0) then
45 [num,den]=simp(num-(m+0)*eye(den).*den,den)
46 end
47 end
48 f=rlist(num,den,f.dt)
49endfunction 16endfunction
diff --git a/scilab/modules/overloading/macros/%r_simp.sci b/scilab/modules/overloading/macros/%r_simp.sci
index 943f0602..edb5b65 100644
--- a/scilab/modules/overloading/macros/%r_simp.sci
+++ b/scilab/modules/overloading/macros/%r_simp.sci
@@ -21,8 +21,8 @@ function h = %r_simp(h, d)
21 n = h 21 n = h
22 h = [] 22 h = []
23 end 23 end
24 i = find(clean(n)==0 & clean(d)~=0)
25 [n, d] = simp(n, d); 24 [n, d] = simp(n, d);
25 i = find(n==0 & d~=0)
26 d(i) = 1 26 d(i) = 1
27 h = rlist(n, d, h(4)) 27 h = rlist(n, d, h(4))
28endfunction 28endfunction
diff --git a/scilab/modules/overloading/macros/%r_x_p.sci b/scilab/modules/overloading/macros/%r_x_p.sci
index 428ce9f..7abdacd 100644
--- a/scilab/modules/overloading/macros/%r_x_p.sci
+++ b/scilab/modules/overloading/macros/%r_x_p.sci
@@ -1,7 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON
5// 5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -10,18 +10,7 @@
10// For more information, see the COPYING file which you should have received 10// For more information, see the COPYING file which you should have received
11// along with this program. 11// along with this program.
12 12
13function f1=%r_x_p(f1,f2) 13function f1 = %r_x_p(f1, f2)
14 // %r_x_p(r,p)=r.*p 14 // rat .* pol == pol .* rat
15 //author Serge Steer, INRIA 15 f1 = %p_x_r(f2, f1)
16 //!
17 f1.num=f1.num.*f2
18 sz=size(f1.num)
19 if size(sz,"*")<=2 then
20
21 f1=simp(f1)
22 else
23 [num,den]=simp(f1.num(:),f1.den(:))
24 f1.num=matrix(num,sz)
25 f1.den=matrix(den,sz)
26 end
27endfunction 16endfunction
diff --git a/scilab/modules/overloading/macros/%rp_k_generic.sci b/scilab/modules/overloading/macros/%rp_k_generic.sci
index 4c219d9..0c94ebf 100644
--- a/scilab/modules/overloading/macros/%rp_k_generic.sci
+++ b/scilab/modules/overloading/macros/%rp_k_generic.sci
@@ -55,6 +55,9 @@ function res = %rp_k_generic(a,b)
55 rib = (ones(a).*.ib); // replicated indices in b 55 rib = (ones(a).*.ib); // replicated indices in b
56 // 56 //
57 res = rlist(anum(ria)(:) .* bnum(rib)(:), aden(ria)(:) .* bden(rib)(:), dt); 57 res = rlist(anum(ria)(:) .* bnum(rib)(:), aden(ria)(:) .* bden(rib)(:), dt);
58 if simp_mode()
59 res = simp(res)
60 end
58 end 61 end
59 62
60 // Final formatting 63 // Final formatting
diff --git a/scilab/modules/overloading/macros/%s_a_b.sci b/scilab/modules/overloading/macros/%s_a_b.sci
new file mode 100644
index 0000000..81dce52
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_a_b.sci
@@ -0,0 +1,16 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %s_a_b(a, b)
14 // Copyright INRIA
15 r = a + bool2s(b)
16endfunction
diff --git a/scilab/modules/overloading/macros/%s_c_b.sci b/scilab/modules/overloading/macros/%s_c_b.sci
new file mode 100644
index 0000000..58dd658
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_c_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %s_c_b(s, b)
14 r = [s bool2s(b)]
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_d_b.sci b/scilab/modules/overloading/macros/%s_d_b.sci
new file mode 100644
index 0000000..c545b05
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_d_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %s_d_b(a, b)
14 r = a ./ bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_f_b.sci b/scilab/modules/overloading/macros/%s_f_b.sci
new file mode 100644
index 0000000..6d206bc
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_f_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%s_f_b(s,b)
14 r = [s ; bool2s(b)]
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_g_s.sci b/scilab/modules/overloading/macros/%s_g_s.sci
index 3b986b3..bde6995 100644
--- a/scilab/modules/overloading/macros/%s_g_s.sci
+++ b/scilab/modules/overloading/macros/%s_g_s.sci
@@ -1,8 +1,8 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
5// Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL 4// Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
5// Copyright (C) 2020 - Samuel GOUGEON
6// 6//
7// This file is hereby licensed under the terms of the GNU GPL v2.0, 7// This file is hereby licensed under the terms of the GNU GPL v2.0,
8// pursuant to article 5.3.4 of the CeCILL v.2.1. 8// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -11,7 +11,11 @@
11// For more information, see the COPYING file which you should have received 11// For more information, see the COPYING file which you should have received
12// along with this program. 12// along with this program.
13 13
14function res=%s_g_s(s1,s2) 14function res = %s_g_s(s1,s2)
15 // Logical operand on complex numbers 15 // Logical operand on complex numbers
16 res = (s1<>0) | (s2<>0); 16 if s1==[] | s2==[] then
17 res = []
18 else
19 res = (s1<>0) | (s2<>0);
20 end
17endfunction 21endfunction
diff --git a/scilab/modules/overloading/macros/%s_h_b.sci b/scilab/modules/overloading/macros/%s_h_b.sci
new file mode 100644
index 0000000..f46e9b2
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_h_b.sci
@@ -0,0 +1,14 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function res = %s_h_b(s1, b2)
12 // complex & boolean
13 res = (s1<>0) & b2;
14endfunction
diff --git a/scilab/modules/overloading/macros/%s_h_s.sci b/scilab/modules/overloading/macros/%s_h_s.sci
index 7b7ef39..0106355 100644
--- a/scilab/modules/overloading/macros/%s_h_s.sci
+++ b/scilab/modules/overloading/macros/%s_h_s.sci
@@ -1,8 +1,8 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) INRIA 2// Copyright (C) INRIA
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
5// Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL 4// Copyright (C) 2016 - Scilab Enterprises - Pierre-Aimé AGNEL
5// Copyright (C) 2020 - Samuel GOUGEON
6// 6//
7// This file is hereby licensed under the terms of the GNU GPL v2.0, 7// This file is hereby licensed under the terms of the GNU GPL v2.0,
8// pursuant to article 5.3.4 of the CeCILL v.2.1. 8// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -11,7 +11,11 @@
11// For more information, see the COPYING file which you should have received 11// For more information, see the COPYING file which you should have received
12// along with this program. 12// along with this program.
13 13
14function res=%s_h_s(s1,s2) 14function res = %s_h_s(s1,s2)
15 // Logical operand on complex numbers 15 // Logical operand on complex numbers
16 res = (s1<>0) & (s2<>0); 16 if s1==[] | s2==[] then
17 res = []
18 else
19 res = (s1<>0) & (s2<>0);
20 end
17endfunction 21endfunction
diff --git a/scilab/modules/overloading/macros/%s_k_b.sci b/scilab/modules/overloading/macros/%s_k_b.sci
new file mode 100644
index 0000000..1182875
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %s_k_b(s, b)
12 r = s .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%s_k_spb.sci b/scilab/modules/overloading/macros/%s_k_spb.sci
new file mode 100644
index 0000000..ac84da7
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_k_spb.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %s_k_spb(s, spb)
12 r = s .*. bool2s(spb)
13endfunction
diff --git a/scilab/modules/overloading/macros/%s_kron.sci b/scilab/modules/overloading/macros/%s_kron.sci
new file mode 100644
index 0000000..3ee1c77
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %s_kron(s, op2)
12 r = s .*. op2
13endfunction
diff --git a/scilab/modules/overloading/macros/%s_l_b.sci b/scilab/modules/overloading/macros/%s_l_b.sci
new file mode 100644
index 0000000..ae0ecd7
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_l_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%s_l_b(a,b)
14 r = a \ bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_p_b.sci b/scilab/modules/overloading/macros/%s_p_b.sci
new file mode 100644
index 0000000..fbc77f8
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_p_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%s_p_b(a,b)
14 r = a ^ bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_r_b.sci b/scilab/modules/overloading/macros/%s_r_b.sci
new file mode 100644
index 0000000..7380445
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_r_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%s_r_b(a,b)
14 r = a / bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_s_b.sci b/scilab/modules/overloading/macros/%s_s_b.sci
new file mode 100644
index 0000000..6b9aefa
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_s_b.sci
@@ -0,0 +1,15 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r=%s_s_b(a,b)
14 r = a - bool2s(b)
15endfunction
diff --git a/scilab/modules/overloading/macros/%s_x_b.sci b/scilab/modules/overloading/macros/%s_x_b.sci
new file mode 100644
index 0000000..fec61a5
--- /dev/null
+++ b/scilab/modules/overloading/macros/%s_x_b.sci
@@ -0,0 +1,17 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) ???? - INRIA - Scilab
3//
4// Copyright (C) 2012 - 2016 - Scilab Enterprises
5//
6// This file is hereby licensed under the terms of the GNU GPL v2.0,
7// pursuant to article 5.3.4 of the CeCILL v.2.1.
8// This file was originally licensed under the terms of the CeCILL v2.1,
9// and continues to be available under such terms.
10// For more information, see the COPYING file which you should have received
11// along with this program.
12
13function r = %s_x_b(a, b)
14 B = zeros(b)
15 B(b) = 1
16 r = a .* B
17endfunction
diff --git a/scilab/modules/overloading/macros/%sp_det.sci b/scilab/modules/overloading/macros/%sp_det.sci
index 113fb98..a5da027 100644
--- a/scilab/modules/overloading/macros/%sp_det.sci
+++ b/scilab/modules/overloading/macros/%sp_det.sci
@@ -1,6 +1,7 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET 2// Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
3// Copyright (C) 2012 - 2016 - Scilab Enterprises 3// Copyright (C) 2012 - 2016 - Scilab Enterprises
4// Copyright (C) 2021 - Samuel GOUGEON - Le Mans Université
4// 5//
5// This file is hereby licensed under the terms of the GNU GPL v2.0, 6// This file is hereby licensed under the terms of the GNU GPL v2.0,
6// pursuant to article 5.3.4 of the CeCILL v.2.1. 7// pursuant to article 5.3.4 of the CeCILL v.2.1.
@@ -18,19 +19,46 @@ function [res1, res2] = %sp_det(A)
18 end 19 end
19 return 20 return
20 end 21 end
21 hand = umf_lufact(A); //umfpack is used for complex sparse matrix 22 if nnz(A)==0 then
23 [res1, res2] = (0,0)
24 return
25 end
26
27 wstatus = warning("query"); warning("off") // to avoid the "is singular" message
28 hand = umf_lufact(A); // umfpack is used for complex sparse matrix
22 [L,U,P,Q,r] = umf_luget(hand); 29 [L,U,P,Q,r] = umf_luget(hand);
23 res1 = prod(r)*prod(diag(U)); 30 umf_ludel(hand);
24 res2 = res1; 31 warning(wstatus)
25 if (lhs == 2) then 32
26 res1 = 0; 33 dU = clean(diag(U), 0, %eps);
34 r = clean(r, 0, %eps);
35 if isreal(A) then
36 p = r .* dU;
37 tmp = sum(log10(full(abs(p))))
38 res1 = int(tmp)
39 if res1 < 0
40 res1 = res1 - 1
41 end
42 res2 = 10^(tmp-res1) * prod(sign(p))
43 else
44 tmp = sum(log([r full(dU)]))
45 phase = imag(tmp)
46 e10 = real(tmp)/log(10) + log10(abs(cos(phase)))
47 res1 = int(e10)
48 res2 = 10^(real(tmp)/log(10)-res1) * exp(%i*phase)
27 while abs(res2) >= 10 49 while abs(res2) >= 10
28 if abs(res2) < 1 then 50 res2 = res2 / 10
29 break; 51 res1 = res1 + 1
30 end 52 end
31 res2 = res2 / 10; 53 while abs(res2)<1 & abs(res2)<>0
32 res1 = res1 + 1; 54 res2 = res2 * 10
55 res1 = res1 - 1
33 end 56 end
34 end 57 end
35 umf_ludel(hand); 58 if res1 == -%inf
59 [res1, res2] = (0,0)
60 end
61 if lhs == 1 then
62 res1 = res2 * 10^res1
63 end
36endfunction 64endfunction
diff --git a/scilab/modules/overloading/macros/%sp_k_b.sci b/scilab/modules/overloading/macros/%sp_k_b.sci
new file mode 100644
index 0000000..04c1423
--- /dev/null
+++ b/scilab/modules/overloading/macros/%sp_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %sp_k_b(sp, b)
12 r = sp .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%sp_k_spb.sci b/scilab/modules/overloading/macros/%sp_k_spb.sci
new file mode 100644
index 0000000..6d11da6
--- /dev/null
+++ b/scilab/modules/overloading/macros/%sp_k_spb.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %sp_k_spb(sp, spb)
12 r = sp .*. bool2s(spb)
13endfunction
diff --git a/scilab/modules/overloading/macros/%sp_kron.sci b/scilab/modules/overloading/macros/%sp_kron.sci
new file mode 100644
index 0000000..9daa94f
--- /dev/null
+++ b/scilab/modules/overloading/macros/%sp_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %sp_kron(sp, op2)
12 r = sp .*. op2
13endfunction
diff --git a/scilab/modules/overloading/macros/%spb_k_b.sci b/scilab/modules/overloading/macros/%spb_k_b.sci
new file mode 100644
index 0000000..076e0ec
--- /dev/null
+++ b/scilab/modules/overloading/macros/%spb_k_b.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %spb_k_b(spb, b)
12 r = bool2s(spb) .*. bool2s(b)
13endfunction
diff --git a/scilab/modules/overloading/macros/%spb_k_s.sci b/scilab/modules/overloading/macros/%spb_k_s.sci
new file mode 100644
index 0000000..5a43c4fc
--- /dev/null
+++ b/scilab/modules/overloading/macros/%spb_k_s.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %spb_k_s(spb, s)
12 r = bool2s(spb) .*. s
13endfunction
diff --git a/scilab/modules/overloading/macros/%spb_k_sp.sci b/scilab/modules/overloading/macros/%spb_k_sp.sci
new file mode 100644
index 0000000..54fc29c
--- /dev/null
+++ b/scilab/modules/overloading/macros/%spb_k_sp.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %spb_k_sp(spb, sp)
12 r = bool2s(spb) .*. sp
13endfunction
diff --git a/scilab/modules/overloading/macros/%spb_k_spb.sci b/scilab/modules/overloading/macros/%spb_k_spb.sci
new file mode 100644
index 0000000..f287f29
--- /dev/null
+++ b/scilab/modules/overloading/macros/%spb_k_spb.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %spb_k_spb(spb1, spb2)
12 r = bool2s(spb1) .*. bool2s(spb2)
13endfunction
diff --git a/scilab/modules/overloading/macros/%spb_kron.sci b/scilab/modules/overloading/macros/%spb_kron.sci
new file mode 100644
index 0000000..6290ed1
--- /dev/null
+++ b/scilab/modules/overloading/macros/%spb_kron.sci
@@ -0,0 +1,13 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2020 - Samuel GOUGEON
3//
4// This file is hereby licensed under the terms of the GNU GPL v2.0,
5// pursuant to article 5.3.4 of the CeCILL v.2.1.
6// This file was originally licensed under the terms of the CeCILL v2.1,
7// and continues to be available under such terms.
8// For more information, see the COPYING file which you should have received
9// along with this program.
10
11function r = %spb_kron(spb, op2)
12 r = bool2s(spb) .*. op2
13endfunction