define(3f) - [M_datapac:VECTOR_OPERATION] set all elements of a vector equal to a specified constant
Synopsis
Description
Input Arguments
Output
Examples
Author
Maintainer
License
SUBROUTINE DEFINE(X,N,Xnew)
REAL(kind=wp),intent(out) :: X(:) INTEGER,intent(in) :: N REAL(kind=wp),intent(in) :: Xnew
DEFINE(3f) sets all of the elements in the REAL vector X equal to XNEW.DEFINE(3f) is useful in defining a vector of constants.
For example, if the data analyst wishes to treat the equal weights case in doing a polynomial regression, this could be done by defining as, say, 1.0 the input weight vector W to the datapac POLY(3f) subroutine; such defining could be done by use of the DEFINE(3f) subroutine with XNEW = 1.0.
Except fo the verbose output, this procedure is deprecated as this can easily be done using Fortran array syntax.
X The vector of (unsorted or sorted) observations. N The integer number of observations in the vector X. XNEW The value to which all of the observations in the vector X will be set.
X The vector X every element of which will be equal to XNEW. Also, 3 lines of summary information will be generated indicating
1. What the sample size was (N) 2. What the defining constant was (XNEW)
Sample program:
program demo_define use M_datapac, only : define implicit none real :: x(4) call define(x,size(x),3.33333) write(*,(*(g0.4,1x)))x end program demo_defineResults:
Output from the DEFINE(3f) subroutine-- The input number of observations is 4 The defining constant is 0.33333299E+013.333 3.333 3.333 3.333
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
Nemo Release 3.1 | define (3) | February 23, 2025 |