Skip to content

Commit 692120d

Browse files
authored
Merge pull request #94 from abhro/petite-output
Make Base.show() output more petite
2 parents c5d24f9 + 8668ea8 commit 692120d

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
@@ -50,7 +50,9 @@ for any matrix-like object `M`.
5050
struct LinearMap{M} <: AbstractAffineMap
5151
linear::M
5252
end
53-
Base.show(io::IO, trans::LinearMap) = print(io, "LinearMap($(trans.linear))") # TODO make this output more petite
53+
function Base.show(io::IO, trans::LinearMap)
54+
print(io, "LinearMap(", trans.linear, ")")
55+
end
5456

5557
function (trans::LinearMap{M})(x) where {M}
5658
trans.linear * x
@@ -130,7 +132,9 @@ function AffineMap(trans::Transformation, x0)
130132
AffineMap(dT, Tx - dT*x0)
131133
end
132134

133-
Base.show(io::IO, trans::AffineMap) = print(io, "AffineMap($(trans.linear), $(trans.translation))") # TODO make this output more petite
135+
function Base.show(io::IO, trans::AffineMap)
136+
print(io, "AffineMap(", trans.linear, ", ", trans.translation, ")")
137+
end
134138

135139
function compose(t1::Translation, t2::LinearMap)
136140
AffineMap(t2.linear, t1.translation)

0 commit comments

Comments
 (0)