当前位置:网站首页>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 .
边栏推荐
- 有些能力,是工作中学不来的,看看这篇超过90%同行
- 年中了,准备了少量的自动化面试题,欢迎来自测
- Jupiter notebook changing font style and font size
- 独家分析 | 关于简历和面试的真 相
- Large scale e-commerce project - environment construction
- snownlp情感分析
- 《通信软件开发与应用》
- 现在零基础转行软件测试还OK吗?
- Buy health products for parents
- Some abilities can't be learned from work. Look at this article, more than 90% of peers
猜你喜欢

Snownlp emotion analysis

Unity学习笔记:个人学习项目《疯狂天才埃德加》纠错文档

Uni app learning 1 bottom menu and parent-child components

QT:QSS自定义 QScrollBar实例

字节跳动大裁员,测试工程师差点遭团灭:大厂招人背后的套路,有多可怕?

Multiple IO transfer - preamble

2021-09-22

Day 7 small exercise

现在零基础转行软件测试还OK吗?

Pour vous amener dans le monde des bases de données natives du cloud
随机推荐
Nuget add reference error while installing packages
Numpy quick start (III) -- array advanced operation
logstash备份跟踪上报的数据记录
UI interface design related knowledge (I)
Flink < --> Introduction to JDBC +with parameter
最高月薪18K 拥有好的“心态和选择”, 成功就差“认真和坚持”~
现在零基础转行软件测试还OK吗?
Qt:qss custom qgroupbox instance
Rollup, cube and grouping sets functions of grouping functions
【吐槽&脑洞】关于逛B站时偶然体验的弹幕互动游戏魏蜀吴三国争霸游戏的一些思考
Numpy quick start (V) -- Linear Algebra
QT:QSS自定义QToolButton实例
Flink <-->Redis的使用介绍+with参数
帶你走進雲原生數據庫界扛把子Amazon Aurora
Cache routing component
Qt:qss custom qlineedit instance
使用ML.NET+ONNX预训练模型整活B站经典《华强买瓜》
Leetcode skimming ---977
QT:QSS自定义 QProgressBar实例
Some abilities can't be learned from work. Look at this article, more than 90% of peers