Sponsored Content
Full Discussion: Loop and array problem
Top Forums Shell Programming and Scripting Loop and array problem Post 302785263 by hubleo on Monday 25th of March 2013 07:22:12 AM
Old 03-25-2013
Don that works perfectly. Does exactly what I wanted. Also, thanks for so clearly annotating your lines, I can tell exactly what you've done and that's really helpful for a relative newbie like me. Thanks so much Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Array Declaration and For Loop

I am just stucked in syntax.This is more like a array and for loop problem. I want to use ls -l command and get filezise and filename of all filenames in the directory in an array (say array#1). After 2 minutes of sleep, i want to get the same information in another array (say array#2). The... (4 Replies)
Discussion started by: 33junaid
4 Replies

2. Shell Programming and Scripting

FTP and run a loop for array problem

Hello, I have a problem with my script whereby it does not want to loop. The function of my script is to FTP into a server and go to each directory/volume in the array 'VOL'. The way the loop is suppose to work, is to go into the first volume, get the files of R(yesterday's date) and... (3 Replies)
Discussion started by: tuffgong2008
3 Replies

3. Shell Programming and Scripting

Help with awk in array in while loop

Hi everyone:) I have 2 files - IN & OUT. Example: IN A:13:30 B:45:40 . . . UNLIMITED OUT Z:12:24 Y:20:15 . . . UNLIMITED I want first row of numbers of IN - OUT. Example 13-12 45-20 My code is (2 Replies)
Discussion started by: vincyoxy
2 Replies

4. Shell Programming and Scripting

Array not surviving while loop

So I'm trying to read datafile into an array, with each line representing one variable in the array. I'm successful at first but somehow it keeps getting erased. i=0 grep '.*' datafile | while read line do echo $i array=$(echo $line) echo ${array} #printing array to make sure it's... (5 Replies)
Discussion started by: DrSammyD
5 Replies

5. Shell Programming and Scripting

Array and Loop Problem

I've got this problem, if I modify an array in the loop and print it, everything is fine as long as I stay in the loop. But, when I print it outside the loop, nothing happens... How can I solve this problem? Here I prepared a sample for you to see my problem; zgrw@Rain:~$ cat test asd 123... (4 Replies)
Discussion started by: zgrw
4 Replies

6. Shell Programming and Scripting

Array with do while and if loop

Hi All, I am trying to run a do while for an array. And in the do while, I'm trying to get a user response. Depending on the the answer, I go ahead and do something or I move on to next element in the array. So far I can read the array, but I can't get the if statement to work. Any suggestions... (5 Replies)
Discussion started by: nitin
5 Replies

7. Shell Programming and Scripting

problem access array outside of loop in bash

Below is a test script I was trying to use so that I could understand why the logic was not working in a larger script. While accessing and printing array data inside the while loop, everything is fine. Outside the loop, i guess everything is null?? The for loop that is meant to cycle... (4 Replies)
Discussion started by: adlmostwanted
4 Replies

8. Shell Programming and Scripting

Array Variable being Assigned Values in Loop, But Gone when Loop Completes???

Hello All, Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....? I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies

9. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

10. Shell Programming and Scripting

Bash for loop array

Hi there, A bit new to bash and am having an issue with a for loop. I look for filenames in a specified directory and pull the date string from each meeting a certain criteria, and then would like to make a directory for each date found, like this: search 20180101.gz 20180102.gz 20180103.gz... (5 Replies)
Discussion started by: mwheeler12
5 Replies
SLAED2(l)								 )								 SLAED2(l)

