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

Mc tools #29

Merged
merged 4 commits into from
Sep 15, 2022
Merged

Mc tools #29

merged 4 commits into from
Sep 15, 2022

Conversation

iintSjds
Copy link
Member

added locate and volumn for monte carlo simulation

@codecov-commenter
Copy link

codecov-commenter commented Sep 15, 2022

Codecov Report

Merging #29 (09dc2a3) into master (c64c55c) will increase coverage by 0.58%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #29      +/-   ##
==========================================
+ Coverage   45.50%   46.08%   +0.58%     
==========================================
  Files           9        9              
  Lines        1191     1202      +11     
==========================================
+ Hits          542      554      +12     
+ Misses        649      648       -1     
Impacted Files Coverage Δ
src/grid/interpolate.jl 62.02% <100.00%> (+1.25%) ⬆️
src/grid/simple.jl 94.87% <0.00%> (+0.85%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

return abs(x-grid[i])<abs(x-grid[i+1]) ? i : (i+1)
end

function volumn(grid::AbstractGrid, i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

volumn -> volume ?

i = floor(grid, x)
return abs(x-grid[i])<abs(x-grid[i+1]) ? i : (i+1)
end

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation. Something like:

returns the span of the grid point. If the grid points are ...x_{i-1}, x_i, x_{i+1},..., then the volume of x_i is defined as (x_{i+1}-x_{i-1})/2. The volume of the grid points on the boundary is halved.

@@ -864,4 +864,23 @@ function differentiate1D(::CompositeDifferentiate, data, xgrid, x)
return differentiate1D(view(data, head:tail), xgrid.subgrids[i], x)
end

# locate and volumn for monte carlo

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

documentation

@iintSjds iintSjds merged commit e6094d1 into master Sep 15, 2022
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

Successfully merging this pull request may close these issues.

3 participants