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

Home » Public Forums » archive » Re: Matrix rank
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Matrix rank [message #57622 is a reply to message #57533] Fri, 14 December 2007 09:49 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Dec 14, 11:26 am, d.po...@gmail.com wrote:
> On Dec 14, 5:28 pm, Vince Hradil <hrad...@yahoo.com> wrote:
>
>
>
>> On Dec 14, 9:42 am, Wox <nom...@hotmail.com> wrote:
>
>>> On Fri, 14 Dec 2007 06:35:11 -0800 (PST), Vince Hradil
>
>>> <hrad...@yahoo.com> wrote:
>>>> IDL can do SVD, can you get the rank from that? Look up SVDC in the
>>>> docs.
>
>>> I could do this, but maybe there's a better way?
>
>>> ; A: integers
>>> ; B: floats
>>> A = [[ 0,0,1], $
>>> [ 0,1,0], $
>>> [ 0,0,0]]
>>> B = [0.25,0.5,1]
>
>>> ; Decompose A
>>> SVDC, A, W, U, V
>>> ; Solve A.X=B
>>> X=SVSOL(U, W, V, B)
>
>>> ; Check
>>> B2=A##X
>>> ind=where(total(abs(A),1,/pres) ne 0)
>
>>> if array_equal(B[ind],B2[ind]) then print,X
>
>> Well, w contains the singular values, the number of these that are non-
>> zero will be the rank:
>> idx = where(w ne 0, rank)
>> print, rank
>> 2
>
>> Does anyone else read the Help??????- Hide quoted text -
>
>> - Show quoted text -
>
> Huuum!!! what about NORM?

Well...
2-norm would be the maximum Singular Value: max(w)
trace norm would be the sum of the SVs: total(w)
Frobenius norm would be the sqrt of the sum of the squares of the SVs:
sqrt(total(w*w))
I think... see: http://en.wikipedia.org/wiki/Singular_value_decomposition
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Off Topic Computer Post
Next Topic: Compiling error in Envi batch mode

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

Current Time: Sat Oct 11 02:17:47 PDT 2025

Total time taken to generate the page: 8.47646 seconds