QR分解求解线性系统的CUDA [英] QR decomposition to solve linear systems in CUDA

查看:806
本文介绍了QR分解求解线性系统的CUDA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在GPU上编写的图像复原算法,在细节

Cuda的:最小二乘法解决,差速

的QR分解法求解线性系统

  Ax = b的
 

的工作原理如下

 分钟||斧-B || ---> || QRX-B || ---> ||(Q ^ T)QRx-(Q ^ T)乙|| ---> || RX-(Q ^ T)乙||
 

其中,研究是上三角矩阵。由此产生的上三角线性系统是很容易解决的。

我想用CULA工具来实现此方法。该CULA程序 GEQRF 计算一个QR分解。手册上说:

  

在退出时,上和在对角线之上的阵列的元件包含   在分(M,N)×-N 上梯形矩阵研究研究为上   三角形,如果 M> = N);下面的对角线的元素,与   数组 TAU ,再present正交/酉矩阵问:作为产品   对分(M,N)基本反射。

我想不通其中问:存储,并且算法似乎太复杂了我。你能给什么建议?

谢谢!

解决方案

 无效GEQRF(INT男,诠释N,T * A,INT LDA,T * TAU,T *工作, INT LWORK,INT和放大器; INFO)
 

GEQRF后,R被存储在答Q值然后使用xORGQR A和TAU作为输入来产生的上三角部

进一步的解释: http://www.culatools.com /forums/viewtopic.php?f=15&t=684

I'm writing an image restoration algorithm on GPU, details in

Cuda: least square solving , poor in speed

The QR decomposition method to solve the linear system

Ax=b  

works as follows

min||Ax-b|| ---> ||QRx-b||  ---> ||(Q^T)QRx-(Q^T)b|| ---> ||Rx-(Q^T)b||

where R is the upper triangular matrix. The resulting upper triangular linear system is easy to solve.

I want to use CULA tools to implement this method. The CULA routine GEQRF computes a QR factorization. The manual says:

On exit, the elements on and above the diagonal of the array contain the min(M,N)-by-N upper trapezoidal matrix R (R is upper triangular if m >= n); the elements below the diagonal, with the array TAU, represent the orthogonal/unitary matrix Q as a product of min(m,n) elementary reflectors.

I cannot figure out where Q is stored, and the algorithm seems too complex for me. Could you give any advice?

Thanks!

解决方案

void GEQRF(int M,int N,T* A,int LDA, T* TAU, T* WORK,int LWORK,int &INFO)

After GEQRF, R is stored in the upper triangular portion of A. Q can then be generated using xORGQR with A and TAU as the inputs.

more explanation: http://www.culatools.com/forums/viewtopic.php?f=15&t=684

这篇关于QR分解求解线性系统的CUDA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