MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_QPSolverRelaxedLOQO.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 //
42 // Here we map from the QPSolverRelaxed QP formulation to the LOQO QP formulation.
43 //
44 // QPSolverRelaxed QP formulation:
45 // ------------------------------
46 //
47 // min g'*d + 1/2 * d'*G*d + (eta + 1/2*eta^2) * M
48 // s.t. dL <= d <= dU
49 // etaL <= eta
50 // eL <= op(E)*d - b*eta <= eU
51 // op(F)*d + (1-eta)*f = 0
52 //
53 // LOQO QP formulation:
54 // -------------------
55 //
56 // min c'*x + 1/2 * x'*Q*x
57 // s.t. b <= A*x <= b + r
58 // l <= x <= u
59 //
60 // Mapping =>
61 //
62 // LOQO QPSolverRelaxed
63 // ---- ---------------
64 // x [ d; eta ]
65 // c [ g; M ]
66 // Q [ G, 0; 0, M ]
67 // A [ op(E), -b; op(F), -f ]
68 // b [ eL; -f ]
69 // r [ eU-eL; 0 ]
70 // l [ dL, etaL ]
71 // u [ dU, +inf ]
72 //
73 // Above, in the LOQO formulation all singly bounded inequalities
74 // must be formulated as b(j) <= A(j,:)*x with r(j) = inf. This
75 // will require some fudging since eL(j) == -inf may be true in some
76 // cases. Here we will have to exchange eL(j) and eU(j) and use
77 // A(j,:) = -op(E)(j,:).
78 //
79 
80 #ifdef CONSTRAINED_OPTIMIZATION_PACK_USE_LOQO
81 
82 #include <assert.h>
83 
84 #include <vector>
85 
87 #include "ConstrainedOptPack/src/AbstractLinAlgPack_MatrixExtractInvCholFactor.hpp"
89 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_MatrixOp.hpp"
92 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_EtaVector.hpp"
95 #include "Midynamic_cast_verbose.h"
96 #include "MiWorkspacePack.h"
97 
98 extern "C" {
99 #include "loqo.h" // -I$(LOQODIR)
100 #include "myalloc.h" // -I$(LOQODIR)
101 } // end extern "C"
102 
103 namespace LinAlgOpPack {
107 }
108 
109 namespace ConstrainedOptPack {
110 
111 // ///////////////////////////////////////
112 // Members for QPSolverRelaxedLOQO::InitLOQOHessianJacobian
113 
114 void QPSolverRelaxedLOQO::InitLOQOHessianJacobian::init_hess_jacob(
115  const MatrixOp& G, const value_type bigM
116  , const MatrixOp* E, BLAS_Cpp::Transp trans_E, const DVectorSlice* b
117  , const int loqo_b_stat[], const size_type num_inequal
118  , const MatrixOp* F, BLAS_Cpp::Transp trans_F, const DVectorSlice* f
119  , void* _loqo_lp
120  ) const
121 {
122 
123  LOQO* loqo_lp = (LOQO*)_loqo_lp;
124 
125  const size_type
126  nd = G.rows(),
127  m_in = E ? b->size() : 0,
128  m_eq = F ? f->size() : 0;
129 
130  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->n == nd + 1 ) );
131  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->m == num_inequal + m_eq ) );
132 
133  // This default implementation assumes G, E and F are completely dense!
134 
135  //
136  // Setup Q
137  //
138 
139  loqo_lp->qnz = nd*nd + 1;
140  MALLOC( loqo_lp->Q, loqo_lp->qnz, double );
141  MALLOC( loqo_lp->iQ, loqo_lp->qnz, int );
142  MALLOC( loqo_lp->kQ, nd+2, int );
143  // Setup kQ[] and iQ[]
144  {for( size_type j = 1; j <= nd; ++j ) {
145  loqo_lp->kQ[j-1] = nd*(j-1);
146  for( size_type i = 1; i <= nd; ++i )
147  loqo_lp->iQ[ loqo_lp->kQ[j-1] + (i-1) ] = i-1; // zero based in LOQO
148  }}
149  loqo_lp->kQ[nd] = nd*nd;
150  loqo_lp->iQ[loqo_lp->kQ[nd]] = nd; // zero based in LOQO
151  loqo_lp->kQ[nd+1] = nd*nd + 1;
152  // Setup Q[]
153  {
154  DMatrixSlice Q( loqo_lp->Q, nd*nd, nd, nd, nd );
156  loqo_lp->Q[nd*nd] = bigM;
157  }
158 
159  //
160  // Setup A
161  //
162 
163  loqo_lp->nz = (num_inequal+m_eq) * (nd+1);
164  MALLOC( loqo_lp->A, loqo_lp->nz, double );
165  MALLOC( loqo_lp->iA, loqo_lp->nz, int );
166  MALLOC( loqo_lp->kA, nd+2, int );
167 
168  if( num_inequal == m_in ) {
169  // All the inequalities have finite bounds
170  // Setup kA[] and iA[]
171  {for( size_type j = 1; j <= nd+1; ++j ) {
172  loqo_lp->kA[j-1] = (m_in+m_eq)*(j-1);
173  for( size_type i = 1; i <= m_in+m_eq; ++i )
174  loqo_lp->iA[ loqo_lp->kA[j-1] + (i-1) ] = i-1; // zero based in LOQO
175  }}
176  loqo_lp->kA[nd+1] = (m_in+m_eq)*(nd+1);
177  // Setup A[]
178  DMatrixSlice A( loqo_lp->A, loqo_lp->nz, loqo_lp->m, loqo_lp->m, nd+1 );
179  if(E) {
180  LinAlgOpPack::assign( &A(1,m_in,1,nd), *E, trans_E ); // A(1:m_in,1:nd) = op(E)
181  LinAlgOpPack::V_StV( &A.col(nd+1)(1,m_in), -1.0, *b ); // A(1:m_in,nd+1) = -b
182  }
183  if(F) {
184  LinAlgOpPack::assign( &A(m_in+1,m_in+m_eq,1,nd), *F, trans_F ); // A(m_in+1:m_in+m_eq,1:nd) = op(F)
185  LinAlgOpPack::V_StV( &A.col(nd+1)(m_in+1,m_in+m_eq), -1.0, *f ); // A(m_in+1:m_in+m_eq,nd+1) = -f
186  }
187  }
188  else {
189  // At least one of the inequality constriants has
190  // both infinite upper and lower bounds.
191  TEUCHOS_TEST_FOR_EXCEPT(true); // ToDo: Finish this!
192  }
193 
194  // Loop through and adjust A for absent lower bound and using upper bound
195  if( num_inequal ) {
196  DMatrixSlice A( loqo_lp->A, loqo_lp->nz, loqo_lp->m, loqo_lp->m, nd+1 );
197  for(size_type k = 1; k <= num_inequal; ++k ) {
198  const int j = loqo_b_stat[k-1];
199  if( j < 0 )
200  DenseLinAlgPack::Vt_S( &A.row(j), -1.0 );
201  }
202  }
203 
204 }
205 
206 // ///////////////////////////////////////
207 // Members for QPSolverRelaxedLOQO
208 
209 QPSolverRelaxedLOQO::QPSolverRelaxedLOQO(
210  const init_hess_jacob_ptr_t init_hess_jacob
211  ,value_type bigM
212  ,value_type nonbinding_lag_mult
213  )
214  :init_hess_jacob_(init_hess_jacob)
215  ,bigM_(bigM)
216  ,nonbinding_lag_mult_(nonbinding_lag_mult)
217 {
218 // bigM_ = 1.0; // Just test this!
219  nonbinding_lag_mult_ = 1e-6;
220 }
221 
222 QPSolverRelaxedLOQO::~QPSolverRelaxedLOQO()
223 {
224  this->release_memory();
225 }
226 
227 // Overridden from QPSolverRelaxed
228 
229 QPSolverStats
230 QPSolverRelaxedLOQO::get_qp_stats() const
231 {
232  return qp_stats_;
233 }
234 
235 void QPSolverRelaxedLOQO::release_memory()
236 {
237  // Todo: resize to zero all the workspace!
238 }
239 
241 QPSolverRelaxedLOQO::imp_solve_qp(
242  std::ostream* out, EOutputLevel olevel, ERunTests test_what
243  , const DVectorSlice& g, const MatrixOp& G
244  , value_type etaL
245  , const SpVectorSlice& dL, const SpVectorSlice& dU
246  , const MatrixOp* E, BLAS_Cpp::Transp trans_E, const DVectorSlice* b
247  , const SpVectorSlice* eL, const SpVectorSlice* eU
248  , const MatrixOp* F, BLAS_Cpp::Transp trans_F, const DVectorSlice* f
249  , value_type* obj_d
250  , value_type* eta, DVectorSlice* d
251  , SpVector* nu
252  , SpVector* mu, DVectorSlice* Ed
253  , DVectorSlice* lambda, DVectorSlice* Fd
254  )
255 {
256  using Teuchos::Workspace;
257  Teuchos::WorkspaceStore* wss = wsp::default_workspace_store.get();
258 
260 // const value_type real_big = 1e+20;
261  const value_type real_big = HUGE_VAL;
262 
263  const size_type
264  nd = g.size(),
265  m_in = E ? b->size() : 0,
266  m_eq = F ? f->size() : 0;
267 
268  //
269  // Create a LOQO QP definition struct
270  //
271 
272  LOQO *loqo_lp = openlp();
273  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp ) );
274 
275  //
276  // Setup loqo_r and loqo_b and count the number of actual
277  // constraints.
278  //
279 
280  // LOQO's b vector storage
281  MALLOC( loqo_lp->b, m_in+m_eq, double ); // May not use all of this storage
282  DVectorSlice loqo_b( loqo_lp->b, m_in+m_eq );
283  // LOQO's r vector storage
284  MALLOC( loqo_lp->r, m_in+m_eq, double ); // May not use all of this storage
285  DVectorSlice loqo_r( loqo_lp->r, m_in+m_eq );
286  // Gives status of b.
287  // / j : if eL(j) > -inf_bnd
288  // loqo_b_stat(k) = |
289  // \ -j : if eL(j) <= -inf_bnd && eU(j) < +inf_bnd
290  //
291  // , for k = 1...num_inequal
292  //
293  Workspace<int> loqo_b_stat_ws(wss,m_in); // May not use all of this
294  DenseLinAlgPack::VectorSliceTmpl<int> loqo_b_stat(&loqo_b_stat_ws[0],loqo_b_stat_ws.size());
295  std::fill( loqo_b_stat.begin(), loqo_b_stat.end(), 0 ); // Initialize to zero
296 
297  // Fill up loqo_b, loqo_r and loqo_b_stat
298  size_type num_inequal = 0; // The actual number of bouned general inequalities
299  if(E) {
300  // Read iterators
302  eLU_itr( eL->begin(), eL->end(), eL->offset()
303  , eU->begin(), eU->end(), eU->offset(), inf_bnd );
304  // written iterators
305  DVectorSlice::iterator
306  b_itr = loqo_b.begin(),
307  r_itr = loqo_r.begin();
309  b_stat_itr = loqo_b_stat.begin();
310  // loop
311  for( int k = 1; !eLU_itr.at_end(); ++k, ++eLU_itr, ++b_itr, ++r_itr, ++b_stat_itr, ++num_inequal )
312  {
313  const size_type j = eLU_itr.indice();
314  if(eLU_itr.lbound() > -inf_bnd) {
315  *b_itr = eLU_itr.lbound();
316  *r_itr = eLU_itr.ubound() >= inf_bnd ? real_big : eLU_itr.ubound() - eLU_itr.lbound();
317  *b_stat_itr = j; // We need to make A(k,:) = [ +op(E)(j,:), -b(j) ]
318  }
319  else {
320  TEUCHOS_TEST_FOR_EXCEPT( !( eLU_itr.ubound() < +inf_bnd ) );
321  *b_itr = -eLU_itr.ubound();
322  *r_itr = eLU_itr.lbound() <= -inf_bnd ? real_big : - eLU_itr.lbound() + eLU_itr.ubound();
323  *b_stat_itr = -j; // We need to make A(k,:) = [ -op(E)(j,:), +b(j) ]
324  }
325  }
326  }
327  if(F) {
328  LinAlgOpPack::V_StV( &loqo_b(num_inequal+1,num_inequal+m_eq), -1.0, *f );
329  loqo_r(num_inequal+1,num_inequal+m_eq) = 0.0;
330  }
331 
332  //
333  // Setup the QP dimensions
334  //
335 
336  loqo_lp->n = nd+1;
337  loqo_lp->m = num_inequal + m_eq;
338 
339  //
340  // Setup loqo_c, loqo_l and loqo_u
341  //
342 
343  // LOQO's c vector storage
344  MALLOC( loqo_lp->c, nd+1, double );
345  DVectorSlice loqo_c( loqo_lp->c, nd+1 );
346  loqo_c(1,nd) = g;
347  loqo_c(nd+1) = bigM();
348 
349  // LOQO's l vector storage
350  MALLOC( loqo_lp->l, nd+1, double );
351  DVectorSlice loqo_l( loqo_lp->l, nd+1 );
352  std::fill( loqo_l.begin(), loqo_l.end(), -real_big );
353  {
354  SpVectorSlice::const_iterator
355  dL_itr = dL.begin(),
356  dL_end = dL.end();
357  for( ; dL_itr != dL_end; ++dL_itr )
358  loqo_l( dL_itr->indice() + dL.offset() ) = dL_itr->value();
359  }
360  loqo_l(nd+1) = etaL;
361 
362  // LOQO's u vector storage
363  MALLOC( loqo_lp->u, nd+1, double );
364  DVectorSlice loqo_u( loqo_lp->u, nd+1 );
365  std::fill( loqo_u.begin(), loqo_u.end(), +real_big );
366  {
367  SpVectorSlice::const_iterator
368  dU_itr = dU.begin(),
369  dU_end = dU.end();
370  for( ; dU_itr != dU_end; ++dU_itr )
371  loqo_u( dU_itr->indice() + dU.offset() ) = dU_itr->value();
372  }
373  loqo_u(nd+1) = +real_big;
374 
375  //
376  // Setup the objective and constraint matrices (using strategy interface).
377  //
378 
379  init_hess_jacob().init_hess_jacob(
380  G,bigM(),E,trans_E,b,&loqo_b_stat[0],num_inequal,F,trans_F,f
381  ,loqo_lp);
382 
383  //
384  // Setup the starting point
385  //
386 
387  MALLOC( loqo_lp->x, nd+1, double );
388  DVectorSlice loqo_x( loqo_lp->x, nd+1 );
389  loqo_x(1,nd) = *d;
390  loqo_x(nd+1) = *eta;
391 
392  //
393  // Set some control parameters
394  //
395 
396 // strcpy( loqo_lp->name, "loqo_qp" );
397  loqo_lp->quadratic = 1;
398  loqo_lp->convex = 1;
399  switch( olevel ) {
400  case PRINT_NONE:
401  loqo_lp->verbose = 0;
402  break;
403  case PRINT_BASIC_INFO:
404  loqo_lp->verbose = 1;
405  break;
406  case PRINT_ITER_SUMMARY:
407  loqo_lp->verbose = 2;
408  break;
409  case PRINT_ITER_STEPS:
410  loqo_lp->verbose = 3;
411  break;
412  case PRINT_ITER_ACT_SET:
413  loqo_lp->verbose = 4;
414  break;
415  case PRINT_ITER_VECTORS:
416  loqo_lp->verbose = 5;
417  break;
418  case PRINT_EVERY_THING:
419  loqo_lp->verbose = 6;
420  break;
421  default:
423  }
424 
425  //
426  // Solve the QP
427  //
428 
429  if( out && olevel >= PRINT_BASIC_INFO ) {
430  *out << "\nSolving QP using LOQO ...\n";
431  out->flush();
432  }
433 
434  const int loqo_status = solvelp(loqo_lp);
435 
436  if( out && olevel >= PRINT_BASIC_INFO ) {
437  *out << "\nLOQO returned status = " << loqo_status << "\n";
438  }
439 
440  //
441  // Map the solution to the output arguments
442  //
443 
444  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->x ) );
445  DVectorSlice loqo_x_sol( loqo_lp->x, nd+1 );
446 
447  // d
448  *d = loqo_x_sol(1,nd);
449 
450  // eta
451  *eta = loqo_x_sol(nd+1);
452 
453  // obj_d
454  if(obj_d)
455  *obj_d = loqo_lp->primal_obj - (*eta + 0.5 * (*eta)*(*eta)) * bigM();
456 
457  // nu
458  if(nu) {
459  nu->resize(nd,nd);
460  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->z ) );
461  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->s ) );
462  const DVectorSlice
463  loqo_z(loqo_lp->z,loqo_lp->n), // Multipliers for l - x <= 0
464  loqo_s(loqo_lp->s,loqo_lp->n); // Multipliers for x - u <= 0
465  DVectorSlice::const_iterator
466  z_itr = loqo_z.begin(),
467  s_itr = loqo_s.begin();
468  typedef SpVector::element_type ele_t;
469  for( size_type i = 1; i <= nd; ++i, ++z_itr, ++s_itr ) {
470  if( *z_itr > *s_itr && *z_itr >= nonbinding_lag_mult() ) {
471  // Lower bound is active
472  nu->add_element(ele_t(i,-(*z_itr)));
473  }
474  else if( *s_itr > *z_itr && *s_itr >= nonbinding_lag_mult() ) {
475  // Upper bound is active
476  nu->add_element(ele_t(i,+(*s_itr)));
477  }
478  }
479  // We could look at z(nd+1) and s(nd+1) for the value of kappa?
480  nu->assume_sorted(true);
481  }
482 
483  // mu
484  if(mu) {
485  mu->resize(m_in,num_inequal);
487  b_stat_itr = loqo_b_stat.begin();
488  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->v ) );
489  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->q ) );
490  const DVectorSlice
491  loqo_v(loqo_lp->v,loqo_lp->m), // Multipliers for b <= A*x
492  loqo_q(loqo_lp->q,loqo_lp->m); // Multipliers for A*x <= b + r
493  DVectorSlice::const_iterator
494  v_itr = loqo_v.begin(),
495  q_itr = loqo_q.begin();
496  // loop
497  typedef SpVector::element_type ele_t;
498  for( size_type k = 1; k <= num_inequal; ++k, ++b_stat_itr, ++v_itr, ++q_itr ) {
499  const int j = *b_stat_itr;
500  if( *v_itr > *q_itr && *v_itr >= nonbinding_lag_mult() ) {
501  // Lower bound is active
502  if( j < 0 ) // We had to flip this since it was really and upper bound
503  mu->add_element(ele_t(-j,+(*v_itr)));
504  else // This really was a lower bound
505  mu->add_element(ele_t(+j,-(*v_itr)));
506  }
507  else if( *q_itr > *v_itr && *q_itr >= nonbinding_lag_mult() ) {
508  // Upper bound is active
509  mu->add_element(ele_t(+j,+(*q_itr)));
510  }
511  }
512  }
513 
514  // Ed
515  if(Ed) {
516  LinAlgOpPack::V_MtV( Ed, *E, trans_E, *d );
517  }
518 
519  // lambda
520  if(lambda) {
521  TEUCHOS_TEST_FOR_EXCEPT( !( loqo_lp->y ) );
522  const DVectorSlice
523  loqo_y(loqo_lp->y,loqo_lp->m); // Multipliers for equalities
524  DVectorSlice::const_iterator
525  y_itr = loqo_y.begin() + num_inequal; // Get iterators to equalities
526  DVectorSlice::iterator
527  lambda_itr = lambda->begin();
528  // loop
529  for( size_type k = 1; k <= m_eq; ++k, ++y_itr, ++lambda_itr ) {
530  *lambda_itr = -(*y_itr);
531  }
532  }
533 
534  // Fd
535  if(Fd) {
536  LinAlgOpPack::V_MtV( Fd, *F, trans_F, *d );
537  }
538 
539  //
540  // Setup the QP statistics
541  //
542 
543  QPSolverStats::ESolutionType solution_type = QPSolverStats::OPTIMAL_SOLUTION; // Assume this?
544  switch( loqo_status ) { // I had to find this out by trial and error!
545  case 0:
546  solution_type = QPSolverStats::OPTIMAL_SOLUTION;
547  break;
548  case 2:
549  solution_type = QPSolverStats::DUAL_FEASIBLE_POINT;
550  break;
551  default:
553  }
554 
555  qp_stats_.set_stats(
556  solution_type, QPSolverStats::CONVEX
558  ,false, *eta > 0.0 );
559 
560  //
561  // Clean up dynamically allocated memory for LOQO
562  //
563 
564  inv_clo(); // frees memory associated with matrix factorization
565  closelp(loqo_lp); // frees all allocated arrays with free(...).
566 
567  return qp_stats_.solution_type();
568 
569 }
570 
571 } // end namespace ConstrainedOptPack
572 
573 #endif // CONSTRAINED_OPTIMIZATION_PACK_USE_LOQO
Iterate through a set of sparse bounds.
AbstractLinAlgPack::size_type size_type
SparseVector< SparseElement< index_type, value_type >, std::allocator< SparseElement< index_type, value_type > > > SpVector
void Vp_StV(VectorMutable *v_lhs, const value_type &alpha, const Vector &v_rhs)
v_lhs = alpha * v_rhs + v_lhs
void assign(VectorMutable *v_lhs, const V &V_rhs)
v_lhs = V_rhs.
const LAPACK_C_Decl::f_int LAPACK_C_Decl::f_dbl_prec * A
void V_StV(VectorMutable *v_lhs, value_type alpha, const V &V_rhs)
v_lhs = alpha * V_rhs.
C++ Standard Library compatable iterator class for accesing nonunit stride arrays of data...
Not transposed.
std::ostream * out
void Mp_StM(MatrixOp *mwo_lhs, value_type alpha, const MatrixOp &M_rhs, BLAS_Cpp::Transp trans_rhs)
void Vp_StMtV(VectorMutable *v_lhs, value_type alpha, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta=1.0)
v_lhs = alpha * op(M_rhs1) * v_rhs2 + beta * v_lhs (BLAS xGEMV)
SparseVectorSlice< SparseElement< index_type, value_type > > SpVectorSlice
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
void Vt_S(DVectorSlice *vs_lhs, value_type alpha)
vs_lhs *= alpha (BLAS xSCAL) (*** Note that alpha == 0.0 is handeled as vs_lhs = 0.0)
void V_MtV(VectorMutable *v_lhs, const MatrixOp &M_rhs1, BLAS_Cpp::Transp trans_rhs1, const V &V_rhs2)
v_lhs = op(M_rhs1) * V_rhs2.
AbstractLinAlgPack::value_type value_type
DenseLinAlgPack::DMatrixSlice DMatrixSlice
Transp
TRANS.
ESolutionType
Enumeration for the type of point returned from solve_qp(...).
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)