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

Language inconsistencies for different implementations #625

Open
leios opened this issue Jul 22, 2019 · 2 comments
Open

Language inconsistencies for different implementations #625

leios opened this issue Jul 22, 2019 · 2 comments
Labels
Problem This is a problem in the archive or an implementation.

Comments

@leios
Copy link
Member

leios commented Jul 22, 2019

Notice

Description

This is a list of all the language inconsistencies with certain implementations in the Algorithm Archive

  1. Monte Carlo: in_circle(...) function reads in a radius in some languages and does not in others. Note: I personally think that these functions should not read in a radius parameter, simply because it is easier to pass around function pointers to similar in_shape(...) functions if we just use x and y as our parameters. Feel free to disagree.

I figure we should consistently update this list as more of these inconsistencies are found.

@leios leios added the Problem This is a problem in the archive or an implementation. label Jul 22, 2019
@Liikt
Copy link
Contributor

Liikt commented Jul 22, 2019

I believe it was the gauss elimination chapter where a language (I want to say python) outputs things in a different order than the rest. Will check once i have the chance. Not a big problem, but more a slight inconsistency

EDIT:
So what I found so far in the gauss chapter code is that

  • Rust only prints the Solution,
  • Go prints original matrix, Gauss elimination, Gauss-Jordan, Solution in that Order (my preferred way)
  • Julia only prints 3 Arrays of which i assume the last one is the solution, but without any description
  • JS prints Gauss, Gauss-Jordan, Solution
  • Java prints Gauss, Gauss-Jordan, Solution
  • Haskell doesn't work with the standard ghc (a new issue I assume?) but should print Original Matrix, Echelon Form, Reduced Echelon Form and Solution in that order
  • C prints Gauss, Gauss-Jordan, Solution
  • C++ prints Original Matrix, Gauss, Solution, Gauss-Jordan

Personally I prefer the way go does it, so original matrix, Gauss elimination, Gauss-Jordan, Solution and also with a line that says what we are currently looking at.

EDIT 2:
Not sure how important that is but in case the matrix would be singular:

  • Go, C, Java, JS and Julia continue the loop and print that the matrix is singular
  • C++, Haskell and Python continue the loop but don't print anything
  • Rust prints that the matrix is singular but returns and doesn't continue

@leios
Copy link
Member Author

leios commented Jul 22, 2019

Yeah, please note these here and I'll update the list!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Problem This is a problem in the archive or an implementation.
Projects
None yet
Development

No branches or pull requests

2 participants