Tpetra Matrix/Vector Services Version of the Day
TpetraExt_MatrixMatrix_decl.hpp
00001 //@HEADER
00002 // ************************************************************************
00003 // 
00004 //               Tpetra: Templated Linear Algebra Services Package 
00005 //                 Copyright (2008) 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 TPETRA_MATRIXMATRIX_DECL_HPP
00030 #define TPETRA_MATRIXMATRIX_DECL_HPP
00031 
00032 #include <Teuchos_RCP.hpp>
00033 #include <Teuchos_Array.hpp>
00034 #include "Tpetra_ConfigDefs.hpp"
00035 #include "Tpetra_CrsMatrix.hpp"
00036 #include "TpetraExt_MMHelpers.hpp"
00037 
00043 namespace Tpetra {
00044 
00045 namespace MatrixMatrix {
00046 
00071 template <class Scalar, 
00072            class LocalOrdinal,
00073            class GlobalOrdinal,
00074            class Node,
00075            class SpMatOps >
00076 void Multiply(
00077   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00078   bool transposeA,
00079   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00080   bool transposeB,
00081   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& C,
00082   bool call_FillComplete_on_result=true);
00083 
00097 template <class Scalar, 
00098           class LocalOrdinal,
00099           class GlobalOrdinal,
00100           class Node,
00101           class SpMatOps >
00102 void Add(
00103   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00104   bool transposeA,
00105   Scalar scalarA,
00106   CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00107   Scalar scalarB );
00108 
00124 template <class Scalar, 
00125           class LocalOrdinal,
00126           class GlobalOrdinal,
00127           class Node,
00128           class SpMatOps>
00129 void Add(
00130   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& A,
00131   bool transposeA,
00132   Scalar scalarA,
00133   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& B,
00134   bool transposeB,
00135   Scalar scalarB,
00136   RCP<CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps> > C);
00137 } //End Namespace MatrixMatrxix
00138 
00139 namespace MMdetails{
00140 
00141 template<class Scalar, 
00142          class LocalOrdinal, 
00143          class GlobalOrdinal, 
00144          class Node, 
00145          class SpMatOps>
00146 void mult_A_B(
00147   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Aview, 
00148   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Bview, 
00149   CrsWrapper<Scalar, LocalOrdinal, GlobalOrdinal, Node>& C,
00150   bool onlyCalculateStructure=false);
00151 
00152 template<class Scalar,
00153          class LocalOrdinal, 
00154          class GlobalOrdinal, 
00155          class Node,
00156          class SpMatOps>
00157 void import_and_extract_views(
00158   const CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& M,
00159   RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > targetMap,
00160   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Mview);
00161 
00162 template<class Scalar,
00163          class LocalOrdinal, 
00164          class GlobalOrdinal, 
00165          class Node,
00166          class SpMatOps>
00167 void setMaxNumEntriesPerRow(
00168   CrsMatrixStruct<Scalar, LocalOrdinal, GlobalOrdinal, Node, SpMatOps>& Mview);
00169   
00170 }//end namespace MMdetails
00171 
00172 } // end of Tpetra namespace
00173 
00174 #endif // TPETRA_MATRIXMATRIX_DECL_HPP
00175 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines