Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/AbstractFixedEffectSolver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,11 @@ function FixedEffects.solve_coefficients!(r::AbstractVector, feM::AbstractFixedE
if !(feM.weights isa UnitWeights)
feM.b .*= sqrt.(feM.weights)
end
fill!(feM.x, 0.0)
fill!(feM.x, zero(T))
x, ch = lsmr!(feM.x, feM.m, feM.b, feM.v, feM.h, feM.hbar; atol = tol, btol = tol, maxiter = maxiter)
for (x, scale) in zip(feM.x.x, feM.m.scales)
x .*= scale
end
x = Vector{eltype(r)}[collect(x) for x in feM.x.x]
full(normalize!(x, feM.m.fes; tol = tol, maxiter = maxiter), feM.m.fes), div(ch.mvps, 2), ch.isconverged
end
end
8 changes: 4 additions & 4 deletions src/FixedEffectCoefficients.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Define methods used in LSMR
e# Define methods used in LSMR

##############################################################################
##
Expand Down Expand Up @@ -28,14 +28,14 @@ end

function Base.fill!(fecoefs::FixedEffectCoefficients, α::Number)
for x in fecoefs.x
fill!(x, α)
fill!(x, eltype(fecoefs)(α))
end
return fecoefs
end

function LinearAlgebra.rmul!(fecoefs::FixedEffectCoefficients, α::Number)
for x in fecoefs.x
rmul!(x, α)
rmul!(x, eltype(fecoefs)(α))
end
return fecoefs
end
Expand All @@ -52,4 +52,4 @@ function LinearAlgebra.axpy!(α::Number, fecoefs1::FixedEffectCoefficients, feco
axpy!(α, x1, x2)
end
return fecoefs2
end
end