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

order of vector shouldn't matter for calculations #71

Open
jordansread opened this issue Nov 21, 2016 · 3 comments
Open

order of vector shouldn't matter for calculations #71

jordansread opened this issue Nov 21, 2016 · 3 comments
Labels

Comments

@jordansread
Copy link
Member

schmidt.stability(wtr=c(30,10),depths=c(0,10),bthA=c(100,2),bthD=c(0,10))
         [,1]
[1,] 119.3527

schmidt.stability(wtr=c(10,30),depths=c(10,0),bthA=c(100,2),bthD=c(0,10))
              [,1]
[1,] -2.658799e-11

very different answer because the order of the depths was switched around. Still should yield the same result.

@jordansread
Copy link
Member Author

One way to deal with this is to require depths to be a monotonically increasing vector (error when it is not?)

@lawinslow
Copy link
Member

If its out of order, could we just order the data first thing in the function? Might take roughly the same amount of time as checking.

Also, does this order issue affect other functions? Could check and sort in the other functions as well if yes.

@markbfernandez
Copy link

This also affects thermo.depth().

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

No branches or pull requests

3 participants