Question

In the old version (Iridium) there was a method Vector.SquaredNorm() but in the most recent stable version of Math.Net there is none available.

What method should I use?

Was it helpful?

Solution

If you want the squared L2-norm (which is what Iridium did if I remember correctly) you can simply square it yourself:

var squaredNorm1 = Math.Pow(v.L2Norm(),2);

Alternatively you can also use dot product which is a bit shorter (and also faster in case you use native providers and the vectors are very large):

var squaredNorm2 = v*v;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top