当前位置:网站首页>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 5about 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.47723normalize()
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 .
边栏推荐
- Flink -- 内置函数(ALL)
- Leetcode skimming ---852
- Numpy quick start (IV) -- random sampling and general functions
- QT:QSS自定义 QRadioButton实例
- QT:QSS自定义 QTreeView实例
- STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管
- Nuget add reference error while installing packages
- 《通信软件开发与应用》
- 你真的需要自动化测试吗?
- Set ArrayList nested map set loop traversal
猜你喜欢

Entropy method to calculate weight

测试理论概述
![[roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B](/img/2a/c232b83e0acbb970884148bd2aadc1.png)
[roast & brain hole] Some Thoughts on the bullet screen interactive game of Wei Shu Wu Three Kingdoms when visiting station B

Basic theoretical knowledge of software testing -- app testing

C project - dormitory management system (1)

Uni app learning 1 bottom menu and parent-child components

QT:QSS自定义 QScrollBar实例

Hou Jie -- STL source code analysis notes

Jupiter notebook changing font style and font size

T5 的尝试
随机推荐
Classification (data consolidation and grouping aggregation)
2021-09-22
C语言项目:学生成绩系统
Basic usage of sqlmap
文件上传下载测试点
Qt:qss custom qgroupbox instance
QT:QSS自定义 QRadioButton实例
Small file special
QT:QSS自定义 QStatusBar实例
Some abilities can't be learned from work. Look at this article, more than 90% of peers
Interviewer: what is the internal implementation of the list in redis?
How to make a blood bar in the game
Qt:qss custom qmenubar instance
Snownlp emotion analysis
Common scenarios in which Seata distributed transactions fail and do not take effect (transactions do not rollback)
[untitled]
Numpy quick start (IV) -- random sampling and general functions
Unity小组工程实践项目《最强外卖员》策划案&纠错文档
extern关键字
小文件专项