Arman Akbarian

c libvutil: Vector manipulation library

!Vector-vector multiply 
subroutine dvvm(v1,v2,v3,n)

!Vector-vector divide.
subroutine dvvd(v1,v2,v3,n)

!Vector/vector divide with check for division by zero.
subroutine dvvdx(v1,v2,v3,n)

!Vector-vector add.
subroutine dvva(v1,v2,v3,n)

!Vector-vector subtract.
subroutine dvvs(v1,v2,v3,n)

!Vector-scalar multiply
subroutine dvsm(v1,s1,v2,n)

!Vector-scalar add
subroutine dvsa(v1,s1,v2,n)

!Load vector with scalar
subroutine dvls(v1,s1,n)

!Vector negate.
subroutine dvneg(v1,v2,n)

!Vector function application.
subroutine dvfapl(v1,v2,f,n)

!Vector copy.
subroutine dvcopy(v1,v2,n)

!Vector reversal.
subroutine dvrev(v1,v2,n)

!Vector in--place reversal.
subroutine dvrevp(v,n)

!Scalar/Vector divide ( Vector reciprocal: call DVSD(V1,V2,1.0D0,N) )
subroutine dvsd(v1,v2,s1,n)

!Vector absolute difference.
subroutine dvabd(v1,v2,v3,n)

!Vector dot product.
double precision function dvvdot(v1,v2,n)

!Vector sum.
double precision function dvsum(v,n)

!Vector average
double precision function dvmean(v,n)

!Vector sum of absolute values.
double precision function dvsuma(v,n)

!Injects every INCth element of V1 into V2.
subroutine dvinj(v1,v2,inc,n)

!Computes normalized l-2 norm of V.
double precision function dvnrm2(v,n)

!Computes normalized l-1 norm of V.
double precision function dvnrm1(v,n)

!Routines for calculating finite difference approximations
!to derivatives. 2nd order forward, central, and backward
!expressions are used.

subroutine dvd2q1(v,vp,h,n)

!Vector minimum.
double precision function dvmin(v1,n)

!Vector maximum.
double precision function dvmax(v1,n)

!"l-inifinity" norm of V.
double precision function dvlinf(v,n)

!Initializes vector to "Gaussian" profile.
subroutine dvgaus(v,x,v0,x0,xwid,n)

!Dumps vector labelled with LABEL on UNIT.
subroutine dvdump(v,n,label,unit)

!Dumps V2 "as function" of V1 on UNIT.
subroutine dvpdmp(v1,v2,n,label,unit)

!V3 = sqrt( v1 ** 2 + v2 ** 2 ).
subroutine dvpyth(v1,v2,v3,n)

!Unformatted vector write.
subroutine dvoutu(v,n,unit)

!Unformatted vector read.
subroutine dvinu(v,n,unit)

!O(h**2) approximation to dv/dx with nonuniform mesh.
subroutine dvd1nu(v,x,dvdx,n)

!Angle between vectors.
double precision function dotarg(x1,y1,x2,y2)

!Mid--point first integral ...
subroutine dvmint(y,x,res,n)

!Generates uniform mesh
subroutine dvumsh(v,n,v1,vn)

!2:1 cubic interpolation of VC to VF
subroutine dv2i4(vc,vf,nc)

!Computes best fit coefficients ... negative return value indicates singular fit.
!(Pass -n_in to avoid outputs from clls)
double precision function clls(x,y,w,n_in,a,b)

!Returns least-squares linear fit evaluated at x(i)
subroutine dvlls(x,y,yfit,n)

!Computes deviation from least-squares linear fit.
!dy := y - fit.
subroutine dvdlls(x,y,dy,n)

!Simple-minded maximum locator
subroutine dvlocmx(x,v,n,xmx,vmx,nmx)

!Simple-minded miniumum locator ...
subroutine dvlocmn(x,v,n,xmn,vmn,nmn)

c libutilio simple I/O in FORTRAN

!Returns a double precision vector (one-dimensional
!array) read from file 'fname'.  If 'fname' is the
!string '-', the vector is read from standard input.
subroutine dvfrom(fname,v,n,maxn)

!Writes a double precision vector to file 'fname'.
!If fname is the string '-' then the vector is written
!to standard output.
subroutine dvto(fname,v,n)

!Returns first unit number .ge. umin not attached to a file.
integer function getu()

!Returns argnoth argument in double precision
double precision function r8arg(argno,defval)

!Same as above, integer
integer function i4arg(argno,defval)

!Retrieves a double precision value from environment variable <env>
real*8 function r8env(env,defval)

!Same as above, integer
integer function i4env(env,defval)

!Converts integer to character representation.

last update: Wed Aug 19, 2015