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

Change order for the 2nd order derivative tensors #154

Open
6 tasks
jlperla opened this issue Aug 4, 2022 · 0 comments
Open
6 tasks

Change order for the 2nd order derivative tensors #154

jlperla opened this issue Aug 4, 2022 · 0 comments

Comments

@jlperla
Copy link
Member

jlperla commented Aug 4, 2022

The storage order for the A_2 and C_2 3-tensors should be reversed. This shoudl be done in conjunction with SciML/DifferenceEquations.jl#54

Instead of a 3-tensor, the natural datastructure is a vector of matrices, which will make the calculation of likelihoods/etc. and simulatino much more convenient. Basically we want to have the transformation of the current structure from C_2 to C_2_new and then get rid of the old C_2.

C_2_new = [C_2[i, :, :] for i in 1:size(C_2, 1)] 

To do this,

        fill!(c.C_2, zero(eltype(c.C_2)))  # reset as we need to use `+=`
        for i in 1:n_z
            for j in 1:n_y
                c.C_2[i, :, :] += 0.5 * c.Q[i, j] * c.g_xx[j, :, :]
            end
        end

becomes something like

        fill!.(c.C_2, Ref(zero(eltype(c.C_2[1])))  # reset as we need to use `+=`
        for i in 1:n_z
            for j in 1:n_y
                c.C_2[i]+= 0.5 * c.Q[i, j] * c.g_xx[j, :, :]
            end
        end

After this is done, SciML/DifferenceEquations.jl#54 can then be sync'd up - which might be required for the full unit tests to pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant