All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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, class LocalOrdinal, class GlobalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
64  class MatrixFactory2 {
65 #undef XPETRA_MATRIXFACTORY2_SHORT
66 #include "Xpetra_UseShortNames.hpp"
67 
68  public:
70  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
71  if (oldOp == Teuchos::null)
72  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
73 
74  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
75 
76  UnderlyingLib lib = A->getRowMap()->lib();
77 
79  "Not Epetra or Tpetra matrix");
80 
81 #ifdef HAVE_XPETRA_EPETRA
82  if (lib == UseEpetra) {
83  // NOTE: The proper Epetra conversion in Xpetra_MatrixFactory.cpp
84  throw Exceptions::RuntimeError("Xpetra::BuildCopy(): matrix templates are incompatible with Epetra");
85  }
86 #endif
87 
88 #ifdef HAVE_XPETRA_TPETRA
89  if (lib == UseTpetra) {
90  // Underlying matrix is Tpetra
91  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
92 
93  if (oldTCrsOp != Teuchos::null) {
94  RCP<TpetraCrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
96  newOp->SetFixedBlockSize(A->GetFixedBlockSize());
97 
98  return newOp;
99  } else {
100  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::TpetraCrsMatrix failed");
101  }
102  }
103 #endif
104 
105  return Teuchos::null;
106  }
107  };
108 #define XPETRA_MATRIXFACTORY2_SHORT
109 
110  //template<>
111  //class MatrixFactory2<double,int,int,typename Xpetra::Matrix<double, int, int>::node_type> {
112  template<class Node>
113  class MatrixFactory2<double,int,int,Node> {
114  typedef double Scalar;
115  typedef int LocalOrdinal;
116  typedef int GlobalOrdinal;
117  //typedef Matrix<double, int, GlobalOrdinal>::node_type Node;
118 #undef XPETRA_MATRIXFACTORY2_SHORT
119 #include "Xpetra_UseShortNames.hpp"
120  public:
122  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
123  if (oldOp == Teuchos::null)
124  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
125 
126  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
127 
128 #ifdef HAVE_XPETRA_EPETRA
129 #ifndef XPETRA_EPETRA_NO_32BIT_GLOBAL_INDICES
130  RCP<const EpetraCrsMatrixT<GlobalOrdinal,Node> > oldECrsOp = Teuchos::rcp_dynamic_cast<const EpetraCrsMatrixT<GlobalOrdinal,Node> >(oldCrsOp);
131  if (oldECrsOp != Teuchos::null) {
132  // Underlying matrix is Epetra
133  RCP<CrsMatrix> newECrsOp(new EpetraCrsMatrixT<GlobalOrdinal,Node>(*oldECrsOp));
134  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap (newECrsOp));
135  newOp->SetFixedBlockSize(A->GetFixedBlockSize());
136  return newOp;
137  }
138 #endif
139 #endif
140 
141 #ifdef HAVE_XPETRA_TPETRA
142  // Underlying matrix is Tpetra
143  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
144  if (oldTCrsOp != Teuchos::null) {
145  RCP<CrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
146  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap(newTCrsOp));
147  newOp->SetFixedBlockSize(A->GetFixedBlockSize());
148  return newOp;
149  }
150  return Teuchos::null;
151 #else
152  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::EpetraCrsMatrix or Xpetra::TpetraCrsMatrix failed");
153  TEUCHOS_UNREACHABLE_RETURN(Teuchos::null); // make compiler happy
154 #endif
155 
156  } //BuildCopy
157  };
158 
159 #define XPETRA_MATRIXFACTORY2_SHORT
160 
161 #ifdef HAVE_XPETRA_INT_LONG_LONG
162  //template<>
163  //class MatrixFactory2<double,int,long long,typename Xpetra::Matrix<double, int, long long>::node_type> {
164  template<class Node>
165  class MatrixFactory2<double, int, long long, Node> {
166  typedef double Scalar;
167  typedef int LocalOrdinal;
168  typedef long long GlobalOrdinal;
169  //typedef Matrix<double, int, GlobalOrdinal>::node_type Node;
170 #undef XPETRA_MATRIXFACTORY2_SHORT
171 #include "Xpetra_UseShortNames.hpp"
172  public:
173  static RCP<Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > BuildCopy(const RCP<const Xpetra::Matrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > A) {
174  RCP<const CrsMatrixWrap> oldOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(A);
175  if (oldOp == Teuchos::null)
176  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
177 
178  RCP<const CrsMatrix> oldCrsOp = oldOp->getCrsMatrix();
179 
180 #ifdef HAVE_XPETRA_EPETRA
181 #ifndef XPETRA_EPETRA_NO_64BIT_GLOBAL_INDICES
182  RCP<const EpetraCrsMatrixT<GlobalOrdinal,Node> > oldECrsOp = Teuchos::rcp_dynamic_cast<const EpetraCrsMatrixT<GlobalOrdinal,Node> >(oldCrsOp);
183  if (oldECrsOp != Teuchos::null) {
184  // Underlying matrix is Epetra
185  RCP<CrsMatrix> newECrsOp(new EpetraCrsMatrixT<GlobalOrdinal,Node>(*oldECrsOp));
186  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap (newECrsOp));
187  newOp->SetFixedBlockSize(A->GetFixedBlockSize());
188  return newOp;
189  }
190 #endif
191 #endif
192 
193 #ifdef HAVE_XPETRA_TPETRA
194  // Underlying matrix is Tpetra
195  RCP<const TpetraCrsMatrix> oldTCrsOp = Teuchos::rcp_dynamic_cast<const TpetraCrsMatrix>(oldCrsOp);
196  if (oldTCrsOp != Teuchos::null) {
197  RCP<CrsMatrix> newTCrsOp(new TpetraCrsMatrix(*oldTCrsOp));
198  RCP<CrsMatrixWrap> newOp (new CrsMatrixWrap(newTCrsOp));
199  newOp->SetFixedBlockSize(A->GetFixedBlockSize());
200  return newOp;
201  }
202 #else
203  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::EpetraCrsMatrix or Xpetra::TpetraCrsMatrix failed");
204 #endif
205 
206  return Teuchos::null; // make compiler happy
207  }
208  };
209 #endif // HAVE_XPETRA_INT_LONG_LONG
210 
211 #define XPETRA_MATRIXFACTORY2_SHORT
212 
213 
214  template <class Scalar,
215  class LocalOrdinal,
216  class GlobalOrdinal,
217  class Node>
218  class MatrixFactory {
219 #undef XPETRA_MATRIXFACTORY_SHORT
220 #include "Xpetra_UseShortNames.hpp"
221 
222  private:
225 
226  public:
227 
229  static RCP<Matrix> Build(const RCP<const Map>& rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype = Xpetra::DynamicProfile) {
230  return rcp(new CrsMatrixWrap(rowMap, maxNumEntriesPerRow, pftype));
231  }
232 
234  static RCP<Matrix> Build(const RCP<const Map>& rowMap, const RCP<const Map>& colMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype = Xpetra::DynamicProfile) {
235  return rcp(new CrsMatrixWrap(rowMap, colMap, maxNumEntriesPerRow, pftype));
236  }
237 
239  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) {
240  return rcp(new CrsMatrixWrap(rowMap, colMap, NumEntriesPerRowToAlloc, pftype));
241  }
242 
243 #ifdef HAVE_XPETRA_KOKKOS_REFACTOR
244  static RCP<Matrix> Build (
246  const Teuchos::RCP<const Map>& rowMap,
247  const Teuchos::RCP<const Map>& colMap,
249  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
250  XPETRA_MONITOR("MatrixFactory::Build");
251  return rcp(new CrsMatrixWrap(rowMap, colMap, lclMatrix, params));
252  }
254  static RCP<Matrix> Build (
256  const Teuchos::RCP<const Map>& rowMap,
257  const Teuchos::RCP<const Map>& colMap,
258  const Teuchos::RCP<const Map>& domainMap = Teuchos::null,
259  const Teuchos::RCP<const Map>& rangeMap = Teuchos::null,
260  const Teuchos::RCP<Teuchos::ParameterList>& params = null) {
261  XPETRA_MONITOR("MatrixFactory::Build");
262  return rcp(new CrsMatrixWrap(lclMatrix, rowMap, colMap, domainMap, rangeMap, params));
263  }
264 #endif
265 
267  static RCP<Matrix> Build(const RCP<const Map> &rowMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, ProfileType pftype = Xpetra::DynamicProfile) {
268  return rcp( new CrsMatrixWrap(rowMap, NumEntriesPerRowToAlloc, pftype) );
269  }
270 
272  static RCP<Matrix> Build(const RCP<const CrsGraph>& graph, const RCP<ParameterList>& paramList = Teuchos::null) {
273  return rcp(new CrsMatrixWrap(graph, paramList));
274  }
275 
277  static RCP<Matrix> Build(const RCP<const Vector>& diagonal) {
278  Teuchos::ArrayRCP<const Scalar> vals = diagonal->getData(0);
279  LocalOrdinal NumMyElements = diagonal->getMap()->getNodeNumElements();
280  Teuchos::ArrayView<const GlobalOrdinal> MyGlobalElements = diagonal->getMap()->getNodeElementList();
281 
283 
284  for (LocalOrdinal i = 0; i < NumMyElements; ++i) {
285  mtx->insertGlobalValues(MyGlobalElements[i],
286  Teuchos::tuple<GlobalOrdinal>(MyGlobalElements[i]),
287  Teuchos::tuple<Scalar>(vals[i]) );
288  }
289  mtx->fillComplete();
290  return mtx;
291  }
292 
294  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) {
295  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
296  if (crsOp == Teuchos::null)
297  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
298 
299  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
300  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, importer, domainMap, rangeMap, params);
301  if (newCrs->hasMatrix())
302  return rcp(new CrsMatrixWrap(newCrs));
303  else
304  return Teuchos::null;
305  }
306 
308  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) {
309  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
310  if (crsOp == Teuchos::null)
311  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
312 
313  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
314  return rcp(new CrsMatrixWrap(CrsMatrixFactory::Build(originalCrs, exporter, domainMap, rangeMap, params)));
315  }
316 
318  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) {
319  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
320  if (crsOp == Teuchos::null)
321  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
322 
323  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
324  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, RowImporter, Teuchos::rcpFromRef(DomainImporter), domainMap, rangeMap, params);
325  if (newCrs->hasMatrix())
326  return rcp(new CrsMatrixWrap(newCrs));
327  else
328  return Teuchos::null;
329  }
330 
332  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) {
333  RCP<const CrsMatrixWrap> crsOp = Teuchos::rcp_dynamic_cast<const CrsMatrixWrap>(sourceMatrix);
334  if (crsOp == Teuchos::null)
335  throw Exceptions::BadCast("Cast from Xpetra::Matrix to Xpetra::CrsMatrixWrap failed");
336 
337  RCP<CrsMatrix> originalCrs = crsOp->getCrsMatrix();
338  RCP<CrsMatrix> newCrs = CrsMatrixFactory::Build(originalCrs, RowExporter, Teuchos::rcpFromRef(DomainExporter), domainMap, rangeMap, params);
339  if (newCrs->hasMatrix())
340  return rcp(new CrsMatrixWrap(newCrs));
341  else
342  return Teuchos::null;
343  }
344 
345 
349  RCP<const BlockedCrsMatrix> input = Teuchos::rcp_dynamic_cast<const BlockedCrsMatrix>(A);
350  if(input == Teuchos::null)
352 
353  // deep copy of MapExtractors (and underlying maps)
354  RCP<const MapExtractor> rgMapExt = Teuchos::rcp(new MapExtractor(*(input->getRangeMapExtractor())));
355  RCP<const MapExtractor> doMapExt = Teuchos::rcp(new MapExtractor(*(input->getDomainMapExtractor())));
356 
357  // create new BlockedCrsMatrix object
358  RCP<BlockedCrsMatrix> bop = Teuchos::rcp(new BlockedCrsMatrix(rgMapExt, doMapExt, input->getNodeMaxNumRowEntries()));
359 
360  for (size_t r = 0; r < input->Rows(); ++r) {
361  for (size_t c = 0; c < input->Cols(); ++c)
362  if(input->getMatrix(r,c) != Teuchos::null) {
363  // make a deep copy of the matrix
364  // This is a recursive call to this function
365  RCP<Matrix> mat =
367  bop->setMatrix(r,c,mat);
368  }
369  }
370 
371  if(input->isFillComplete())
372  bop->fillComplete();
373  return bop;
374  }
375  };
376 #define XPETRA_MATRIXFACTORY_SHORT
377 
378 }
379 
380 #define XPETRA_MATRIXFACTORY_SHORT
381 #define XPETRA_MATRIXFACTORY2_SHORT
382 #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.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
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.
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.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
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...
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
TypeTo as(const TypeFrom &t)
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...