Skip to main content
9 events
when toggle format what by license comment
Jun 18, 2014 at 23:30 comment added user1235831 Linear algebra is also my weakness... That is why I am challenging it ;)
Jun 18, 2014 at 23:23 comment added user1235831 I have made the revision. Here is the link: codereview.stackexchange.com/questions/54667/… I made this into a single function and added your method within it as a choice. I am new to this so let me know if I am giving credits incorrectly.
Jun 18, 2014 at 23:14 comment added Flambino @user1235831 Awesome, glad you found it useful! And yes, do feel free to add your own answer, or (better yet, if you feel like it) to post a new question with the revised code. Let more people look it over. I should add that I also got bogged down simply because linear algebra's never been my strong suit and it's been a long time since I last dealt with it :)
Jun 18, 2014 at 22:42 comment added user1235831 Don't worry about the main function; there is usable information in the fact that you read it, but found it too time consuming to digest it. You literally told me the simple and valid reason: too short variable names. (They are also just bad) I was mostly asking about general review about my style, and you delivered nicely. The code itself is too terse and that is a big problem. I will add the revision in another answer later, it might be the next weekend when I have more time. I will let you know here in the comment section when it is ready. Again, thanks.
Jun 18, 2014 at 21:25 comment added Flambino @user1235831 No problem. I may still take a crack at reviewing the main function, but I haven't found the time. Generally, though, using Array's map, reduce and their friends should help (also things like findIndex - see link in answer - which aren't available everywhere, but easy to write yourself). Factoring out some commonly used functions like scaling a vector/row, transposing a matrix, etc., would also help clean things up, I'd bet. Lastly, if you've got a normal for loop, consider using continue to skip an iteration instead of wrapping everything in an if block
Jun 18, 2014 at 21:10 vote accept user1235831
Jun 18, 2014 at 16:38 history edited Flambino CC BY-SA 3.0
added 12 characters in body
Jun 17, 2014 at 23:59 history edited Flambino CC BY-SA 3.0
added 49 characters in body
Jun 17, 2014 at 22:05 history answered Flambino CC BY-SA 3.0