@@ -7,6 +7,7 @@ function Base.map!(
77 mask, accum, desc = _handlenothings (mask, accum, desc)
88 op = getoperator (op, eltype (A))
99 accum = getoperator (accum, eltype (C))
10+ A, desc = _handletranspose (A, desc)
1011 if C isa GBVector && A isa GBVector
1112 libgb. GrB_Vector_apply (C, mask, accum, op, A, desc)
1213 elseif C isa GBMatrix && A isa GBMatrix
@@ -36,6 +37,7 @@ function Base.map!(
3637 mask, accum, desc = _handlenothings (mask, accum, desc)
3738 op = getoperator (op, optype (eltype (A), typeof (x)))
3839 accum = getoperator (accum, eltype (C))
40+ _, desc, A = _handletranspose (nothing , desc, A)
3941 if C isa GBVector && A isa GBVector
4042 libgb. scalarvecapply1st[optype (typeof (x), eltype (A))](C, mask, accum, op, x, A, desc)
4143 elseif C isa GBMatrix && A isa GBMatrix
@@ -66,6 +68,7 @@ function Base.map!(
6668 mask, accum, desc = _handlenothings (mask, accum, desc)
6769 op = getoperator (op, optype (eltype (A), typeof (x)))
6870 accum = getoperator (accum, eltype (C))
71+ A, desc, _ = _handletranspose (A, desc)
6972 if C isa GBVector && A isa GBVector
7073 libgb. scalarvecapply2nd[optype (typeof (x), eltype (A))](C, mask, accum, op, A, x, desc)
7174 elseif C isa GBMatrix && A isa GBMatrix
@@ -89,25 +92,41 @@ function Base.map(
8992 return map! (op, similar (A, t), A, x; mask, accum, desc)
9093end
9194
92- function Base. broadcasted (:: typeof (+ ), u:: GBArray , x:: valid_union
93- )
95+ function Base. broadcasted (:: typeof (+ ), u:: GBArray , x:: valid_union )
9496 map (BinaryOps. PLUS, u, x)
9597end
96- function Base. broadcasted (
97- :: typeof (+ ), x:: valid_union , u:: GBArray
98- )
98+ function Base. broadcasted (:: typeof (+ ), x:: valid_union , u:: GBArray )
9999 map (BinaryOps. PLUS, x, u)
100100end
101101
102- function Base. broadcasted (:: typeof (* ), u:: GBArray , x:: valid_union
103- )
102+ function Base. broadcasted (:: typeof (- ), u:: GBArray , x:: valid_union )
103+ map (BinaryOps. MINUS, u, x)
104+ end
105+ function Base. broadcasted (:: typeof (- ), x:: valid_union , u:: GBArray )
106+ map (BinaryOps. MINUS, x, u)
107+ end
108+
109+ function Base. broadcasted (:: typeof (* ), u:: GBArray , x:: valid_union )
104110 map (BinaryOps. TIMES, u, x)
105111end
106- function Base. broadcasted (:: typeof (* ), x:: valid_union , u:: GBArray
107- )
112+ function Base. broadcasted (:: typeof (* ), x:: valid_union , u:: GBArray )
108113 map (BinaryOps. TIMES, x, u)
109114end
110115
116+ function Base. broadcasted (:: typeof (/ ), u:: GBArray , x:: valid_union )
117+ map (BinaryOps. DIV, u, x)
118+ end
119+ function Base. broadcasted (:: typeof (/ ), x:: valid_union , u:: GBArray )
120+ map (BinaryOps. DIV, x, u;)
121+ end
122+
123+ function Base. broadcasted (:: typeof (^ ), u:: GBArray , x:: valid_union )
124+ map (BinaryOps. POW, u, x)
125+ end
126+ function Base. broadcasted (:: typeof (^ ), x:: valid_union , u:: GBArray )
127+ map (BinaryOps. POW, x, u)
128+ end
129+
111130"""
112131 map(op::UnaryOp, A::GBArray; kwargs...)::GBArray
113132 map(op::BinaryOp, A::GBArray, x; kwargs...)::GBArray
0 commit comments