Skip to content

Commit 4c7ec86

Browse files
committed
Leave out identity matrices in specific cases
1 parent a3ade04 commit 4c7ec86

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/std.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,16 @@ function _to_std_string(arg::BinaryOperation{Mult})
363363
m_ids = get_indices(matrix)
364364
v_ids = get_indices(vector)
365365

366+
matrix_str = if matrix isa KrD
367+
""
368+
else
369+
_to_std_string(matrix)
370+
end
371+
366372
if m_ids[1] == v_ids[1]
367-
return "diag(" * _to_std_string(vector) * ")" * _to_std_string(matrix)
373+
return "diag(" * _to_std_string(vector) * ")" * matrix_str
368374
elseif m_ids[2] == v_ids[1]
369-
return _to_std_string(matrix) * " diag(" * _to_std_string(vector) * ")"
375+
return matrix_str * " diag(" * _to_std_string(vector) * ")"
370376
end
371377
end
372378

0 commit comments

Comments
 (0)