C Library Functions  - define (3)

NAME

define(3f) - [M_datapac:VECTOR_OPERATION] set all elements of a vector equal to a specified constant

CONTENTS

Synopsis
Description
Input Arguments
Output
Examples
Author
Maintainer
License

SYNOPSIS

SUBROUTINE DEFINE(X,N,Xnew)

       REAL(kind=wp),intent(out)  :: X(:)
       INTEGER,intent(in)         :: N
       REAL(kind=wp),intent(in)   :: Xnew

DESCRIPTION

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.

INPUT ARGUMENTS

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.

OUTPUT

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)

EXAMPLES

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_define

Results:

    Output from the DEFINE(3f) subroutine--
           The input number of observations is 4
           The defining constant is 0.33333299E+01
3.333 3.333 3.333 3.333

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0


Nemo Release 3.1 define (3) July 22, 2023
Generated by manServer 1.08 from 04c09117-ac09-49f7-a2c2-70665dee7fb5 using man macros.