@@ -48,10 +48,12 @@ typealias ConjRowVector{T, CV <: ConjVector} RowVector{T, CV}
48
48
convert {T,V<:AbstractVector} (:: Type{RowVector{T,V}} , rowvec:: RowVector ) =
49
49
RowVector {T,V} (convert (V,rowvec. vec))
50
50
51
- # similar()
52
- @inline similar (rowvec:: RowVector ) = RowVector (similar (rowvec. vec))
53
- @inline similar {T} (rowvec:: RowVector , :: Type{T} ) = RowVector (similar (rowvec. vec, transpose_type (T)))
54
- # There is no resizing similar() because it would be ambiguous if the result were a Matrix or a RowVector
51
+ # similar tries to maintain the RowVector wrapper and the parent type
52
+ @inline similar (rowvec:: RowVector ) = RowVector (similar (parent (rowvec)))
53
+ @inline similar {T} (rowvec:: RowVector , :: Type{T} ) = RowVector (similar (parent (rowvec), transpose_type (T)))
54
+
55
+ # Resizing similar currently looses its RowVector property.
56
+ @inline similar {T,N} (rowvec:: RowVector , :: Type{T} , dims:: Dims{N} ) = similar (parent (rowvec), T, dims)
55
57
56
58
# Basic methods
57
59
"""
@@ -84,8 +86,11 @@ julia> transpose(v)
84
86
85
87
parent (rowvec:: RowVector ) = rowvec. vec
86
88
87
- # Strictly, these are unnecessary but will make things stabler if we introduce
88
- # a "view" for conj(::AbstractArray)
89
+ """
90
+ conj(rowvector)
91
+
92
+ Returns a `ConjArray` lazy view of the input, where each element is conjugated.
93
+ """
89
94
@inline conj (rowvec:: RowVector ) = RowVector (_conj (rowvec. vec))
90
95
@inline conj {T<:Real} (rowvec:: RowVector{T} ) = rowvec
91
96
0 commit comments