Skip to content

Commit

Permalink
Remove sumabs2j (#67)
Browse files Browse the repository at this point in the history
* remove colsumabs2j

* update compat
  • Loading branch information
matthieugomez authored and sglyon committed Sep 5, 2016
1 parent 7961352 commit e41f170
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Expand Up @@ -3,4 +3,4 @@ Optim
Calculus
Distances
ForwardDiff 0.2.0
Compat 0.8.0
Compat 0.8.4
2 changes: 1 addition & 1 deletion src/NLsolve.jl
Expand Up @@ -6,7 +6,7 @@ using Distances
using Optim
using ForwardDiff
using Compat

import Compat.view
import Compat.String

import Base.show,
Expand Down
4 changes: 2 additions & 2 deletions src/trust_region.jl
Expand Up @@ -102,7 +102,7 @@ function trust_region_{T}(df::AbstractDifferentiableMultivariateFunction,

if autoscale
for j = 1:nn
d2[j] = sumabs2j(J, j)
d2[j] = sumabs2(view(J, :, j))
if d2[j] == zero(T)
d2[j] = one(T)
end
Expand Down Expand Up @@ -142,7 +142,7 @@ function trust_region_{T}(df::AbstractDifferentiableMultivariateFunction,
# Update scaling vector
if autoscale
for j = 1:nn
d2[j] = max(convert(T, 0.01) * d2[j], sumabs2j(J, j))
d2[j] = max(convert(T, 0.01) * d2[j], sumabs2(view(J, :, j)))
end
end

Expand Down
6 changes: 0 additions & 6 deletions src/utils.jl
@@ -1,9 +1,3 @@
sumabs2j(S::AbstractMatrix, j::Integer) = sumabs2(slice(S, :, j))

function sumabs2j(S::SparseMatrixCSC, j::Integer)
sumabs2(sub(nonzeros(S), nzrange(S, j)))
end

function wdot{T}(w::Vector{T}, x::Vector{T}, y::Vector{T})
out = zero(T)
@inbounds @simd for i in 1:length(x)
Expand Down

0 comments on commit e41f170

Please sign in to comment.