Download User's Guide for SQOPT Version 7: Software for Large

Transcript
1.
one
neA
Introduction
= 1.0d+0
= 0
! Counts the nonzeros in A
do j = 1, n
locA( j) = neA + 1
if (j .gt. 1) then
neA
= neA + 1
indA(neA) = j
- 1
Acol(neA) = -one
end if
if (j .lt. n) then
neA
= neA + 1
indA(neA) = j
Acol(neA) = one
end if
neA
= neA + 1
indA(neA) = m
Acol(neA) = one
end do
locA(n+1) =
7
! Points to the start of column j
neA + 1
As a matter of good programming practice, we recommend using the counter neA to
reference the elements of Acol and indA as they are generated. This allows the code
to be updated easily if new constraints or variables are added to the problem.
This example is included as examples/sqmain.f in the SQOPT distribution.