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 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
11 #define XPETRA_TPETRABLOCKCRSMATRIX_DEF_HPP
12 
14 #include "Xpetra_TpetraCrsGraph.hpp"
15 
16 namespace Xpetra {
17 
19 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
22  size_t maxNumEntriesPerRow,
23  const Teuchos::RCP<Teuchos::ParameterList> &params) {
24  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
25 }
26 
28 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
31  const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
32  const Teuchos::RCP<Teuchos::ParameterList> &params) {
33  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
34 }
35 
37 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
40  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
41  size_t maxNumEntriesPerRow,
42  const Teuchos::RCP<Teuchos::ParameterList> &params) {
43  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
44 }
45 
47 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
50  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &colMap,
51  const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc,
52  const Teuchos::RCP<Teuchos::ParameterList> &params) {
53  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
54 }
55 
57 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
60  const Teuchos::RCP<Teuchos::ParameterList> &params)
61 // : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node >(toTpetra(graph), params)))
62 // * there is no Tpetra::BlockCrsMatrix(graph, params) c'tor. We throw anyways here so no need to set mtx_.
63 {
64  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
65 }
66 
68 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
71  const LocalOrdinal blockSize)
72  : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*toTpetra(graph), blockSize))) {}
73 
75 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
78  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &pointDomainMap,
79  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &pointRangeMap,
80  const LocalOrdinal blockSize)
81  : mtx_(Teuchos::rcp(new Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>(*toTpetra(graph), *toTpetra(pointDomainMap), *toTpetra(pointRangeMap), blockSize))) {}
82 
84 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
86  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
88  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
89  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
90  const Teuchos::RCP<Teuchos::ParameterList> &params) {
91  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
92 }
93 
95 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
97  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
99  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
100  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
101  const Teuchos::RCP<Teuchos::ParameterList> &params) {
102  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
103 }
104 
106 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
108  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
110  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
111  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
112  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
113  const Teuchos::RCP<Teuchos::ParameterList> &params) {
114  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
115 }
116 
118 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
120  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
122  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
123  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
124  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
125  const Teuchos::RCP<Teuchos::ParameterList> &params) {
126  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
127 }
128 
130 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
133 
135 
137 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
139  insertGlobalValues(GlobalOrdinal globalRow,
140  const ArrayView<const GlobalOrdinal> &cols,
141  const ArrayView<const Scalar> &vals) {
142  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
143 }
144 
146 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
148  insertLocalValues(LocalOrdinal localRow,
149  const ArrayView<const LocalOrdinal> &cols,
150  const ArrayView<const Scalar> &vals) {
151  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
152 }
153 
155 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
157  replaceGlobalValues(GlobalOrdinal globalRow,
158  const ArrayView<const GlobalOrdinal> &cols,
159  const ArrayView<const Scalar> &vals) {
160  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in" + std::string(__FILE__) + ":" + std::to_string(__LINE__));
161 }
162 
164 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
166  replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {
167  XPETRA_MONITOR("TpetraBlockCrsMatrix::replaceLocalValues");
168  mtx_->replaceLocalValues(localRow, cols.getRawPtr(), vals.getRawPtr(), cols.size());
169 }
170 
172 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
174  setAllToScalar(const Scalar &alpha) {
175  XPETRA_MONITOR("TpetraBlockCrsMatrix::setAllToScalar");
176  mtx_->setAllToScalar(alpha);
177 }
178 
180 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
182  scale(const Scalar &alpha) {
183  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
184 }
185 
187 //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
188 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
190  allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {
191  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
192 }
193 
195 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
197  setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {
198  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
199 }
200 
202 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
204  getAllValues(ArrayRCP<const size_t> &rowptr,
205  ArrayRCP<const LocalOrdinal> &colind,
206  ArrayRCP<const Scalar> &values) const {
207  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
208 }
209 
211 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
213  getAllValues(ArrayRCP<Scalar> &values) {
214  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
215 }
216 
218 
219 // Transformational Methods
221 
222 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
224  resumeFill(const RCP<ParameterList> &params) {
225  /*noop*/
226 }
227 
228 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
231  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
232  const RCP<ParameterList> &params) {
233  /*noop*/
234 }
235 
236 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
238  fillComplete(const RCP<ParameterList> &params) {
239  /*noop*/
240 }
241 
242 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
245  Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {
246  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
247 }
248 
249 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
252  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
253  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer,
254  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter,
255  const RCP<ParameterList> &params) {
256  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
257 }
258 
260 
262 
263 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
264 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
266  getRowMap() const {
267  XPETRA_MONITOR("TpetraBlockCrsMatrix::getRowMap");
268  return toXpetra(mtx_->getRowMap());
269 }
270 
271 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
272 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
274  getColMap() const {
275  XPETRA_MONITOR("TpetraBlockCrsMatrix::getColMap");
276  return toXpetra(mtx_->getColMap());
277 }
278 
279 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
280 RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> >
282  getCrsGraph() const {
283  XPETRA_MONITOR("TpetraBlockCrsMatrix::getCrsGraph");
284  using G_t = Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>;
286  RCP<G_t> t_graph = Teuchos::rcp_const_cast<G_t>(Teuchos::rcpFromRef(mtx_->getCrsGraph()));
287  RCP<const G_x> x_graph = rcp(new G_x(t_graph));
288  return x_graph;
289 }
290 
291 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
295  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumRows");
296  return mtx_->getGlobalNumRows();
297 }
298 
299 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
303  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumCols");
304  return mtx_->getGlobalNumCols();
305 }
306 
307 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
308 size_t
311  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumRows");
312  return mtx_->getLocalNumRows();
313 }
314 
315 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
316 size_t
319  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumCols");
320  return mtx_->getLocalNumCols();
321 }
322 
323 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
327  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalNumEntries");
328  return mtx_->getGlobalNumEntries();
329 }
330 
331 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
332 size_t
335  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalNumEntries");
336  return mtx_->getLocalNumEntries();
337 }
338 
339 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
340 size_t
342  getNumEntriesInLocalRow(LocalOrdinal localRow) const {
343  XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInLocalRow");
344  return mtx_->getNumEntriesInLocalRow(localRow);
345 }
346 
347 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
348 size_t
350  getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const {
351  XPETRA_MONITOR("TpetraBlockCrsMatrix::getNumEntriesInGlobalRow");
352  return mtx_->getNumEntriesInGlobalRow(globalRow);
353 }
354 
355 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
357  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalMaxNumRowEntries");
358  return mtx_->getGlobalMaxNumRowEntries();
359 }
360 
361 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
363  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalMaxNumRowEntries");
364  return mtx_->getLocalMaxNumRowEntries();
365 }
366 
367 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
369  XPETRA_MONITOR("TpetraBlockCrsMatrix::isLocallyIndexed");
370  return mtx_->isLocallyIndexed();
371 }
372 
373 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
375  XPETRA_MONITOR("TpetraBlockCrsMatrix::isGloballyIndexed");
376  return mtx_->isGloballyIndexed();
377 }
378 
379 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
381  XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillComplete");
382  return mtx_->isFillComplete();
383 }
384 
385 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
387  XPETRA_MONITOR("TpetraBlockCrsMatrix::isFillActive");
388  return false;
389 }
390 
391 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
392 typename ScalarTraits<Scalar>::magnitudeType TpetraBlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::getFrobeniusNorm() const {
393  XPETRA_MONITOR("TpetraBlockCrsMatrix::getFrobeniusNorm");
394  return mtx_->getFrobeniusNorm();
395 }
396 
397 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
399  XPETRA_MONITOR("TpetraBlockCrsMatrix::supportsRowViews");
400  return mtx_->supportsRowViews();
401 }
402 
403 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
405  getLocalRowCopy(LocalOrdinal LocalRow,
406  const ArrayView<LocalOrdinal> &Indices,
407  const ArrayView<Scalar> &Values,
408  size_t &NumEntries) const {
409  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowCopy");
410  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_local_inds_host_view_type indices("indices", Indices.size());
411  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values("values", Values.size());
412 
413  mtx_->getLocalRowCopy(LocalRow, indices, values, NumEntries);
414  for (size_t i = 0; i < NumEntries; ++i) {
415  Indices[i] = indices(i);
416  Values[i] = values(i);
417  }
418 }
419 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
421  getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &Indices,
422  ArrayView<const Scalar> &Values) const {
423  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalRowView");
424  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::local_inds_host_view_type indices;
425  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
426 
427  mtx_->getLocalRowView(LocalRow, indices, values);
428  Indices = ArrayView<const LocalOrdinal>(indices.data(), indices.extent(0));
429  Values = ArrayView<const Scalar>(reinterpret_cast<const Scalar *>(values.data()), values.extent(0));
430 }
431 
432 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
434  getGlobalRowView(GlobalOrdinal GlobalRow,
435  ArrayView<const GlobalOrdinal> &Indices,
436  ArrayView<const Scalar> &Values) const {
437  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowView");
438  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::global_inds_host_view_type indices;
439  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::values_host_view_type values;
440 
441  mtx_->getGlobalRowView(GlobalRow, indices, values);
442  Indices = ArrayView<const GlobalOrdinal>(indices.data(), indices.extent(0));
443  Values = ArrayView<const Scalar>(reinterpret_cast<const Scalar *>(values.data()), values.extent(0));
444 }
445 
446 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
448  getGlobalRowCopy(GlobalOrdinal GlobalRow,
449  const ArrayView<GlobalOrdinal> &Indices,
450  const ArrayView<Scalar> &Values,
451  size_t &NumEntries) const {
452  XPETRA_MONITOR("TpetraBlockCrsMatrix::getGlobalRowCopy");
453  typename Tpetra::CrsGraph<LocalOrdinal, GlobalOrdinal, Node>::nonconst_global_inds_host_view_type indices("indices", Indices.size());
454  typename Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::nonconst_values_host_view_type values("values", Values.size());
455 
456  mtx_->getGlobalRowCopy(GlobalRow, indices, values, NumEntries);
457  for (size_t i = 0; i < NumEntries; ++i) {
458  Indices[i] = indices(i);
459  Values[i] = values(i);
460  }
461 }
462 
463 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
465  haveGlobalConstants() const { return true; }
466 
467 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
471  Teuchos::ETransp mode,
472  Scalar alpha,
473  Scalar beta) const {
474  XPETRA_MONITOR("TpetraBlockCrsMatrix::apply");
475  mtx_->apply(toTpetra(X), toTpetra(Y), mode, alpha, beta);
476 }
477 
478 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
482  Teuchos::ETransp mode,
483  Scalar alpha,
484  Scalar beta,
485  bool sumInterfaceValues,
486  const RCP<Import<LocalOrdinal, GlobalOrdinal, Node> > &regionInterfaceImporter,
487  const Teuchos::ArrayRCP<LocalOrdinal> &regionInterfaceLIDs) const {}
488 
489 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
490 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
492  getDomainMap() const {
493  XPETRA_MONITOR("TpetraBlockCrsMatrix::getDomainMap");
494  return toXpetra(mtx_->getDomainMap());
495 }
496 
497 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
498 const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
500  getRangeMap() const {
501  XPETRA_MONITOR("TpetraBlockCrsMatrix::getRangeMap");
502  return toXpetra(mtx_->getRangeMap());
503 }
504 
505 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
506 std::string
508  description() const {
509  XPETRA_MONITOR("TpetraBlockCrsMatrix::description");
510  return mtx_->description();
511 }
512 
513 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
515  describe(Teuchos::FancyOStream &out,
516  const Teuchos::EVerbosityLevel verbLevel) const {
517  XPETRA_MONITOR("TpetraBlockCrsMatrix::describe");
518  mtx_->describe(out, verbLevel);
519 }
520 
521 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
523  setObjectLabel(const std::string &objectLabel) {
524  XPETRA_MONITOR("TpetraCrsMatrix::setObjectLabel");
525  Teuchos::LabeledObject::setObjectLabel(objectLabel);
526  mtx_->setObjectLabel(objectLabel);
527 }
528 
529 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
532  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagCopy");
534  diag,
535  tDiag,
536  "Xpetra::TpetraBlockCrsMatrix.getLocalDiagCopy() only accept Xpetra::TpetraVector as input arguments.");
537  mtx_->getLocalDiagCopy(*tDiag.getTpetra_Vector());
538 }
539 
541 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
544  const Teuchos::ArrayView<const size_t> &offsets) const {
545  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
546 }
547 
549 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
552  const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {
553  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
554 }
555 
556 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
558  getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {
559  XPETRA_MONITOR("TpetraBlockCrsMatrix::getLocalDiagOffsets");
560 
561  const size_t lclNumRows = mtx_->getGraph()->getLocalNumRows();
562  if (static_cast<size_t>(offsets.size()) < lclNumRows) {
563  offsets.resize(lclNumRows);
564  }
565 
566  // The input ArrayRCP must always be a host pointer. Thus, if
567  // device_type::memory_space is Kokkos::HostSpace, it's OK for us
568  // to write to that allocation directly as a Kokkos::View.
569  typedef typename Node::device_type device_type;
570  typedef typename device_type::memory_space memory_space;
571  if (std::is_same<memory_space, Kokkos::HostSpace>::value) {
572  // It is always syntactically correct to assign a raw host
573  // pointer to a device View, so this code will compile correctly
574  // even if this branch never runs.
575  typedef Kokkos::View<size_t *, device_type, Kokkos::MemoryUnmanaged> output_type;
576  output_type offsetsOut(offsets.getRawPtr(), offsets.size());
577  mtx_->getLocalDiagOffsets(offsetsOut);
578  } else {
579  Kokkos::View<size_t *, device_type> offsetsTmp("diagOffsets", offsets.size());
580  mtx_->getLocalDiagOffsets(offsetsTmp);
581  typedef Kokkos::View<size_t *, Kokkos::HostSpace, Kokkos::MemoryUnmanaged> output_type;
582  output_type offsetsOut(offsets.getRawPtr(), offsets.size());
583  Kokkos::deep_copy(offsetsOut, offsetsTmp);
584  }
585 }
586 
587 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
590  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix::replaceDiag: function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
591 }
592 
593 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
596  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
597 }
598 
599 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
602  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
603 }
604 
605 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
606 Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >
608  getMap() const {
609  XPETRA_MONITOR("TpetraBlockCrsMatrix::getMap");
610  return rcp(new TpetraMap<LocalOrdinal, GlobalOrdinal, Node>(mtx_->getMap()));
611 }
612 
614 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
618  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
619 }
620 
622 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
626  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
627 }
628 
630 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
634  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
635 }
636 
638 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
642  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
643 }
644 
645 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
648  throw std::runtime_error("Xpetra::TpetraBlockCrsMatrix function not implemented in " + std::string(__FILE__) + ":" + std::to_string(__LINE__));
649 }
650 
651 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
653  hasMatrix() const {
654  return !mtx_.is_null();
655 }
656 
657 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
659  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx)
660  : mtx_(mtx) {}
661 
662 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
663 RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
666  return mtx_;
667 }
668 
669 // TODO: remove
670 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
671 RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
674  return mtx_;
675 }
676 
677 #ifdef HAVE_XPETRA_TPETRA
678 
679 // was: typedef typename Xpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type local_matrix_type;
680 // using local_matrix_type = typename CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>::local_matrix_type;
681 
682 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
686  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__));
687 
688 #ifndef __NVCC__
689  local_matrix_type ret;
690 #endif // __NVCC__
691 
692  TEUCHOS_UNREACHABLE_RETURN(ret);
693 }
694 
695 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
699  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__));
700 
701 #ifndef __NVCC__
702  typename local_matrix_type::HostMirror ret;
703 #endif // __NVCC__
704 
705  TEUCHOS_UNREACHABLE_RETURN(ret);
706 }
707 
708 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
710  setAllValues(const typename local_matrix_type::row_map_type &ptr,
711  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
712  const typename local_matrix_type::values_type &val) {
713  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__));
714 }
715 
716 #endif // HAVE_XPETRA_TPETRA
717 
718 #ifdef HAVE_XPETRA_EPETRA
719 
720 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT))) || \
721  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_INT))))
722 
723 // specialization of TpetraBlockCrsMatrix for GO=LO=int and Node=EpetraNode
724 template <class Scalar>
725 class TpetraBlockCrsMatrix<Scalar, int, int, EpetraNode>
726  : public CrsMatrix<Scalar, int, int, EpetraNode> //, public TpetraRowMatrix<Scalar,int,int,Node>
727 {
728  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
729  typedef int LocalOrdinal;
730  typedef int GlobalOrdinal;
731  typedef EpetraNode Node;
736 
737  public:
739 
741  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, size_t maxNumEntriesPerRow, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
743  }
744 
746  TpetraBlockCrsMatrix(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rowMap, const ArrayRCP<const size_t> &NumEntriesPerRowToAlloc, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
748  }
749 
751  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) {
753  }
754 
756  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) {
758  }
759 
761  TpetraBlockCrsMatrix(const Teuchos::RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph, const Teuchos::RCP<Teuchos::ParameterList> &params = Teuchos::null) {
763  }
764 
766  TpetraBlockCrsMatrix(const Teuchos::RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > &graph, const LocalOrdinal blockSize) {
768  }
769 
771  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
773  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
774  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
775  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()); }
776 
778  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
780  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
781  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
782  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()); }
783 
785  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
787  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
788  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
789  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
790  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()); }
791 
793  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
795  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
796  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
797  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
798  const Teuchos::RCP<Teuchos::ParameterList> &params) {
800  }
801 
804 
806 
808  void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
809 
811  void insertLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
812 
814  void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
815 
817  void replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
818 
820  void setAllToScalar(const Scalar &alpha) {}
821 
823  void scale(const Scalar &alpha) {}
824 
826  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
827  void allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
828 
830  void setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {}
831 
833  void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values) const {}
834 
836  void getAllValues(ArrayRCP<Scalar> &values) {}
837 
839 
841  void resumeFill(const RCP<ParameterList> &params = null) { /*noop*/
842  }
843 
845  void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) { /*noop*/
846  }
847 
849  void fillComplete(const RCP<ParameterList> &params = null) { /*noop*/
850  }
851 
853  void replaceDomainMapAndImporter(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newDomainMap, Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {}
854 
857  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
858  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = Teuchos::null,
859  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = Teuchos::null,
860  const RCP<ParameterList> &params = Teuchos::null) {}
861 
863 
865  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRowMap() const { return Teuchos::null; }
866 
868  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getColMap() const { return Teuchos::null; }
869 
871  RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getCrsGraph() const { return Teuchos::null; }
872 
874  global_size_t getGlobalNumRows() const { return 0; }
875 
877  global_size_t getGlobalNumCols() const { return 0; }
878 
880  size_t getLocalNumRows() const { return 0; }
881 
883  size_t getLocalNumCols() const { return 0; }
884 
886  global_size_t getGlobalNumEntries() const { return 0; }
887 
889  size_t getLocalNumEntries() const { return 0; }
890 
892  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
893 
895  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
896 
898  size_t getGlobalMaxNumRowEntries() const { return 0; }
899 
901  size_t getLocalMaxNumRowEntries() const { return 0; }
902 
904  bool isLocallyIndexed() const { return false; }
905 
907  bool isGloballyIndexed() const { return false; }
908 
910  bool isFillComplete() const { return false; }
911 
913  bool isFillActive() const { return false; }
914 
916  typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
917 
919  bool supportsRowViews() const { return false; }
920 
922  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView<LocalOrdinal> &Indices, const ArrayView<Scalar> &Values, size_t &NumEntries) const {}
923 
925  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
926 
928  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView<GlobalOrdinal> &indices, const ArrayView<Scalar> &values, size_t &numEntries) const {}
929 
931  void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
932 
934  bool haveGlobalConstants() const { return false; }
935 
937 
939  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 {}
940 
942  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const { return Teuchos::null; }
943 
945  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const { return Teuchos::null; }
946 
948 
950  std::string description() const { return std::string(""); }
951 
953  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
954 
957 
960 
962  void getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {}
963 
965  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Teuchos::ArrayView<const size_t> &offsets) const {}
966 
968  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {}
969 
971 
974 
976 
978  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
979 
983 
987 
991 
995 
996  void removeEmptyProcessesInPlace(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newMap) {}
997 
999 
1001  bool hasMatrix() const { return false; }
1002 
1004  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1006  }
1007 
1009  RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrix() const { return Teuchos::null; }
1010 
1012  RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrixNonConst() const { return Teuchos::null; }
1013 
1014 #ifdef HAVE_XPETRA_TPETRA
1016 
1018  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__));
1019  local_matrix_type ret;
1020  return ret; // make compiler happy
1021  }
1022 
1023  void setAllValues(const typename local_matrix_type::row_map_type &ptr,
1024  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1025  const typename local_matrix_type::values_type &val) {
1026  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__));
1027  }
1028 #endif // HAVE_XPETRA_TPETRA
1029 
1030 }; // TpetraBlockCrsMatrix class
1031 
1032 #endif // #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_INT)))
1033 
1034 #if ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))) || \
1035  (!defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_SERIAL) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG))))
1036 
1037 // specialization of TpetraBlockCrsMatrix for GO=long long and Node=EpetraNode
1038 template <class Scalar>
1039 class TpetraBlockCrsMatrix<Scalar, int, long long, EpetraNode>
1040  : public CrsMatrix<Scalar, int, long long, EpetraNode> //, public TpetraRowMatrix<Scalar,int,int,Node>
1041 {
1042  // The following typedef are used by the XPETRA_DYNAMIC_CAST() macro.
1043  typedef int LocalOrdinal;
1044  typedef long long GlobalOrdinal;
1045  typedef EpetraNode Node;
1050 
1051  public:
1053 
1055  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()); }
1056 
1058  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()); }
1059 
1061  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()); }
1062 
1064  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()); }
1065 
1067  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()); }
1068 
1071 
1073  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1075  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
1076  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
1077  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()); }
1078 
1080  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1082  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap = Teuchos::null,
1083  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap = Teuchos::null,
1084  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()); }
1085 
1087  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1088  const Import<LocalOrdinal, GlobalOrdinal, Node> &RowImporter,
1089  const Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > DomainImporter,
1090  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
1091  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1092  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()); }
1093 
1095  TpetraBlockCrsMatrix(const Teuchos::RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &sourceMatrix,
1096  const Export<LocalOrdinal, GlobalOrdinal, Node> &RowExporter,
1097  const Teuchos::RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > DomainExporter,
1098  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap,
1099  const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1100  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()); }
1101 
1104 
1106 
1108  void insertGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1109 
1111  void insertLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1112 
1114  void replaceGlobalValues(GlobalOrdinal globalRow, const ArrayView<const GlobalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1115 
1117  void replaceLocalValues(LocalOrdinal localRow, const ArrayView<const LocalOrdinal> &cols, const ArrayView<const Scalar> &vals) {}
1118 
1120  void setAllToScalar(const Scalar &alpha) {}
1121 
1123  void scale(const Scalar &alpha) {}
1124 
1126  //** \warning This is an expert-only routine and should not be called from user code. (not implemented)
1127  void allocateAllValues(size_t numNonZeros, ArrayRCP<size_t> &rowptr, ArrayRCP<LocalOrdinal> &colind, ArrayRCP<Scalar> &values) {}
1128 
1130  void setAllValues(const ArrayRCP<size_t> &rowptr, const ArrayRCP<LocalOrdinal> &colind, const ArrayRCP<Scalar> &values) {}
1131 
1133  void getAllValues(ArrayRCP<const size_t> &rowptr, ArrayRCP<const LocalOrdinal> &colind, ArrayRCP<const Scalar> &values) const {}
1134 
1136  void getAllValues(ArrayRCP<Scalar> &values) {}
1137 
1139 
1141  void resumeFill(const RCP<ParameterList> &params = null) { /*noop*/
1142  }
1143 
1145  void fillComplete(const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &domainMap, const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap, const RCP<ParameterList> &params = null) { /*noop*/
1146  }
1147 
1149  void fillComplete(const RCP<ParameterList> &params = null) { /*noop*/
1150  }
1151 
1153  void replaceDomainMapAndImporter(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newDomainMap, Teuchos::RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &newImporter) {}
1154 
1157  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &rangeMap,
1158  const RCP<const Import<LocalOrdinal, GlobalOrdinal, Node> > &importer = Teuchos::null,
1159  const RCP<const Export<LocalOrdinal, GlobalOrdinal, Node> > &exporter = Teuchos::null,
1160  const RCP<ParameterList> &params = Teuchos::null) {}
1161 
1163 
1165  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRowMap() const { return Teuchos::null; }
1166 
1168  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getColMap() const { return Teuchos::null; }
1169 
1171  RCP<const CrsGraph<LocalOrdinal, GlobalOrdinal, Node> > getCrsGraph() const { return Teuchos::null; }
1172 
1174  global_size_t getGlobalNumRows() const { return 0; }
1175 
1177  global_size_t getGlobalNumCols() const { return 0; }
1178 
1180  size_t getLocalNumRows() const { return 0; }
1181 
1183  size_t getLocalNumCols() const { return 0; }
1184 
1186  global_size_t getGlobalNumEntries() const { return 0; }
1187 
1189  size_t getLocalNumEntries() const { return 0; }
1190 
1192  size_t getNumEntriesInLocalRow(LocalOrdinal localRow) const { return 0; }
1193 
1195  size_t getNumEntriesInGlobalRow(GlobalOrdinal globalRow) const { return 0; }
1196 
1198  size_t getGlobalMaxNumRowEntries() const { return 0; }
1199 
1201  size_t getLocalMaxNumRowEntries() const { return 0; }
1202 
1204  bool isLocallyIndexed() const { return false; }
1205 
1207  bool isGloballyIndexed() const { return false; }
1208 
1210  bool isFillComplete() const { return false; }
1211 
1213  bool isFillActive() const { return false; }
1214 
1216  typename ScalarTraits<Scalar>::magnitudeType getFrobeniusNorm() const { return Teuchos::ScalarTraits<Scalar>::magnitude(Teuchos::ScalarTraits<Scalar>::zero()); }
1217 
1219  bool supportsRowViews() const { return false; }
1220 
1222  void getLocalRowCopy(LocalOrdinal LocalRow, const ArrayView<LocalOrdinal> &Indices, const ArrayView<Scalar> &Values, size_t &NumEntries) const {}
1223 
1225  void getGlobalRowView(GlobalOrdinal GlobalRow, ArrayView<const GlobalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
1226 
1228  void getGlobalRowCopy(GlobalOrdinal GlobalRow, const ArrayView<GlobalOrdinal> &indices, const ArrayView<Scalar> &values, size_t &numEntries) const {}
1229 
1231  void getLocalRowView(LocalOrdinal LocalRow, ArrayView<const LocalOrdinal> &indices, ArrayView<const Scalar> &values) const {}
1232 
1234  bool haveGlobalConstants() const { return true; }
1235 
1237 
1239  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 {}
1240 
1242  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getDomainMap() const { return Teuchos::null; }
1243 
1245  const RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getRangeMap() const { return Teuchos::null; }
1246 
1248 
1250  std::string description() const { return std::string(""); }
1251 
1253  void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel = Teuchos::Describable::verbLevel_default) const {}
1254 
1257 
1260 
1262  void getLocalDiagOffsets(Teuchos::ArrayRCP<size_t> &offsets) const {}
1263 
1265  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Teuchos::ArrayView<const size_t> &offsets) const {}
1266 
1268  void getLocalDiagCopy(Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> &diag, const Kokkos::View<const size_t *, typename Node::device_type, Kokkos::MemoryUnmanaged> &offsets) const {}
1269 
1271 
1274 
1276 
1278  Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > getMap() const { return Teuchos::null; }
1279 
1283 
1287 
1291 
1295 
1296  void removeEmptyProcessesInPlace(const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> > &newMap) {}
1297 
1299 
1301  bool hasMatrix() const { return false; }
1302 
1304  TpetraBlockCrsMatrix(const Teuchos::RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > &mtx) {
1306  }
1307 
1309  RCP<const Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrix() const { return Teuchos::null; }
1310 
1312  RCP<Tpetra::BlockCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > getTpetra_BlockCrsMatrixNonConst() const { return Teuchos::null; }
1313 
1314 #ifdef HAVE_XPETRA_TPETRA
1316 
1318  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__));
1319  local_matrix_type ret;
1320  TEUCHOS_UNREACHABLE_RETURN(ret);
1321  }
1322 
1323  void setAllValues(const typename local_matrix_type::row_map_type &ptr,
1324  const typename local_matrix_type::StaticCrsGraphType::entries_type::non_const_type &ind,
1325  const typename local_matrix_type::values_type &val) {
1326  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__));
1327  }
1328 #endif // HAVE_XPETRA_TPETRA
1329 
1330 }; // TpetraBlockCrsMatrix class
1331 
1332 #endif // IF ((defined(EPETRA_HAVE_OMP) && (!defined(HAVE_TPETRA_INST_OPENMP) || !defined(HAVE_TPETRA_INST_INT_LONG_LONG)))
1333 
1334 #endif // HAVE_XPETRA_EPETRA
1335 
1336 } // namespace Xpetra
1337 
1338 #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)