使用 GSL 构建 3x3 反射矩阵
基于文档
http://www.gnu.org/ software/gsl/manual/html_node/Householder-Transformations.html
和
http://en. wikipedia.org/wiki/Householder_transformation
我认为以下代码将成功生成与单位向量 normal_vector
正交的平面中的反射矩阵。
gsl_matrix * reflection = gsl_matrix_alloc(3, 3);
gsl_matrix_set_identity(reflection);
gsl_linalg_householder_hm(2, normal_vector, reflection);
然而,据我所知,结果不是反射矩阵。特别是在我的例子中,它具有实特征值 -(2 + 1/3),这对于反射矩阵来说是不可能的。
所以我的问题是:
(1)我做错了什么?看来这对我应该有用。
(2) 如果这种方法不起作用,有谁知道如何使用 gsl 构建这样的矩阵?
[最后一点,我意识到 gsl 提供了应用 Householder 变换的函数,而无需实际找到矩阵。我实际上需要我的案例中的矩阵来进行其他工作。]
Based on the documents
http://www.gnu.org/software/gsl/manual/html_node/Householder-Transformations.html
and
http://en.wikipedia.org/wiki/Householder_transformation
I figured the following code would successfully produce the matrix for reflection in the plane orthogonal to the unit vector normal_vector
.
gsl_matrix * reflection = gsl_matrix_alloc(3, 3);
gsl_matrix_set_identity(reflection);
gsl_linalg_householder_hm(2, normal_vector, reflection);
However, the result is not a reflection matrix as far as I can tell. In particular in my case it has the real eigenvalue -(2 + 1/3), which is impossible for a reflection matrix.
So my questions are:
(1) What am I doing wrong? It seems like that should work to me.
(2) If that approach doesn't work, does anyone know how to go about building such a matrix using gsl?
[As a final note, I realize gsl provides functions for applying Householder transformations without actually finding the matrices. I actually need the matrices in my case for other work.]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
反射矩阵 P 永远不会形成。
相反,您会得到 v,如
P = I - \tau vv^T
中所示。gsl_linalg_householder_hm 应用 PA 变换,您必须先使用
gsl_linalg_householder_transform
生成 vreflection matrix, P, is never formed.
Instead you get v as in
P = I - \tau v v^T
.gsl_linalg_householder_hm applies PA transformation, you must generate v first with
gsl_linalg_householder_transform