Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_TpetraBlockCrsMatrix_def.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 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
47 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
48 
50 #include "Xpetra_TpetraCrsGraph.hpp"
51 
52 namespace Xpetra {
53 
55 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
58  size_t maxNumEntriesPerRow,
59  const Teuchos::RCP<Teuchos::ParameterList> &params) {
60  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
61 }
62 
64 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
67  const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
68  const Teuchos::RCP<Teuchos::ParameterList> &params) {
69  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
70 }
71 
73 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
76  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
77  size_t maxNumEntriesPerRow,
78  const Teuchos::RCP<Teuchos::ParameterList> &params) {
79  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
80 }
81 
83 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
86  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
87  const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
88  const Teuchos::RCP<Teuchos::ParameterList> &params) {
89  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
90 }
91 
93 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
96  const Teuchos::RCP<Teuchos::ParameterList> &params)
97 // : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >(toTpetra(graph), params)))
98 // * there is no Tpetra::BlockCrsMatrix(graph, params) c'tor. We throw anyways here so no need to set mtx_.
99 {
100  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
101 }
102 
104 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
107  const LocalOrdinal blockSize)
108  : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*toTpetra(graph), blockSize))) {}
109 
111 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
114  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &pointDomainMap,
115  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &pointRangeMap,
116  const LocalOrdinal blockSize)
117  : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*toTpetra(graph), *toTpetra(pointDomainMap), *toTpetra(pointRangeMap), blockSize))) {}
118 
120 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
122  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
124  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
125  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
126  const Teuchos::RCP<Teuchos::ParameterList> &params) {
127  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
128 }
129 
131 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
133  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
135  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
136  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
137  const Teuchos::RCP<Teuchos::ParameterList> &params) {
138  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
139 }
140 
142 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
144  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
146  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
147  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
148  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
149  const Teuchos::RCP<Teuchos::ParameterList> &params) {
150  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
151 }
152 
154 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
156  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
158  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
159  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
160  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
161  const Teuchos::RCP<Teuchos::ParameterList> &params) {
162  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
163 }
164 
166 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
169 
171 
173 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
175  insertGlobalValues(GlobalOrdinal globalRow,
176  const ArrayView<const GlobalOrdinal> &cols,
177  const ArrayView<const Scalar> &vals) {
178  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
179 }
180 
182 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
184  insertLocalValues(LocalOrdinal localRow,
185  const ArrayView<const LocalOrdinal> &cols,
186  const ArrayView<const Scalar> &vals) {
187  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
188 }
189 
191 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
193  replaceGlobalValues(GlobalOrdinal globalRow,
194  const ArrayView<const GlobalOrdinal> &cols,
195  const ArrayView<const Scalar> &vals) {
196  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
197 }
198 
200 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
202  replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {
203  XPETRA_MONITOR("TpetraBlockCrsMatrix::replaceLocalValues");
204  mtx_->replaceLocalValues(localRow, cols.getRawPtr(), vals.getRawPtr(), cols.size());
205 }
206 
208 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
210  setAllToScalar(const Scalar &alpha) {
211  XPETRA_MONITOR("TpetraBlockCrsMatrix::setAllToScalar");
212  mtx_->setAllToScalar(alpha);
213 }
214 
216 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
218  scale(const Scalar &alpha) {
219  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
220 }
221 
223 //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
224 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
226  allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {
227  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
228 }
229 
231 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
233  setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {
234  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
235 }
236 
238 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
240  getAllValues(ArrayRCP<const size_t> &rowptr,
241  ArrayRCP<const LocalOrdinal> &colind,
242  ArrayRCP<const Scalar> &values) const {
243  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
244 }
245 
247 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
249  getAllValues(ArrayRCP<Scalar> &values) {
250  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
251 }
252 
254 
255 // Transformational Methods
257 
258 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
260  resumeFill(const RCP<ParameterList> &params) {
261  /*noop*/
262 }
263 
264 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
267  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
268  const RCP<ParameterList> &params) {
269  /*noop*/
270 }
271 
272 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
274  fillComplete(const RCP<ParameterList> &params) {
275  /*noop*/
276 }
277 
278 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
281  Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {
282  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
283 }
284 
285 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
288  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
289  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer,
290  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter,
291  const RCP<ParameterList> &params) {
292  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
293 }
294 
296 
298 
299 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
300 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
302  getRowMap() const {
303  XPETRA_MONITOR("TpetraBlockCrsMatrix::getRowMap");
304  return toXpetra(mtx_->getRowMap());
305 }
306 
307 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
308 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
310  getColMap() const {
311  XPETRA_MONITOR("TpetraBlockCrsMatrix::getColMap");
312  return toXpetra(mtx_->getColMap());
313 }
314 
315 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
316 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
318  getCrsGraph() const {
319  XPETRA_MONITOR("TpetraBlockCrsMatrix::getCrsGraph");
320  using G_t = Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;
322  RCP<G_t> t_graph = Teuchos::rcp_const_cast<G_t>(Teuchos::rcpFromRef(mtx_->getCrsGraph()));
323  RCP<const G_x> x_graph = rcp(new G_x(t_graph));
324  return x_graph;
325 }
326 
327 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
331  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumRows");
332  return mtx_->getGlobalNumRows();
333 }
334 
335 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
339  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumCols");
340  return mtx_->getGlobalNumCols();
341 }
342 
343 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
344 size_t
347  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumRows");
348  return mtx_->getLocalNumRows();
349 }
350 
351 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
352 size_t
355  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumCols");
356  return mtx_->getLocalNumCols();
357 }
358 
359 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
363  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumEntries");
364  return mtx_->getGlobalNumEntries();
365 }
366 
367 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
368 size_t
371  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumEntries");
372  return mtx_->getLocalNumEntries();
373 }
374 
375 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
376 size_t
378  getNumEntriesInLocalRow(LocalOrdinal localRow) const {
379  XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInLocalRow");
380  return mtx_->getNumEntriesInLocalRow(localRow);
381 }
382 
383 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
384 size_t
386  getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const {
387  XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInGlobalRow");
388  return mtx_->getNumEntriesInGlobalRow(globalRow);
389 }
390 
391 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
393  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
394  return mtx_->getGlobalMaxNumRowEntries();
395 }
396 
397 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
399  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalMaxNumRowEntries");
400  return mtx_->getLocalMaxNumRowEntries();
401 }
402 
403 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
405  XPETRA_MONITOR("TpetraBlockCrsMatrix::isLocallyIndexed");
406  return mtx_->isLocallyIndexed();
407 }
408 
409 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
411  XPETRA_MONITOR("TpetraBlockCrsMatrix::isGloballyIndexed");
412  return mtx_->isGloballyIndexed();
413 }
414 
415 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
417  XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillComplete");
418  return mtx_->isFillComplete();
419 }
420 
421 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
423  XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillActive");
424  return false;
425 }
426 
427 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
428 typename ScalarTraits<Scalar>::magnitudeType TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getFrobeniusNorm() const {
429  XPETRA_MONITOR("TpetraBlockCrsMatrix::getFrobeniusNorm");
430  return mtx_->getFrobeniusNorm();
431 }
432 
433 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
435  XPETRA_MONITOR("TpetraBlockCrsMatrix::supportsRowViews");
436  return mtx_->supportsRowViews();
437 }
438 
439 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
441  getLocalRowCopy(LocalOrdinal LocalRow,
442  const ArrayView<LocalOrdinal> &Indices,
443  const ArrayView<Scalar> &Values,
444  size_t &NumEntries) const {
445  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowCopy");
446  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_local_inds_host_view_type indices("indices", Indices.size());
447  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values("values", Values.size());
448 
449  mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
450  for (size_t i = 0; i < NumEntries; ++i) {
451  Indices[i] = indices(i);
452  Values[i] = values(i);
453  }
454 }
455 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
457  getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &Indices,
458  ArrayView<const Scalar> &Values) const {
459  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowView");
460  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
461  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
462 
463  mtx_->getLocalRowView(LocalRow, indices, values);
464  Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
465  Values = ArrayView<const Scalar>(reinterpret_cast<const Scalar *>(values.data()), values.extent(0));
466 }
467 
468 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
470  getGlobalRowView(GlobalOrdinal GlobalRow,
471  ArrayView<const GlobalOrdinal> &Indices,
472  ArrayView<const Scalar> &Values) const {
473  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowView");
474  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
475  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
476 
477  mtx_->getGlobalRowView(GlobalRow, indices, values);
478  Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
479  Values = ArrayView<const Scalar>(reinterpret_cast<const Scalar *>(values.data()), values.extent(0));
480 }
481 
482 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
484  getGlobalRowCopy(GlobalOrdinal GlobalRow,
485  const ArrayView<GlobalOrdinal> &Indices,
486  const ArrayView<Scalar> &Values,
487  size_t &NumEntries) const {
488  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowCopy");
489  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_global_inds_host_view_type indices("indices", Indices.size());
490  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values("values", Values.size());
491 
492  mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
493  for (size_t i = 0; i < NumEntries; ++i) {
494  Indices[i] = indices(i);
495  Values[i] = values(i);
496  }
497 }
498 
499 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
501  haveGlobalConstants() const { return true; }
502 
503 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
507  Teuchos::ETransp mode,
508  Scalar alpha,
509  Scalar beta) const {
510  XPETRA_MONITOR("TpetraBlockCrsMatrix::apply");
511  mtx_->apply(toTpetra(X), toTpetra(Y), mode, alpha, beta);
512 }
513 
514 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
518  Teuchos::ETransp mode,
519  Scalar alpha,
520  Scalar beta,
521  bool sumInterfaceValues,
522  const RCP<Import<LocalOrdinal, GlobalOrdinal, Node> > &regionInterfaceImporter,
523  const Teuchos::ArrayRCP<LocalOrdinal> &regionInterfaceLIDs) const {}
524 
525 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
526 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
528  getDomainMap() const {
529  XPETRA_MONITOR("TpetraBlockCrsMatrix::getDomainMap");
530  return toXpetra(mtx_->getDomainMap());
531 }
532 
533 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
534 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
536  getRangeMap() const {
537  XPETRA_MONITOR("TpetraBlockCrsMatrix::getRangeMap");
538  return toXpetra(mtx_->getRangeMap());
539 }
540 
541 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
542 std::string
544  description() const {
545  XPETRA_MONITOR("TpetraBlockCrsMatrix::description");
546  return mtx_->description();
547 }
548 
549 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
551  describe(Teuchos::FancyOStream &out,
552  const Teuchos::EVerbosityLevel verbLevel) const {
553  XPETRA_MONITOR("TpetraBlockCrsMatrix::describe");
554  mtx_->describe(out, verbLevel);
555 }
556 
557 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
559  setObjectLabel(const std::string &objectLabel) {
560  XPETRA_MONITOR("TpetraCrsMatrix::setObjectLabel");
561  Teuchos::LabeledObject::setObjectLabel(objectLabel);
562  mtx_->setObjectLabel(objectLabel);
563 }
564 
565 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
568  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagCopy");
570  diag,
571  tDiag,
572  "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
573  mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
574 }
575 
577 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
580  const Teuchos::ArrayView<const size_t> &offsets) const {
581  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
582 }
583 
585 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
588  const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {
589  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
590 }
591 
592 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
594  getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {
595  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagOffsets");
596 
597  const size_t lclNumRows = mtx_->getGraph()->getLocalNumRows();
598  if (static_cast<size_t>(offsets.size()) < lclNumRows) {
599  offsets.resize(lclNumRows);
600  }
601 
602  // The input ArrayRCP must always be a host pointer. Thus, if
603  // device_type::memory_space is Kokkos::HostSpace, it's OK for us
604  // to write to that allocation directly as a Kokkos::View.
605  typedef typename Node::device_type device_type;
606  typedef typename device_type::memory_space memory_space;
607  if (std::is_same<memory_space, Kokkos::HostSpace>::value) {
608  // It is always syntactically correct to assign a raw host
609  // pointer to a device View, so this code will compile correctly
610  // even if this branch never runs.
611  typedef Kokkos::View<size_t *, device_type, Kokkos::MemoryUnmanaged> output_type;
612  output_type offsetsOut(offsets.getRawPtr(), offsets.size());
613  mtx_->getLocalDiagOffsets(offsetsOut);
614  } else {
615  Kokkos::View<size_t *, device_type> offsetsTmp("diagOffsets", offsets.size());
616  mtx_->getLocalDiagOffsets(offsetsTmp);
617  typedef Kokkos::View<size_t *, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
618  output_type offsetsOut(offsets.getRawPtr(), offsets.size());
619  Kokkos::deep_copy(offsetsOut, offsetsTmp);
620  }
621 }
622 
623 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
626  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
627 }
628 
629 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
632  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
633 }
634 
635 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
638  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
639 }
640 
641 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
642 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
644  getMap() const {
645  XPETRA_MONITOR("TpetraBlockCrsMatrix::getMap");
646  return rcp(new TpetraMap<LocalOrdinal, GlobalOrdinal, Node>(mtx_->getMap()));
647 }
648 
650 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
654  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
655 }
656 
658 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
662  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
663 }
664 
666 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
670  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
671 }
672 
674 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
678  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
679 }
680 
681 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
684  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
685 }
686 
687 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
689  hasMatrix() const {
690  return !mtx_.is_null();
691 }
692 
693 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
695  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
696  : mtx_(mtx) {}
697 
698 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
699 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
702  return mtx_;
703 }
704 
705 // TODO: remove
706 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
707 RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
710  return mtx_;
711 }
712 
713 #ifdef HAVE_XPETRA_TPETRA
714 
715 // was: typedef typename Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type local_matrix_type;
716 // using local_matrix_type = typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type;
717 
718 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
722  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
723 
724 #ifndef __NVCC__
725  local_matrix_type ret;
726 #endif // __NVCC__
727 
728  TEUCHOS_UNREACHABLE_RETURN(ret);
729 }
730 
731 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
735  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
736 
737 #ifndef __NVCC__
738  typename local_matrix_type::HostMirror ret;
739 #endif // __NVCC__
740 
741  TEUCHOS_UNREACHABLE_RETURN(ret);
742 }
743 
744 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
746  setAllValues(const typename local_matrix_type::row_map_type &ptr,
747  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
748  const typename local_matrix_type::values_type &val) {
749  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
750 }
751 
752 #endif // HAVE_XPETRA_TPETRA
753 
754 #ifdef HAVE_XPETRA_EPETRA
755 
756 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
757  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
758 
759 // specialization of TpetraBlockCrsMatrix for GO=LO=int and Node=EpetraNode
760 template <class Scalar>
761 class TpetraBlockCrsMatrix<Scalar, int, int, EpetraNode>
762  : public CrsMatrix<Scalar, int, int, EpetraNode> //, public TpetraRowMatrix<Scalar,int,int,Node>
763 {
764  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
765  typedef int LocalOrdinal;
766  typedef int GlobalOrdinal;
767  typedef EpetraNode Node;
772 
773  public:
775 
777  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
779  }
780 
782  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
784  }
785 
787  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
789  }
790 
792  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
794  }
795 
797  TpetraBlockCrsMatrix(const Teuchos::RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
799  }
800 
802  TpetraBlockCrsMatrix(const Teuchos::RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph, const LocalOrdinal blockSize) {
804  }
805 
807  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
809  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
810  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
811  const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "int", typeid(EpetraNode).name()); }
812 
814  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
816  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
817  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
818  const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "int", typeid(EpetraNode).name()); }
819 
821  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
823  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
824  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
825  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
826  const Teuchos::RCP<Teuchos::ParameterList> &params) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "int", typeid(EpetraNode).name()); }
827 
829  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
831  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
832  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
833  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
834  const Teuchos::RCP<Teuchos::ParameterList> &params) {
836  }
837 
840 
842 
844  void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
845 
847  void insertLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
848 
850  void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
851 
853  void replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
854 
856  void setAllToScalar(const Scalar &alpha) {}
857 
859  void scale(const Scalar &alpha) {}
860 
862  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
863  void allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
864 
866  void setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {}
867 
869  void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values) const {}
870 
872  void getAllValues(ArrayRCP<Scalar> &values) {}
873 
875 
877  void resumeFill(const RCP<ParameterList> &params = null) { /*noop*/
878  }
879 
881  void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) { /*noop*/
882  }
883 
885  void fillComplete(const RCP<ParameterList> &params = null) { /*noop*/
886  }
887 
889  void replaceDomainMapAndImporter(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newDomainMap, Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {}
890 
893  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
894  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = Teuchos::null,
895  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = Teuchos::null,
896  const RCP<ParameterList> &params = Teuchos::null) {}
897 
899 
901  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRowMap() const { return Teuchos::null; }
902 
904  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getColMap() const { return Teuchos::null; }
905 
907  RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getCrsGraph() const { return Teuchos::null; }
908 
910  global_size_t getGlobalNumRows() const { return 0; }
911 
913  global_size_t getGlobalNumCols() const { return 0; }
914 
916  size_t getLocalNumRows() const { return 0; }
917 
919  size_t getLocalNumCols() const { return 0; }
920 
922  global_size_t getGlobalNumEntries() const { return 0; }
923 
925  size_t getLocalNumEntries() const { return 0; }
926 
928  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
929 
931  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
932 
934  size_t getGlobalMaxNumRowEntries() const { return 0; }
935 
937  size_t getLocalMaxNumRowEntries() const { return 0; }
938 
940  bool isLocallyIndexed() const { return false; }
941 
943  bool isGloballyIndexed() const { return false; }
944 
946  bool isFillComplete() const { return false; }
947 
949  bool isFillActive() const { return false; }
950 
952  typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
953 
955  bool supportsRowViews() const { return false; }
956 
958  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView<LocalOrdinal> &Indices, const ArrayView<Scalar> &Values, size_t &NumEntries) const {}
959 
961  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
962 
964  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView<GlobalOrdinal> &indices, const ArrayView<Scalar> &values, size_t &numEntries) const {}
965 
967  void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
968 
970  bool haveGlobalConstants() const { return false; }
971 
973 
975  void apply(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &X, MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &Y, Teuchos::ETransp mode = Teuchos::NO_TRANS, Scalar alpha = ScalarTraits<Scalar>::one(), Scalar beta = ScalarTraits<Scalar>::zero()) const {}
976 
978  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const { return Teuchos::null; }
979 
981  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const { return Teuchos::null; }
982 
984 
986  std::string description() const { return std::string(""); }
987 
989  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
990 
993 
996 
998  void getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {}
999 
1001  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Teuchos::ArrayView<const size_t> &offsets) const {}
1002 
1004  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {}
1005 
1007 
1010 
1012 
1014  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
1015 
1019 
1023 
1027 
1031 
1032  void removeEmptyProcessesInPlace(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newMap) {}
1033 
1035 
1037  bool hasMatrix() const { return false; }
1038 
1040  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1042  }
1043 
1045  RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrix() const { return Teuchos::null; }
1046 
1048  RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrixNonConst() const { return Teuchos::null; }
1049 
1050 #ifdef HAVE_XPETRA_TPETRA
1052 
1054  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
1055  local_matrix_type ret;
1056  return ret; // make compiler happy
1057  }
1058 
1059  void setAllValues(const typename local_matrix_type::row_map_type &ptr,
1060  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1061  const typename local_matrix_type::values_type &val) {
1062  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
1063  }
1064 #endif // HAVE_XPETRA_TPETRA
1065 
1066 }; // TpetraBlockCrsMatrix class
1067 
1068 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
1069 
1070 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1071  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1072 
1073 // specialization of TpetraBlockCrsMatrix for GO=long long and Node=EpetraNode
1074 template <class Scalar>
1075 class TpetraBlockCrsMatrix<Scalar, int, long long, EpetraNode>
1076  : public CrsMatrix<Scalar, int, long long, EpetraNode> //, public TpetraRowMatrix<Scalar,int,int,Node>
1077 {
1078  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
1079  typedef int LocalOrdinal;
1080  typedef long long GlobalOrdinal;
1081  typedef EpetraNode Node;
1086 
1087  public:
1089 
1091  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1092 
1094  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1095 
1097  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1098 
1100  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1101 
1103  TpetraBlockCrsMatrix(const Teuchos::RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1104 
1107 
1109  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1111  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
1112  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
1113  const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1114 
1116  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1118  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
1119  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
1120  const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1121 
1123  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1124  const Import<LocalOrdinal, GlobalOrdinal, Node> &RowImporter,
1125  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
1126  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
1127  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1128  const Teuchos::RCP<Teuchos::ParameterList> &params) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1129 
1131  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1132  const Export<LocalOrdinal, GlobalOrdinal, Node> &RowExporter,
1133  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
1134  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
1135  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1136  const Teuchos::RCP<Teuchos::ParameterList> &params) { XPETRA_TPETRA_ETI_EXCEPTION(typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), typeid(TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, EpetraNode>).name(), "long long", typeid(EpetraNode).name()); }
1137 
1140 
1142 
1144  void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1145 
1147  void insertLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1148 
1150  void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1151 
1153  void replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1154 
1156  void setAllToScalar(const Scalar &alpha) {}
1157 
1159  void scale(const Scalar &alpha) {}
1160 
1162  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
1163  void allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
1164 
1166  void setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {}
1167 
1169  void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values) const {}
1170 
1172  void getAllValues(ArrayRCP<Scalar> &values) {}
1173 
1175 
1177  void resumeFill(const RCP<ParameterList> &params = null) { /*noop*/
1178  }
1179 
1181  void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) { /*noop*/
1182  }
1183 
1185  void fillComplete(const RCP<ParameterList> &params = null) { /*noop*/
1186  }
1187 
1189  void replaceDomainMapAndImporter(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newDomainMap, Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {}
1190 
1193  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1194  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = Teuchos::null,
1195  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = Teuchos::null,
1196  const RCP<ParameterList> &params = Teuchos::null) {}
1197 
1199 
1201  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRowMap() const { return Teuchos::null; }
1202 
1204  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getColMap() const { return Teuchos::null; }
1205 
1207  RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getCrsGraph() const { return Teuchos::null; }
1208 
1210  global_size_t getGlobalNumRows() const { return 0; }
1211 
1213  global_size_t getGlobalNumCols() const { return 0; }
1214 
1216  size_t getLocalNumRows() const { return 0; }
1217 
1219  size_t getLocalNumCols() const { return 0; }
1220 
1222  global_size_t getGlobalNumEntries() const { return 0; }
1223 
1225  size_t getLocalNumEntries() const { return 0; }
1226 
1228  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1229 
1231  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1232 
1234  size_t getGlobalMaxNumRowEntries() const { return 0; }
1235 
1237  size_t getLocalMaxNumRowEntries() const { return 0; }
1238 
1240  bool isLocallyIndexed() const { return false; }
1241 
1243  bool isGloballyIndexed() const { return false; }
1244 
1246  bool isFillComplete() const { return false; }
1247 
1249  bool isFillActive() const { return false; }
1250 
1252  typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
1253 
1255  bool supportsRowViews() const { return false; }
1256 
1258  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView<LocalOrdinal> &Indices, const ArrayView<Scalar> &Values, size_t &NumEntries) const {}
1259 
1261  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
1262 
1264  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView<GlobalOrdinal> &indices, const ArrayView<Scalar> &values, size_t &numEntries) const {}
1265 
1267  void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
1268 
1270  bool haveGlobalConstants() const { return true; }
1271 
1273 
1275  void apply(const MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &X, MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &Y, Teuchos::ETransp mode = Teuchos::NO_TRANS, Scalar alpha = ScalarTraits<Scalar>::one(), Scalar beta = ScalarTraits<Scalar>::zero()) const {}
1276 
1278  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const { return Teuchos::null; }
1279 
1281  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const { return Teuchos::null; }
1282 
1284 
1286  std::string description() const { return std::string(""); }
1287 
1289  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
1290 
1293 
1296 
1298  void getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {}
1299 
1301  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Teuchos::ArrayView<const size_t> &offsets) const {}
1302 
1304  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {}
1305 
1307 
1310 
1312 
1314  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
1315 
1319 
1323 
1327 
1331 
1332  void removeEmptyProcessesInPlace(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newMap) {}
1333 
1335 
1337  bool hasMatrix() const { return false; }
1338 
1340  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1342  }
1343 
1345  RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrix() const { return Teuchos::null; }
1346 
1348  RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrixNonConst() const { return Teuchos::null; }
1349 
1350 #ifdef HAVE_XPETRA_TPETRA
1352 
1354  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support getLocalMatrix due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
1355  local_matrix_type ret;
1356  TEUCHOS_UNREACHABLE_RETURN(ret);
1357  }
1358 
1359  void setAllValues(const typename local_matrix_type::row_map_type &ptr,
1360  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1361  const typename local_matrix_type::values_type &val) {
1362  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix does not support setAllValues due to missing Kokkos::CrsMatrix in Tpetra's experimental implementation in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
1363  }
1364 #endif // HAVE_XPETRA_TPETRA
1365 
1366 }; // TpetraBlockCrsMatrix class
1367 
1368 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1369 
1370 #endif // HAVE_XPETRA_EPETRA
1371 
1372 } // namespace Xpetra
1373 
1374 #endif // XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void replaceDiag(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
TpetraExport< LocalOrdinal, GlobalOrdinal, Node > TpetraExportClass
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
local_matrix_type::HostMirror getLocalMatrixHost() const
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using global IDs (not implemented)
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView< LocalOrdinal > &Indices, const ArrayView< Scalar > &Values, size_t &NumEntries) const
Extract a list of entries in a specified local row of the matrix. Put into storage allocated by calli...
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale operator with given vector values.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
bool hasMatrix() const
Does this have an underlying matrix.
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused import ( not implemented )
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and fixed number of entries for each row (not implemented) ...
void setObjectLabel(const std::string &objectLabel)
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
#define XPETRA_TPETRA_ETI_EXCEPTION(cl, obj, go, node)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Import (using an Exporter).
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
std::string description() const
A simple one-line description of this object.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
void fillComplete(const RCP< ParameterList > &params=null)
Signal that data entry is complete.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph &amp; blocksize.
size_t getLocalNumRows() const
Returns the number of matrix rows owned on the calling node.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Kokkos::View< const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
void scale(const Scalar &alpha)
Scale the current values of a matrix, this = alpha*this (not implemented)
virtual bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
TpetraBlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraBlockCrsMatrixClass
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented) ...
TpetraImport< LocalOrdinal, GlobalOrdinal, Node > TpetraImportClass
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > getCrsGraph() const
Returns the CrsGraph associated with this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented) ...
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
std::string description() const
A simple one-line description of this object.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag) const
Get a copy of the diagonal entries owned by this node, with local row idices.
std::string description() const
A simple one-line description of this object.
void setAllValues(const ArrayRCP< size_t > &rowptr, const ArrayRCP< LocalOrdinal > &colind, const ArrayRCP< Scalar > &values)
Sets the 1D pointer arrays of the graph (not impelmented)
RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrixNonConst() const
Get the underlying Tpetra matrix.
size_t getLocalNumCols() const
Returns the number of columns connected to the locally owned rows of this matrix. ...
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused export (not implemented(.
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused import (not implemented)
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
void setAllToScalar(const Scalar &alpha)
Set all matrix entries equal to scalarThis.
void rightScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Right scale matrix using the given vector entries.
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
global_size_t getGlobalNumCols() const
Number of global columns in the matrix.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused export (not implemented(.
#define XPETRA_DYNAMIC_CAST(type, obj, newObj, exceptionMsg)
size_t global_size_t
Global size_t object.
void getAllValues(ArrayRCP< Scalar > &values)
Gets the 1D pointer arrays of the graph (not implemented)
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
TpetraBlockCrsMatrix(const TpetraBlockCrsMatrix &matrix)
Deep copy constructor.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused export (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &colMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying column Map and number of entries in each row (not implemented) ...
void allocateAllValues(size_t numNonZeros, ArrayRCP< size_t > &rowptr, ArrayRCP< LocalOrdinal > &colind, ArrayRCP< Scalar > &values)
Allocates and returns ArrayRCPs of the Crs arrays — This is an Xpetra-only routine.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
bool isFillComplete() const
Returns true if the matrix is in compute mode, i.e. if fillComplete() has been called.
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
bool supportsRowViews() const
Returns true if getLocalRowView() and getGlobalRowView() are valid for this class.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Export< LocalOrdinal, GlobalOrdinal, Node > &exporter, CombineMode CM)
Export (using an Importer).
Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const
Implements DistObject interface.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale matrix using the given vector entries.
Tpetra::KokkosCompat::KokkosSerialWrapperNode EpetraNode
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying a previously constructed graph ( not implemented )
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap=Teuchos::null, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap=Teuchos::null, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor for a fused import (not implemented)
void doImport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &source, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Import.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
TpetraBlockCrsMatrix(const Teuchos::RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph, const LocalOrdinal blockSize)
Constructor specifying a previously constructed graph &amp; blocksize.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getTpetra_BlockCrsMatrix() const
Get the underlying Tpetra matrix.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView< const GlobalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of global indices in a specified row of the matrix.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
bool isLocallyIndexed() const
If matrix indices are in the local range, this function returns true. Otherwise, this function return...
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
void leftScale(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &x)
Left scale operator with given vector values.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
global_size_t getGlobalNumEntries() const
Returns the global number of entries in this matrix.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Map associated with the domain of this operator. This will be null until fillComplete() i...
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceDiag(const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag)
Replace the diagonal entries of the matrix.
TpetraVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TpetraVectorClass
void replaceLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using local IDs.
void fillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< ParameterList > &params=null)
Signal that data entry is complete, specifying domain and range maps.
void expertStaticFillComplete(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &importer=Teuchos::null, const RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > &exporter=Teuchos::null, const RCP< ParameterList > &params=Teuchos::null)
Expert static fill complete.
void setAllValues(const typename local_matrix_type::row_map_type &ptr, const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind, const typename local_matrix_type::values_type &val)
CombineMode
Xpetra::Combine Mode enumerable type.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getColMap() const
Returns the Map that describes the column distribution in this matrix.
void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView< const GlobalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Replace matrix entries, using global IDs (not implemented)
#define XPETRA_MONITOR(funcName)
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying fixed number of entries for each row (not implemented)
bool haveGlobalConstants() const
Returns true if globalConstants have been computed; false otherwise.
TpetraBlockCrsMatrix(const Teuchos::RCP< Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &mtx)
TpetraBlockCrsMatrix constructor to wrap a Tpetra::BlockCrsMatrix object.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Teuchos::ArrayView< const size_t > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
size_t getLocalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on this node.
bool isGloballyIndexed() const
If matrix indices are in the global range, this function returns true. Otherwise, this function retur...
size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const
Returns the current number of entries on this node in the specified local row.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void getLocalDiagOffsets(Teuchos::ArrayRCP< size_t > &offsets) const
Get offsets of the diagonal entries in the matrix.
size_t getLocalNumEntries() const
Returns the local number of entries in this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Export< LocalOrdinal, GlobalOrdinal, Node > &RowExporter, const Teuchos::RCP< const Export< LocalOrdinal, GlobalOrdinal, Node > > DomainExporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused export (not implemented)
void apply(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=ScalarTraits< Scalar >::one(), Scalar beta=ScalarTraits< Scalar >::zero()) const
Computes the sparse matrix-multivector multiplication.
size_t getGlobalMaxNumRowEntries() const
Returns the maximum number of entries across all rows/columns on all nodes.
KokkosSparse::CrsMatrix< impl_scalar_type, LocalOrdinal, execution_space, void, typename local_graph_type::size_type > local_matrix_type
The specialization of Kokkos::CrsMatrix that represents the part of the sparse matrix on each MPI pro...
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_matrix_type local_matrix_type
void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView< GlobalOrdinal > &indices, const ArrayView< Scalar > &values, size_t &numEntries) const
Extract a list of entries in a specified global row of this matrix. Put into pre-allocated storage...
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
global_size_t getGlobalNumRows() const
Number of global elements in the row map of this matrix.
TpetraBlockCrsMatrix(const Teuchos::RCP< const Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &sourceMatrix, const Import< LocalOrdinal, GlobalOrdinal, Node > &RowImporter, const Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > DomainImporter, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &domainMap, const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rangeMap, const Teuchos::RCP< Teuchos::ParameterList > &params)
Constructor for a fused import ( not implemented )
void getAllValues(ArrayRCP< const size_t > &rowptr, ArrayRCP< const LocalOrdinal > &colind, ArrayRCP< const Scalar > &values) const
Gets the 1D pointer arrays of the graph (not implemented)
void replaceDomainMapAndImporter(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newDomainMap, Teuchos::RCP< const Import< LocalOrdinal, GlobalOrdinal, Node > > &newImporter)
Replaces the current domainMap and importer with the user-specified objects.
bool isFillActive() const
Returns true if the matrix is in edit mode.
void doExport(const DistObject< char, LocalOrdinal, GlobalOrdinal, Node > &dest, const Import< LocalOrdinal, GlobalOrdinal, Node > &importer, CombineMode CM)
Export.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRowMap() const
Returns the Map that describes the row distribution in this matrix.
void insertLocalValues(LocalOrdinal localRow, const ArrayView< const LocalOrdinal > &cols, const ArrayView< const Scalar > &vals)
Insert matrix entries, using local IDs (not implemented)
void getLocalDiagCopy(Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &diag, const Kokkos::View< const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged > &offsets) const
Get a copy of the diagonal entries owned by this node, with local row indices.
const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Map associated with the range of this operator, which must be compatible with Y...
void getLocalRowView(LocalOrdinal LocalRow, ArrayView< const LocalOrdinal > &indices, ArrayView< const Scalar > &values) const
Extract a const, non-persisting view of local indices in a specified row of the matrix.
void resumeFill(const RCP< ParameterList > &params=null)
TpetraBlockCrsMatrix(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &rowMap, const ArrayRCP< const size_t > &NumEntriesPerRowToAlloc, const Teuchos::RCP< Teuchos::ParameterList > &params=Teuchos::null)
Constructor specifying (possibly different) number of entries in each row (not implemented) ...
size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const
Returns the current number of entries in the (locally owned) global row.
ScalarTraits< Scalar >::magnitudeType getFrobeniusNorm() const
Returns the Frobenius norm of the matrix.
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)