@@ -29,7 +29,7 @@ finalize() = icxx"El::Finalize();"
2929# ## ElementalMatrix ###
3030# Many of the definitions in Elemental are very similar which makes it easy to define methods for a common abstract type. However, we should be careful when calling into the library with e.g. @cxx or icxx because all leaf types might not implement the actual method.
3131
32- @compat abstract type ElementalMatrix{T} <: AbstractMatrix{T} end
32+ abstract type ElementalMatrix{T} <: AbstractMatrix{T} end
3333
3434_getindex (A:: ElementalMatrix , i:: ElInt , j:: ElInt ) = icxx " $(A.buf).Get($i, $j);"
3535getindex (A:: ElementalMatrix , i:: Integer , j:: Integer ) = _getindex (A, ElInt (i - 1 ), ElInt (j - 1 ))
6363svdvals (A:: ElementalMatrix ) = svdvals! (copy (A))
6464
6565# ## AbstractDistMatrix ###
66- @compat abstract type AbstractDistMatrix{T} <: ElementalMatrix{T} end
66+ abstract type AbstractDistMatrix{T} <: ElementalMatrix{T} end
6767
6868_resize! (A:: AbstractDistMatrix , i:: ElInt , j:: ElInt ) = icxx " $(A.buf).Resize($i, $j);"
6969resize! (A:: AbstractDistMatrix , i:: Integer , j:: Integer ) = _resize! (A, ElInt (i), ElInt (j))
7070
7171_reserve (A:: AbstractDistMatrix , n:: ElInt ) = icxx " $(A.buf).Reserve($n);"
7272reserve (A:: AbstractDistMatrix , n:: Integer ) = _reserve (A, ElInt (n))
7373
74- _queueUpdate {T} (A:: AbstractDistMatrix{T} , i:: ElInt , j:: ElInt , x:: T ) = icxx " $(A.buf).QueueUpdate($i, $j, $x);"
75- queueUpdate {T} (A:: AbstractDistMatrix{T} , i:: Integer , j:: Integer , x) = _queueUpdate (A, ElInt (i - 1 ), ElInt (j - 1 ), T (x))
74+ _queueUpdate (A:: AbstractDistMatrix{T} , i:: ElInt , j:: ElInt , x:: T ) where {T} = icxx " $(A.buf).QueueUpdate($i, $j, $x);"
75+ queueUpdate (A:: AbstractDistMatrix{T} , i:: Integer , j:: Integer , x) where {T} = _queueUpdate (A, ElInt (i - 1 ), ElInt (j - 1 ), T (x))
7676
7777processQueues! (A:: AbstractDistMatrix ) = icxx " $(A.buf).ProcessQueues();"
7878
@@ -81,7 +81,7 @@ zeros!(A::AbstractDistMatrix, m::Integer = size(A,1), n::Integer = size(A,2)) =
8181
8282# ## Matrix ###
8383
84- immutable Matrix{T} <: ElementalMatrix{T}
84+ struct Matrix{T} <: ElementalMatrix{T}
8585 # buf::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppTemplate{Cxx.CppBaseType{symbol("El::Matrix")},Tuple{T}},(false,false,false)},56}
8686 buf:: Any
8787end
@@ -91,7 +91,7 @@ convert(::Type{Matrix{Float64}}, m::ElInt = 0, n::ElInt = 0) = Matrix{Float64}(i
9191
9292_randn! (A:: Matrix , i:: ElInt , j:: ElInt ) = icxx " Gaussian($(A.buf), $i, $j);"
9393
94- function svdvals! {T} (A:: Matrix{T} )
94+ function LinearAlgebra . svdvals! (A:: Matrix{T} ) where {T}
9595 s = Matrix {T} (min (size (A)... ),1 )
9696 @cxx El:: SVD (A. buf, s. buf)
9797 return s
101101
102102# DistMatrix
103103
104- immutable DistMatrix{T,U,V} <: AbstractDistMatrix{T}
104+ struct DistMatrix{T,U,V} <: AbstractDistMatrix{T}
105105 # buf::Cxx.CppValue{Cxx.CxxQualType{Cxx.CppTemplate{Cxx.CppBaseType{symbol("El::DistMatrix")},Tuple{T,U,V,U}},(false,false,false)},144}
106106 buf:: Any
107107end
@@ -115,18 +115,18 @@ convert(::Type{Cxx.CppEnum{symbol("El::DistWrapNS::DistWrap")}}, x::Int) = Cxx.C
115115
116116convert (:: Type{DistMatrix{Float32,MC,MR}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMatrix {Float32,MC,MR} (icxx " El::DistMatrix<float,El::MC,El::MR>($m,$n);" )
117117convert (:: Type{DistMatrix{Float64,MC,MR}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMatrix {Float64,MC,MR} (icxx " El::DistMatrix<double,El::MC,El::MR>($m,$n);" )
118- convert {T} (:: Type{DistMatrix{T}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMatrix {T,MC,MR} (m, n)
118+ convert (:: Type{DistMatrix{T}} , m:: ElInt = 0 , n:: ElInt = 0 ) where {T} = DistMatrix {T,MC,MR} (m, n)
119119
120120_randn! (A:: DistMatrix , i:: ElInt , j:: ElInt ) = icxx " Gaussian($(A.buf), $i, $j);"
121121
122- function svdvals! {T} (A:: DistMatrix{T} )
122+ function LinearAlgebra . svdvals! (A:: DistMatrix{T} ) where {T}
123123 s = DistMatrix {T} (min (size (A)... ),1 )
124124 @cxx El:: SVD (A. buf, s. buf)
125125 return s
126126end
127127
128128# DistSparseMatrix
129- immutable DistSparseMatrix{T} <: AbstractDistMatrix{T}
129+ struct DistSparseMatrix{T} <: AbstractDistMatrix{T}
130130 buf:: Any
131131end
132132
@@ -136,16 +136,16 @@ convert(::Type{DistSparseMatrix{Float64}}, m::ElInt = 0, n::ElInt = 0) = DistSpa
136136processLocalQueues! (A:: DistSparseMatrix ) = icxx " $(A.buf).ProcessLocalQueues();"
137137
138138# DistMultiVec
139- immutable DistMultiVec{T} <: AbstractDistMatrix{T}
139+ struct DistMultiVec{T} <: AbstractDistMatrix{T}
140140 buf:: Any
141141end
142142
143143convert (:: Type{DistMultiVec{ElInt}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMultiVec {ElInt} (icxx " El::DistMultiVec<El::Int>($m,$n);" )
144144convert (:: Type{DistMultiVec{Float32}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMultiVec {Float32} (icxx " El::DistMultiVec<float>($m,$n);" )
145145convert (:: Type{DistMultiVec{Float64}} , m:: ElInt = 0 , n:: ElInt = 0 ) = DistMultiVec {Float64} (icxx " El::DistMultiVec<double>($m,$n);" )
146146
147- _setindex! {T} (A:: DistMultiVec{T} , x:: T , i:: ElInt , j:: ElInt ) = icxx " $(A.buf).Set($i, $j, $x);"
148- setindex! {T} (A:: DistMultiVec{T} , x, i:: Integer , j:: Integer ) = _setindex! (A, T (x), ElInt (i - 1 ), ElInt (j - 1 ))
147+ _setindex! (A:: DistMultiVec{T} , x:: T , i:: ElInt , j:: ElInt ) where {T} = icxx " $(A.buf).Set($i, $j, $x);"
148+ setindex! (A:: DistMultiVec{T} , x, i:: Integer , j:: Integer ) where {T} = _setindex! (A, T (x), ElInt (i - 1 ), ElInt (j - 1 ))
149149
150150
151151# ## SOCP ###
0 commit comments