c Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
c Copyright (C) INRIA
-c
+c
c This file must be used under the terms of the CeCILL.
c This source file is licensed as described in the file COPYING, which
c you should have received as part of this distribution. The terms
-c are also available at
+c are also available at
c http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
c SCILAB function ordmmd
nbvars=0
c*****************************************************
c 0-Check number of rhs and lhs arguments
-c*****************************************************
+c*****************************************************
minrhs=3
maxrhs=3
minlhs=3
if(.not.getrhsvar(1,'i',m1,n1,l1)) return
if(.not.getrhsvar(2,'i',m2,n2,l2)) return
if(.not.getrhsvar(3,'i',m3,n3,l3)) return
-
+c*******************************************************
+c 1.1-Verify the input.
+c*******************************************************
+ if(istk(l3).ne.m1-1) then
+ buf = ' The provided "n" does not correspond to the matrix'//
+ + ' defined by xadj and iadj'
+ call error(9999)
+ return
+ endif
c*****************************************************
-c 2-If necessary, create additional variables
+c 2-If necessary, create additional variables
c (working arrays, default values, ...)
c*****************************************************
if(.not.createvar(k, 'i',istk(l3),1,l4)) return
if(.not.createvar(k+1,'i',istk(l3),1,l5)) return
if(.not.createvar(k+2,'i',1,1,l6)) return
- if(.not.createvar(k+3,'i',4*istk(l3),1,l7)) return
+ if(.not.createvar(k+3,'i',4*istk(l3),1,l7)) return
c******************************************************
c 3-Routine call
c stk <-> double
c******************************************************
c 4-Display error message(s)
c******************************************************
- if(iflag .NE. 0) then
+ if(iflag .NE. 0) then
buf = ' insufficient working storage'
call error(9999)
return
return
end
c ======================================
-
--- /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 10271 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10271
+//
+// <-- Short Description -->
+// ordmmd now checks the consistency of the third input argument with the
+// input matrix defined by the two first input arguments.
+A = ReadHBSparse(SCI+"/modules/umfpack/examples/ex14.rua");
+[xadj, iadj, val] = sp2adj(A);
+n = floor(size(A, "r")/2);
+refMsg = msprintf(_(" The provided ""n"" does not correspond to the matrix defined by xadj and iadj"));
+assert_checkerror("[perm, invp, nofsub] = ordmmd(xadj, iadj, n);", refMsg);
--- /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 10271 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=10271
+//
+// <-- Short Description -->
+// ordmmd now checks the consistency of the third input argument with the
+// input matrix defined by the two first input arguments.
+
+A = ReadHBSparse(SCI+"/modules/umfpack/examples/ex14.rua");
+
+[xadj, iadj, val] = sp2adj(A);
+n = floor(size(A, "r")/2);
+
+refMsg = msprintf(_(" The provided ""n"" does not correspond to the matrix defined by xadj and iadj"));
+assert_checkerror("[perm, invp, nofsub] = ordmmd(xadj, iadj, n);", refMsg);