* Bug #7858 fixed - variance and variancef can now return the mean of the input
in a new output argument.
+* Bug #7879 fixed - string now accepts plist type, and printing a plist displays that string.
+
* Bug #8031 fixed - cdfgam error message fixed.
* Bug #8337 fixed - mtlb_rand now uses the "uniform" rule, whatever the random rule set is.
--- /dev/null
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// 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.1-en.txt
+
+//
+// %plist_p --
+// Prints the string containing the parameters list
+//
+function %plist_p ( this )
+
+ str = string(this)
+ nbrows = size(str, "r")
+ for i = 1:nbrows
+ mprintf("%s\n", str(i))
+ end
+
+endfunction
--- /dev/null
+// Copyright (C) 2010 - DIGITEO - Michael Baudin
+//
+// 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.1-en.txt
+
+//
+// %plist_string --
+// Returns the string containing the parameters list.
+//
+function str = %plist_string ( this )
+
+ // In case there is a function field
+ prot = funcprot()
+ funcprot(0)
+
+ fieldmat = getfield(1, params);
+ nf = size(fieldmat, "*") - 1;
+ str = emptystr(nf+3, 1); // Allocating the result
+ str(1) = sprintf("Parameters list:"); // Headers
+ str(2) = sprintf("================");
+ str(3) = sprintf("Number of fields = %d", nf);
+
+ k = 3; // Start printing after headers
+ for i = 1 : nf
+ key = fieldmat(i+1);
+ value = getfield(i+1, params);
+ if ( or ( typeof(value) == ["constant" "boolean" "string" ] ) ) then
+ k = k + 1;
+ if ( size(value, "*") == 1 ) then
+ str(k) = sprintf("%s = %s (""%s"")", key , string(value) , typeof(value) );
+ else
+ siz = size(value);
+ str(k) = sprintf("%s = ""%s"" %dx%d ", key , typeof(value) , siz(1), siz(2) );
+ end
+ else
+ k = k + 1;
+ str(k) = sprintf("%s = ""%s""", key , typeof(value) );
+ end
+ end
+
+ funcprot(prot)
+
+endfunction
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises- Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 7879 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=7879
+//
+// <-- Short Description -->
+// string now accepts plist type.
+function order = mycompfun ( x , y )
+ order = x+y;
+endfunction
+params = init_param();
+params = add_param(params, "boolval", %f);
+params = add_param(params, "funval", mycompfun);
+params = add_param(params, "doubleval", 1);
+params = add_param(params, "doublematrix", ones(10, 10));
+params = add_param(params, "stringval", "1");
+params = add_param(params, "stringmat", ["1" "2"]);
+string(params)
+ ans =
+
+!Parameters list: !
+! !
+!================ !
+! !
+!Number of fields = 6 !
+! !
+!boolval = F ("boolean") !
+! !
+!funval = "function" !
+! !
+!doubleval = 1 ("constant") !
+! !
+!doublematrix = "constant" 10x10 !
+! !
+!stringval = 1 ("string") !
+! !
+!stringmat = "string" 1x2 !
--- /dev/null
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2013 - Scilab Enterprises- Paul Bignier
+//
+// This file is distributed under the same license as the Scilab package.
+// =============================================================================
+//
+// <-- CLI SHELL MODE -->
+//
+// <-- Non-regression test for bug 7879 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=7879
+//
+// <-- Short Description -->
+// string now accepts plist type.
+
+function order = mycompfun ( x , y )
+ order = x+y;
+endfunction
+
+params = init_param();
+params = add_param(params, "boolval", %f);
+params = add_param(params, "funval", mycompfun);
+params = add_param(params, "doubleval", 1);
+params = add_param(params, "doublematrix", ones(10, 10));
+params = add_param(params, "stringval", "1");
+params = add_param(params, "stringmat", ["1" "2"]);
+
+string(params)