Sponsored Content
Top Forums Shell Programming and Scripting Numerical calculation by any programming language or Awk ?? Post 302438963 by radoulov on Wednesday 21st of July 2010 09:11:25 AM
Old 07-21-2010
Quote:
col2(78507634)+col11 1st value(0) = 78507634
78507634+ col12 1st value (29) = 78507663
col11 1st value is 29 and col12 1st value is 0 or I'm missing something?

If you want the output you posted:

Code:
awk '{
  n11 = split($11, t11, ",")
  n12 = split($12, t12, ",")
  for (i = 0; ++i < n11;) {
    s12 = $2 + t12[i]
	print $1, s12, s12 + t11[i]
    }
  }' infile

If the description is semi-correct and the output wrong:

Code:
awk '{
  n11 = split($11, t11, ",")
  n12 = split($12, t12, ",")
  for (i = 0; ++i < n11;) {
    s11 = $2 + t11[i]
	print $1, s11, s11 + s12[i]
    }
  }' infile

P.S. I didn't include the last column, because I don't now how it is generated.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Does the programming language matters?

I see you guys encouraged people studied and used C while they were working on UNIX. Does C++ or JAVA matter? And in the past threads, Neo, PxT, and other members recommanded lots good books. I think those people who asked for the references, such as Dominic, had experiences on sys admin or... (8 Replies)
Discussion started by: HOUSCOUS
8 Replies

2. Programming

c programming language

Can someone enligten me on what below program does? I understand getchar and putchar.. but what is this program suppose to do? I try to put printf on it, but it shows nothing.. can someone explain to me what this program is suppose to do? It is reading something and assigning to c? so, if... (8 Replies)
Discussion started by: convenientstore
8 Replies

3. UNIX for Dummies Questions & Answers

Carreer:Networking Programming in Unix (C programming Language)

Hello, I am trying to learn Networking Programming in C in unix enviorment. I want to know how good it is to become a network programmer. i am crazy about Network programming but i also want to opt for the best carreer options. Anybody experienced Network Programmer, please tell me is my... (5 Replies)
Discussion started by: vibhory2j
5 Replies

4. UNIX for Dummies Questions & Answers

Is PERL a programming language?

I need a small and simple clarification... Can someone tell me whether PERL is a programming language or not. Also, can shell scripts also considered as programming language or not. Also, please tell me the exact difference between programming language and scripting. Please help.... (3 Replies)
Discussion started by: Anjan1
3 Replies

5. Programming

How is a new Web Development language written ?

I'm wondering how programmers develop new Web Development languages because I want to learn how everything begins from the start. Let's say I'm planning to write a new language for the Web. How do I do this? Is there anyone who knows about the way Web Development languages first appear ? I'm asking... (1 Reply)
Discussion started by: Anna Hussie
1 Replies

6. Programming

What Programming language should I start learning first?

I want to create a computer program that will translate from English to Spanish and vice versa. So someone could type in a word, phrase, or paragraph and translate from one language to another. What programming language would I use to write up the code and then implement this program? I want to... (8 Replies)
Discussion started by: Anna Hussie
8 Replies

7. Programming

How is a new Web Development language written ?

I'm wondering how programmers develop new Web Development languages because I want to learn how everything begins from the start. Let's say I'm planning to write a new language for the Web. How do I do this? Is there anyone who knows about the way Web Development languages first appear ? I'm... (3 Replies)
Discussion started by: Anna Hussie
3 Replies
cpbstf.f(3)							      LAPACK							       cpbstf.f(3)

NAME
cpbstf.f - SYNOPSIS
Functions/Subroutines subroutine cpbstf (UPLO, N, KD, AB, LDAB, INFO) CPBSTF Function/Subroutine Documentation subroutine cpbstf (characterUPLO, integerN, integerKD, complex, dimension( ldab, * )AB, integerLDAB, integerINFO) CPBSTF Purpose: CPBSTF computes a split Cholesky factorization of a complex Hermitian positive definite band matrix A. This routine is designed to be used in conjunction with CHBGST. The factorization has the form A = S**H*S where S is a band matrix of the same bandwidth as A and the following structure: S = ( U ) ( M L ) where U is upper triangular of order m = (n+kd)/2, and L is lower triangular of order n-m. Parameters: UPLO UPLO is CHARACTER*1 = 'U': Upper triangle of A is stored; = 'L': Lower triangle of A is stored. N N is INTEGER The order of the matrix A. N >= 0. KD KD is INTEGER The number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KD >= 0. AB AB is COMPLEX array, dimension (LDAB,N) On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first kd+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows: if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j; if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd). On exit, if INFO = 0, the factor S from the split Cholesky factorization A = S**H*S. See Further Details. LDAB LDAB is INTEGER The leading dimension of the array AB. LDAB >= KD+1. INFO INFO is INTEGER = 0: successful exit < 0: if INFO = -i, the i-th argument had an illegal value > 0: if INFO = i, the factorization could not be completed, because the updated element a(i,i) was negative; the matrix A is not positive definite. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: November 2011 Further Details: The band storage scheme is illustrated by the following example, when N = 7, KD = 2: S = ( s11 s12 s13 ) ( s22 s23 s24 ) ( s33 s34 ) ( s44 ) ( s53 s54 s55 ) ( s64 s65 s66 ) ( s75 s76 s77 ) If UPLO = 'U', the array AB holds: on entry: on exit: * * a13 a24 a35 a46 a57 * * s13 s24 s53**H s64**H s75**H * a12 a23 a34 a45 a56 a67 * s12 s23 s34 s54**H s65**H s76**H a11 a22 a33 a44 a55 a66 a77 s11 s22 s33 s44 s55 s66 s77 If UPLO = 'L', the array AB holds: on entry: on exit: a11 a22 a33 a44 a55 a66 a77 s11 s22 s33 s44 s55 s66 s77 a21 a32 a43 a54 a65 a76 * s12**H s23**H s34**H s54 s65 s76 * a31 a42 a53 a64 a64 * * s13**H s24**H s53 s64 s75 * * Array elements marked * are not used by the routine; s12**H denotes conjg(s12); the diagonal elements of S are real. Definition at line 154 of file cpbstf.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.1 Sun May 26 2013 cpbstf.f(3)
All times are GMT -4. The time now is 02:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy