2 // =============================================================================
3 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 // Copyright (C) 2020 - Samuel GOUGEON
6 // This file is distributed under the same license as the Scilab package.
7 // =============================================================================
9 // <-- CLI SHELL MODE -->
10 // <-- NO CHECK REF -->
12 A = list(rand(4,5), rand(4,5) + rand(4,5)*%i, ..
13 sprand(4,5,0.5), sprand(4,5,0.5) + sprand(4,5,0.5)*%i);
14 B = list(rand(5,6), rand(5,6)+rand(5,6)*%i, ..
15 sprand(5,6,0.5), sprand(5,6,0.5) + sprand(5,6,0.5)*%i);
20 // p = a * b => a = p / b
27 // complex sparse / complex sparse is not supported
28 if ~isspa & ~isspb | (isspa & isspb & (~isreal(a) | ~isreal(b)))
33 if ~issparse(p) | ~isspb
34 assert_checkfalse(issparse(a2));
36 assert_checktrue(issparse(a2));
38 assert_checkequal(size(a2), size(a));
39 assert_checkalmostequal(clean(a2*b,%eps,%eps), p);
44 SB = list(rand(5,5), rand(5,5)+rand(5,5)*%i, ..
45 sprand(5,5,0.5), sprand(5,5,0.5) + sprand(5,5,0.5)*%i);
55 if ~issparse(p) | ~isspb
56 assert_checkfalse(issparse(a2));
58 assert_checktrue(issparse(a2));
60 assert_checkequal(size(a2), size(a));
61 assert_checkalmostequal(clean(a2*b,%eps,%eps), p);
68 // p = a * b => b = a \ p
75 // complex sparse \ complex sparse is not supported
76 if ~isspa & ~isspb | (isspa & isspb & (~isreal(a) | ~isreal(b)))
81 if ~isspa | ~issparse(p)
82 assert_checkfalse(issparse(b2));
84 assert_checktrue(issparse(b2));
86 assert_checkequal(size(b2), size(b));
87 assert_checkalmostequal(clean(a*b2,%eps,%eps), p);
102 if ~isspa | ~issparse(p)
103 assert_checkfalse(issparse(b2));
105 assert_checktrue(issparse(b2));
107 assert_checkequal(size(b2), size(b));
108 assert_checkalmostequal(clean(a*b2,%eps,%eps), p);