43 #include "Moocho_ConfigDefs.hpp"
46 #ifdef CONSTRAINED_OPTIMIZATION_PACK_USE_QPKWIK
49 #include "ConstrainedOptPack_QPKWIK_Output.hpp"
52 namespace QPKWIK_Output {
53 std::ostream* out = 0;
55 set_output::set_output(std::ostream* _out)
68 void output(
const char name[],
const T& val) {
69 *QPKWIK_Output::out << name <<
" = " << val <<
"\n";
75 void output(
const char name[],
const int n,
const T array[]) {
76 *QPKWIK_Output::out << name <<
" =\n";
77 for(
const T* itr = array; itr != array + n; )
78 *QPKWIK_Output::out <<
"\t" << *itr++;
79 *QPKWIK_Output::out <<
"\n";
85 void output(
const char name[],
const int m,
const int n,
const T matrix[]) {
86 *QPKWIK_Output::out << name <<
" =\n";
87 for(
int i = 0; i < m; ++i) {
88 for(
int j = 0; j < n; ++j) {
89 *QPKWIK_Output::out <<
"\t" << matrix[ i + j * m ];
91 *QPKWIK_Output::out <<
"\n";
97 namespace QPKWIK_Print_Decl {
99 using FortranTypes::f_int;
100 using FortranTypes::f_dbl_prec;
107 FORTRAN_FUNC_DECL_UL_(
void,QPKWIK_PRINT_INPUT,qpkwik_print_input) (
const f_int& N,
const f_int& M1
108 ,
const f_int& M2,
const f_int& M3,
const f_int& M1D,
const f_int& M2D
109 ,
const f_int& M3D,
const f_dbl_prec GRAD[],
const f_dbl_prec Z[]
110 ,
const f_int& LDZ,
const f_int IBND[]
111 ,
const f_dbl_prec BL[],
const f_dbl_prec BU[],
const f_dbl_prec A[],
const f_int& LDA
112 ,
const f_dbl_prec YPY[],
const f_int& INF,
const f_dbl_prec& SMALL
113 ,
const f_dbl_prec& VSMALL,
const f_dbl_prec& VLARGE,
const f_int& N1
114 ,
const f_int& M12,
const f_int& M23,
const f_int& M123 )
116 using QPKWIK_Output::out;
119 *out <<
"\n*** Printing QPKWIK input\n";
127 output(
"GRAD",N,GRAD);
128 output(
"Z",LDZ,N1,Z);
129 output(
"IBND",M1D,IBND);
135 output(
"SMALL",SMALL);
136 output(
"VSMALL",VSMALL);
137 output(
"VLARGE",VLARGE);
145 FORTRAN_FUNC_DECL_UL_(
void,QPKWIK_PRINT_SPARSITY,qpkwik_print_sparsity) (
const f_int& N,
const f_int& M2D
146 ,
const f_int& ISPARSE,
const f_int ISTART[],
const f_int IPOINT[] )
148 using QPKWIK_Output::out;
151 *out <<
"\n*** Printing QPKWIK sparsity data\n";
153 output(
"ISTART",M2D+1,ISTART);
154 output(
"IPOINT",M2D*N,IPOINT);
158 FORTRAN_FUNC_DECL_UL_(
void,QPKWIK_PRINT_ITERATION_INFO,qpkwik_print_iteration_info) (
159 const f_int& CALLING_LABLE,
const f_int& N,
const f_int& M1
160 ,
const f_int& M2,
const f_int& M3,
const f_int& M1D,
const f_int& M2D
161 ,
const f_int& M3D,
const f_dbl_prec X[]
162 ,
const f_int& NACT,
const f_int IACT[],
const f_dbl_prec UR[]
163 ,
const f_int IACTSTORE[],
const f_dbl_prec Z[],
const f_int& LDZ,
const f_dbl_prec AINV[]
164 ,
const f_dbl_prec T1[],
const f_dbl_prec T2[],
const f_dbl_prec R[]
165 ,
const f_dbl_prec XX[],
const f_int& IYPY,
const f_dbl_prec& EXTRA
166 ,
const f_int& WARM,
const f_int& NACTSTORE,
const f_dbl_prec& SUMY
167 ,
const f_int& ICHECK,
const f_int& I,
const f_int& J,
const f_int& II
168 ,
const f_dbl_prec& SUM,
const f_int& KDROP,
const f_int& IFLAG
169 ,
const f_int& KSTART,
const f_dbl_prec& SUMNORM,
const f_dbl_prec& CVMAX
170 ,
const f_dbl_prec& RES,
const f_int& KNEXT,
const f_int& IFINISH
171 ,
const f_int& IBEGIN,
const f_dbl_prec& TEMP,
const f_int& INDEX
172 ,
const f_dbl_prec& PARNEW,
const f_int& LFLAG,
const f_dbl_prec& SUMA
173 ,
const f_dbl_prec& SUMB,
const f_dbl_prec& SUMC,
const f_dbl_prec& TEMPA
174 ,
const f_dbl_prec& TEMPB,
const f_int& IKNEXT,
const f_int& JJ,
const f_int& JN
175 ,
const f_dbl_prec& PARINC,
const f_dbl_prec& STEP
176 ,
const f_dbl_prec& RATIO,
const f_int& ICOUNT,
const f_dbl_prec& XMIN
177 ,
const f_dbl_prec& BOTTOM,
const f_int& IWARM,
const f_int& ITEMP
178 ,
const f_int& ITEMPP )
180 using QPKWIK_Output::out;
183 *out <<
"\n*** QPKWIK Iteration info, CALLING_LABLE = " << CALLING_LABLE <<
"\n";
186 output(
"IACT",NACT,IACT);
187 output(
"UR",NACT,UR);
188 output(
"IACTSTORE",NACTSTORE,IACTSTORE);
189 output(
"Z",LDZ,N+1,Z);
190 output(
"AINV",M3D+1,AINV);
193 output(
"R",(3*(N+1)+(N+1)*(N+1))/2,R);
196 output(
"EXTRA",EXTRA);
198 output(
"NACTSTORE",NACTSTORE);
200 output(
"ICHECK",ICHECK);
205 output(
"KDROP",KDROP);
206 output(
"IFLAG",IFLAG);
207 output(
"KSTART",KSTART);
208 output(
"SUMNORM",SUMNORM);
209 output(
"CVMAX",CVMAX);
211 output(
"KNEXT",KNEXT);
212 output(
"IFINISH",IFINISH);
213 output(
"IBEGIN",IBEGIN);
215 output(
"INDEX",INDEX);
216 output(
"PARNEW",PARNEW);
217 output(
"LFLAG",LFLAG);
221 output(
"TEMPA",TEMPA);
222 output(
"TEMPB",TEMPB);
223 output(
"IKNEXT",IKNEXT);
226 output(
"PARINC",PARINC);
228 output(
"RATIO",RATIO);
229 output(
"ICOUNT",ICOUNT);
231 output(
"BOTTOM",BOTTOM);
232 output(
"IWARM",IWARM);
233 output(
"ITEMP",ITEMP);
234 output(
"ITEMPP",ITEMPP);
244 #endif // CONSTRAINED_OPTIMIZATION_PACK_USE_QPKWIK