Re: orthogonal complement



Peter... you're quite right. Thanks for picking up on that!
Still, even after fixing that problem, I'm still not getting a zero
matrix when I calculate the product of cPerp^t and C. As mentioned
later in the thread, my matrix may not be of full rank and this would
be causing a problem. However, I believe that the final few columns
would still be zero vectors. Strange, to say the least.

Thanks for your help (much appreciated),
-Mark

Peter Spellucci wrote:
In article <1158761766.593934.23540@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
markeroon@xxxxxxxxx writes:
>Hi everybody:
>
>I have an rxc matrix C, and I'm trying to find the othogonal complement
>of its column space. Does it make sense to take the singular value
>decomposition of C (where C=UWV^t) and make the orthogonal complement
>(cPerp) the (r-c)th to (c)th columns of U? I'm not sure if anyone here
>uses the OpenCV image processing library, but I'll attach my source
>anyway for possible clarification:
>
>Ut = cvCreateMat( r, r, CV_32F );
>W = cvCreateMat( r, c, CV_32F );
>Vt = cvCreateMat( c, c, CV_32F );
>cPerp = cvCreateMat( r, r-c, CV_32F );
>
>cvSVD( C, W, Ut, Vt, CV_SVD_U_T|CV_ SVD_V_T ); //both are transposed
>
>// make U
>CvMat* U = cvCreateMat( r, r, CV_32F );
>cvTranspose( Ut, U );
>
>//copy the r-c to r columns to the new vector
>for( int i=0; i<rows; i++ ) {
> for( int j=0; j<(rows-cols) ; j++ ) {
> CV_MAT_ELEM( *cPerp, float, i, j ) = cvmGet( U, i,j+(rows-cols)
>);
> }
>}
>
>The logic seems fine to me,
>but when I multiply C and cPerp together (using cvMatMul or
>cvMatMulAdd) , I don't get zeros as my elements. Am I making some
>fundamental error?
>
>Thanks in advance for any insight,
>-Mark
>

your idea is quite o.k.:
if

r=rows>c=cols

and

C = U * W * V'

U is r times r , V' is c times c and W diagonal nonnegative of the
same shape as C , U, V unitary, then you get

U(:,c:r-1)'*C=O

but in your code you have forgotten :
rows=r;
cols=c;
and shouldn't it read

CV_MAT_ELEM( *cPerp, float, i, j ) = cvmGet( U, i,j+cols)

????

hth
peter

.



Relevant Pages

  • Act 3, Scene 2 (was Re: wasting precious time on Ray Haddad)
    ... I heard someone was going to write a post celebrating Chefp, ... sheer ugliness of having to read a post celebrating his memory, ... that Chefp would have been pleased had his boon companion Zero actually ... "Peter, you are lamentably undereducated." ...
    (misc.writing)
  • RE: subform textbox value causing invalid use of null error messag
    ... "Peter S." ... time the subform initializes. ... numeric zero value. ... Nz(Me.MyTextBox,"") this would convert a null value in MyTextBox to a zero ...
    (microsoft.public.access.modulesdaovba)
  • Re: D3/Linux compile question
    ... Congratulations Robert and thank you for at least getting the option ... Peter, to as your question as to where this idiocy started: ... The ANSI Basic standard committee X332 proposed the zero standard ...
    (comp.databases.pick)
  • Re: etymology of the word zero
    ... Peter T. Daniels wrote: ... This might be silly but is this where the english "zero" comes from? ... reason 1827 is the last citation. ...
    (sci.lang)

Quantcast