From 45dfda4f2230fdf96ca5f08cfb1ecd8abca86041 Mon Sep 17 00:00:00 2001 From: Anais AUBERT Date: Mon, 17 Nov 2014 09:23:07 +0100 Subject: [PATCH] regenerated bug 8101 test ref Change-Id: I6f2b9e1e70d79737ea9cf046619cc478b485a870 (cherry picked from commit 3aa1b65fea94ca175ab1135735a7ac802c80727f) --- .../statistics/tests/nonreg_tests/bug_8101.dia.ref | 22 ++--- .../statistics/tests/nonreg_tests/bug_8101.tst | 87 ++++++++++---------- 2 files changed, 51 insertions(+), 58 deletions(-) diff --git a/scilab/modules/statistics/tests/nonreg_tests/bug_8101.dia.ref b/scilab/modules/statistics/tests/nonreg_tests/bug_8101.dia.ref index 842c991..387dcb9 100644 --- a/scilab/modules/statistics/tests/nonreg_tests/bug_8101.dia.ref +++ b/scilab/modules/statistics/tests/nonreg_tests/bug_8101.dia.ref @@ -14,26 +14,18 @@ // The median function with a sparse as a first argument did not return the // good result. Moreover, median(sparse,'r'|'c") were not supported. // ============================================================================= -s=sparse([1 0 2 0 0 ; 0 -4 0 0 7 ]) - s = - -( 2, 5) sparse matrix - -( 1, 1) 1. -( 1, 3) 2. -( 2, 2) - 4. -( 2, 5) 7. +s=sparse([1 0 2 0 0 ; 0 -4 0 0 7 ]); y = median(s); res = sparse(median(full(s))); assert_checkequal(y, res); -y = median(s, 'r'); -res = sparse(median(full(s), 'r')); +y = median(s, "r"); +res = sparse(median(full(s), "r")); assert_checkequal(y, res); -y = median(s, 'c'); -res = sparse(median(full(s), 'c')); +y = median(s, "c"); +res = sparse(median(full(s), "c")); assert_checkequal(y, res); -y = median(s, 'm'); -res = sparse(median(full(s), 'm')); +y = median(s, "m"); +res = sparse(median(full(s), "m")); assert_checkequal(y, res); y = median(s, 1); res = sparse(median(full(s), 1)); diff --git a/scilab/modules/statistics/tests/nonreg_tests/bug_8101.tst b/scilab/modules/statistics/tests/nonreg_tests/bug_8101.tst index 0efa988..32992b7 100644 --- a/scilab/modules/statistics/tests/nonreg_tests/bug_8101.tst +++ b/scilab/modules/statistics/tests/nonreg_tests/bug_8101.tst @@ -1,43 +1,44 @@ -// ============================================================================= -// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab -// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS -// -// This file is distributed under the same license as the Scilab package. -// ============================================================================= - -// <-- CLI SHELL MODE --> - -// <-- Non-regression test for bug 8101 --> -// -// <-- Bugzilla URL --> -// http://bugzilla.scilab.org/show_bug.cgi?id=8101 -// -// <-- Short Description --> -// The median function with a sparse as a first argument did not return the -// good result. Moreover, median(sparse,'r'|'c") were not supported. -// ============================================================================= - -s=sparse([1 0 2 0 0 ; 0 -4 0 0 7 ]) -y = median(s); -res = sparse(median(full(s))); -assert_checkequal(y, res); - -y = median(s, 'r'); -res = sparse(median(full(s), 'r')); -assert_checkequal(y, res); - -y = median(s, 'c'); -res = sparse(median(full(s), 'c')); -assert_checkequal(y, res); - -y = median(s, 'm'); -res = sparse(median(full(s), 'm')); -assert_checkequal(y, res); - -y = median(s, 1); -res = sparse(median(full(s), 1)); -assert_checkequal(y, res); - - - - +// ============================================================================= +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2012 - Scilab Enterprises - Adeline CARNIS +// +// This file is distributed under the same license as the Scilab package. +// ============================================================================= + +// <-- CLI SHELL MODE --> + +// <-- Non-regression test for bug 8101 --> +// +// <-- Bugzilla URL --> +// http://bugzilla.scilab.org/show_bug.cgi?id=8101 +// +// <-- Short Description --> +// The median function with a sparse as a first argument did not return the +// good result. Moreover, median(sparse,'r'|'c") were not supported. +// ============================================================================= + +s=sparse([1 0 2 0 0 ; 0 -4 0 0 7 ]); +y = median(s); +res = sparse(median(full(s))); +assert_checkequal(y, res); + +y = median(s, "r"); +res = sparse(median(full(s), "r")); +assert_checkequal(y, res); + +y = median(s, "c"); +res = sparse(median(full(s), "c")); +assert_checkequal(y, res); + +y = median(s, "m"); +res = sparse(median(full(s), "m")); +assert_checkequal(y, res); + +y = median(s, 1); +res = sparse(median(full(s), 1)); +assert_checkequal(y, res); + + + + + -- 1.7.9.5