00001 // $Id: Sacado_PCE_Workspace.hpp,v 1.1 2007/11/14 00:18:19 etphipp Exp $ 00002 // $Source: /space/CVS/Trilinos/packages/sacado/src/pce/Sacado_PCE_Workspace.hpp,v $ 00003 // @HEADER 00004 // *********************************************************************** 00005 // 00006 // Sacado Package 00007 // Copyright (2006) Sandia Corporation 00008 // 00009 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00010 // license for use of this work by or on behalf of the U.S. Government. 00011 // 00012 // This library is free software; you can redistribute it and/or modify 00013 // it under the terms of the GNU Lesser General Public License as 00014 // published by the Free Software Foundation; either version 2.1 of the 00015 // License, or (at your option) any later version. 00016 // 00017 // This library is distributed in the hope that it will be useful, but 00018 // WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 // Lesser General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU Lesser General Public 00023 // License along with this library; if not, write to the Free Software 00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00025 // USA 00026 // Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps 00027 // (etphipp@sandia.gov). 00028 // 00029 // *********************************************************************** 00030 // @HEADER 00031 00032 #ifndef SACADO_PCE_WORKSPACE_HPP 00033 #define SACADO_PCE_WORKSPACE_HPP 00034 00035 #include <vector> 00036 #include "Sacado_PCE_TripleProduct.hpp" 00037 #include "Teuchos_SerialDenseMatrix.hpp" 00038 #include "Teuchos_SerialDenseVector.hpp" 00039 #include "Teuchos_LAPACK.hpp" 00040 00041 namespace Sacado { 00042 00043 namespace PCE { 00044 00046 template <typename BasisT> 00047 class Workspace { 00048 public: 00049 00051 typedef typename BasisT::value_type value_type; 00052 00054 typedef int ordinal_type; 00055 00057 typedef Teuchos::SerialDenseMatrix<ordinal_type,value_type> matrix_type; 00058 00060 typedef TripleProduct<BasisT> tp_type; 00061 00063 Workspace(unsigned int sz); 00064 00066 ~Workspace() {} 00067 00069 void resize(unsigned int sz); 00070 00072 unsigned int size() const { return sz; } 00073 00075 matrix_type& getMatrix() { return A; } 00076 00078 matrix_type& getRHS() { return b; } 00079 00081 const tp_type& getTripleProduct() const { return Cijk; } 00082 00084 ordinal_type solve(ordinal_type s, ordinal_type nrhs); 00085 00086 protected: 00087 00089 unsigned int sz; 00090 00092 matrix_type A; 00093 00095 matrix_type b; 00096 00098 std::vector<ordinal_type> piv; 00099 00101 tp_type Cijk; 00102 00104 Teuchos::LAPACK<ordinal_type,value_type> lapack; 00105 00106 }; // class Workspace 00107 00108 } // namesspace PCE 00109 00110 } // namespace Sacado 00111 00112 #include "Sacado_PCE_WorkspaceImp.hpp" 00113 00114 #endif // SACADO_PCE_WORKSPACE_HPP
1.4.7