MTL: Diagonal matrix iterator

View: New views
2 Messages — Rating Filter:   Alert me  

MTL: Diagonal matrix iterator

by Tom-200 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

What is the correct way to iterate over the diagonal elements of a diagonal
matrix (single diagonal, no side bands)? Is there an easy way to copy a vector
onto that diagonal?

Cheers,

Tom.

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/

Re: MTL: Diagonal matrix iterator

by Peter Gottschling :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Tom,

The best way I can think of is just writing a loop (over the rows).  This is not very fancy but there are no special iterators for traversing the diagonal.

Cheers,
Peter

On May 28, 2007, at 9:23 AM, Tom wrote:

Hi,

What is the correct way to iterate over the diagonal elements of a diagonal 
matrix (single diagonal, no side bands)? Is there an easy way to copy a vector 
onto that diagonal?

Cheers,

Tom. 

_______________________________________________

------------
Peter Gottschling
Research Associate
Open Systems Laboratory
Indiana University
135 Lindley Hall
Bloomington, IN 47405
Tel.: +1 812 855-3608   Fax: +1 812 856 0853



_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/