Hi,
I was wondering if there is a way of using awk to extract the lower or upper triangular matrix from a symmetric matrix. Say I have this matrix:
$ cat data:
I am trying to do two things.
Result 1:
Result 2:
Result 1 has only the lower triangular without the diagonal while result 2 has the lower triangular and the diagonal.
Hi!
I pass a parameter to a script code and I have to make it upper case before use:
$ MyShell aBcDe
script code:
UpperVariable=function($1)
I can't know how make function, maybe some sed option?
Thank You,
PARIDE (1 Reply)
Hi,
I have to reshape some ascii files. I have many ascii files that have collapsed the lower triangular of my matrix into row. I simply want to convert them back to the proper matrix form. So, my current data looks like this:
11 21 22 31 32
33 41 42 43 44
...
This is five columns of... (2 Replies)
I want to code a triangular window in an array. The array size is an odd number and indices start from 1.
For example Having the number of elements N = 13
The middle position 7, the value will be 1.0 Then things decrease to zero using a rectangular variation.
Having problem how to code it. (2 Replies)
Hi all,
Is there a way to convert full data matrix to linearised left data matrix?
e.g full data matrix
Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7
Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245
Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
Hi everyone
I am very new at awk but think that that might be the best strategy for this. I have a matrix very similar to a correlation matrix and in practical terms I need to convert it into a list containing the values from the matrix (one value per line) with the first field of the line (row... (5 Replies)
Hi,
I think this is a weird problem.
I have two files...one with all UPPER case and the other one with a mix of upper and lower.
Match each record in file1 against record in file2, if they match, then change the record in file1 to that of record in file2.
Thanks in advance. (2 Replies)
I have a string like below. Now i want to split this string like below and put the value in the array using awk. I am able to do it using bash but getting no clue for doing it in awk
O/P
A=0
A=01
A=014
A=0143
A=01438
A=014387
A=0143876
A=01438765
A=014387650
... (7 Replies)
I have a file that has a pattern 2 lines, blanktwo line
If encountering the first line, the 2nd line need to be converted to UPPERCASE...or...conver the 2nd line after ablank into uppercase
Is there a 'tr' function in awk..(probably the best tool over sed) ?
i.e.
......................... (6 Replies)
Hi,
I'm writing a BBS telnet program. I'm having issues with it not displaying lower ASCII characters. For example, instead of displaying the "smiley face" character (Ctrl-B), it displays ^B. Is this because i'm using Ncurses? If so, is there any way around this?
Thanks. (3 Replies)
Discussion started by: ignatius
3 Replies
LEARN ABOUT REDHAT
dsytf2
DSYTF2(l) ) DSYTF2(l)
NAME
DSYTF2 - compute the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method
SYNOPSIS
SUBROUTINE DSYTF2( UPLO, N, A, LDA, IPIV, INFO )
CHARACTER UPLO
INTEGER INFO, LDA, N
INTEGER IPIV( * )
DOUBLE PRECISION A( LDA, * )
PURPOSE
DSYTF2 computes the factorization of a real symmetric matrix A using the Bunch-Kaufman diagonal pivoting method:
A = U*D*U' or A = L*D*L'
where U (or L) is a product of permutation and unit upper (lower) triangular matrices, U' is the transpose of U, and D is symmetric and
block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
This is the unblocked version of the algorithm, calling Level 2 BLAS.
ARGUMENTS
UPLO (input) CHARACTER*1
Specifies whether the upper or lower triangular part of the symmetric matrix A is stored:
= 'U': Upper triangular
= 'L': Lower triangular
N (input) INTEGER
The order of the matrix A. N >= 0.
A (input/output) DOUBLE PRECISION array, dimension (LDA,N)
On entry, the symmetric matrix A. If UPLO = 'U', the leading n-by-n upper triangular part of A contains the upper triangular part
of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = 'L', the leading n-by-n lower triangular
part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.
On exit, the block diagonal matrix D and the multipliers used to obtain the factor U or L (see below for further details).
LDA (input) INTEGER
The leading dimension of the array A. LDA >= max(1,N).
IPIV (output) INTEGER array, dimension (N)
Details of the interchanges and the block structure of D. If IPIV(k) > 0, then rows and columns k and IPIV(k) were interchanged
and D(k,k) is a 1-by-1 diagonal block. If UPLO = 'U' and IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and -IPIV(k) were
interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If UPLO = 'L' and IPIV(k) = IPIV(k+1) < 0, then rows and columns k+1
and -IPIV(k) were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block.
INFO (output) INTEGER
= 0: successful exit
< 0: if INFO = -k, the k-th argument had an illegal value
> 0: if INFO = k, D(k,k) is exactly zero. The factorization has been completed, but the block diagonal matrix D is exactly singu-
lar, and division by zero will occur if it is used to solve a system of equations.
FURTHER DETAILS
1-96 - Based on modifications by J. Lewis, Boeing Computer Services
Company
If UPLO = 'U', then A = U*D*U', where
U = P(n)*U(n)* ... *P(k)U(k)* ...,
i.e., U is a product of terms P(k)*U(k), where k decreases from n to 1 in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and
2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and U(k) is a unit upper triangular matrix, such that if
the diagonal block D(k) is of order s (s = 1 or 2), then
( I v 0 ) k-s
U(k) = ( 0 I 0 ) s
( 0 0 I ) n-k
k-s s n-k
If s = 1, D(k) overwrites A(k,k), and v overwrites A(1:k-1,k). If s = 2, the upper triangle of D(k) overwrites A(k-1,k-1), A(k-1,k), and
A(k,k), and v overwrites A(1:k-2,k-1:k).
If UPLO = 'L', then A = L*D*L', where
L = P(1)*L(1)* ... *P(k)*L(k)* ...,
i.e., L is a product of terms P(k)*L(k), where k increases from 1 to n in steps of 1 or 2, and D is a block diagonal matrix with 1-by-1 and
2-by-2 diagonal blocks D(k). P(k) is a permutation matrix as defined by IPIV(k), and L(k) is a unit lower triangular matrix, such that if
the diagonal block D(k) is of order s (s = 1 or 2), then
( I 0 0 ) k-1
L(k) = ( 0 I 0 ) s
( 0 v I ) n-k-s+1
k-1 s n-k-s+1
If s = 1, D(k) overwrites A(k,k), and v overwrites A(k+1:n,k). If s = 2, the lower triangle of D(k) overwrites A(k,k), A(k+1,k), and
A(k+1,k+1), and v overwrites A(k+2:n,k:k+1).
LAPACK version 3.0 15 June 2000 DSYTF2(l)