Skip to content

Commit bdbe6e0

Browse files
committed
Change all AbstractFloat to Real
1 parent 572fb86 commit bdbe6e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/approximations/nystrom.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function nystrom_sample(k::Kernel, X::AbstractMatrix, S::Vector{<:Integer}; obsd
1717
return (C, Cs)
1818
end
1919

20-
function nystrom_pinv!(Cs::Matrix{T}, tol::T=eps(T)*size(Cs,1)) where {T<:AbstractFloat}
20+
function nystrom_pinv!(Cs::Matrix{T}, tol::T=eps(T)*size(Cs,1)) where {T<:Real}
2121
# Compute eigendecomposition of sampled component of K
2222
QΛQᵀ = LinearAlgebra.eigen!(LinearAlgebra.Symmetric(Cs))
2323

@@ -76,7 +76,7 @@ function nystrom(k::Kernel, X::AbstractMatrix, S::Vector{<:Integer}; obsdim::Int
7676
end
7777

7878
@doc raw"""
79-
nystrom(k::Kernel, X::Matrix, r::AbstractFloat; obsdim::Int=defaultobs)
79+
nystrom(k::Kernel, X::Matrix, r::Real; obsdim::Int=defaultobs)
8080
8181
Computes a factorization of Nystrom approximation of the square kernel matrix of data
8282
matrix `X` with respect to kernel `k` using a sample ratio of `r`.
@@ -85,7 +85,7 @@ Returns a `NystromFact` struct which stores a Nystrom factorization satisfying:
8585
\mathbf{K} \approx \mathbf{C}^{\intercal}\mathbf{W}\mathbf{C}
8686
```
8787
"""
88-
function nystrom(k::Kernel, X::AbstractMatrix, r::AbstractFloat; obsdim::Int=defaultobs)
88+
function nystrom(k::Kernel, X::AbstractMatrix, r::Real; obsdim::Int=defaultobs)
8989
S = sampleindex(X, r; obsdim=obsdim)
9090
return nystrom(k, X, S; obsdim=obsdim)
9191
end
@@ -95,7 +95,7 @@ end
9595
9696
Compute the approximate kernel matrix based on the Nystrom factorization.
9797
"""
98-
function kernelmatrix(CᵀWC::NystromFact{<:AbstractFloat})
98+
function kernelmatrix(CᵀWC::NystromFact{<:Real})
9999
W = CᵀWC.W
100100
C = CᵀWC.C
101101
return C'*W*C

0 commit comments

Comments
 (0)