Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在旧版本 (Iridium) 中有一个方法 Vector.SquaredNorm() 但在最新的稳定版 Math.Net 中没有可用的方法。
我应该使用什么方法?
如果你想要平方 L2 范数(如果我没记错的话,这就是 Iridium 所做的)你可以自己简单地平方它:
var squaredNorm1 = Math.Pow(v.L2Norm(),2);
或者,您也可以使用更短的点积(如果您使用本地提供程序并且向量非常大,也可以更快):
var squaredNorm2 = v*v;