NAME
SLAED2 - merge the two sets of eigenvalues together into a single sorted set SYNOPSIS
SUBROUTINE SLAED2( K, N, N1, D, Q, LDQ, INDXQ, RHO, Z, DLAMDA, W, Q2, INDX, INDXC, INDXP, COLTYP, INFO ) INTEGER INFO, K, LDQ, N, N1 REAL RHO INTEGER COLTYP( * ), INDX( * ), INDXC( * ), INDXP( * ), INDXQ( * ) REAL D( * ), DLAMDA( * ), Q( LDQ, * ), Q2( * ), W( * ), Z( * ) PURPOSE
SLAED2 merges the two sets of eigenvalues together into a single sorted set. Then it tries to deflate the size of the problem. There are two ways in which deflation can occur: when two or more eigenvalues are close together or if there is a tiny entry in the Z vector. For each such occurrence the order of the related secular equation problem is reduced by one. ARGUMENTS
K (output) INTEGER The number of non-deflated eigenvalues, and the order of the related secular equation. 0 <= K <=N. N (input) INTEGER The dimension of the symmetric tridiagonal matrix. N >= 0. N1 (input) INTEGER The location of the last eigenvalue in the leading sub-matrix. min(1,N) <= N1 <= N/2. D (input/output) REAL array, dimension (N) On entry, D contains the eigenvalues of the two submatrices to be combined. On exit, D contains the trailing (N-K) updated eigen- values (those which were deflated) sorted into increasing order. Q (input/output) REAL array, dimension (LDQ, N) On entry, Q contains the eigenvectors of two submatrices in the two square blocks with corners at (1,1), (N1,N1) and (N1+1, N1+1), (N,N). On exit, Q contains the trailing (N-K) updated eigenvectors (those which were deflated) in its last N-K columns. LDQ (input) INTEGER The leading dimension of the array Q. LDQ >= max(1,N). INDXQ (input/output) INTEGER array, dimension (N) The permutation which separately sorts the two sub-problems in D into ascending order. Note that elements in the second half of this permutation must first have N1 added to their values. Destroyed on exit. RHO (input/output) REAL On entry, the off-diagonal element associated with the rank-1 cut which originally split the two submatrices which are now being recombined. On exit, RHO has been modified to the value required by SLAED3. Z (input) REAL array, dimension (N) On entry, Z contains the updating vector (the last row of the first sub-eigenvector matrix and the first row of the second sub- eigenvector matrix). On exit, the contents of Z have been destroyed by the updating process. DLAMDA (output) REAL array, dimension (N) A copy of the first K eigenvalues which will be used by SLAED3 to form the secular equa- tion. W (output) REAL array, dimension (N) The first k values of the final deflation-altered z-vector which will be passed to SLAED3. Q2 (output) REAL array, dimension (N1**2+(N-N1)**2) A copy of the first K eigenvectors which will be used by SLAED3 in a matrix multiply (SGEMM) to solve for the new eigenvectors. INDX (workspace) INTEGER array, dimension (N) The permutation used to sort the contents of DLAMDA into ascending order. INDXC (output) INTEGER array, dimension (N) The permutation used to arrange the columns of the deflated Q matrix into three groups: the first group contains non-zero elements only at and above N1, the second contains non-zero elements only below N1, and the third is dense. INDXP (workspace) INTEGER array, dimension (N) The permutation used to place deflated values of D at the end of the array. INDXP(1:K) points to the nondeflated D-values and INDXP(K+1:N) points to the deflated eigenvalues. COLTYP (workspace/output) INTEGER array, dimension (N) During execution, a label which will indicate which of the following types a column in the Q2 matrix is: 1 : non-zero in the upper half only; 2 : dense; 3 : non-zero in the lower half only; 4 : deflated. On exit, COLTYP(i) is the number of columns of type i, for i=1 to 4 only. INFO (output) INTEGER = 0: successful exit. < 0: if INFO = -i, the i-th argument had an illegal value. FURTHER DETAILS
Based on contributions by Jeff Rutter, Computer Science Division, University of California at Berkeley, USA Modified by Francoise Tisseur, University of Tennessee. LAPACK version 3.0 15 June 2000 SLAED2(l)
All times are GMT -4. The time now is 08:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy