Sponsored Content
Full Discussion: FORTRAN p-norm
Top Forums Programming FORTRAN p-norm Post 302945118 by kristinu on Tuesday 26th of May 2015 09:49:15 AM
Old 05-26-2015
FORTRAN p-norm

What would be an accurate and efficient computation of the p-norm in Fortran?

Code:
Integer :: p
Real :: sum, pn
Do i = 1, Size (a)          
  sum = sum + ((Abs a(i)) ** p)       
End Do
pn = sum ** (1.0/ Real(p))

 

10 More Discussions You Might Find Interesting

1. Linux

Fortran 90 compiler

Hi everybody: Could anybody help me where could I download Fortran 90 complier? Thanks in advance. :) (2 Replies)
Discussion started by: tonet
2 Replies

2. UNIX for Dummies Questions & Answers

FORTRAN compiling

Hello, I have a FORTRAN code that I want to compile using F90 compiler. However, when I enter the command: f90 ./code.f -o ./code.out It would give me prompt saying that absoft license has failed, or something. I remember, however, that I could enter some keyword that ends with 'soft' in... (1 Reply)
Discussion started by: Iamthe great
1 Replies

3. Programming

learning fortran

Can anyone recommend a very good Fortran online course for unix. It should also cover Fortran X11 programming if possible. I understand this learning cannot be rushed but a course that addresses useful topics sooner is best. If it isn't free, that's okay. (1 Reply)
Discussion started by: gav2251
1 Replies

4. Programming

Fortran 77 and gfortran

Hi! I have a program in fortran77. This program was compiled with pgf90, but now, I need compiled it with gfortran. I show a bit of code. program hello PARAMETER(a=100) integer a write(*,*)'value ', a end program hello What's the problem? Thanks (2 Replies)
Discussion started by: kekaes
2 Replies

5. Red Hat

Bad flash sound in Firefox, Chrome (youtube norm)

There is a solution but it seems that it works only once - the first run (adding to a shortcut LD_PRELOAD=$HOME/linusmemcpy.so /usr/bin/firefox &) . Then an error occurs: Failed to execute child process "LD_PRELOAD=$HOME/linusmemcpy.so" (No such file or directory) linusmemcpy.so exists in the... (0 Replies)
Discussion started by: Xcislav
0 Replies

6. Linux

fortran compilation issue

Hi, I am getting following error when i try to compile : Error: Expected variable in READ statement at (1) read(12,*) ((l1to2(l,j),j=1,2),l=1,ngl(2,4)) Also i am getting following error : Error: Syntax error in COMMON statement at (1) at some statements. I am using mpif90... (1 Reply)
Discussion started by: aksharb
1 Replies

7. Linux

Fortran compile problem

Hello everyone, I am trying to compile a code under fedora14.Kernel Linux 2.6.35.6-45fc14.i686-GNOME 2.32.0. I use f77,g77 and gfortran to compile but I get the same error all ways. Unsupported OPEN control item at (^) -- ACTION=, ASSOCIATEVARIABLE=, BLOCKSIZE=, BUFFERCOUNT=,... (1 Reply)
Discussion started by: miriammiriam
1 Replies

8. Shell Programming and Scripting

FORTRAN read statement

Hi, I've been having trouble figuring out what the following read statement is doing. DO I = 1, natom k = 3 * (i - 1) + 1 READ(8,*) AtNum(I), (X_2(J),J=k,k+2) END DO The part I don't understand is: (X_2(J),J=k,k+2) the file it is reading is simply a set of... (8 Replies)
Discussion started by: butson
8 Replies

9. Shell Programming and Scripting

FORTRAN Compiler

Need assistance in Fortran Compiler I need to install Fortran compiler on Linux distribution . I don't have root access to use rpm or yum to install compiler . Is there any way I can get it ? Are there any sites that has fortran compiler . Any links to download and install . (10 Replies)
Discussion started by: ajayram_arya
10 Replies

10. Programming

FORTRAN Extends

I am writing some code in fortran that defines certain shapes. Currently I have a cuboid and a prism. Now a parallelepiped is both a cuboid and a prism. Is there a way to code this? Currently I only have Type, Extends (Cuboid) :: Parallelepipied How can I do so that Parallelepipied is... (3 Replies)
Discussion started by: kristinu
3 Replies
clangt.f(3)							      LAPACK							       clangt.f(3)

NAME
clangt.f - SYNOPSIS
Functions/Subroutines REAL function clangt (NORM, N, DL, D, DU) CLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix. Function/Subroutine Documentation REAL function clangt (characterNORM, integerN, complex, dimension( * )DL, complex, dimension( * )D, complex, dimension( * )DU) CLANGT returns the value of the 1-norm, Frobenius norm, infinity-norm, or the largest absolute value of any element of a general tridiagonal matrix. Purpose: CLANGT returns the value of the one norm, or the Frobenius norm, or the infinity norm, or the element of largest absolute value of a complex tridiagonal matrix A. Returns: CLANGT CLANGT = ( max(abs(A(i,j))), NORM = 'M' or 'm' ( ( norm1(A), NORM = '1', 'O' or 'o' ( ( normI(A), NORM = 'I' or 'i' ( ( normF(A), NORM = 'F', 'f', 'E' or 'e' where norm1 denotes the one norm of a matrix (maximum column sum), normI denotes the infinity norm of a matrix (maximum row sum) and normF denotes the Frobenius norm of a matrix (square root of sum of squares). Note that max(abs(A(i,j))) is not a consistent matrix norm. Parameters: NORM NORM is CHARACTER*1 Specifies the value to be returned in CLANGT as described above. N N is INTEGER The order of the matrix A. N >= 0. When N = 0, CLANGT is set to zero. DL DL is COMPLEX array, dimension (N-1) The (n-1) sub-diagonal elements of A. D D is COMPLEX array, dimension (N) The diagonal elements of A. DU DU is COMPLEX array, dimension (N-1) The (n-1) super-diagonal elements of A. Author: Univ. of Tennessee Univ. of California Berkeley Univ. of Colorado Denver NAG Ltd. Date: September 2012 Definition at line 107 of file clangt.f. Author Generated automatically by Doxygen for LAPACK from the source code. Version 3.4.2 Tue Sep 25 2012 clangt.f(3)
All times are GMT -4. The time now is 12:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy