Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 20th, 2005, 01:55 AM
bluekite2000@gmail.com
Guest
 
Posts: n/a
Default weird bug w/ a template program

I have 2 matrices Qex,R of type float which are returned from a
function (qr decomposition). I then do


Float_Matrix M=Qex*R; //wrong result

Float_Matrix Qex_copy(Qex);//copy constructor
Float_Matrix R_copy(R);//copy constructor

Float_Matrix Mcopy=Qex_copy*R_copy;//correct result

For some reason M is incorrect!

I do a cout<<Qex<<R; and cout<<Qex_copy<<R_copy;
to visually compare Qex with Qex_copy and R with R_copy and they are
equal!!!
However I think they are not really equal but cant figure out where.

I tried running the same program with type complex (Complex_Matrix) and
everything works fine.

Any idea? Can it be a misalignment issue???

  #2  
Old August 20th, 2005, 02:15 AM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: weird bug w/ a template program

bluekite2000@gmail.com wrote:[color=blue]
> I have 2 matrices Qex,R of type float which are returned from a
> function (qr decomposition). I then do
>
>
> Float_Matrix M=Qex*R; //wrong result
>
> Float_Matrix Qex_copy(Qex);//copy constructor
> Float_Matrix R_copy(R);//copy constructor
>
> Float_Matrix Mcopy=Qex_copy*R_copy;//correct result
>
> For some reason M is incorrect!
>
> I do a cout<<Qex<<R; and cout<<Qex_copy<<R_copy;
> to visually compare Qex with Qex_copy and R with R_copy and they are
> equal!!!
> However I think they are not really equal but cant figure out where.
>
> I tried running the same program with type complex (Complex_Matrix)
> and everything works fine.
>
> Any idea? Can it be a misalignment issue???[/color]

No idea. But I don't think it's "a misalignment issue". But do
check out FAQ 5.8.

V


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles