Thyra_MultiVectorStdOpsDecl.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 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
00030 #define THYRA_MULTI_VECTOR_STD_OPS_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "RTOpPack_ROpNorm1.hpp"
00034 #include "RTOpPack_ROpNorm2.hpp"
00035 #include "RTOpPack_ROpNormInf.hpp"
00036 
00037 namespace Thyra {
00038 
00039 
00055 
00063 template<class Scalar>
00064 void norms( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] );
00065 
00076 template<class Scalar, class NormOp>
00077 void reductions( const MultiVectorBase<Scalar>& V, const NormOp &op, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] );
00078 
00088 template<class Scalar>
00089 void norms_1( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] );
00090 
00100 template<class Scalar>
00101 void norms_2( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] );
00102 
00112 template<class Scalar>
00113 void norms_inf( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] );
00114 
00116 template<class Scalar>
00117 Array<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>
00118 norms_inf( const MultiVectorBase<Scalar>& V );
00119 
00128 template<class Scalar>
00129 void dots( const MultiVectorBase<Scalar>& V1, const MultiVectorBase<Scalar>& V2, Scalar dots[] );
00130 
00138 template<class Scalar>
00139 void sums( const MultiVectorBase<Scalar>& V, Scalar sums[] );
00140 
00147 template<class Scalar>
00148 typename Teuchos::ScalarTraits<Scalar>::magnitudeType norm_1( const MultiVectorBase<Scalar>& V );
00149 
00155 template<class Scalar>
00156 void scale( Scalar alpha, MultiVectorBase<Scalar>* V );
00157 
00160 template<class Scalar>
00161 void scaleUpdate( const VectorBase<Scalar>& a, const MultiVectorBase<Scalar>& U, MultiVectorBase<Scalar>* V );
00162 
00165 template<class Scalar>
00166 void assign( MultiVectorBase<Scalar>* V, Scalar alpha );
00167 
00170 template<class Scalar>
00171 void assign( MultiVectorBase<Scalar>* V, const MultiVectorBase<Scalar>& U );
00172 
00175 template<class Scalar>
00176 void update( Scalar alpha, const MultiVectorBase<Scalar>& U, MultiVectorBase<Scalar>* V );
00177 
00180 template<class Scalar>
00181 void update( Scalar alpha[], Scalar beta, const MultiVectorBase<Scalar>& U, MultiVectorBase<Scalar>* V );
00182 
00185 template<class Scalar>
00186 void update( const MultiVectorBase<Scalar>& U, Scalar alpha[], Scalar beta, MultiVectorBase<Scalar>* V );
00187 
00208 template<class Scalar>
00209 void linear_combination(
00210   const int                         m
00211   ,const Scalar                     alpha[]
00212   ,const MultiVectorBase<Scalar>*   X[]
00213   ,const Scalar                     &beta
00214   ,MultiVectorBase<Scalar>          *Y
00215   );
00216 
00225 template<class Scalar>
00226 void randomize( Scalar l, Scalar u, MultiVectorBase<Scalar>* V );
00227 
00229 
00242 
00245 template<class Scalar>
00246 void Vt_S( MultiVectorBase<Scalar>* Z, const Scalar& alpha );
00247 
00250 template<class Scalar>
00251 void Vp_S( MultiVectorBase<Scalar>* Z, const Scalar& alpha );
00252 
00255 template<class Scalar>
00256 void Vp_V( MultiVectorBase<Scalar>* Z, const MultiVectorBase<Scalar>& X );
00257 
00260 template<class Scalar>
00261 void V_VpV( MultiVectorBase<Scalar>* Z, const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y );
00262 
00266 template<class Scalar>
00267 void V_VmV( MultiVectorBase<Scalar>* Z, const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y );
00268 
00272 template<class Scalar>
00273 void V_StVpV(
00274   MultiVectorBase<Scalar>* Z, const Scalar &alpha,
00275   const MultiVectorBase<Scalar>& X, const MultiVectorBase<Scalar>& Y 
00276   );
00277 
00279 
00280 } // end namespace Thyra
00281 
00282 // /////////////////////////////////////
00283 // Inline functions
00284 
00285 template<class Scalar>
00286 inline
00287 void Thyra::norms_1( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] )
00288 {
00289   reductions(V,RTOpPack::ROpNorm1<Scalar>(),norms);
00290 }
00291 
00292 template<class Scalar>
00293 inline
00294 void Thyra::norms_2( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] )
00295 {
00296   reductions(V,RTOpPack::ROpNorm2<Scalar>(),norms);
00297 }
00298 
00299 template<class Scalar>
00300 inline
00301 void Thyra::norms_inf( const MultiVectorBase<Scalar>& V, typename Teuchos::ScalarTraits<Scalar>::magnitudeType norms[] )
00302 {
00303   reductions(V,RTOpPack::ROpNormInf<Scalar>(),norms);
00304 }
00305 
00306 template<class Scalar>
00307 Teuchos::Array<typename Teuchos::ScalarTraits<Scalar>::magnitudeType>
00308 Thyra::norms_inf( const MultiVectorBase<Scalar>& V )
00309 {
00310   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00311   Array<ScalarMag> norms(V.domain()->dim());
00312   Thyra::norms_inf(V,&norms[0]);
00313   return norms;
00314 }
00315 
00316 #endif // THYRA_MULTI_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