Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Symmetric Toeplitz Array

Status
Not open for further replies.

sbev

Programmer
May 30, 2001
27
CA
I need to create numerous symmetric Toeplitz matrices from different beginning 1-dimensional arrays. It is straight forward to do with DO loops, but want to know if it can be done efficiently with intrinsic functions in 90/95. The problem is:

Given n numbers, x1, x2, ..., xn, form an n by n array x such that x(1,1:n) = x1, ..., xn; x(i,i) = x1; and x(i,j) = x(j,i).
 
I just had to google Toeplitz matrices, never heard of it.

If you put your x1,...,xn numbers into a single one-dimensional array, xs, I think you can do it in a single loop:
Code:
do i = 1,n
   toe(i,i:n) = xs(1:(n+1-i))
   toe(i:n,i) = xs(1:(n+1-i))
end do
Is this acceptable?
 
Thanks salgerman, the solution works great.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top