1function C = emult (arg1, arg2, arg3, arg4, arg5, arg6, arg7)
2%GRB.EMULT sparse element-wise 'multiplication'.
3%
4%   C = GrB.emult (op, A, B, desc)
5%   C = GrB.emult (Cin, accum, op, A, B, desc)
6%   C = GrB.emult (Cin, M, op, A, B, desc)
7%   C = GrB.emult (Cin, M, accum, op, A, B, desc)
8%
9% GrB.emult computes the element-wise 'multiplication' T=A.*B.  The result
10% T has the pattern of the intersection of A and B. The operator is used
11% where A(i,j) and B(i,j) are present.  Otherwise the entry does not
12% appear in T.
13%
14%   if (A(i,j) and B(i,j) is present)
15%       T(i,j) = op (A(i,j), B(i,j))
16%
17% T is then accumulated into C via C<#M,replace> = accum (C,T).
18%
19% Cin, M, accum, and the optional descriptor desc are the same as all other
20% GrB.methods; see GrB.mxm and GrB.descriptorinfo for more details.  For the
21% binary operator, see GrB.binopinfo.
22%
23% See also GrB.eadd.
24
25% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2021, All Rights Reserved.
26% SPDX-License-Identifier: GPL-3.0-or-later
27
28if (isobject (arg1))
29    arg1 = arg1.opaque ;
30end
31
32if (isobject (arg2))
33    arg2 = arg2.opaque ;
34end
35
36if (nargin > 2 && isobject (arg3))
37    arg3 = arg3.opaque ;
38end
39
40if (nargin > 3 && isobject (arg4))
41    arg4 = arg4.opaque ;
42end
43
44if (nargin > 4 && isobject (arg5))
45    arg5 = arg5.opaque ;
46end
47
48if (nargin > 5 && isobject (arg6))
49    arg6 = arg6.opaque ;
50end
51
52switch (nargin)
53    case 3
54        [C, k] = gbemult (arg1, arg2, arg3) ;
55    case 4
56        [C, k] = gbemult (arg1, arg2, arg3, arg4) ;
57    case 5
58        [C, k] = gbemult (arg1, arg2, arg3, arg4, arg5) ;
59    case 6
60        [C, k] = gbemult (arg1, arg2, arg3, arg4, arg5, arg6) ;
61    case 7
62        [C, k] = gbemult (arg1, arg2, arg3, arg4, arg5, arg6, arg7) ;
63end
64
65if (k == 0)
66    C = GrB (C) ;
67end
68
69