Thyra_VectorStdOpsDecl.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) 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 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details//  
00019 // You should have received a copy of the GNU Lesser General Public
00020 // License along with this library; if not, write to the Free Software
00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00022 // USA
00023 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00024 // 
00025 // ***********************************************************************
00026 // @HEADER
00027 
00028 #ifndef THYRA_VECTOR_STD_OPS_DECL_HPP
00029 #define THYRA_VECTOR_STD_OPS_DECL_HPP
00030 
00031 #include "Thyra_OperatorVectorTypes.hpp"
00032 
00033 namespace Thyra {
00034 
00050 
00053 template<class Scalar>
00054 Scalar sum( const VectorBase<Scalar>& v );
00055 
00060 template<class Scalar>
00061 Scalar scalarProd( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y );
00062 
00067 template<class Scalar>
00068 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00069 norm( const VectorBase<Scalar>& v );
00070 
00073 template<class Scalar>
00074 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00075 norm_1( const VectorBase<Scalar>& v );
00076 
00079 template<class Scalar>
00080 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00081 norm_2( const VectorBase<Scalar>& v );
00082 
00085 template<class Scalar>
00086 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00087 norm_2( const VectorBase<Scalar> &w, const VectorBase<Scalar>& v );
00088 
00091 template<class Scalar>
00092 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00093 norm_inf( const VectorBase<Scalar>& v_rhs );
00094 
00097 template<class Scalar>
00098 Scalar dot( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y );
00099 
00102 template<class Scalar>
00103 Scalar get_ele( const VectorBase<Scalar>& v, Index i );
00104 
00107 template<class Scalar>
00108 void set_ele( Index i, Scalar alpha, VectorBase<Scalar>* v );
00109 
00112 template<class Scalar>
00113 void put_scalar( const Scalar& alpha, VectorBase<Scalar>* y );
00114 
00117 template<class Scalar>
00118 void copy( const VectorBase<Scalar>& x, VectorBase<Scalar>* y );
00119 
00122 template<class Scalar>
00123 void add_scalar( const Scalar& alpha, VectorBase<Scalar>* y );
00124 
00131 template<class Scalar>
00132 void scale( const Scalar& alpha, VectorBase<Scalar>* y );
00133 
00136 template<class Scalar>
00137 void abs( VectorBase<Scalar>* y, const VectorBase<Scalar>& x );
00138 
00141 template<class Scalar>
00142 void reciprocal( VectorBase<Scalar>* y, const VectorBase<Scalar>& x );
00143 
00146 template<class Scalar>
00147 void ele_wise_prod( const Scalar& alpha, const VectorBase<Scalar>& x, const VectorBase<Scalar>& v, VectorBase<Scalar>* y );
00148 
00151 template<class Scalar>
00152 void Vp_StVtV( VectorBase<Scalar>* y, const Scalar& alpha, const VectorBase<Scalar>& x, const VectorBase<Scalar>& v);
00153 
00156 template<class Scalar>
00157 void ele_wise_prod_update( const Scalar& alpha, const VectorBase<Scalar>& x, VectorBase<Scalar>* y );
00158 
00161 template<class Scalar>
00162 void Vt_StV( VectorBase<Scalar>* y, const Scalar& alpha, const VectorBase<Scalar> &x );
00163 
00166 template<class Scalar>
00167 void ele_wise_divide( const Scalar& alpha, const VectorBase<Scalar>& x, const VectorBase<Scalar>& v, VectorBase<Scalar>* y );
00168 
00182 template<class Scalar>
00183 void linear_combination(
00184   const int                    m
00185   ,const Scalar                alpha[]
00186   ,const VectorBase<Scalar>*   x[]
00187   ,const Scalar                &beta
00188   ,VectorBase<Scalar>          *y
00189   );
00190 
00197 template<class Scalar>
00198 void seed_randomize( unsigned int s );
00199 
00207 template<class Scalar>
00208 void randomize( Scalar l, Scalar u, VectorBase<Scalar>* v );
00209 
00211 
00224 
00227 template<class Scalar>
00228 void assign( VectorBase<Scalar>* y, const Scalar& alpha );
00229 
00232 template<class Scalar>
00233 void assign( VectorBase<Scalar>* y, const VectorBase<Scalar>& x );
00234 
00237 template<class Scalar>
00238 void Vp_S( VectorBase<Scalar>* y, const Scalar& alpha );
00239 
00246 template<class Scalar>
00247 void Vt_S( VectorBase<Scalar>* y, const Scalar& alpha );
00248 
00251 template<class Scalar>
00252 void V_StV( VectorBase<Scalar>* y, const Scalar& alpha, const VectorBase<Scalar> &x );
00253 
00256 template<class Scalar>
00257 void Vp_StV( VectorBase<Scalar>* y, const Scalar& alpha, const VectorBase<Scalar>& x );
00258 
00261 template<class Scalar>
00262 void Vp_V( VectorBase<Scalar>* y, const VectorBase<Scalar>& x, const Scalar& beta
00263 #ifndef SUN_CXX
00264    = Teuchos::ScalarTraits<Scalar>::one()
00265 #endif
00266   );
00267 
00268 #ifdef SUN_CXX
00269 
00270 template<class Scalar>
00271 inline
00272 void Vp_V( VectorBase<Scalar>* y, const VectorBase<Scalar>& x )
00273 {
00274   Vp_V(y,x,Teuchos::ScalarTraits<Scalar>::one());
00275 }
00276 
00277 #endif
00278 
00281 template<class Scalar>
00282 void V_V( VectorBase<Scalar>* y, const VectorBase<Scalar>& x );
00283 
00286 template<class Scalar>
00287 void V_S( VectorBase<Scalar>* y, const Scalar& alpha );
00288 
00291 template<class Scalar>
00292 void V_VpV( VectorBase<Scalar>* z, const VectorBase<Scalar>& x, const VectorBase<Scalar>& y );
00293 
00296 template<class Scalar>
00297 void V_VmV( VectorBase<Scalar>* z, const VectorBase<Scalar>& x, const VectorBase<Scalar>& y );
00298 
00301 template<class Scalar>
00302 void V_StVpV( VectorBase<Scalar>* z, const Scalar &alpha, const VectorBase<Scalar>& x, const VectorBase<Scalar>& y );
00303 
00306 template<class Scalar>
00307 void V_StVpStV( VectorBase<Scalar>* z, const Scalar &alpha, const VectorBase<Scalar>& x, const Scalar &beta, const VectorBase<Scalar>& y );
00308 
00310 
00319 
00322 template<class Scalar>
00323 Scalar min( const VectorBase<Scalar>& x );
00324 
00342 template<class Scalar>
00343 void min( const VectorBase<Scalar>& x, Scalar *maxEle, Index *maxIndex );
00344 
00370 template<class Scalar>
00371 void minGreaterThanBound( const VectorBase<Scalar>& x, const Scalar &bound, Scalar *minEle, Index *minIndex );
00372 
00375 template<class Scalar>
00376 Scalar max( const VectorBase<Scalar>& x );
00377 
00395 template<class Scalar>
00396 void max( const VectorBase<Scalar>& x, Scalar *maxEle, Index *maxIndex );
00397 
00422 template<class Scalar>
00423 void maxLessThanBound( const VectorBase<Scalar>& x, const Scalar &bound, Scalar *maxEle, Index *maxIndex );
00424 
00426 
00427 } // end namespace Thyra
00428 
00429 // /////////////////////////
00430 // Inline functions
00431 
00432 template<class Scalar>
00433 inline
00434 Scalar Thyra::scalarProd( const VectorBase<Scalar>& x, const VectorBase<Scalar>& y )
00435 {
00436   return x.space()->scalarProd(x,y);
00437 }
00438 
00439 template<class Scalar>
00440 inline
00441 typename Teuchos::ScalarTraits<Scalar>::magnitudeType
00442 Thyra::norm( const VectorBase<Scalar>& v )
00443 {
00444   typedef Teuchos::ScalarTraits<Scalar> ST;
00445   return ST::magnitude(ST::squareroot(v.space()->scalarProd(v,v)));
00446 }
00447 
00448 
00449 #endif // THYRA_VECTOR_STD_OPS_DECL_HPP

Generated on Tue Oct 20 12:47:27 2009 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.4.7