algorithm-archive icon indicating copy to clipboard operation
algorithm-archive copied to clipboard

Language inconsistencies for different implementations

Open leios opened this issue 6 years ago • 2 comments

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 avatar Jul 22 '19 09:07 leios

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

Liikt avatar Jul 22 '19 10:07 Liikt

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

leios avatar Jul 22 '19 10:07 leios