当前位置:网站首页>Differences among norm, normalize and normalized in eigen
Differences among norm, normalize and normalized in eigen
2022-07-03 10:54:00 【dzxia920】
Eigen in norm、normalize、normalized The difference between
norm()
about Vector,norm Returns the second norm of the vector , namely
for example :
Vector2d vec(3.0,4.0);
cout << vec.norm() << endl; // Output 5
about Matrix,norm The Frobenius norm of the matrix is returned (Frobenius Norm), namely
for example :
Matrix2d mat;
mat << 1,2
3,4;
cout << mat.norm() << endl; // Output sqrt(1*1+2*2+3*3+4*4), namely sqrt(30) = 5.47723
normalize()
It's clear norm() After the definition of ,normalize() In fact, it is to divide each element of itself by its norm . The return value is void.
for example :
vec.normalize();
cout << vec << endl; // Output : 0.6
// 0.8
mat.normalize(); //mat Each element divided by mat.norm()
cout << mat << endl;
normalized()
and normalized() And normalize() similar , It's just normalize() Is to make changes to itself , and normalized() It's a new Vector/Matrix, Does not change the original matrix .
边栏推荐
- QT:QSS自定义 QRadioButton实例
- Flink <-->Redis的使用介绍+with参数
- STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管
- 文件上传下载测试点
- [roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B
- 项目组织战略管理
- Unity学习笔记:联网游戏Pixel Adventure 1学习过程&纠错心得
- Classification (data consolidation and grouping aggregation)
- [untitled]
- QT:QSS自定义QListView实例
猜你喜欢
DAY 7 小练习
正常一英寸25.4厘米,在影像领域是16厘米
Unity learning notes: personal learning project "crazy genius Edgar" error correction document
Some abilities can't be learned from work. Look at this article, more than 90% of peers
Snownlp emotion analysis
Numpy quick start (II) -- Introduction to array (creation of array + basic operation of array)
Day 7 small exercise
UI interface design related knowledge (I)
如何监测服务器主机的进出流量?
Use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
随机推荐
Qt:qss custom qpprogressbar instance
QT:QSS自定义 QRadioButton实例
Unity learning notes: online game pixel Adventure 1 learning process & error correction experience
小文件专项
Wechat applet training 2
那些一门心思研究自动化测试的人,后来怎样了?
[combinatorial mathematics] pigeon's nest principle (simple form of pigeon's nest principle | simple form examples of pigeon's nest principle 1, 2, 3)
8年测试总监的行业思考,看完后测试思维认知更深刻
缓存路由组件
项目组织战略管理
Detailed cross validation and grid search -- sklearn implementation
月薪过万的测试员,是一种什么样的生活状态?
How to hide cvxpy warnings: warn: a- > P (column pointers) not strictly increasing, column x empty?
Numpy quick start (I) -- pre knowledge (create array + constant + data type)
Praise syllogism
硬 货 | 一改测试步骤代码就全写?为什么不试试用 Yaml实现数据驱动?
Rollup, cube and grouping sets functions of grouping functions
QT:QSS自定义QToolButton实例
如何监测服务器主机的进出流量?
带你走进云原生数据库界扛把子Amazon Aurora