Hi, > I've noticed in the source code that the result for norm_*(vector<int>) > was also an int. Am I correct?
Yes, you are. > If yes,I think that it should be changed > because this easily violates the axioms of a norm : we can have > norm(alpha*v) != alpha*norm(v) because of the rounding. This will usually be the case even if we change it. There are good reasons why Clang emits warnings when using != or == for floating point comparisons ;-) > I think that norm_*(vector<int>) should be changed to float > norm_*(vector<int>). Any thoughts? There is no need to change it for anything for norm_1 and norm_inf. So, the only relevant implementation case is norm_2, for which ublas uses the same type convention we use now (at least that's what I found when I looked it up). Although a floating point return type is probably more often desired than an integer type, it would certainly complicate the implementation. Moreover, it would introduce inconsistency, which I'm not very fond of. The other thing, of course, is that it complicates the implementation considerably (which floating point type to return? float is not great in terms of precision, but double may not be available on the GPU...). I'm open to using a different approach than what we have now, but I'd like to hear solid arguments in favor of a change ;-) Best regards, Karli ------------------------------------------------------------------------------ HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions Find What Matters Most in Your Big Data with HPCC Systems Open Source. Fast. Scalable. Simple. Ideal for Dirty Data. Leverages Graph Analysis for Fast Processing & Easy Data Exploration http://p.sf.net/sfu/hpccsystems _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel