Advice on Replacement Calls for Withdrawn/Superseded Functions (PDF version)
NAG C Library Manual

NAG Library

Advice on Replacement Calls for Withdrawn/Superseded Functions

The following list gives the names of replacement functions for those functions that have been withdrawn or superseded since Mark 23.
The list indicates the minimum change necessary, but many of the replacement functions have additional flexibility and you may wish to take advantage of new features. It is strongly recommended that you consult the function documents.

+ Contents

+ g05 – Random Number Generators

c05 – Roots of One or More Transcendental Equations

nag_zero_cont_func_bd (c05adc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_zero_cont_func_brent (c05ayc).
Old: double f(double xx)
        {
           ...
        }
     ...
     nag_zero_cont_func_bd(a, b, &x, f, xtol, ftol, &fail);
New: double f(double xx, Nag_Comm *comm)
        {
           ...
        }
     ...
     Nag_Comm comm;
     ...
     nag_zero_cont_func_brent(a, b, xtol, ftol, f, &x, &comm, &fail);

nag_zero_cont_func_brent_bsrch (c05agc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zero_cont_func_brent_binsrch (c05auc).
Old: nag_zero_cont_func_brent_bsrch(...);
New: nag_zero_cont_func_brent_binsrch(...);

nag_zero_nonlin_eqns (c05nbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_zero_nonlin_eqns_easy (c05qbc).
Old: void f(Integer n, const double x[], double fvec[], Integer *userflag)
        {
           ...
        }
     ...
     nag_zero_nonlin_eqns(n, x, fvec, f, xtol, &fail);
New: void fcn(Integer n, const double x[], double fvec[], Nag_Comm *comm, Integer *userflag)
        {
           ...
        }
     ...
     Nag_Comm comm;
     ...
     nag_zero_nonlin_eqns_easy(fcn, n, x, fvec, xtol, &comm, &fail);

nag_zero_nonlin_eqns_deriv (c05pbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_zero_nonlin_eqns_deriv_easy (c05rbc).
Old: void f(Integer n, double x[], double fvec[], double fjac[], Integer tdfjac, Integer *userflag)
        {
           ...
        }
     ...
     fjac = NAG_ALLOC(n*tdfjac, double);
     ...
     nag_zero_nonlin_eqns_deriv(n, x, fvec, fjac, tdfjac, f, xtol, &fail);
New: void fcn(Integer n, double x[], double fvec[], double fjac[], Nag_Comm *comm, Integer *iflag)
        {
           ...
        }
     ...
     Nag_Comm comm;
     Nag_OrderType order;
     ...
     fjac = NAG_ALLOC(n*n, double);
     ...
     nag_zero_nonlin_eqns_deriv_easy(order, fcn, n, x, fvec, fjac, xtol, &comm, &fail);

nag_zero_cont_func_bd_1 (c05sdc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zero_cont_func_brent (c05ayc).
Old: double f(double x, Nag_User *comm)
        {
           ...
        }
     ...
     Nag_User comm;
     ...
     nag_zero_cont_func_bd_1(a, b, &x, f, xtol, ftol, &comm, &fail);
New: double f(double xx, Nag_Comm *comm)
        {
           ...
        }
     ...
     Nag_Comm comm;
     ...
     nag_zero_cont_func_brent(a, b, xtol, ftol, f, &x, &comm, &fail);
Note that the communication structure comm is now of type Nag_Comm (see Section 3.2.1.1 in the Essential Introduction) rather than Nag_User (see Section 3.2.1.1 in the Essential Introduction).

nag_zero_nonlin_eqns_1 (c05tbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_zero_nonlin_eqns_easy (c05qbc).

nag_zero_nonlin_eqns_deriv_1 (c05ubc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zero_nonlin_eqns_deriv_easy (c05rbc).

nag_check_deriv (c05zbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_check_derivs (c05zdc).
Old: nag_check_deriv(n, x, fvec, fjac, tdfjac, f, &fail);
New: Integer mode, m;
     double *xp = 0, *fvecp = 0, *err = 0;
     m = n;
     mode = 1;
     nag_check_derivs(mode, m, n, x, fvec, fjac, xp, fvecp, err, &fail);
     /* Set fvec to the function values at the original point x and the
      * update point xp. */
     mode = 2;
     nag_check_derivs(mode, m, n, x, fvec, fjac, xp, fvecp, err, &fail);
     /* Check the contents of err for the measures of correctness of each
      * gradient. */

nag_check_deriv_1 (c05zcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_check_derivs (c05zdc).
Old: nag_check_deriv_1(n, x, fvec, fjac, tdfjac, f, &comm, &fail);
New: Integer mode, m;
     double *xp = 0, *fvecp = 0, *err = 0;
     m = n;
     mode = 1;
     nag_check_derivs(mode, m, n, x, fvec, fjac, xp, fvecp, err, &fail);
     /* Set fvec to the function values at the original point x and the
      * update point xp. */
     mode = 2;
     nag_check_derivs(mode, m, n, x, fvec, fjac, xp, fvecp, err, &fail);
     /* Check the contents of err for the measures of correctness of each
      * gradient. */

d01 – Quadrature

nag_1d_quad_gen (d01ajc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_gen_1 (d01sjc).

nag_1d_quad_osc (d01akc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_osc_1 (d01skc).

nag_1d_quad_brkpts (d01alc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_brkpts_1 (d01slc).

nag_1d_quad_inf (d01amc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_inf_1 (d01smc).

nag_1d_quad_wt_trig (d01anc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_wt_trig_1 (d01snc).

nag_1d_quad_wt_alglog (d01apc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_wt_alglog_1 (d01spc).

nag_1d_quad_wt_cauchy (d01aqc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_wt_cauchy_1 (d01sqc).

nag_1d_quad_inf_wt_trig (d01asc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_inf_wt_trig_1 (d01ssc).

nag_1d_quad_gauss (d01bac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_1d_quad_gauss_1 (d01tac).

nag_multid_quad_adapt (d01fcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_multid_quad_adapt_1 (d01wcc).

nag_multid_quad_monte_carlo (d01gbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_multid_quad_monte_carlo_1 (d01xbc).

e01 – Interpolation

nag_2d_scat_interpolant (e01sac)

Withdrawn at Mark 23.
Replaced by nag_2d_shep_interp (e01sgc) or nag_2d_triang_interp (e01sjc).
nag_2d_scat_interpolant (e01sac) generates a two-dimensional surface interpolating a set of scattered data points, using either the method of Renka and Cline or a modification of Shepard's method. The replacement functions separate these two methods.

e01sac_rk.c

provides replacement call information for the Renka and Cline method (nag_2d_shep_interp (e01sgc)) and

e01sac_shep.c

provides replacement call information for the Shepard's method (nag_2d_triang_interp (e01sjc)).

nag_2d_scat_eval (e01sbc)

Withdrawn at Mark 23.
Replaced by nag_2d_shep_eval (e01shc) or nag_2d_triang_eval (e01skc).
See the example program

e01sac_rk.c

and

e01sac_shep.c

for full details.

nag_2d_scat_free (e01szc)

Withdrawn at Mark 23.
There is no replacement for this function.

e04 – Minimizing or Maximizing a Function

nag_opt_simplex (e04ccc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_opt_simplex_easy (e04cbc).
The new function can be derived from the old as follows:
Old: nag_opt_simplex(n, funct, x, &objf, &options, &comm, &fail);
New: nag_opt_simplex_easy(n, x, &objf, tolf, tolx, funct, monit, maxcal, 
  &comm, &fail);
The options structure has been removed from nag_opt_simplex (e04ccc). The optim_tol member of the options structure has been introduced as the argument tolf. tolx is an additional argument to control tolerance.

f01 – Matrix Operations, Including Inversion

nag_complex_cholesky (f01bnc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zpotrf (f07frc).
If you were only using nag_complex_cholesky (f01bnc) in order to feed its results into nag_hermitian_lin_eqn_mult_rhs (f04awc), then the simple replacement function given further below, in the section for nag_hermitian_lin_eqn_mult_rhs (f04awc), will suffice. A more thorough replacement function is given here and it will put the same values in arrays a and p as nag_complex_cholesky (f01bnc) did.
void f01bnc_replacement(Integer n, Complex a[], Integer tda,
  double p[], NagError *fail)
{
  Integer i, pdb=n;
  Complex *b;

  b = NAG_ALLOC(n*n, Complex);
  /* replacement factorization routine requires the upper triangle
     to be stored for U^H*U, but f01bnc expects the lower triangle
     to be stored so put the lower triangle of a into the upper
     triangle of b */
  /* nag_zge_copy */
  f16tfc(Nag_RowMajor, Nag_ConjTrans, n, n, a, tda, b, pdb, fail);
  /* factorise b */
  /* nag_zpotrf */
  f07frc(Nag_RowMajor, Nag_Upper, n, b,pdb, fail);
  /* diagonal elements to populate the p array */
  for (i = 0; i < n; ++i) p[i] = 1.0/b[i*tda+i].re;
  /* overwrite the off-diagonal upper triangle of a with U */
  /* nag_ztr_copy */
  f16tec(Nag_RowMajor, Nag_Upper, Nag_NoTrans, Nag_UnitDiag, n,
	 b, pdb, a, tda, fail);
  NAG_FREE(b);
}

nag_real_qr (f01qcc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dgeqrf (f08aec).
The subdiagonal elements of a and the elements of zeta returned by nag_dgeqrf (f08aec) are not the same as those returned by nag_real_qr (f01qcc). Subsequent calls to nag_real_apply_q (f01qdc) or nag_real_form_q (f01qec) must also be replaced by calls to nag_dorgqr (f08afc) or nag_dormqr (f08agc) as shown below.
void f01qcc_replacement(Integer m, Integer n, double a[], Integer tda,
     double zeta[], NagError *fail)
{
  /* nag_dgeqrf */
  f08aec(Nag_RowMajor, m, n, a, tda, zeta, fail);
  /* the factorization in a and zeta will be stored differently */
}

nag_real_apply_q (f01qdc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dormqr (f08agc).
The following replacement is valid only if the previous call to nag_real_qr (f01qcc) has been replaced by a call to nag_dgeqrf (f08aec) as shown below. It also assumes that the second argument of nag_real_apply_q (f01qdc) is set to wheret=Nag_ElementsSeparate, which is appropriate if the contents of a and zeta have not been changed after the call of nag_real_qr (f01qcc).
void f01qcc_replacement(Integer m, Integer n, double a[], Integer tda,
     double zeta[], NagError *fail)
{
  /* nag_dgeqrf */
  f08aec(Nag_RowMajor, m, n, a, tda, zeta, fail);
  /* the factorization in a and zeta will be stored differently */ }

void f01qdc_replacement(MatrixTranspose trans, Nag_WhereElements wheret,
  Integer m, Integer n, double a[], Integer tda, const double zeta[],
  Integer ncolb, double b[], Integer tdb, NagError *fail) {
  Nag_TransType t = (trans==NoTranspose)? Nag_NoTrans : Nag_Trans;
  /* nag_dormqr */
  f08agc(Nag_RowMajor, Nag_LeftSide, t, m, ncolb, n, a, tda, zeta,
	   b, tdb, fail);
}

nag_real_form_q (f01qec)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dorgqr (f08afc).
The following replacement is valid only if the previous call to nag_real_qr (f01qcc) has been replaced by a call to nag_dgeqrf (f08aec) as shown below. It also assumes that the first argument of nag_real_form_q (f01qec) is set to wheret=Nag_ElementsSeparate, which is appropriate if the contents of a and zeta have not been changed after the call of nag_real_qr (f01qcc).
void f01qcc_replacement(Integer m, Integer n, double a[], Integer tda, 
     double zeta[], NagError *fail) 
{ 
  /* nag_dgeqrf */ 
  f08aec(Nag_RowMajor, m, n, a, tda, zeta, fail); 
  /* the factorization in a and zeta will be stored differently */  
} 
 
void f01qec_replacement(Nag_WhereElements wheret, Integer m, Integer n, 
  Integer ncolq, double a[], Integer tda, const double zeta[], 
  NagError *fail) 
{ 
  /* factorization performed by nag_dgeqrf (f08aec) */ 
  /* nag_dorgqr */ 
  f08afc(Nag_RowMajor, m, ncolq, n, a, tda, zeta, fail); 
}

nag_complex_qr (f01rcc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zgeqrf (f08asc).
The subdiagonal elements of a and the elements of theta returned by nag_zgeqrf (f08asc) are not the same as those returned by nag_complex_qr (f01rcc). Subsequent calls to nag_complex_apply_q (f01rdc) or nag_complex_form_q (f01rec) must also be replaced by calls to nag_zunmqr (f08auc) or nag_zungqr (f08atc) as shown below.
void f01rcc_replacement(Integer m, Integer n, Complex a[], Integer tda,
     Complex theta[], NagError *fail)
{
  /* nag_zgeqrf */
  f08asc(Nag_RowMajor, m, n, a, tda, theta, fail);
  /* the factorization in a and theta will be stored differently */
}

nag_complex_apply_q (f01rdc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zunmqr (f08auc).
The following replacement is valid only if the previous call to nag_complex_qr (f01rcc) has been replaced by a call to nag_zgeqrf (f08asc) as shown below. It also assumes that the second argument of nag_complex_apply_q (f01rdc) is set to wheret=Nag_ElementsSeparate, which is appropriate if the contents of a and theta have not been changed after the call of nag_complex_qr (f01rcc).
void f01rcc_replacement(Integer m, Integer n, Complex a[], Integer tda,
     Complex theta[], NagError *fail)
{
  /* nag_zgeqrf */
  f08asc(Nag_RowMajor, m, n, a, tda, theta, fail);
  /* the factorization in a and theta will be stored differently */
}

void f01rdc_replacement(MatrixTranspose trans, Nag_WhereElements wheret,
  Integer m, Integer n, Complex a[], Integer tda, const Complex theta[],
  Integer ncolb, Complex b[], Integer tdb, NagError *fail)
{
  Nag_TransType t = (trans==NoTranspose)? Nag_NoTrans : Nag_ConjTrans;
  /* nag_zunmqr */
  f08auc(Nag_RowMajor, Nag_LeftSide, t, m, ncolb, n, a, tda, theta,
	   b, tdb, fail);
}

nag_complex_form_q (f01rec)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zungqr (f08atc).
The following replacement is valid only if the previous call to nag_complex_qr (f01rcc) has been replaced by a call to nag_zgeqrf (f08asc) as shown below. It also assumes that the first argument of nag_complex_form_q (f01rec) is set to wheret=Nag_ElementsSeparate, which is appropriate if the contents of a and theta have not been changed after the call of nag_complex_qr (f01rcc).
void f01rcc_replacement(Integer m, Integer n, Complex a[], Integer tda, 
     Complex theta[], NagError *fail) 
{ 
  /* nag_zgeqrf */ 
  f08asc(Nag_RowMajor, m, n, a, tda, theta, fail); 
  /* the factorization in a and theta will be stored differently */
} 
 
void f01rec_replacement(Nag_WhereElements wheret, Integer m, Integer n, 
  Integer ncolq, Complex a[], Integer tda, const Complex theta[], 
  NagError *fail) 
{ 
  /* nag_zungqr */ 
  /* factorization performed by nag_zgeqrf (f08asc) */ 
  f08atc(Nag_RowMajor, m, ncolq, n, a, tda, theta, fail);  
}

f03 – Determinants

nag_real_cholesky (f03aec)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dpotrf (f07fdc) and nag_det_real_sym (f03bfc).
void f03aec_replacement(Integer n, double a[], Integer tda,
     double p[], double *detf, Integer *dete, NagError *fail) 
{
  f07fdc(Nag_RowMajor, Nag_Upper, n, a, tda, fail);
  f03bfc(Nag_RowMajor, n, a, tda, detf, dete, fail);
  /* p is not written to */
  /* factorization in a will be different */ 
}
nag_dpotrf (f07fdc) performs the Cholesky factorization and nag_det_real_sym (f03bfc) calculates the determinant from the factored form.
Note: subsequent solution of linear systems using the Cholesky factorization performed by nag_dpotrf (f07fdc) should be performed using nag_dpotrs (f07fec)).

nag_real_lu (f03afc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dgetrf (f07adc) and nag_det_real_gen (f03bac).
void f03afc_replacement(Integer n, double a[], Integer tda,
  Integer pivot[], double *detf, Integer *dete, NagError *fail)
{
  /* nag_dgetrf */
  f07adc(Nag_RowMajor, n, n, a, tda, pivot, fail);
  /* nag_det_real_gen */
  f03bac(Nag_RowMajor, n, a, tda, pivot, detf, dete, fail);
  /* the factorization in a will be different */
  /* the array pivot will be different */ 
}
Note: subsequent solution of linear systems using the LU factorization performed by nag_dgetrf (f07adc) should be performed using nag_dgetrs (f07aec)).

nag_complex_lu (f03ahc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zgetrf (f07arc) and nag_det_complex_gen (f03bnc).
void f03ahc_replacement(Integer n, Complex a[], Integer tda, 
     Integer pivot[], Complex *det, Integer *dete, NagError *fail)
{
  Complex d={0,0};
  Integer id[2]={0,0};
  /* nag_zgetrf */
  f07arc(Nag_RowMajor, n, n, a, tda, pivot, fail);
  /* nag_det_complex_gen */
  f03bnc(Nag_RowMajor, n, a, tda, pivot, &d, id, fail);
  /* Bring real and imaginary parts to a common scale */
  *dete = MAX(id[0],id[1]);
  det->re = ldexp(d.re,id[0]-*dete);
  det->im = ldexp(d.im,id[1]-*dete);
  /* the factorization in a will be different */ 
}
nag_zgetrf (f07arc) performs the LU factorization and nag_det_complex_gen (f03bnc) calculates the determinant from the factored form.
Note: the details of the LU factorization performed by nag_zgetrf (f07arc) differ from those perfomed by nag_complex_lu (f03ahc); subsequent solution of linear systems using the LU factorization performed by nag_zgetrf (f07arc) should be performed using nag_zgetrs (f07asc). The determinant returned by nag_det_complex_gen (f03bnc) independently scales the real and imaginary parts whereas the determinant returned by nag_complex_lu (f03ahc) used a single scaling factor.

f04 – Simultaneous Linear Equations

The factorization and solution of a positive definite linear system can be handled by calls to functions from Chapter f07.

nag_complex_lin_eqn_mult_rhs (f04adc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_complex_gen_lin_solve (f04cac).
void f04adc_replacement(Integer n, Integer nrhs,
    Complex a[], Integer tda, const Complex b[], Integer tdb,
    Complex x[], Integer tdx, NagError *fail)
{
  Integer *ipiv;
  double rcond, errbnd;

  ipiv = NAG_ALLOC(n, Integer);
  /* nag_zge_copy */
  f16tfc(Nag_RowMajor, Nag_NoTrans, n, nrhs, b, tdb, x, tdx, fail);
  /* nag_complex_gen_lin_solve */
  f04cac(Nag_RowMajor, n, nrhs, a, tda, ipiv, x,
	 tdx, &rcond, &errbnd, fail);
  /* The factorization in a will be different */
  /* Error codes will be different */
  /* Condition number and error bounds are available to you */
  NAG_FREE(ipiv);
}

nag_real_cholesky_solve_mult_rhs (f04agc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dpotrs (f07fec).
It is assumed that the matrix has been factorized by a call to nag_dpotrf (f07fdc) rather than nag_real_cholesky (f03aec). The array p is no longer required.
void f03aec_replacement(Integer n, double a[], Integer tda,
     double p[], double *detf, Integer *dete, NagError *fail)
{
  /* nag_dpotrf /*
  f07fdc(Nag_RowMajor, Nag_Upper, n, a, tda, fail);
  /* nag_det_real_sym */
  f03bfc(Nag_RowMajor, n, a, tda, detf, dete, fail);
  /* p is not used */
  /* the factorization in a will be different */ 
}

void f04agc_replacement(Integer n, Integer nrhs, double a[],
   Integer tda, double p[], const double b[], Integer tdb, double x[],
   Integer tdx, NagError *fail)
{
  /* nag_dge_copy */
  f16qfc(Nag_RowMajor, Nag_NoTrans, n, nrhs, b, tdb, x, tdx, fail);
  /* nag_dpotrs */
  f07fec(Nag_RowMajor, Nag_Upper, n, nrhs, a, tda, x, tdx, fail);
  /* p is not used */
}

nag_real_lu_solve_mult_rhs (f04ajc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_dgetrs (f07aec).
It is assumed that the matrix has been factorized by a call to nag_dgetrf (f07adc) rather than nag_real_lu (f03afc).
void f03afc_replacement(Integer n, double a[], Integer tda,
   Integer pivot[], double *detf, Integer *dete, NagError *fail)
{
  /* nag_dgetrf */
  f07adc(Nag_RowMajor, n, n, a, tda, pivot, fail);
  /* nag_det_real_gen */
  f03bac(Nag_RowMajor, n, a, tda, pivot, detf, dete, fail);
  /* the call to f03bac is not needed if you don't want determinants */ 
}

void f04ajc_replacement(Integer n, Integer nrhs, const double a[],
   Integer tda, const Integer pivot[], double b[], Integer tdb, 
   NagError *fail)
{
  /* nag_dgetrs */
  f07aec(Nag_RowMajor, Nag_NoTrans, n, nrhs, a, tda, pivot, b, tdb, fail); 
}

nag_complex_lu_solve_mult_rhs (f04akc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zgetrs (f07asc).
void f03ahc_replacement(Integer n, Complex a[], Integer tda,
     Integer pivot[], Complex *det, Integer *dete, NagError *fail)
{
  Complex d={0,0};
  Integer id[2]={0,0};
  /* nag_zgetrf */
  f07arc(Nag_RowMajor, n, n, a, tda, pivot, fail);
  /* nag_det_complex_gen */
  f03bnc(Nag_RowMajor, n, a, tda, pivot, &d, id, fail);
  /* Bring real and imaginary parts to a common scale */
  *dete = MAX(id[0],id[1]);
  det->re = ldexp(d.re,id[0]-*dete);
  det->im = ldexp(d.im,id[1]-*dete);
  /* the factorization in a will be different */ 
}

void f04akc_replacement(Integer n, Integer nrhs, const Complex a[],
  Integer tda, const Integer pivot[], Complex b[], Integer tdb,
  NagError *fail)
{
  /* nag_zgetrs */
   f07asc(Nag_RowMajor, Nag_NoTrans, n, nrhs, a, tda, pivot, b, tdb, fail ); 
}
It is assumed that the matrix has been factorized by a call to nag_zgetrf (f07arc) rather than nag_complex_lu (f03ahc).

nag_real_lin_eqn (f04arc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_real_gen_lin_solve (f04bac).
void  f04arc_replacement(Integer n, double a[], Integer tda,
  const double b[], double x[], NagError *fail)
{
  Integer *ipiv;
  double rcond, errbnd;

  ipiv = NAG_ALLOC(n, Integer);
  /* nag_dge_copy */
  f16qfc(Nag_RowMajor, Nag_NoTrans, n, 1, b, 1, x, 1, fail);
  /* nag_real_gen_lin_solve */
  f04bac(Nag_RowMajor, n, 1, a, tda, ipiv, x, 1,
	 &rcond, &errbnd, fail);
  /* The factorization in a will be different */
  /* Error codes will be different */
  /* Condition number and error bounds are available to you */
  NAG_FREE(ipiv);
}

nag_hermitian_lin_eqn_mult_rhs (f04awc)

Scheduled for withdrawal at Mark 25.
Replaced by nag_zpotrs (f07fsc).
void f01bnc_replacement(Integer n, Complex a[], Integer tda,
  double p[], NagError *fail)
{
  /* nag_zpotrf */
  f07frc(Nag_RowMajor, Nag_Lower, n, a, tda, fail);
}

void f04awc_replacement(Integer n, Integer nrhs, const Complex a[],
  Integer tda, const double p[], const Complex b[],
  Integer tdb, Complex x[], Integer tdx, NagError *fail)
{
  /* nag_zge_copy */
  f16tfc(Nag_RowMajor, Nag_NoTrans, n, nrhs, b, tdb, x, tdx, fail);
  /* nag_zpotrs */
  f07fsc(Nag_RowMajor, Nag_Lower, n, nrhs, a, tda, x, tdx, fail);
}
Note that the preceding call to nag_complex_cholesky (f01bnc) has been replaced by nag_zpotrf (f07frc).

f06 – Linear Algebra Support Functions

The functions in Chapter f16 provide greater functionality than their corresponding functions in Chapter f06. The essential differences are:
  1. The order argument. This provides the flexibility to operate on matrix data stored in row or column major order.
  2. The addition of the fail argument to trap data errors. The f06 functions used to abort noisily.
  3. The enumeration types and members use NAG_ as the prefix. This is to guard against accidental use of non-NAG enums.
  4. Scale factors have been introduced in some functions. For example nag_dtrmv (f16pfc) has an extra argument, alpha which was not present in the corresponding old_dtrmv (f06pfc) function.

old_dgemv (f06pac)

Withdrawn at Mark 23.
Replaced by nag_dgemv (f16pac).

old_dgbmv (f06pbc)

Withdrawn at Mark 23.
Replaced by nag_dgbmv (f16pbc).

old_dsymv (f06pcc)

Withdrawn at Mark 23.
Replaced by nag_dsymv (f16pcc).

old_dsbmv (f06pdc)

Withdrawn at Mark 23.
Replaced by nag_dsbmv (f16pdc).

old_dspmv (f06pec)

Withdrawn at Mark 23.
Replaced by nag_dspmv (f16pec).

old_dtrmv (f06pfc)

Withdrawn at Mark 23.
Replaced by nag_dtrmv (f16pfc).

old_dtbmv (f06pgc)

Withdrawn at Mark 23.
Replaced by nag_dtbmv (f16pgc).

old_dtpmv (f06phc)

Withdrawn at Mark 23.
Replaced by nag_dtpmv (f16phc).

old_dtrsv (f06pjc)

Withdrawn at Mark 23.
Replaced by nag_dtrsv (f16pjc).

old_dtbsv (f06pkc)

Withdrawn at Mark 23.
Replaced by nag_dtbsv (f16pkc).

old_dtpsv (f06plc)

Withdrawn at Mark 23.
Replaced by nag_dtpsv (f16plc).

old_dger (f06pmc)

Withdrawn at Mark 23.
Replaced by nag_dger (f16pmc).

old_dsyr (f06ppc)

Withdrawn at Mark 23.
Replaced by nag_dsyr (f16ppc).

old_dspr (f06pqc)

Withdrawn at Mark 23.
Replaced by nag_dspr (f16pqc).

old_dsyr2 (f06prc)

Withdrawn at Mark 23.
Replaced by nag_dsyr2 (f16prc).

old_dspr2 (f06psc)

Withdrawn at Mark 23.
Replaced by nag_dspr2 (f16psc).

old_zgemv (f06sac)

Withdrawn at Mark 23.
Replaced by nag_zgemv (f16sac).

old_zgbmv (f06sbc)

Withdrawn at Mark 23.
Replaced by nag_zgbmv (f16sbc).

old_zhemv (f06scc)

Withdrawn at Mark 23.
Replaced by nag_zhemv (f16scc).

old_zhbmv (f06sdc)

Withdrawn at Mark 23.
Replaced by nag_zhbmv (f16sdc).

old_zhpmv (f06sec)

Withdrawn at Mark 23.
Replaced by nag_zhpmv (f16sec).

old_ztrmv (f06sfc)

Withdrawn at Mark 23.
Replaced by nag_ztrmv (f16sfc).

old_ztbmv (f06sgc)

Withdrawn at Mark 23.
Replaced by nag_ztbmv (f16sgc).

old_ztpmv (f06shc)

Withdrawn at Mark 23.
Replaced by nag_ztpmv (f16shc).

old_ztrsv (f06sjc)

Withdrawn at Mark 23.
Replaced by nag_ztrsv (f16sjc).

old_ztbsv (f06skc)

Withdrawn at Mark 23.
Replaced by nag_ztbsv (f16skc).

old_ztpsv (f06slc)

Withdrawn at Mark 23.
Replaced by nag_ztpsv (f16slc).

old_zgeru (f06smc)

Withdrawn at Mark 23.
Replaced by nag_zger (f16smc).

old_zgerc (f06snc)

Withdrawn at Mark 23.
Replaced by nag_zger (f16smc).

old_zher (f06spc)

Withdrawn at Mark 23.
Replaced by nag_zher (f16spc).

old_zhpr (f06sqc)

Withdrawn at Mark 23.
Replaced by nag_zhpr (f16sqc).

old_zher2 (f06src)

Withdrawn at Mark 23.
Replaced by nag_zher2 (f16src).

old_zhpr2 (f06ssc)

Withdrawn at Mark 23.
Replaced by nag_zhpr2 (f16ssc).

old_dgemm (f06yac)

Withdrawn at Mark 23.
Replaced by nag_dgemm (f16yac).

old_dsymm (f06ycc)

Withdrawn at Mark 23.
Replaced by nag_dsymm (f16ycc).

old_dtrmm (f06yfc)

Withdrawn at Mark 23.
Replaced by nag_dtrmm (f16yfc).

old_dtrsm (f06yjc)

Withdrawn at Mark 23.
Replaced by nag_dtrsm (f16yjc).

old_dsyrk (f06ypc)

Withdrawn at Mark 23.
Replaced by nag_dsyrk (f16ypc).

old_dsyr2k (f06yrc)

Withdrawn at Mark 23.
Replaced by nag_dsyr2k (f16yrc).

old_zgemm (f06zac)

Withdrawn at Mark 23.
Replaced by nag_zgemm (f16zac).

old_zhemm (f06zcc)

Withdrawn at Mark 23.
Replaced by nag_zhemm (f16zcc).

old_ztrmm (f06zfc)

Withdrawn at Mark 23.
Replaced by nag_ztrmm (f16zfc).

old_ztrsm (f06zjc)

Withdrawn at Mark 23.
Replaced by nag_ztrsm (f16zjc).

old_zherk (f06zpc)

Withdrawn at Mark 23.
Replaced by nag_zherk (f16zpc).

old_zher2k (f06zrc)

Withdrawn at Mark 23.
Replaced by nag_zher2k (f16zrc).

old_zsymm (f06ztc)

Withdrawn at Mark 23.
Replaced by nag_zsymm (f16ztc).

old_zsyrk (f06zuc)

Withdrawn at Mark 23.
Replaced by nag_zsyrk (f16zuc).

old_zsyr2k (f06zwc)

Withdrawn at Mark 23.
Replaced by nag_zsyr2k (f16zwc).

g01 – Simple Calculations on Statistical Data

nag_deviates_normal_dist (g01cec)

Scheduled for withdrawal at Mark 24.
Replaced by nag_deviates_normal (g01fac).

g05 – Random Number Generators

nag_random_continuous_uniform (g05cac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_basic (g05sac).
Old: 
    /* nag_random_continuous_uniform (g05cac) */
    for (i = 0; i < n; i++)
      x[i] = nag_random_continuous_uniform();
New: 
    /* nag_rand_basic (g05sac) */
    nag_rand_basic(n,state,x,&fail);
The Integer array state in the call to nag_rand_basic (g05sac) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_basic (g05sac) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_basic (g05sac) is likely to be different from those produced by nag_random_continuous_uniform (g05cac).

nag_random_init_repeatable (g05cbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_init_repeatable (g05kfc).
Old: 
     /* nag_random_init_repeatable (g05cbc) */
     nag_random_init_repeatable(i);
New: 
     lseed = 1;
     seed[0] = i;
     genid = Nag_Basic;
     subid = 1;
     
     /* nag_rand_init_repeatable (g05kfc) */
     nag_rand_init_repeatable(genid,subid,seed,lseed,state,&lstate,&fail);
The Integer array state in the call to nag_rand_init_repeatable (g05kfc) contains information on the base generator being used. The base generator is chosen via the integer arguments genid and subid. The required length of the array state depends on the base generator chosen. Due to changes in the underlying code a sequence of values produced by using a random number generator initialized via a call to nag_rand_init_repeatable (g05kfc) is likely to be different from a sequence produced by a generator initialized by nag_random_init_repeatable (g05cbc), even if the same value for i is used.

nag_random_init_nonrepeatable (g05ccc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_init_nonrepeatable (g05kgc).
Old: 
     /* nag_random_init_nonrepeatable (g05ccc) */
     nag_random_init_nonrepeatable();
New: 
     genid = Nag_Basic;
     subid = 1;
     
     /* nag_rand_init_nonrepeatable (g05kgc) */
     nag_rand_init_nonrepeatable(genid,subid,state,&lstate,&fail);
The Integer array state in the call to nag_rand_init_nonrepeatable (g05kgc) contains information on the base generator being used. The base generator is chosen via the integer arguments genid and subid. The required length of the array state depends on the base generator chosen.

nag_save_random_state (g05cfc)

Scheduled for withdrawal at Mark 24.
There is no replacement for this function.
Old: 
     /* nag_save_random_state (g05cfc) */
     nag_save_random_state(istate,xstate);
New: 
     for (i = 0; i < lstate; i++)
       istate[i] = state[i];
The state of the base generator for the group of functions nag_rand_init_repeatable (g05kfc), nag_rand_init_nonrepeatable (g05kgc), nag_rand_leap_frog (g05khc), nag_rand_skip_ahead (g05kjc), nag_rand_permute (g05ncc), nag_rand_sample (g05ndc), nag_rand_agarchI (g05pdc)nag_rand_2_way_table (g05pzc), nag_rand_copula_students_t (g05rcc)nag_rand_matrix_multi_normal (g05rzc), g05s and g05t can be saved by simply creating a local copy of the array state. The first element of the state array contains the number of elements that are used by the random number generating functions, therefore either this number of elements can be copied, or the whole array (as defined in the calling program).

nag_restore_random_state (g05cgc)

Scheduled for withdrawal at Mark 24.
There is no replacement for this function.
Old: 
     /* nag_restore_random_state (g05cgc) */
     nag_restore_random_state(istate,xstate,&fail);
New: 
     for (i = 0; i < lstate; i++)
       state[i] = istate[i];
The state of the base generator for the group of functions nag_rand_init_repeatable (g05kfc), nag_rand_init_nonrepeatable (g05kgc), nag_rand_leap_frog (g05khc), nag_rand_skip_ahead (g05kjc), nag_rand_permute (g05ncc), nag_rand_sample (g05ndc), nag_rand_agarchI (g05pdc)nag_rand_2_way_table (g05pzc), nag_rand_copula_students_t (g05rcc)nag_rand_matrix_multi_normal (g05rzc), g05s and g05t can be restored by simply copying back the previously saved copy of the state array. The first element of the state array contains the number of elements that are used by the random number generating functions, therefore either this number of elements can be copied, or the whole array (as defined in the calling program).

nag_random_continuous_uniform_ab (g05dac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_uniform (g05sqc).
Old: 
     for (i = 0; i < n; i++)
       /* nag_random_continuous_uniform_ab (g05dac) */
       x[i] =  nag_random_continuous_uniform_ab(aa,bb);
New: 
     a = (aa < bb) ? aa : bb;
     b = (aa < bb) ? bb : aa;
     
     /* nag_rand_uniform (g05sqc) */
     nag_rand_uniform(n,a,b,state,x,&fail);
The old function nag_random_continuous_uniform_ab (g05dac) returns a single variate at a time, whereas the new function nag_rand_uniform (g05sqc) returns a vector of n values in one go. In nag_rand_uniform (g05sqc) the minimum value must be held in the argument a and the maximum in argument b, therefore a<b. This was not the case for the equivalent arguments in nag_random_continuous_uniform_ab (g05dac).
The Integer array state in the call to nag_rand_uniform (g05sqc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_uniform (g05sqc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_uniform (g05sqc) is likely to be different from those produced by nag_random_continuous_uniform_ab (g05dac).

nag_random_exp (g05dbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_exp (g05sfc).
Old: 
     for (i = 0; i < n; i++)
       /* nag_random_exp (g05dbc) */
       x[i] = nag_random_exp(aa);
New: 
     a = fabs(aa);
     
     /* nag_rand_exp (g05sfc) */
     nag_rand_exp(n,a,state,x,&fail);
The old function nag_random_exp (g05dbc) returns a single variate at a time, whereas the new function nag_rand_exp (g05sfc) returns a vector of n values in one go. In nag_rand_exp (g05sfc) argument a must be non-negative, this was not the case for the equivalent argument in nag_random_exp (g05dbc).
The Integer array state in the call to nag_rand_exp (g05sfc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_exp (g05sfc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_exp (g05sfc) is likely to be different from those produced by nag_random_exp (g05dbc).

nag_random_normal (g05ddc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_normal (g05skc).
Old:
    for (i = 0; i < n; i++)
      /* nag_random_normal (g05ddc) */
      x[i] = nag_random_normal(xmu,sd);
New: 
     /* nag_rand_normal (g05skc) */
     nag_rand_normal(n,xmu,var,state,x,&fail);
The old function nag_random_normal (g05ddc) returns a single variate at a time, whereas the new function nag_rand_normal (g05skc) returns a vector of n values in one go. nag_rand_normal (g05skc) expects the variance of the Normal distribution (argument var), compared to nag_random_normal (g05ddc) which expected the standard deviation.
The Integer array state in the call to nag_rand_normal (g05skc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_normal (g05skc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_normal (g05skc) is likely to be different from those produced by nag_random_normal (g05ddc).

nag_random_discrete_uniform (g05dyc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_discrete_uniform (g05tlc).
Old: 
     for (i = 0; i < n; i++)
        /* nag_random_discrete_uniform (g05dyc) */
        x[i] = nag_random_discrete_uniform(aa,bb);
New: 
     a = (aa < bb) ? aa : bb;
     b = (aa < bb) ? bb : aa;
     /* nag_rand_discrete_uniform (g05tlc) */
     nag_rand_discrete_uniform(n,a,b,state,x,&fail);
The old function nag_random_discrete_uniform (g05dyc) returns a single variate at a time, whereas the new function nag_rand_discrete_uniform (g05tlc) returns a vector of n values in one go. In nag_rand_discrete_uniform (g05tlc) the minimum value must be held in the argument a and the maximum in argument b, therefore ab. This was not the case for the equivalent arguments in nag_random_discrete_uniform (g05dyc).
The Integer array state in the call to nag_rand_discrete_uniform (g05tlc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_discrete_uniform (g05tlc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_discrete_uniform (g05tlc) is likely to be different from those produced by nag_random_discrete_uniform (g05dyc).

nag_ref_vec_multi_normal (g05eac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_matrix_multi_normal (g05rzc).
Old: 
     /* nag_ref_vec_multi_normal (g05eac) */
     nag_ref_vec_multi_normal(a,m,c,tdc,eps,&r,&fail);
New: 
     order = Nag_RowMajor;
     mode = Nag_InitializeReference;
     lr = m * (m + 1) + 1;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_matrix_multi_normal (g05rzc) */
     nag_rand_matrix_multi_normal(order,mode,n,m,a,c,tdc,r,lr,
        state,x,pdx,&fail);
The old function nag_ref_vec_multi_normal (g05eac) sets up a reference vector for use by nag_return_multi_normal (g05ezc). The functionality of both these functions has been combined into the single new function nag_rand_matrix_multi_normal (g05rzc). Setting mode=Nag_InitializeReference in the call to nag_rand_matrix_multi_normal (g05rzc) only sets up the double reference vector r and hence mimics the functionality of nag_ref_vec_multi_normal (g05eac).
The length of the double reference vector, r, in nag_rand_matrix_multi_normal (g05rzc) must be at least m×m+1+1. In contrast to the equivalent argument in nag_ref_vec_multi_normal (g05eac), this array must be allocated in the calling program.

nag_ref_vec_poisson (g05ecc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_poisson (g05tjc).
Old: 
     /* nag_ref_vec_poisson (g05ecc) */
     nag_ref_vec_poisson(t,&r,&fail);
     for (i = 0; i < n; i++)
       /* nag_return_discrete (g05eyc) */
       x[i] = nag_return_discrete(r);
New: 
     mode = Nag_InitializeAndGenerate;
     lr = 30 + (Integer) (20 * sqrt(t) + t);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_poisson (g05tjc) */
     nag_rand_poisson(mode,n,t,r,lr,state,x,&fail);
The old function nag_ref_vec_poisson (g05ecc) sets up a reference vector for use by nag_return_discrete (g05eyc). The replacement function nag_rand_poisson (g05tjc) is now used to both set up a reference vector and generate the required variates. Setting mode=Nag_InitializeReference in the call to nag_rand_poisson (g05tjc) sets up the double reference vector r and hence mimics the functionality of nag_ref_vec_poisson (g05ecc). Setting mode=Nag_GenerateFromReference generates a series of variates from a reference vector mimicking the functionality of nag_return_discrete (g05eyc) for this particular distribution. Setting mode=Nag_InitializeAndGenerate initializes the reference vector and generates the variates in one go.
The function nag_return_discrete (g05eyc) returns a single variate at a time, whereas the new function nag_rand_poisson (g05tjc) returns a vector of n values in one go.
The length of the double reference vector, r, in nag_rand_poisson (g05tjc), must be allocated in the calling program in contrast to the equivalent argument in nag_ref_vec_poisson (g05ecc), see the documentation for more details.
The Integer array state in the call to nag_rand_poisson (g05tjc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_poisson (g05tjc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_poisson (g05tjc) is likely to be different from those produced by a combination of nag_ref_vec_poisson (g05ecc) and nag_return_discrete (g05eyc).

nag_ref_vec_binomial (g05edc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_binomial (g05tac).
Old: 
     /* nag_ref_vec_binomial (g05edc) */
     nag_ref_vec_binomial(m,p,&r,&fail);
     for (i = 0; i < n; i++)
       /* nag_return_discrete (g05eyc) */
       x[i] = nag_return_discrete(r);
New: 
     mode = Nag_InitializeAndGenerate;
     lr = 22 + 20 * ((Integer) sqrt(m * p * (1 - p)));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_binomial (g05tac) */
     nag_rand_binomial(mode,n,m,p,r,lr,state,x,&fail);
The old function nag_ref_vec_binomial (g05edc) sets up a reference vector for use by nag_return_discrete (g05eyc). The replacement function nag_rand_binomial (g05tac) is now used to both set up a reference vector and generate the required variates. Setting mode=Nag_InitializeReference in the call to nag_rand_binomial (g05tac) sets up the double reference vector r and hence mimics the functionality of nag_ref_vec_binomial (g05edc). Setting mode=Nag_GenerateFromReference generates a series of variates from a reference vector mimicking the functionality of nag_return_discrete (g05eyc) for this particular distribution. Setting mode=Nag_InitializeAndGenerate initializes the reference vector and generates the variates in one go.
The function nag_return_discrete (g05eyc) returns a single variate at a time, whereas the new function nag_rand_binomial (g05tac) returns a vector of n values in one go.
The length of the double reference vector, r, in nag_rand_binomial (g05tac), needs to be a different length from the equivalent argument in nag_ref_vec_binomial (g05edc), see the documentation for more details.
The Integer array state in the call to nag_rand_binomial (g05tac) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_binomial (g05tac) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_binomial (g05tac) is likely to be different from those produced by a combination of nag_ref_vec_binomial (g05edc) and nag_return_discrete (g05eyc).

nag_ran_permut_vec (g05ehc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_permute (g05ncc).
Old: 
     /* nag_ran_permut_vec (g05ehc) */
      nag_ran_permut_vec(index,n,&fail);
New: 
     /* nag_rand_permute (g05ncc) */
     nag_rand_permute(index,n,state,&fail);
The Integer array state in the call to nag_rand_permute (g05ncc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_permute (g05ncc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_permute (g05ncc) is likely to be different from those produced by nag_ran_permut_vec (g05ehc).

nag_ran_sample_vec (g05ejc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_sample (g05ndc).
Old: 
     /* nag_ran_sample_vec (g05ejc) */
     nag_ran_sample_vec(ia,n,iz,m,&fail);
New: 
     /* nag_rand_sample (g05ndc) */
     nag_rand_sample(ia,n,iz,m,state,&fail);
The Integer array state in the call to nag_rand_sample (g05ndc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_sample (g05ndc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_sample (g05ndc) is likely to be different from those produced by nag_ran_sample_vec (g05ejc).

nag_ref_vec_discrete_pdf_cdf (g05exc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gen_discrete (g05tdc).
Old: 
     /* nag_ref_vec_discrete_pdf_cdf (g05exc) */
     nag_ref_vec_discrete_pdf_cdf(p,np,sizep,distf,&r,&fail);
     for (i = 0; i < n; i++)
       /* nag_return_discrete (g05eyc) */
       x[i] = nag_return_discrete(r);
New: 
     mode = Nag_InitializeAndGenerate;
     lr = 10 + (Integer) (1.4 * np);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_gen_discrete (g05tdc) */
     nag_rand_gen_discrete(mode,n,p,np,sizep,distf,r,lr,state,x,&fail);
The old function nag_ref_vec_discrete_pdf_cdf (g05exc) sets up a reference vector for use by nag_return_discrete (g05eyc). The replacement function nag_rand_gen_discrete (g05tdc) is now used to both set up a reference vector and generate the required variates. Setting mode=Nag_InitializeReference in the call to nag_rand_gen_discrete (g05tdc) sets up the double reference vector r and hence mimics the functionality of nag_ref_vec_discrete_pdf_cdf (g05exc). Setting mode=Nag_GenerateFromReference generates a series of variates from a reference vector mimicking the functionality of nag_return_discrete (g05eyc) for this particular distribution. Setting mode=Nag_InitializeAndGenerate initializes the reference vector and generates the variates in one go.
The function nag_return_discrete (g05eyc) returns a single variate at a time, whereas the new function nag_rand_gen_discrete (g05tdc) returns a vector of n values in one go.
The length of the double reference vector, r, in nag_rand_gen_discrete (g05tdc) must be allocated in the calling program in contrast to the equivalent argument in nag_ref_vec_discrete_pdf_cdf (g05exc), see the documentation for more details.
The Integer array state in the call to nag_rand_gen_discrete (g05tdc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_gen_discrete (g05tdc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_gen_discrete (g05tdc) is likely to be different from those produced by a combination of nag_ref_vec_discrete_pdf_cdf (g05exc) and nag_return_discrete (g05eyc).

nag_return_discrete (g05eyc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gen_discrete (g05tdc).
There is no direct replacement function for nag_return_discrete (g05eyc).
nag_return_discrete (g05eyc) is designed to generate random draws from a distribution defined by a reference vector. These reference vectors are created by other functions in Chapter g05, for example nag_ref_vec_poisson (g05ecc), which have themselves been superseded. In order to replace a call to nag_return_discrete (g05eyc) you must identify which NAG function generated the reference vector being used and look up its replacement. For example, to replace a call to nag_return_discrete (g05eyc) preceded by a call to nag_ref_vec_discrete_pdf_cdf (g05exc), as in:
     /* nag_ref_vec_discrete_pdf_cdf (g05exc) */
     nag_ref_vec_discrete_pdf_cdf(p,np,sizep,distf,&r,&fail);
     /* nag_return_discrete (g05eyc) */
     x = nag_return_discrete(r);
you would need to look at the replacement function for nag_ref_vec_discrete_pdf_cdf (g05exc).

nag_return_multi_normal (g05ezc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_matrix_multi_normal (g05rzc).
Old: 
     #define X(I,J) x[(I*pdx + J)]
     /* nag_ref_vec_multi_normal (g05eac) */
     nag_ref_vec_multi_normal(a,m,c,tdc,eps,&r,&fail);
     for (i = 0; i < n; i++) {
       /* nag_return_multi_normal (g05ezc) */
       nag_return_multi_normal(z,r);
       for (j = 0; j < m; j++)
         X(i,j) = z[j];
     }
New: 
     order = Nag_RowMajor;
     mode = Nag_InitializeAndGenerate;
     lr = m * (m + 1) + 1;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_matrix_multi_normal (g05rzc) */
     nag_rand_matrix_multi_normal(order,mode,n,m,a,c,tdc,r,lr,
        state,x,pdx,&fail);
The old function nag_ref_vec_multi_normal (g05eac) sets up a reference vector for use by nag_return_multi_normal (g05ezc). The functionality of both these functions has been combined into the single new function nag_rand_matrix_multi_normal (g05rzc). Setting mode=Nag_InitializeAndGenerate in the call to nag_rand_matrix_multi_normal (g05rzc) sets up the double reference vector r and generates the draws from the multivariate Normal distribution in one go.
The old function nag_return_multi_normal (g05ezc) returns a single (m-dimensional vector) draw from the multivariate Normal distribution at a time, whereas the new function nag_rand_matrix_multi_normal (g05rzc) returns an n by m matrix of n draws in one go.
The Integer array state in the call to nag_rand_matrix_multi_normal (g05rzc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_matrix_multi_normal (g05rzc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_matrix_multi_normal (g05rzc) is likely to be different from those produced by nag_return_multi_normal (g05ezc).

nag_random_beta (g05fec)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_beta (g05sbc).
Old: 
     /* nag_random_beta (g05fec) */
    nag_random_beta(a,b,n,x,&fail);
New: 
     /* nag_rand_beta (g05sbc) */
     nag_rand_beta(n,a,b,state,x,&fail);
The Integer array state in the call to nag_rand_beta (g05sbc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_beta (g05sbc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_beta (g05sbc) is likely to be different from those produced by nag_random_beta (g05fec).

nag_random_gamma (g05ffc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gamma (g05sjc).
Old: 
     /* nag_random_gamma (g05ffc) */
     nag_random_gamma(a,b,n,x,&fail);
New: 
     /* nag_rand_gamma (g05sjc) */
     nag_rand_gamma(n,a,b,state,x,&fail);
The Integer array state in the call to nag_rand_gamma (g05sjc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_gamma (g05sjc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_gamma (g05sjc) is likely to be different from those produced by nag_random_gamma (g05ffc).

nag_arma_time_series (g05hac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_arma (g05phc).
Old: 
     /* nag_arma_time_series (g05hac) */
     nag_arma_time_series(start,p,q,phi,theta,mean,vara,n,w,ref,&fail);
New: 
     mode = (start == Nag_TRUE) ? Nag_InitializeAndGenerate : Nag_GenerateFromReference;
     lr = (p > q + 1) ? p : q + 1;
     lr += p + q + 6;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_arma (g05phc) */
     nag_rand_arma(mode,n,mean,p,phi,q,theta,vara,r,lr,state,&var,x,&fail);
The Integer array state in the call to nag_rand_arma (g05phc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_arma (g05phc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_arma (g05phc) is likely to be different from those produced by nag_arma_time_series (g05hac).

nag_generate_agarchI (g05hkc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_agarchI (g05pdc).
Old: 
     /* nag_generate_agarchI (g05hkc) */
     nag_generate_agarchI(num,p,q,theta,gamma,ht,et,fcall,rvec,&fail);
New: 
     dist = Nag_NormalDistn;
     df = 0;
     bfcall = (fcall == Nag_Garch_Fcall_True) ? Nag_TRUE : Nag_FALSE;
     lr = 2 * (p + q + 2);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_agarchI (g05pdc) */
     nag_rand_agarchI(dist,num,p,q,theta,gamma,df,ht,et,bfcall,r,lr,
        state,&fail);
The Integer array state in the call to nag_rand_agarchI (g05pdc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_agarchI (g05pdc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_agarchI (g05pdc) is likely to be different from those produced by nag_generate_agarchI (g05hkc).

nag_generate_agarchII (g05hlc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_agarchII (g05pec).
Old: 
     /* nag_generate_agarchII (g05hlc) */
     nag_generate_agarchII(num,p,q,theta,gamma,ht,et,fcall,rvec,&fail);
New: 
     dist = Nag_NormalDistn;
     df = 0;
     bfcall = (fcall == Nag_Garch_Fcall_True) ? Nag_TRUE : Nag_FALSE;
     lr = 2 * (p + q + 2);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_agarchII (g05pec) */
     nag_rand_agarchII(dist,num,p,q,theta,gamma,df,ht,et,bfcall,r,lr,
        state,&fail);
The Integer array state in the call to nag_rand_agarchII (g05pec) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_agarchII (g05pec) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_agarchII (g05pec) is likely to be different from those produced by nag_generate_agarchII (g05hlc).

nag_generate_garchGJR (g05hmc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_garchGJR (g05pfc).
Old: 
     /* nag_generate_garchGJR (g05hmc) */
     nag_generate_garchGJR(num,p,q,theta,gamma,ht,et,fcall,rvec,&fail);
New: 
     dist = Nag_NormalDistn;
     df = 0;
     bfcall = (fcall == Nag_Garch_Fcall_True) ? Nag_TRUE : Nag_FALSE;
     lr = 2 * (p + q + 2);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_garchGJR (g05pfc) */
     nag_rand_garchGJR(dist,num,p,q,theta,gamma,df,ht,et,bfcall,r,lr,
        state,&fail);
The Integer array state in the call to nag_rand_garchGJR (g05pfc) contains information on the base generator being used. This array must have been initialized prior to calling nag_rand_garchGJR (g05pfc) with a call to either nag_rand_init_repeatable (g05kfc) or nag_rand_init_nonrepeatable (g05kgc). The required length of the array state will depend on the base generator chosen during initialization. Due to changes in the underlying code the sequence of values produced by nag_rand_garchGJR (g05pfc) is likely to be different from those produced by nag_generate_garchGJR (g05hmc).

nag_rngs_basic (g05kac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_basic (g05sac).
Old:
     for (i = 0; i < n; i++) 
       /* nag_rngs_basic (g05kac) */
       x[i] = nag_rngs_basic(igen,iseed);
New: 
     /* nag_rand_basic (g05sac) */
     nag_rand_basic(n,state,x,&fail);
The old function nag_rngs_basic (g05kac) returns a single variate at a time, whereas the new function nag_rand_basic (g05sac) returns a vector of n values in one go.

nag_rngs_init_repeatable (g05kbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_init_repeatable (g05kfc).
Old: 
     /* nag_rngs_init_repeatable (g05kbc) */
     nag_rngs_init_repeatable(&igen,iseed);
New: 
     if (igen == 0) {
       genid = Nag_Basic;
       subid = 1;
     } else if (igen >= 1) { 
       genid = Nag_WichmannHill_I;
       subid = igen;
     }
     
     /* nag_rand_init_repeatable (g05kfc) */
     nag_rand_init_repeatable(genid,subid,iseed,lseed,state,&lstate,&fail);

nag_rngs_init_nonrepeatable (g05kcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_init_nonrepeatable (g05kgc).
Old: 
     /* nag_rngs_init_nonrepeatable (g05kcc) */
     nag_rngs_init_nonrepeatable(&igen,iseed);
New: 
     if (igen == 0) {
       genid = Nag_Basic;
       subid = 1;
     } else if (igen >= 1) { 
       genid = Nag_WichmannHill_I;
       subid = igen;
     }
     
     /* nag_rand_init_nonrepeatable (g05kgc) */
     nag_rand_init_nonrepeatable(genid,subid,state,&lstate,&fail);

nag_rngs_logical (g05kec)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_logical (g05tbc).
Old:
     for (i = 0; i < n; i++)
        /* nag_rngs_logical (g05kec) */
        x[i] = nag_rngs_logical(p,igen,iseed,&fail);
New: 
     /* nag_rand_logical (g05tbc) */
     nag_rand_logical(n,p,state,x,&fail);
The old function nag_rngs_logical (g05kec) returns a single variate at a time, whereas the new function nag_rand_logical (g05tbc) returns a vector of n values in one go.

nag_rngs_normal (g05lac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_normal (g05skc).
Old: 
     /* nag_rngs_normal (g05lac) */
     nag_rngs_normal(xmu,var,n,x,igen,iseed,&fail);
New:
     /* nag_rand_normal (g05skc) */
     nag_rand_normal(n,xmu,var,state,x,&fail);

nag_rngs_students_t (g05lbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_students_t (g05snc).
Old: 
     /* nag_rngs_students_t (g05lbc) */
     nag_rngs_students_t(df,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_students_t (g05snc) */
     nag_rand_students_t(n,df,state,x,&fail);

nag_rngs_chi_sq (g05lcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_chi_sq (g05sdc).
Old: 
     /* nag_rngs_chi_sq (g05lcc) */
     nag_rngs_chi_sq(df,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_chi_sq (g05sdc) */
     nag_rand_chi_sq(n,df,state,x,&fail);

nag_rngs_f (g05ldc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_f (g05shc).
Old: 
     /* nag_rngs_f (g05ldc) */
     nag_rngs_f(df1,df2,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_f (g05shc) */
     nag_rand_f(n,df1,df2,state,x,&fail);

nag_rngs_beta (g05lec)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_beta (g05sbc).
Old: 
     /* nag_rngs_beta (g05lec) */
     nag_rngs_beta(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_beta (g05sbc) */
     nag_rand_beta(n,a,b,state,x,&fail);

nag_rngs_gamma (g05lfc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gamma (g05sjc).
Old: 
     /* nag_rngs_gamma (g05lfc) */
     nag_rngs_gamma(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_gamma (g05sjc) */
     nag_rand_gamma(n,a,b,state,x,&fail);

nag_rngs_uniform (g05lgc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_uniform (g05sqc).
Old: 
     /* nag_rngs_uniform (g05lgc) */
     nag_rngs_uniform(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_uniform (g05sqc) */
     nag_rand_uniform(n,a,b,state,x,&fail);

nag_rngs_triangular (g05lhc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_triangular (g05spc).
Old: 
     /* nag_rngs_triangular (g05lhc) */
     nag_rngs_triangular(xmin,xmax,xmed,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_triangular (g05spc) */
     nag_rand_triangular(n,xmin,xmed,xmax,state,x,&fail);

nag_rngs_exp (g05ljc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_exp (g05sfc).
Old: 
     /* nag_rngs_exp (g05ljc) */
     nag_rngs_exp(a,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_exp (g05sfc) */
     nag_rand_exp(n,a,state,x,&fail);

nag_rngs_lognormal (g05lkc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_lognormal (g05smc).
Old: 
     /* nag_rngs_lognormal (g05lkc) */
     nag_rngs_lognormal(xmu,var,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_lognormal (g05smc) */
     nag_rand_lognormal(n,xmu,var,state,x,&fail);

nag_rngs_cauchy (g05llc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_cauchy (g05scc).
Old: 
     /* nag_rngs_cauchy (g05llc) */
     nag_rngs_cauchy(xmed,semiqr,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_cauchy (g05scc) */
     nag_rand_cauchy(n,xmed,semiqr,state,x,&fail);

nag_rngs_weibull (g05lmc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_weibull (g05ssc).
Old: 
     /* nag_rngs_weibull (g05lmc) */
     nag_rngs_weibull(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_weibull (g05ssc) */
     nag_rand_weibull(n,a,b,state,x,&fail);

nag_rngs_logistic (g05lnc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_logistic (g05slc).
Old: 
     /* nag_rngs_logistic (g05lnc) */
     nag_rngs_logistic(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_logistic (g05slc) */
      nag_rand_logistic(n,a,b,state,x,&fail);

nag_rngs_von_mises (g05lpc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_von_mises (g05src).
Old: 
     /* nag_rngs_von_mises (g05lpc) */
     nag_rngs_von_mises(vk,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_von_mises (g05src) */
     nag_rand_von_mises(n,vk,state,x,&fail);

nag_rngs_exp_mix (g05lqc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_exp_mix (g05sgc).
Old: 
     /* nag_rngs_exp_mix (g05lqc) */
     nag_rngs_exp_mix(nmix,a,wgt,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_exp_mix (g05sgc) */
     nag_rand_exp_mix(n,nmix,a,wgt,state,x,&fail);

nag_rngs_matrix_multi_students_t (g05lxc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_matrix_multi_students_t (g05ryc).
Old: 
     /* nag_rngs_matrix_multi_students_t (g05lxc) */
     nag_rngs_matrix_multi_students_t(order,mode,df,m,xmu,c,pdc,n,x,pdx,
        igen,iseed,r,lr,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 1) {
       emode = Nag_InitializeReference;
     } else if (mode == 2) {
       emode = Nag_GenerateFromReference;
     }
     lr = m * (m + 1) + 2;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_matrix_multi_students_t (g05ryc) */
     nag_rand_matrix_multi_students_t(order,emode,n,df,m,xmu,c,pdc,r,lr,
        state,x,pdx,&fail);

nag_rgsn_matrix_multi_normal (g05lyc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_matrix_multi_normal (g05rzc).
Old: 
     /* nag_rgsn_matrix_multi_normal (g05lyc) */
     nag_rgsn_matrix_multi_normal(order,mode,m,xmu,c,pdc,n,x,pdx,igen,
        iseed,r,lr,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 1) {
       emode = Nag_InitializeReference;
     } else if (mode == 2) {
       emode = Nag_GenerateFromReference;
     }
     lr = m * (m + 1) + 1;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_matrix_multi_normal (g05rzc) */
     nag_rand_matrix_multi_normal(order,emode,n,m,xmu,c,pdc,r,lr,
        state,x,pdx,&fail);

nag_rngs_multi_normal (g05lzc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_matrix_multi_normal (g05rzc).
Old: 
     /* nag_rngs_multi_normal (g05lzc) */
     nag_rngs_multi_normal(order,mode,m,xmu,c,pdc,x,igen,iseed,r,&fail);
New:
     if (mode == 0) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 1) {
       emode = Nag_InitializeReference;
     } else if (mode == 2) {
       emode = Nag_GenerateFromReference;
     }
     n = 1;
     pdx = 1;
     lr = m * (m + 1) + 1;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_matrix_multi_normal (g05rzc) */
     nag_rand_matrix_multi_normal(order,emode,n,m,xmu,c,pdc,r,lr,
        state,x,pdx,&fail);

nag_rngs_discrete_uniform (g05mac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_discrete_uniform (g05tlc).
Old: 
     /* nag_rngs_discrete_uniform (g05mac) */
     nag_rngs_discrete_uniform(a,b,n,x,igen,iseed,&fail);
New: 
     /* nag_rand_discrete_uniform (g05tlc) */
     nag_rand_discrete_uniform(n,a,b,state,x,&fail);

nag_rngs_geom (g05mbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_geom (g05tcc).
Old: 
     /* nag_rngs_geom (g05mbc) */
     nag_rngs_geom(mode,p,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 
          8 + (Integer) (42 / p);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_geom (g05tcc) */
     nag_rand_geom(emode,n,p,r,lr,state,x,&fail);
nag_rngs_geom (g05mbc) returned the number of trials required to get the first success, whereas nag_rand_geom (g05tcc) returns the number of failures before the first success, therefore the value returned by nag_rand_geom (g05tcc) is one less than the equivalent value returned from nag_rngs_geom (g05mbc).

nag_rngs_neg_bin (g05mcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_neg_bin (g05thc).
Old: 
     /* nag_rngs_neg_bin (g05mcc) */
     nag_rngs_neg_bin(mode,m,p,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 
          28 + (Integer) ((20 * sqrt(m*p) + 30 * p) / (1 - p));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_neg_bin (g05thc) */
     nag_rand_neg_bin(emode,n,m,p,r,lr,state,x,&fail);

nag_rngs_logarithmic (g05mdc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_logarithmic (g05tfc).
Old: 
     /* nag_rngs_logarithmic (g05mdc) */
     nag_rngs_logarithmic(mode,a,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 
          18 + (Integer) (40 / (1 - a));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_logarithmic (g05tfc) */
     nag_rand_logarithmic(emode,n,a,r,lr,state,x,&fail);

nag_rngs_compd_poisson (g05mec)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_compd_poisson (g05tkc).
Old: 
     /* nag_rngs_compd_poisson (g05mec) */
     nag_rngs_compd_poisson(m,vlamda,x,igen,iseed,&fail);
New: 
     /* nag_rand_compd_poisson (g05tkc) */
     nag_rand_compd_poisson(m,vlamda,state,x,&fail);

nag_rngs_binomial (g05mjc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_binomial (g05tac).
Old: 
     /* nag_rngs_binomial (g05mjc) */
     nag_rngs_binomial(mode,m,p,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 
          22 + 20 * ((Integer) sqrt(m * p * (1 - p)));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_binomial (g05tac) */
     nag_rand_binomial(emode,n,m,p,r,lr,state,x,&fail);

nag_rngs_poisson (g05mkc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_poisson (g05tjc).
Old: 
     /* nag_rngs_poisson (g05mkc) */
     nag_rngs_poisson(mode,lambda,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 30 + 
          (Integer) (20 * sqrt(lambda) + lambda);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_poisson (g05tjc) */
     nag_rand_poisson(emode,n,lambda,r,lr,state,x,&fail);

nag_rngs_hypergeometric (g05mlc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_hypergeometric (g05tec).
Old: 
     /* nag_rngs_hypergeometric (g05mlc) */
     nag_rngs_hypergeometric(mode,ns,np,m,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 28 + 20 * 
          ((Integer) sqrt((ns * m * (np - m) * (np - ns)) / 
          (np * np * np)));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_hypergeometric (g05tec) */
     nag_rand_hypergeometric(emode,n,ns,np,m,r,lr,state,x,&fail);

nag_rngs_gen_multinomial (g05mrc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gen_multinomial (g05tgc).
Old: 
     /* nag_rngs_gen_multinomial (g05mrc) */
     nag_rngs_gen_multinomial(order,mode,m,k,p,n,x,pdx,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_GenerateWithoutReference;
     }
     pmax = p[0];
     for (i = 1; i < k; i++)
       pmax = (pmax > p[i]) ? p[i] : pmax;
     lr = (emode == Nag_GenerateWithoutReference) ? 1 : 30 + 
          20 * ((Integer) sqrt(m * pmax * (1 - pmax)));
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_gen_multinomial (g05tgc) */
     nag_rand_gen_multinomial(order,emode,n,m,k,p,r,lr,state,x,pdx,&fail);

nag_rngs_gen_discrete (g05mzc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_gen_discrete (g05tdc).
Old: 
     /* nag_rngs_gen_discrete (g05mzc) */
     nag_rngs_gen_discrete(mode,p,np,ip1,comp_type,n,x,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     }
     itype = (comp_type == Nag_Compute_1) ? Nag_PDF : Nag_CDF;
     lr = 10 + (Integer) (1.4 * np);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_gen_discrete (g05tdc) */
     nag_rand_gen_discrete(emode,n,p,np,ip1,itype,r,lr,state,x,&fail);

nag_rngs_permute (g05nac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_permute (g05ncc).
Old: 
     /* nag_rngs_permute (g05nac) */
     nag_rngs_permute(index,n,igen,iseed,&fail);
New: 
     /* nag_rand_permute (g05ncc) */
     nag_rand_permute(index,n,state,&fail);

nag_rngs_sample (g05nbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_sample (g05ndc).
Old: 
     /* nag_rngs_sample (g05nbc) */
     nag_rngs_sample(ipop,n,isampl,m,igen,iseed,&fail);
New: 
     /* nag_rand_sample (g05ndc) */
     nag_rand_sample(ipop,n,isampl,m,state,&fail);

nag_rngs_arma_time_series (g05pac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_arma (g05phc).
Old: 
     /* nag_rngs_arma_time_series (g05pac) */
     nag_rngs_arma_time_series(mode,xmean,p,phi,q,theta,avar,&var,n,x,
        igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     }
     lr = p + q + 6 * ((p < q + 1) ? q + 1 : p);
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_arma (g05phc) */
     nag_rand_arma(emode,n,xmean,p,phi,q,theta,avar,r,lr,state,&var,x,
        &fail);

nag_rngs_varma_time_series (g05pcc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_varma (g05pjc).
Old: 
     /* nag_rngs_varma_time_series (g05pcc) */
     nag_rngs_varma_time_series(order,mode,k,xmean,p,phi,q,theta,
        var,pdv,n,x,pdx,igen,iseed,r,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     } else if (mode == 3) {
       emode = Nag_ReGenerateFromReference;
     }
     tmp1 = (p > q) ? p : q;
     if (p == 0) {
       tmp2 = k * (k + 1) / 2;
     } else {
       tmp2 = k*(k+1)/2 + (p-1)*k*k;
     }
     tmp3 = p + q;
     if (k >= 6) {
       lr = (5*tmp1*tmp1+1)*k*k + (4*tmp1+3)*k + 4;
     } else {
       tmp4 = k*tmp1*(k*tmp1+2);
       tmp5 = k*k*tmp3*tmp3+tmp2*(tmp2+3)+k*k*(q+1);
       lr = (tmp3*tmp3+1)*k*k + (4*tmp3+3)*k + 
            ((tmp4 > tmp5) ? tmp4 : tmp5) + 4;
     }
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_varma (g05pjc) */
     nag_rand_varma(order,emode,n,k,xmean,p,phi,q,theta,var,pdv,r,lr,
        state,x,pdx,&fail);

nag_rngs_orthog_matrix (g05qac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_orthog_matrix (g05pxc).
Old: 
     /* nag_rngs_orthog_matrix (g05qac) */
     nag_rngs_orthog_matrix(order,side,init,m,n,a,pda,igen,iseed,&fail);
New: 
     if (order == Nag_RowMajor) {
       /* nag_rand_orthog_matrix (g05pxc) */
       nag_rand_orthog_matrix(side,init,m,n,state,a,pda,&fail);
     } else {
       tside = (side == Nag_LeftSide) ? Nag_RightSide : Nag_LeftSide;
       pda = m;
       
       /* nag_rand_orthog_matrix (g05pxc) */
       nag_rand_orthog_matrix(tside,init,n,m,state,a,pda,&fail);
     }

nag_rngs_corr_matrix (g05qbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_corr_matrix (g05pyc).
Old: 
     /* nag_rngs_corr_matrix (g05qbc) */
     nag_rngs_corr_matrix(order,n,d,c,pdc,eps,igen,iseed,&fail);
New: 
     /* nag_rand_corr_matrix (g05pyc) */
     nag_rand_corr_matrix(n,d,eps,state,c,pdc,&fail);

nag_rngs_2_way_table (g05qdc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_2_way_table (g05pzc).
Old: 
     /* nag_rngs_2_way_table (g05qdc) */
     nag_rngs_2_way_table(order,mode,nrow,ncol,totr,totc,x,pdx,igen,
        iseed,r,nr,&fail);
New: 
     if (mode == 0) {
       emode = Nag_InitializeReference;
     } else if (mode == 1) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 2) {
       emode = Nag_InitializeAndGenerate;
     }
     for (i = 0, lr = 5; i < nrow; i++)
       lr += totr[i];
     r = NAG_ALLOC(lr,double);
     if (order == Nag_RowMajor) {
       /* nag_rand_2_way_table (g05pzc) */
       nag_rand_2_way_table(emode,nrow,ncol,totr,totc,r,lr,state,x,pdx,
          &fail);
     } else {
       pdx = nrow;
       
       /* nag_rand_2_way_table (g05pzc) */
       nag_rand_2_way_table(emode,ncol,nrow,totc,totr,r,lr,state,x,pdx,
          &fail);
     }

nag_rngs_copula_normal (g05rac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_copula_normal (g05rdc).
Old: 
     /* nag_rngs_copula_normal (g05rac) */
     nag_rngs_copula_normal(order,mode,m,c,pdc,n,x,pdx,igen,iseed,r,lr,
        &fail);
New: 
     if (mode == 1) {
       emode = Nag_InitializeReference;
     } else if (mode == 2) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 0) {
       emode = Nag_InitializeAndGenerate;
     }
     lr = m * (m + 1) + 1;
     r = NAG_ALLOC(lr,double);
     
     /* nag_rand_copula_normal (g05rdc) */
     nag_rand_copula_normal(order,emode,n,m,c,pdc,r,lr,state,x,pdx,
        &fail);

nag_rngs_copula_students_t (g05rbc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_rand_copula_students_t (g05rcc).
Old: 
     /* nag_rngs_copula_students_t (g05rbc) */
     nag_rngs_copula_students_t(order,mode,df,m,c,pdc,n,x,pdx,igen,
        iseed,r,lr,&fail);
New: 
     if (mode == 1) {
       emode = Nag_InitializeReference;
     } else if (mode == 2) {
       emode = Nag_GenerateFromReference;
     } else if (mode == 0) {
       emode = Nag_InitializeAndGenerate;
     }
     
     /* nag_rand_copula_students_t (g05rcc) */
     nag_rand_copula_students_t(order,emode,n,df,m,c,pdc,r,lr,
        state,x,pdx,&fail);

nag_quasi_random_uniform (g05yac)

Scheduled for withdrawal at Mark 24.
Replaced by nag_quasi_init (g05ylc) and nag_quasi_rand_uniform (g05ymc).
Old: 
     /* nag_quasi_random_uniform (g05yac) */
     nag_quasi_random_uniform(state,seq,iskip,idim,quasi,&gf,&fail);
New: 
     liref = (seq == Nag_QuasiRandom_Faure) ? 407 : 32 * idim + 7;
     iref = NAG_ALLOC(liref,Integer);
     seq = (seq == Nag_QuasiRandom_Sobol) ? 
       Nag_QuasiRandom_SobolA659 : seq;
     
     if (state == Nag_QuasiRandom_Init) {
       /* nag_quasi_init (g05ylc) */
       nag_quasi_init(seq,idim,iref,liref,iskip,&fail);
     } else if (state == Nag_QuasiRandom_Cont) {
       n = 1;
       pdquasi = (order == Nag_RowMajor) ? idim : n;
       
       /* nag_quasi_rand_uniform (g05ymc) */
       nag_quasi_rand_uniform(order,n,quasi,pdquasi,iref,&fail);
     }
nag_quasi_random_uniform (g05yac) has been split into two functions; nag_quasi_init (g05ylc) to initialize the quasi-random generators and nag_quasi_rand_uniform (g05ymc) to generate the values. nag_quasi_rand_uniform (g05ymc) will generate more than one realization at a time. Information is passed between nag_quasi_init (g05ylc) and nag_quasi_rand_uniform (g05ymc) using the integer vector iref rather than the NAG defined structure gf. Therefore there is no longer any need to call a function to release memory as iref can be "freed" like any C array.

nag_quasi_random_normal (g05ybc)

Scheduled for withdrawal at Mark 24.
Replaced by nag_quasi_rand_normal (g05yjc) and nag_quasi_init (g05ylc).
Old: 
     /* nag_quasi_random_normal (g05ybc) */
     nag_quasi_random_normal(state,seq,lnorm,mean,std,iskip,idim,
        quasi,&gf,&fail);
New: 
     liref = (seq == Nag_QuasiRandom_Faure) ? 407 : 32 * idim + 7;
     iref = NAG_ALLOC(liref,Integer);
     seq = (seq == Nag_QuasiRandom_Sobol) ? 
       Nag_QuasiRandom_SobolA659 : seq;
       
     if (state == Nag_QuasiRandom_Init) {
       /* nag_quasi_init (g05ylc) */
       nag_quasi_init(seq,idim,iref,liref,iskip,&fail);
     } else if (state == Nag_QuasiRandom_Cont) {
       n = 1;
       pdquasi = (order == Nag_RowMajor) ? idim : n;
       
       if (lnorm == Nag_LogNormal) {
         /* nag_quasi_rand_lognormal (g05ykc) */
         nag_quasi_rand_lognormal(order,mean,std,n,quasi,pdquasi,iref,
            &fail);
       } else if (lnorm == Nag_Normal) {
         /* nag_quasi_rand_normal (g05yjc) */
         nag_quasi_rand_normal(order,mean,std,n,quasi,pdquasi,iref,&fail);
       }
     }
nag_quasi_random_normal (g05ybc) has been split into three functions; nag_quasi_init (g05ylc) to initialize the quasi-random generators, nag_quasi_rand_lognormal (g05ykc) to generate values from a log-normal distribution and nag_quasi_rand_normal (g05yjc) to generate values from a normal distribution. Both nag_quasi_rand_lognormal (g05ykc) and nag_quasi_rand_normal (g05yjc) will generate more than one realization at a time. Information is passed between nag_quasi_init (g05ylc) and nag_quasi_rand_lognormal (g05ykc) and nag_quasi_rand_normal (g05yjc) using the integer vector iref rather than the NAG defined structure gf. Therefore there is no longer any need to call a function to release memory as iref can be "freed" like any C array.

x02 – Machine Constants

nag_underflow_flag (X02DAC)

Scheduled for withdrawal at Mark 24.
There is no replacement for this function.

nag_real_arithmetic_rounds (X02DJC)

Scheduled for withdrawal at Mark 24.
There is no replacement for this function.

x04 – Input/Output Utilities

nag_example_file_io (x04aec)

Scheduled for withdrawal at Mark 25.
There is no replacement for this function.

Advice on Replacement Calls for Withdrawn/Superseded Functions (PDF version)
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012