AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
AbstractLinAlgPack_VectorAuxiliaryOps.hpp
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // Redistribution and use in source and binary forms, with or without
00011 // modification, are permitted provided that the following conditions are
00012 // met:
00013 //
00014 // 1. Redistributions of source code must retain the above copyright
00015 // notice, this list of conditions and the following disclaimer.
00016 //
00017 // 2. Redistributions in binary form must reproduce the above copyright
00018 // notice, this list of conditions and the following disclaimer in the
00019 // documentation and/or other materials provided with the distribution.
00020 //
00021 // 3. Neither the name of the Corporation nor the names of the
00022 // contributors may be used to endorse or promote products derived from
00023 // this software without specific prior written permission.
00024 //
00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00036 //
00037 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00038 // 
00039 // ***********************************************************************
00040 // @HEADER
00041 
00042 #ifndef ABSTRACT_LINALG_PACK_VECTOR_AUXILIARY_OPS_H
00043 #define ABSTRACT_LINALG_PACK_VECTOR_AUXILIARY_OPS_H
00044 
00045 #include <utility>
00046 
00047 #include "AbstractLinAlgPack_VectorMutable.hpp"
00048 
00049 namespace AbstractLinAlgPack {
00050 
00054 
00057 
00066 value_type max_element( const Vector& v ); 
00067 
00083 std::pair<value_type,value_type>
00084 max_near_feas_step(
00085   const Vector& x, const Vector& d
00086   ,const Vector& xl, const Vector& xu
00087   ,value_type max_bnd_viol
00088   ); 
00089 
00097 value_type max_rel_step(
00098   const Vector& x, const Vector& d
00099   );
00100 
00102 
00106 value_type fraction_to_boundary(
00107   const value_type    tau,
00108   const Vector  &x,
00109   const Vector  &d,
00110   const Vector  &xl,
00111   const Vector  &xu
00112   );
00113 
00115 
00120 value_type fraction_to_zero_boundary(
00121   const value_type    tau,
00122   const Vector  &x,
00123   const Vector  &d
00124   );
00125 
00130 size_type num_bounded(
00131   const Vector& xl, const Vector& xu
00132   ,value_type inf_bound );
00133 
00141 value_type log_bound_barrier(
00142   const Vector    &x
00143   ,const Vector   &xl
00144   ,const Vector   &xu
00145   ); 
00146 
00155 value_type combined_nu_comp_err(
00156   const Vector    &v
00157   ,const Vector   &x
00158   ,const Vector   &xl
00159   ,const Vector   &xu
00160   ); 
00161 
00162 
00176 value_type combined_nu_comp_err_lower(
00177   const Vector    &v
00178   ,const Vector    &x
00179   ,const Vector   &xl
00180   );
00181 
00191 value_type combined_nu_comp_err_upper(
00192   const Vector    &v
00193   ,const Vector   &x
00194   ,const Vector   &xu
00195   );
00196 
00197 
00210 value_type IP_comp_err_with_mu(
00211   const value_type    mu
00212   ,const value_type   inf_bound
00213   ,const Vector &x
00214   ,const Vector &xl
00215   ,const Vector &xu
00216   ,const Vector &vl
00217   ,const Vector &vu
00218   );
00219 
00265 bool max_inequ_viol(
00266   const AbstractLinAlgPack::Vector   &v
00267   ,const AbstractLinAlgPack::Vector  &vL
00268   ,const AbstractLinAlgPack::Vector  &vU
00269   ,AbstractLinAlgPack::size_type     *max_viol_i
00270   ,AbstractLinAlgPack::value_type    *max_viol
00271   ,AbstractLinAlgPack::value_type    *v_i
00272   ,int                               *bnd_type
00273   ,AbstractLinAlgPack::value_type    *vLU_i
00274   ); 
00275 
00277 
00280 
00292 void force_in_bounds( const Vector& xl, const Vector& xu, VectorMutable* x );
00293 
00298 void force_in_bounds_buffer(
00299   const value_type     rel_push,
00300   const value_type     abs_push,
00301   const Vector   &xl, 
00302   const Vector   &xu, 
00303   VectorMutable  *x 
00304   );
00305 
00313 void inv_of_difference(
00314   const value_type       alpha
00315   ,const Vector    &v0
00316   ,const Vector    &v1
00317   ,VectorMutable   *z
00318   );
00319 
00327 void correct_lower_bound_multipliers(
00328   const Vector      &xl
00329   ,const value_type       inf_bound_limit
00330   ,VectorMutable    *vl
00331   );
00332 
00340 void correct_upper_bound_multipliers(
00341   const Vector       &xu
00342   ,const value_type        inf_bound_limit
00343   ,VectorMutable     *vu
00344   );
00345 
00352 void lowerbound_multipliers_step(
00353   const value_type         mu,
00354   const Vector       &invXl,
00355   const Vector       &vl,
00356   const Vector       &d_k,
00357   VectorMutable      *dvl
00358   );
00359 
00367 void upperbound_multipliers_step(
00368   const value_type       mu,
00369   const Vector     &invXu,
00370   const Vector     &vu,
00371   const Vector     &d_k,
00372   VectorMutable    *dvu
00373   );
00374 
00375 
00384 void ele_wise_sqrt(
00385   VectorMutable* z
00386     );    
00387 
00395 void max_vec_scalar(
00396   value_type              min_ele
00397   ,VectorMutable    *y
00398   );
00399 
00407 void max_abs_vec_scalar(
00408   value_type              min_ele
00409   ,VectorMutable    *y
00410   );
00411 
00413 
00415 
00416 } // end namespace AbstractLinAlgPack
00417 
00418 #endif // ABSTRACT_LINALG_PACK_VECTOR_AUXILIARY_OPS_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends