comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with qrfac and Qrsolv(for least square)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Problem with qrfac and Qrsolv(for least square) [message #57051] Fri, 30 November 2007 14:53
coold is currently offline  coold
Messages: 8
Registered: December 2004
Junior Member
I was trying to solve a constrained least square problem with qrfac
and qrsolv but it stops at

idiag = lindgen(minmn)
r(idiag, idiag) = rdiag
I am wondering if I am making any mistake as I really would like to
use the QRdecomp routine.
************************************************
IDL>.run leastsq_decomp
IDL>leastsq_qrdecomp
pro leastsq_qrdecomp
;solve the equation A## X = B, in the least squares sense, where:
;A=[3,4] B=[4,1] ;;SIZE OF MATRICES

A = [[1,2,2],$
[4,5,6],$
[7,8,9],$
[1,1,1]]
print, A
B = [[1],[3],[5],[1]]
print, B

qrfac, a, r, ipvt, /PIVOT
x = qrsolv(a, r, b, PIVOTS=ipvt)
print, x
end

Thanks.
[Message index]
 
Read Message
Previous Topic: ENVI Graphics Colors (only grayscale)
Next Topic: about widgets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:34:59 PDT 2025

Total time taken to generate the page: 0.00403 seconds