6 ms·
> how do I find eigenvalues and eigenvectors? The function is called ev! Why not call that function eigen-vectors instead of ev? Some library authors need to
by hota_mazi 9y ago
> how do I find eigenvalues and eigenvectors? The function is called ev!
Why not call that function eigen-vectors instead of ev?
Some library authors need to be smacked on the head with a programming book and learn how to design sensible API's.
Seriously, Clojure is typically easy on the eyes but this is just garbage:
(require '[uncomplicate.neanderthal
[core :refer [col entry nrm2 mv scal axpy copy mm dia]]
axpy? mm? dia? nrm2?
- dragandj 9y agoBecause when you string a couple of those please-compute-eigen-vectors-and-also-eigen-values in nested calls, you easily end up with a multi-page text in no time. Besides, the standard way to call eigenvectors/eigenvalues function is ev in LAPACK - sgeev/dgeev.
- hota_mazi 9y agoRenaming "ev" to "eigen" will result in multi pages of text? And even so, we know today it's preferable to have longer but easier to read code than this kind of garbage. > sgeev/dgeev. That's just as bad.
- dragandj 9y agoBut eigen-what? There are multiple subtle variations of these functions. On the other hand, you are free to choose libraries that you use. There is surely no shortage of libraries than invent those "proper" names.
- catnaroek 9y agoYou might have a different opinion once you have written a few tens of thousands lines of numerical code. There is a reason why mathematical notation is so terse - much terser than the “garbage” you bemoan, in fact. Also, regarding your specific example, `eigen` would be ambiguous. Do you mean eigenvalues? Eigenvectors? Eigenfunctions? Eigenspaces?
- submeta 9y agoWell, the author of Mathematica has chosen elaborate names for functions. Everything is explicit. Super long camel-cased names.
- sampo 9y ago> axpy? mm? dia? nrm2? Those are the standard BLAS names for those things.
- btilly 9y agoYou are walking into a classic argument about concise notation for experts versus self-explanatory names for generalist programmers. See https://news.ycombinator.com/item?id=14239228 https://news.ycombinator.com/item?id=14239228 for a previous iteration of this argument on this site. Suffice it to say that anyone with sufficient mathematical expertise to actually make sense of this stuff, who is going to do anything interesting will want to use concise names. And yes, this will be the first thing that a programmer who doesn't know it will complain about, but it is far from the largest problem that you have to face in using this stuff. And if you work through the actually important barriers to doing useful stuff with this knowledge, you'll probably appreciate concise notation.
- marmaduke 9y agoIt's still an interesting idea to try to expose an unknown domain in terms of a well thought out API which takes care of some of those dirty details. An ORM would be an example. Should linear algebra API be the raw numerical algorithms (Fortran like) or something dressed up which throw exceptions on failed convergence? (This is probably orthogonal to your comment btw )
- btilly 9y agoAny abstraction layer built on top of linear algebra intended for non-mathematicians should be given mnemonic names that are domain specific for what that abstraction layer is aimed at. Any abstraction layer built with the purpose of making it easy to do linear algebra in software should use names that are domain specific to linear algebra. Which will be the short concise names that make sense to those with mathematical expertise, no matter what generalist programmers think of said names.
- neutronicus 9y agoI think most programmers probably either need control of the nitty-gritty of the numerical algorithms or would be better-served by a library explicitly modeling their domain (with library authors minding the p's and q's of the numerical algorithm).
- 9y ago
- afghanPower 9y agoThose are standard function names in most lin-alg related packages.
- syphilis2 9y agoI'm fond of "eig" which in Matlab is the function to return eigenvectors and eigenvalues. My experience is that it's easier to recognize and remember abbreviations rather than acronyms.
- mnarayan01 9y agoIt would be interesting to have a language with first-class(ish) support for "tagged" aliases, where an IDE could then expand to short/long versions as configured. To some extent you could already do it in a lot of languages which support annotations/decorations, but it might be nice to have it more built into the language for "standardization" if nothing else.
- jperras 9y agoWhy do we have shell commands called `cp` and `mv` instead of just `copy` and `move`?
- hota_mazi 9y agoSame stupid reason. We've learned a lot since those times.