Skip to content

Commit 250d3ad

Browse files
authored
Make Base.show() output more petite
1 parent a0b7026 commit 250d3ad

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/affine.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ for any matrix-like object `M`.
4444
struct LinearMap{M} <: AbstractAffineMap
4545
linear::M
4646
end
47-
Base.show(io::IO, trans::LinearMap) = print(io, "LinearMap($(trans.linear))") # TODO make this output more petite
47+
function Base.show(io::IO, trans::LinearMap)
48+
print(io, "LinearMap(", trans.linear, ")")
49+
end
4850

4951
function (trans::LinearMap{M})(x) where {M}
5052
trans.linear * x
@@ -124,7 +126,9 @@ function AffineMap(trans::Transformation, x0)
124126
AffineMap(dT, Tx - dT*x0)
125127
end
126128

127-
Base.show(io::IO, trans::AffineMap) = print(io, "AffineMap($(trans.linear), $(trans.translation))") # TODO make this output more petite
129+
function Base.show(io::IO, trans::AffineMap)
130+
print(io, "AffineMap(", trans.linear, ", ", trans.translation, ")")
131+
end
128132

129133
function compose(t1::Translation, t2::LinearMap)
130134
AffineMap(t2.linear, t1.translation)

0 commit comments

Comments
 (0)