Xpetra_MatrixFactory.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Xpetra: A linear algebra interface package
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 
47 // WARNING: This code is experimental. Backwards compatibility should not be expected.
48 
49 #ifndef XPETRA_MATRIXFACTORY_HPP
50 #define XPETRA_MATRIXFACTORY_HPP
51 
52 #include "Xpetra_ConfigDefs.hpp"
54 #include "Xpetra_Matrix.hpp"
55 #include "Xpetra_CrsMatrixWrap.hpp"
57 #include "Xpetra_Map.hpp"
58 #include "Xpetra_Vector.hpp"
59 #include "Xpetra_Exceptions.hpp"
60 
61 namespace Xpetra {
62 
63  /*template <class Scalar = Matrix<>::scalar_type,
64  class LocalOrdinal = typename Matrix<Scalar>::local_ordinal_type,
65  class GlobalOrdinal =
66  typename Matrix<Scalar, LocalOrdinal>::global_ordinal_type,
67  class Node =
68  typename Matrix<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>*/
69  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
70  class MatrixFactory2 {
71  #undef XPETRA_MATRIXFACTORY2_SHORT
72  #include "Xpetra_UseShortNames.hpp"
73 
74  public:
75  static RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > BuildCopy(const RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > A) {
76  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
77  if (oldOp == Teuchos::null)
78  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
79 
80  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
81 
82  UnderlyingLib lib = A->getRowMap()->lib();
83 
84  TEUCHOS_TEST_FOR_EXCEPTION(lib != UseEpetra && lib != UseTpetra, Exceptions::RuntimeError,
85  "Not Epetra or Tpetra matrix");
86 
87  #ifdef HAVE_XPETRA_EPETRA
88  if (lib == UseEpetra) {
89  // NOTE: The proper Epetra conversion in Xpetra_MatrixFactory.cpp
90  throw Exceptions::RuntimeError("Xpetra::BuildCopy(): matrix templates are incompatible with Epetra");
91  }
92  #endif
93 
94  #ifdef HAVE_XPETRA_TPETRA
95  if (lib == UseTpetra) {
96  // Underlying matrix is Tpetra
97  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
98 
99  if (oldTCrsOp != Teuchos::null) {
100  RCP<TpetraCrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
101  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap(Teuchos::as<RCP<CrsMatrix> >(newTCrsOp)));
102 
103  return newOp;
104  } else {
105  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::TpetraCrsMatrix failed");
106  }
107  }
108  #endif
109 
110  return Teuchos::null;
111  }
112  };
113  #define XPETRA_MATRIXFACTORY2_SHORT
114 
115  //template<>
116  //class MatrixFactory2<double,int,int,typename Xpetra::Matrix<double, int, int>::node_type> {
117  template<class Node>
118  class MatrixFactory2<double,int,int,Node> {
119  typedef double Scalar;
120  typedef int LocalOrdinal;
121  typedef int GlobalOrdinal;
122  //typedef Matrix<double, int, GlobalOrdinal>::node_type Node;
123  #undef XPETRA_MATRIXFACTORY2_SHORT
124  #include "Xpetra_UseShortNames.hpp"
125  public:
126  static RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > BuildCopy(const RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > A) {
127  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
128  if (oldOp == Teuchos::null)
129  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
130 
131  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
132 
133  #ifdef HAVE_XPETRA_EPETRA
134  #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
135  RCP<const EpetraCrsMatrixT<GlobalOrdinal,Node> > oldECrsOp = Teuchos::rcp_dynamic_cast<const EpetraCrsMatrixT<GlobalOrdinal,Node> >(oldCrsOp);
136  if (oldECrsOp != Teuchos::null) {
137  // Underlying matrix is Epetra
138  RCP<CrsMatrix> newECrsOp(new EpetraCrsMatrixT<GlobalOrdinal,Node>(*oldECrsOp));
139  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap (newECrsOp));
140 
141  return newOp;
142  }
143  #endif
144  #endif
145 
146  #ifdef HAVE_XPETRA_TPETRA
147  // Underlying matrix is Tpetra
148  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
149  if (oldTCrsOp != Teuchos::null) {
150  RCP<CrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
151  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap(newTCrsOp));
152 
153  return newOp;
154  }
155  #else
156  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::EpetraCrsMatrix or Xpetra::TpetraCrsMatrix failed");
157  #endif
158 
159  return Teuchos::null; // make compiler happy
160  }
161  };
162 
163  #define XPETRA_MATRIXFACTORY2_SHORT
164 
165  #ifdef HAVE_XPETRA_INT_LONG_LONG
166  //template<>
167  //class MatrixFactory2<double,int,long long,typename Xpetra::Matrix<double, int, long long>::node_type> {
168  template<class Node>
169  class MatrixFactory2<double, int, long long, Node> {
170  typedef double Scalar;
171  typedef int LocalOrdinal;
172  typedef long long GlobalOrdinal;
173  //typedef Matrix<double, int, GlobalOrdinal>::node_type Node;
174  #undef XPETRA_MATRIXFACTORY2_SHORT
175  #include "Xpetra_UseShortNames.hpp"
176  public:
177  static RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > BuildCopy(const RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > A) {
178  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
179  if (oldOp == Teuchos::null)
180  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
181 
182  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
183 
184  #ifdef HAVE_XPETRA_EPETRA
185  #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
186  RCP<const EpetraCrsMatrixT<GlobalOrdinal,Node> > oldECrsOp = Teuchos::rcp_dynamic_cast<const EpetraCrsMatrixT<GlobalOrdinal,Node> >(oldCrsOp);
187  if (oldECrsOp != Teuchos::null) {
188  // Underlying matrix is Epetra
189  RCP<CrsMatrix> newECrsOp(new EpetraCrsMatrixT<GlobalOrdinal,Node>(*oldECrsOp));
190  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap (newECrsOp));
191 
192  return newOp;
193  }
194  #endif
195  #endif
196 
197  #ifdef HAVE_XPETRA_TPETRA
198  // Underlying matrix is Tpetra
199  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
200  if (oldTCrsOp != Teuchos::null) {
201  RCP<CrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
202  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap(newTCrsOp));
203 
204  return newOp;
205  }
206  #else
207  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::EpetraCrsMatrix or Xpetra::TpetraCrsMatrix failed");
208  #endif
209 
210  return Teuchos::null; // make compiler happy
211  }
212  };
213  #endif // HAVE_XPETRA_INT_LONG_LONG
214 
215  #define XPETRA_MATRIXFACTORY2_SHORT
216 
217 
218  template <class Scalar = Matrix<>::scalar_type,
219  class LocalOrdinal = typename Matrix<Scalar>::local_ordinal_type,
220  class GlobalOrdinal =
222  class Node =
224  class MatrixFactory {
225 #undef XPETRA_MATRIXFACTORY_SHORT
226 #include "Xpetra_UseShortNames.hpp"
227 
228  private:
231 
232  public:
233 
235  static RCP<Matrix> Build(const RCP<const Map>& rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype = Xpetra::DynamicProfile) {
236  return rcp(new CrsMatrixWrap(rowMap, maxNumEntriesPerRow, pftype));
237  }
238 
240  static RCP<Matrix> Build(const RCP<const Map>& rowMap, const RCP<const Map>& colMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype = Xpetra::DynamicProfile) {
241  return rcp(new CrsMatrixWrap(rowMap, colMap, maxNumEntriesPerRow, pftype));
242  }
243 
245  static RCP<Matrix> Build(const RCP<const Map>& rowMap, const RCP<const Map>& colMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, Xpetra::ProfileType pftype = Xpetra::DynamicProfile) {
246  return rcp(new CrsMatrixWrap(rowMap, colMap, NumEntriesPerRowToAlloc, pftype));
247  }
248 
249 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
250  static RCP<Matrix> Build (
252  const Teuchos::RCP<const Map>& rowMap,
253  const Teuchos::RCP<const Map>& colMap,
255  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
256  XPETRA_MONITOR("MatrixFactory::Build");
257  return rcp(new CrsMatrixWrap(rowMap, colMap, lclMatrix, params));
258  }
259 #endif
260 
262  static RCP<Matrix> Build(const RCP<const Map> &rowMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, ProfileType pftype = Xpetra::DynamicProfile) {
263  return rcp( new CrsMatrixWrap(rowMap, NumEntriesPerRowToAlloc, pftype) );
264  }
265 
267  static RCP<Matrix> Build(const RCP<const CrsGraph>& graph, const RCP<ParameterList>& paramList = Teuchos::null) {
268  return rcp(new CrsMatrixWrap(graph, paramList));
269  }
270 
272  static RCP<Matrix> Build(const RCP<const Vector>& diagonal) {
273  Teuchos::ArrayRCP<const Scalar> vals = diagonal->getData(0);
274  LocalOrdinal NumMyElements = diagonal->getMap()->getNodeNumElements();
275  Teuchos::ArrayView<const GlobalOrdinal> MyGlobalElements = diagonal->getMap()->getNodeElementList();
276 
277  Teuchos::RCP<CrsMatrixWrap> mtx = Teuchos::rcp(new CrsMatrixWrap(diagonal->getMap(), 1, Xpetra::StaticProfile));
278 
279  for (LocalOrdinal i = 0; i < NumMyElements; ++i) {
280  mtx->insertGlobalValues(MyGlobalElements[i],
281  Teuchos::tuple<GlobalOrdinal>(MyGlobalElements[i]),
282  Teuchos::tuple<Scalar>(vals[i]) );
283  }
284  mtx->fillComplete();
285  return mtx;
286  }
287 
289  static RCP<Matrix> Build(const RCP<const Matrix>& sourceMatrix, const Import& importer, const RCP<const Map>& domainMap = Teuchos::null, const RCP<const Map>& rangeMap = Teuchos::null, const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
290  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
291  if (crsOp == Teuchos::null)
292  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
293 
294  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
295  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, importer, domainMap, rangeMap, params);
296  if (newCrs->hasMatrix())
297  return rcp(new CrsMatrixWrap(newCrs));
298  else
299  return Teuchos::null;
300  }
301 
303  static RCP<Matrix> Build(const RCP<const Matrix> & sourceMatrix, const Export &exporter, const RCP<const Map> & domainMap, const RCP<const Map> & rangeMap,const Teuchos::RCP<Teuchos::ParameterList>& params) {
304  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
305  if (crsOp == Teuchos::null)
306  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
307 
308  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
309  return rcp(new CrsMatrixWrap(CrsMatrixFactory::Build(originalCrs, exporter, domainMap, rangeMap, params)));
310  }
311 
313  static RCP<Matrix> Build(const RCP<const Matrix>& sourceMatrix, const Import& RowImporter, const Import& DomainImporter, const RCP<const Map>& domainMap, const RCP<const Map>& rangeMap, const Teuchos::RCP<Teuchos::ParameterList>& params) {
314  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
315  if (crsOp == Teuchos::null)
316  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
317 
318  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
319  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, RowImporter, Teuchos::rcpFromRef(DomainImporter), domainMap, rangeMap, params);
320  if (newCrs->hasMatrix())
321  return rcp(new CrsMatrixWrap(newCrs));
322  else
323  return Teuchos::null;
324  }
325 
327  static RCP<Matrix> Build(const RCP<const Matrix> & sourceMatrix, const Export &RowExporter, const Export &DomainExporter, const RCP<const Map> & domainMap = Teuchos::null, const RCP<const Map> & rangeMap = Teuchos::null,const Teuchos::RCP<Teuchos::ParameterList>& params = Teuchos::null) {
328  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
329  if (crsOp == Teuchos::null)
330  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
331 
332  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
333  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, RowExporter, Teuchos::rcpFromRef(DomainExporter), domainMap, rangeMap, params);
334  if (newCrs->hasMatrix())
335  return rcp(new CrsMatrixWrap(newCrs));
336  else
337  return Teuchos::null;
338  }
339 
340 
343  static RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > BuildCopy(const RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > A) {
344  RCP<const BlockedCrsMatrix> input = Teuchos::rcp_dynamic_cast<const BlockedCrsMatrix>(A);
345  if(input == Teuchos::null)
347 
348  // deep copy of MapExtractors (and underlying maps)
349  RCP<const MapExtractor> rgMapExt = Teuchos::rcp(new MapExtractor(*(input->getRangeMapExtractor())));
350  RCP<const MapExtractor> doMapExt = Teuchos::rcp(new MapExtractor(*(input->getDomainMapExtractor())));
351 
352  // create new BlockedCrsMatrix object
353  RCP<BlockedCrsMatrix> bop = Teuchos::rcp(new BlockedCrsMatrix(rgMapExt, doMapExt, input->getNodeMaxNumRowEntries()));
354 
355  for (size_t r = 0; r < input->Rows(); ++r) {
356  for (size_t c = 0; c < input->Cols(); ++c)
357  if(input->getMatrix(r,c) != Teuchos::null) {
358  // make a deep copy of the matrix
359  // This is a recursive call to this function
360  RCP<Matrix> mat =
362  bop->setMatrix(r,c,mat);
363  }
364  }
365 
366  if(input->isFillComplete())
367  bop->fillComplete();
368  return bop;
369  }
370  };
371 #define XPETRA_MATRIXFACTORY_SHORT
372 
373 }
374 
375 #define XPETRA_MATRIXFACTORY_SHORT
376 #define XPETRA_MATRIXFACTORY2_SHORT
377 #endif
static RCP< Matrix > Build(const RCP< const Vector > &diagonal)
Constructor for creating a diagonal Xpetra::Matrix using the entries of a given vector for the diagon...
static RCP< Matrix > Build(const RCP< const Matrix > &sourceMatrix, const Import &importer, const RCP< const Map > &domainMap=Teuchos::null, const RCP< const Map > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor to create a Matrix using a fusedImport-style construction. The originalMatrix must be a X...
static RCP< Matrix > Build(const RCP< const CrsGraph > &graph, const RCP< ParameterList > &paramList=Teuchos::null)
Constructor specifying graph.
static RCP< CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile, const Teuchos::RCP< Teuchos::ParameterList > &plist=Teuchos::null)
Constructor specifying fixed number of entries for each row.
Xpetra namespace
LocalOrdinal local_ordinal_type
Exception throws to report errors in the internal logical of the program.
static RCP< Matrix > Build(const RCP< const Map > &rowMap, const RCP< const Map > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor specifying the (possibly different) number of entries per row and providing column map...
static RCP< Matrix > Build(const RCP< const Map > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, ProfileType pftype=Xpetra::DynamicProfile)
Constructor specifying (possibly different) number of entries in each row.
Exception indicating invalid cast attempted.
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > BuildCopy(const RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A)
static RCP< Matrix > Build(const RCP< const Map > &rowMap, const RCP< const Map > &colMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor specifying the max number of non-zeros per row and providing column map.
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > BuildCopy(const RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A)
static RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > BuildCopy(const RCP< const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A)
static RCP< Matrix > Build(const RCP< const Matrix > &sourceMatrix, const Export &exporter, const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor to create a Matrix using a fusedExport-style construction. The originalMatrix must be a X...
Concrete implementation of Xpetra::Matrix.
#define XPETRA_MONITOR(funcName)
static RCP< Matrix > Build(const RCP< const Matrix > &sourceMatrix, const Export &RowExporter, const Export &DomainExporter, const RCP< const Map > &domainMap=Teuchos::null, const RCP< const Map > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor to create a Matrix using a fusedExport-style construction. The originalMatrix must be a X...
static RCP< Matrix > Build(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Constructor specifying the number of non-zeros for all rows.
Xpetra-specific matrix class.
MatrixFactory()
Private constructor. This is a static class.
static RCP< Matrix > Build(const RCP< const Matrix > &sourceMatrix, const Import &RowImporter, const Import &DomainImporter, const RCP< const Map > &domainMap, const RCP< const Map > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor to create a Matrix using a fusedImport-style construction. The originalMatrix must be a X...
GlobalOrdinal global_ordinal_type