3 ms·
Maybe in some technical way this is correct, but when I'm pushing a string onto a vector of strings, I'm not thinking about conceptually adding a dimension to m
by skohan 6y ago
Maybe in some technical way this is correct, but when I'm pushing a string onto a vector of strings, I'm not thinking about conceptually adding a dimension to my vector in string space.
And how would you compute the cross product of <"foo", "bar", "baz"> and <"apple", "orange", "banana"> exactly?
- chrisseaton 6y ago> And how would you compute the cross product of <"foo", "bar", "baz"> and <"apple", "orange", "banana"> exactly? How would you compute the cross product of <NaN, NaN, NaN> and <NaN, NaN, NaN>? Some vectors don't have a useful result for cross product, even if they contain 'numbers' and even if you can get some kind of result out. Same with dot product of a string. Doesn't make much sense... so probably don't do it.
- skohan 6y ago> even if they contain 'numbers' Vectors don't 'contain' numbers, a vector is a multidimensional value. The fact that a C++ vector is conceptually a container for values more than anything else is a reason why 'vector' is a poor name for this component.
- chrisseaton 6y agoYes they contain a number for each dimension. Not sure what you think the point of debating individual words like this? What practical problems do you think there are?
- skohan 6y agoYou're the one arguing from the extremely strained logic that because ordering rules exist for strings, this somehow means that C++ vectors have anything to do with mathematical vectors in the mind of the average programmer. The practical problem is, when you do a lot of work with linear algebra, you would really like to have the term vector to use for its canonical mathematical meaning rather than having it reserved for a data structure which is not suitable for that purpose.
- a1369209993 6y ago> And how would you compute the cross product of <"foo", "bar", "baz"> and <"apple", "orange", "banana"> exactly? Cross product isn't a well-defined operation. The wedge product[0] would be <a,b,c>~<x,y,z>=<<ay-bx,az-cx,bz-cy>>, assuming I didn't get the signs wrong again. That would require scalar multiplication and subtraction of strings, though, neither of which are generally well-defined. If you substitute in string multiplication (ie concatentation) and addition of negatives (alternation and reversal, the latter of which is only vaguely justified by anticommutativity of multiplication), you get: << /fooorange|elpparab/ , /foobanana|elppazab/ , /barbanana|egnarozab/ >> which frankly sounds to me like a pretty good argument that vectors of strings make no sense and shouldn't be supported, but maybe someone working on parsing algebras could come up a more useful interpretation. 0: http://en.wikipedia.org/wiki/Wedge_product http://en.wikipedia.org/wiki/Wedge_product Edit: FWIW, wedge product of NaN makes perfect sense: <NaN,NaN,NaN> ~ <NaN,NaN,NaN> = <<NaN,NaN,NaN>>.