L-BFGS-B  3.0
Large-scale Bound-constrained Optimization
errclb.f
Go to the documentation of this file.
1 c> \file errclb.f
2 
3 c> \brief This subroutine checks the validity of the input data.
4 c>
5 c> This subroutine checks the validity of the input data.
6 c>
7 c> @param n number of parameters
8 c> @param m history size of approximated Hessian
9 c> @param factr convergence criterion on function value
10 c> @param l lower bounds for parameters
11 c> @param u upper bounds for parameters
12 c> @param nbd indicates which bounds are present
13 c> @param task if an error occurs, contains a human-readable error message
14 c> @param info =0 on success; =-6 if nbd(k) was invalid; =-7 if both limits are given but l(k) > u(k)
15 c> @param k index of last errournous parameter
16  subroutine errclb(n, m, factr, l, u, nbd, task, info, k)
17 
18  character*60 task
19  integer n, m, info, k, nbd(n)
20  double precision factr, l(n), u(n)
21 c
22 c * * *
23 c
24 c NEOS, November 1994. (Latest revision June 1996.)
25 c Optimization Technology Center.
26 c Argonne National Laboratory and Northwestern University.
27 c Written by
28 c Ciyou Zhu
29 c in collaboration with R.H. Byrd, P. Lu-Chen and J. Nocedal.
30 c
31 c
32 c ************
33 
34  integer i
35  double precision one,zero
36  parameter(one=1.0d0,zero=0.0d0)
37 
38 c Check the input arguments for errors.
39 
40  if (n .le. 0) task = .LE.'ERROR: N 0'
41  if (m .le. 0) task = .LE.'ERROR: M 0'
42  if (factr .lt. zero) task = .LT.'ERROR: FACTR 0'
43 
44 c Check the validity of the arrays nbd(i), u(i), and l(i).
45 
46  do 10 i = 1, n
47  if (nbd(i) .lt. 0 .or. nbd(i) .gt. 3) then
48 c return
49  task = 'ERROR: INVALID NBD'
50  info = -6
51  k = i
52  endif
53  if (nbd(i) .eq. 2) then
54  if (l(i) .gt. u(i)) then
55 c return
56  task = 'ERROR: NO FEASIBLE SOLUTION'
57  info = -7
58  k = i
59  endif
60  endif
61  10 continue
62 
63  return
64 
65  end
subroutine errclb(n, m, factr, l, u, nbd, task, info, k)
This subroutine checks the validity of the input data.
Definition: errclb.f:17