/usr/include/trilinos/ConstrainedOptPack_QPInitFixedFreeStd.hpp is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | // @HEADER
// ***********************************************************************
//
// Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
// Copyright (2003) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
// Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
//
// ***********************************************************************
// @HEADER
#ifndef QP_INIT_FIXED_FREE_STD_H
#define QP_INIT_FIXED_FREE_STD_H
#include "ConstrainedOptPack_QPSchur.hpp"
namespace ConstrainedOptPack {
namespace QPSchurPack {
/** \brief General (and flexible) implementation class for a QPSchur QP
* problem.
*
* The basic idea of this class is to just build the QP from its
* various components in a way that is easy and flexible for the
* client. The class will also do consistency testing if asked
* to.
*/
class QPInitFixedFreeStd : public QP {
public:
/// Construct uninitialized
QPInitFixedFreeStd();
/** \brief Initialize.
*
* The pointers and references to the objects pointed to by the
* arguments to this function must not be modified by the caller.
* Copies of these objects are not made internally so these
* objects must remain valid while this object is in use.
*
* If the sizes of the arguments do not match up or some consistency
* test fails then exceptions may be thrown with (hopefully) helpful
* messages.
*
* @param g [in] vector (size <tt>n</tt>): objective gradient
* @param G [in] matrix (size <tt>n x n</tt>): objective Hessian
* @param A [in] matrix (size <tt>n x m</tt>): full rank equality constraints
* in <tt>Ko</tt>. If <tt>A==NULL</tt> then there are no equality constraints
* in <tt>Ko</tt> and m will be zero.
* @param n_R [in] number of initially free variables
* @param i_x_free
* [in] array (size <tt>n_R</tt>): <tt>i_x_free[l-1], l = 1...n_R</tt> defines
* the matrix <tt>Q_R</tt> as:<br>
* <tt>Q_R(:,l) = e(i_x_free[l-1]), l = 1...n_R</tt><br>
* The ordering of these indices is significant. It is allowed
* for <tt>i_x_free == NULL</tt> in which case it will be
* considered to be identity.
* @param i_x_fixed
* [in] array (size <tt>n_X = n - n_R</tt>):
* <tt>i_x_fixed[l-1], l = 1...n_X</tt> defines the matrix <tt>Q_X</tt> as:<br>
* <tt>Q_X(:,l) = e(i_x_fixed[l-1]), l = 1...n_X</tt><br>
* The ordering of these indices is significant.
* @param bnd_fixed
* [in] array (size <tt>n_X = n - n_R</tt>):
* <tt>bnd_fixed[l-1], l = 1...n_X</tt> defines the initial active set as:<br>
\begin{verbatim}
/ LOWER : b_X(l) = xL(i_x_fixed[l-1])
bnd_fixed[l-1] = | UPPER : b_X(l) = xU(i_x_fixed[l-1])
\ EQUALITY : b_X(l) = xL(i) = xU(i) (i = i_x_fixed[l-1])
\end{verbatim}
* @param b_X [in] vector (size <tt>n_X = n - n_R</tt>):
* Initial varaible bounds (see <tt>bnd_fixed</tt>)
* @param Ko [in] matrix (size <tt>(n_R+m) x (n_R+m)</tt>): Initial KKT matrix
* @param fo [in] vector (size <tt>n_R + m</tt>): Initial KKT system rhs vector
* @param constraints
* [in] Constraints object for the extra constraints
* <tt>cL_bar <= A_bar'*x <= cU_bar</tt>
* @param out [out] If <tt>out!=NULL</tt>, then any warning or error messages will
* be printed here.
* @param test_setup
* [in] If set to true, then consistency checks will be
* made on all the input arguments. The cost of the
* tests will not be too excessive in runtime or
* storge costs and do not completly validate everything
* @param waring_tol
* [in] Warning tolerance for tests.
* @param error_tol
* [in] Error tolerance for tests. If the relative error
* of any test exceeds this limit, then an error
* message will be printed to out (if <tt>out!=NULL</tt>) and then
* a runtime exception will be thrown.
* @param print_all_warnings
* [in] If set to <tt>true</tt>, then any relative errors for tests
* that are above <tt>warning_tol</tt> will be printed to
* <tt>out</tt> (if <tt>out!= NULL</tt>) (O(<tt>n</tt>) output).
* Otherwise, if <tt>false</tt>, then
* only the number of violations and the maximum
* violation will be printed (O(1) output).
*/
void initialize(
const DVectorSlice &g
,const MatrixSymOp &G
,const MatrixOp *A
,size_type n_R
,const size_type i_x_free[]
,const size_type i_x_fixed[]
,const EBounds bnd_fixed[]
,const DVectorSlice &b_X
,const MatrixSymOpNonsing &Ko
,const DVectorSlice &fo
,Constraints *constraints
,std::ostream *out = NULL
,bool test_setup = false
,value_type warning_tol = 1e-10
,value_type error_tol = 1e-5
,bool print_all_warnings = false
);
/** @name Overridden from QP */
//@{
/** \brief . */
size_type n() const;
/** \brief . */
size_type m() const;
/** \brief . */
const DVectorSlice g() const;
/** \brief . */
const MatrixSymOp& G() const;
/** \brief . */
const MatrixOp& A() const;
/** \brief . */
size_type n_R() const;
/** \brief . */
const x_init_t& x_init() const;
/** \brief . */
const l_x_X_map_t& l_x_X_map() const;
/** \brief . */
const i_x_X_map_t& i_x_X_map() const;
/** \brief . */
const DVectorSlice b_X() const;
/** \brief . */
const GenPermMatrixSlice& Q_R() const;
/** \brief . */
const GenPermMatrixSlice& Q_X() const;
/** \brief . */
const MatrixSymOpNonsing& Ko() const;
/** \brief . */
const DVectorSlice fo() const;
/** \brief . */
Constraints& constraints();
/** \brief . */
const Constraints& constraints() const;
//@}
private:
// ///////////////////////////////////
// Private types
typedef std::vector<size_type> row_i_t;
typedef std::vector<size_type> col_j_t;
// ///////////////////////////////////
// Private data members
size_type n_;
size_type n_R_;
size_type m_;
DVectorSlice g_; // will not be modified!
const MatrixSymOp *G_;
const MatrixOp *A_; // If NULL not no equalities in Ko
x_init_t x_init_;
l_x_X_map_t l_x_X_map_;
i_x_X_map_t i_x_X_map_;
DVectorSlice b_X_; // will not be modified!
GenPermMatrixSlice Q_R_;
row_i_t Q_R_row_i_;
col_j_t Q_R_col_j_;
GenPermMatrixSlice Q_X_;
row_i_t Q_X_row_i_;
col_j_t Q_X_col_j_;
const MatrixSymOpNonsing
*Ko_;
DVectorSlice fo_; // will not be modified
Constraints *constraints_;
// Private member function
void assert_initialized() const;
}; // end class QPInitFixedFreeStd
} // end namespace QPSchurPack
} // end namespace ConstrainedOptPack
#endif // QP_INIT_FIXED_FREE_STD_H
|