Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of the Square root filter #22

Open
guilhermebodin opened this issue Nov 28, 2019 · 0 comments
Open

Improve performance of the Square root filter #22

guilhermebodin opened this issue Nov 28, 2019 · 0 comments
Labels
good first issue Good for newcomers

Comments

@guilhermebodin
Copy link
Member

Some steps on the square root filter can be optimized with auxiliary functions, for example:

U2star[:, :, t] = Ustar[range1, range2]
sqrtF_kf[:, :, t]  = Ustar[range2, range2]

These steps could be replaced with

function fill_U2star!(U2star::Array{T, 3}, Ustar::Matrix{T}, prods::Int, t::Int) where T
    for i in 1:prods, j in (prods + 1):(prods + 2)
       U2star[i, j, t] = Ustar[i, j]
    end
    return
end

function fill_sqrtF_kf!(sqrtF_kf::Array{T, 3}, Ustar::Matrix{T}, prods::Int, t::Int) where T
    for i in (prods + 1):(prods + 2), j in (prods + 1):(prods + 2)
        sqrtF_kf[i, j, t] = Ustar[i, j]
    end
    return
end
@guilhermebodin guilhermebodin added the good first issue Good for newcomers label Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant