Tpetra Matrix/Vector Services  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Tpetra_MultiVector_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Tpetra: Templated Linear Algebra Services Package
5 // Copyright (2008) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ************************************************************************
40 // @HEADER
41 
42 #ifndef TPETRA_MULTIVECTOR_DECL_HPP
43 #define TPETRA_MULTIVECTOR_DECL_HPP
44 
45 #include <Teuchos_DataAccess.hpp>
46 #include <Teuchos_Range1D.hpp>
47 #include "Tpetra_ConfigDefs.hpp"
48 #include "Tpetra_DistObject.hpp"
49 #include "Tpetra_ViewAccepter.hpp"
50 #include <Kokkos_MultiVector.hpp>
51 #include <Teuchos_BLAS_types.hpp>
52 
53 namespace Kokkos {
54 #ifndef DOXYGEN_SHOULD_SKIP_THIS
55  // forward declaration of DefaultArithmetic
56  template<class KokkosMultiVectorType>
57  class DefaultArithmetic;
58 #endif // DOXYGEN_SHOULD_SKIP_THIS
59 } // namespace Kokkos
60 
61 namespace Tpetra {
62 
63 #ifndef DOXYGEN_SHOULD_SKIP_THIS
64  // forward declaration of Vector, needed to prevent circular inclusions
65  template<class S, class LO, class GO, class N> class Vector;
66 
67  // forward declaration of Map
68  template<class LO, class GO, class N> class Map;
69 #endif // DOXYGEN_SHOULD_SKIP_THIS
70 
319  template<class Scalar,
320  class LocalOrdinal=int,
321  class GlobalOrdinal=LocalOrdinal,
322  class Node=Kokkos::DefaultNode::DefaultNodeType>
323  class MultiVector :
324  public DistObject<Scalar, LocalOrdinal, GlobalOrdinal, Node>
325  {
326  public:
328 
329 
331  typedef Scalar scalar_type;
333  typedef LocalOrdinal local_ordinal_type;
335  typedef GlobalOrdinal global_ordinal_type;
337  typedef Node node_type;
338 
340 
342 
349  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
350  size_t NumVectors,
351  bool zeroOut=true);
352 
355 
371  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
372  const Teuchos::ArrayView<const Scalar>& A,
373  size_t LDA,
374  size_t NumVectors);
375 
389  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
390  const Teuchos::ArrayView<const Teuchos::ArrayView<const Scalar> >&ArrayOfPtrs,
391  size_t NumVectors);
392 
394  virtual ~MultiVector();
395 
397 
399 
408  void
409  replaceGlobalValue (GlobalOrdinal globalRow,
410  size_t vectorIndex,
411  const Scalar &value);
412 
421  void
422  sumIntoGlobalValue (GlobalOrdinal globalRow,
423  size_t vectorIndex,
424  const Scalar &value);
425 
434  void
435  replaceLocalValue (LocalOrdinal myRow,
436  size_t vectorIndex,
437  const Scalar &value);
438 
447  void
448  sumIntoLocalValue (LocalOrdinal myRow,
449  size_t vectorIndex,
450  const Scalar &value);
451 
453  void putScalar (const Scalar &value);
454 
470  void randomize();
471 
537  void replaceMap (const RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map);
538 
545  void reduce();
546 
563 
565 
567 
575 
577  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
578  subCopy (const Teuchos::Range1D &colRng) const;
579 
581  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
582  subCopy (const Teuchos::ArrayView<const size_t> &cols) const;
583 
585  Teuchos::RCP<const MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
586  subView (const Teuchos::Range1D &colRng) const;
587 
589  Teuchos::RCP<const MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
590  subView (const Teuchos::ArrayView<const size_t> &cols) const;
591 
593  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
594  subViewNonConst (const Teuchos::Range1D &colRng);
595 
597  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
598  subViewNonConst (const Teuchos::ArrayView<const size_t> &cols);
599 
601 
612  Teuchos::RCP<const MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
613  offsetView (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& subMap,
614  size_t offset) const;
615 
617 
628  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
629  offsetViewNonConst (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> > &subMap,
630  size_t offset);
631 
633  Teuchos::RCP<const Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
634  getVector (size_t j) const;
635 
637  Teuchos::RCP<Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
638  getVectorNonConst (size_t j);
639 
641  Teuchos::ArrayRCP<const Scalar> getData(size_t j) const;
642 
644  Teuchos::ArrayRCP<Scalar> getDataNonConst(size_t j);
645 
652  void get1dCopy (Teuchos::ArrayView<Scalar> A, size_t LDA) const;
653 
659  void get2dCopy (Teuchos::ArrayView<const Teuchos::ArrayView<Scalar> > ArrayOfPtrs) const;
660 
666  Teuchos::ArrayRCP<const Scalar> get1dView() const;
667 
669  Teuchos::ArrayRCP<Teuchos::ArrayRCP<const Scalar> > get2dView() const;
670 
676  Teuchos::ArrayRCP<Scalar> get1dViewNonConst();
677 
679  Teuchos::ArrayRCP<Teuchos::ArrayRCP<Scalar> > get2dViewNonConst();
680 
682  const Kokkos::MultiVector<Scalar,Node> & getLocalMV() const;
683 
685  Kokkos::MultiVector<Scalar,Node> & getLocalMVNonConst();
686 
688 
690 
691 
693  void dot(const MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &A, const Teuchos::ArrayView<Scalar> &dots) const;
694 
697 
700 
708  void scale (const Scalar &alpha);
709 
718  void scale (Teuchos::ArrayView<const Scalar> alpha);
719 
728  void
729  scale (const Scalar& alpha,
731 
738  void
739  update (const Scalar& alpha,
741  const Scalar& beta);
742 
749  void
750  update (const Scalar& alpha,
752  const Scalar& beta,
754  const Scalar& gamma);
755 
757  void norm1(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const;
758 
761  void norm2(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const;
762 
764  void normInf(const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const;
765 
768  void normWeighted(const MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> &weights, const Teuchos::ArrayView<typename Teuchos::ScalarTraits<Scalar>::magnitudeType> &norms) const;
769 
772  void meanValue(const Teuchos::ArrayView<Scalar> &means) const;
773 
779  void
780  multiply (Teuchos::ETransp transA,
781  Teuchos::ETransp transB,
782  const Scalar& alpha,
785  const Scalar& beta);
786 
799  void
800  elementWiseMultiply (Scalar scalarAB,
803  Scalar scalarThis);
805 
807 
809  size_t getNumVectors() const;
810 
812  size_t getLocalLength() const;
813 
816 
822  size_t getStride() const;
823 
827  bool isConstantStride() const;
828 
830 
832 
833 
835  virtual std::string description() const;
836 
865  virtual void
866  describe (Teuchos::FancyOStream& out,
867  const Teuchos::EVerbosityLevel verbLevel =
868  Teuchos::Describable::verbLevel_default) const;
870 
884  virtual void
885  removeEmptyProcessesInPlace (const Teuchos::RCP<const Map<LocalOrdinal, GlobalOrdinal, Node> >& newMap);
886 
887  protected:
888 
889  typedef Kokkos::MultiVector<Scalar,Node> KMV;
890  typedef Kokkos::DefaultArithmetic<KMV> MVT;
891 
893  KMV lclMV_;
894 
907  Array<size_t> whichVectors_;
908 
910 
911 
912  template <class S,class LO,class GO,class N>
913  friend RCP<MultiVector<S,LO,GO,N> >
914  createMultiVectorFromView (const Teuchos::RCP<const Map<LO,GO,N> >&, const Teuchos::ArrayRCP<S>&, size_t, size_t);
915 
925  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
926  const Teuchos::ArrayRCP<Scalar>& view,
927  size_t LDA,
928  size_t NumVectors,
929  EPrivateHostViewConstructor /* dummy */);
930 
931  bool vectorIndexOutOfRange (size_t VectorIndex) const;
932 
938  template <class T>
939  ArrayRCP<T> getSubArrayRCP(ArrayRCP<T> arr, size_t j) const;
940 
942  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
943  Teuchos::ArrayRCP<Scalar> data,
944  size_t LDA,
945  Teuchos::ArrayView<const size_t> whichVectors,
946  EPrivateComputeViewConstructor /* dummy */);
947 
949  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
950  Teuchos::ArrayRCP<Scalar> data,
951  size_t LDA,
952  size_t NumVectors,
953  EPrivateComputeViewConstructor /* dummy */);
954 
962  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
963  const Kokkos::MultiVector<Scalar, Node>& localMultiVector,
964  EPrivateComputeViewConstructor /* dummy */);
965 
973  MultiVector (const Teuchos::RCP<const Map<LocalOrdinal,GlobalOrdinal,Node> >& map,
974  const Kokkos::MultiVector<Scalar, Node>& localMultiVector,
975  Teuchos::ArrayView<const size_t> whichVectors,
976  EPrivateComputeViewConstructor /* dummy */);
977 
979 
981 
986  virtual bool
987  checkSizes (const SrcDistObject& sourceObj);
988 
989  virtual void
990  copyAndPermute (const SrcDistObject& sourceObj,
991  size_t numSameIDs,
992  const ArrayView<const LocalOrdinal>& permuteToLIDs,
993  const ArrayView<const LocalOrdinal>& permuteFromLIDs);
994 
996  virtual size_t constantNumberOfPackets () const;
997 
998  virtual void
999  packAndPrepare (const SrcDistObject& sourceObj,
1000  const ArrayView<const LocalOrdinal>& exportLIDs,
1001  Array<Scalar>& exports,
1002  const ArrayView<size_t>& numExportPacketsPerLID,
1003  size_t& constantNumPackets,
1004  Distributor& distor);
1005 
1006  virtual void
1007  unpackAndCombine (const ArrayView<const LocalOrdinal>& importLIDs,
1008  const ArrayView<const Scalar>& imports,
1009  const ArrayView<size_t>& numPacketsPerLID,
1010  size_t constantNumPackets,
1011  Distributor& distor,
1012  CombineMode CM);
1013 
1014  void createViews () const;
1015  void createViewsNonConst (Kokkos::ReadWriteOption rwo);
1016  void releaseViews () const;
1017 
1019  mutable ArrayRCP<Scalar> ncview_;
1020 
1022  mutable ArrayRCP<const Scalar> cview_;
1023 
1025 
1027 
1034 
1036  }; // class MultiVector
1037 
1045  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
1046  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
1048  size_t numVectors)
1049  {
1050  using Teuchos::rcp;
1052 
1053  const bool initToZero = true;
1054  return rcp (new MV (map, numVectors, initToZero));
1055  }
1056 
1082  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
1083  Teuchos::RCP<MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> >
1085  const Teuchos::ArrayRCP<Scalar>& view,
1086  size_t LDA,
1087  size_t numVectors)
1088  {
1089  using Teuchos::rcp;
1092 
1093  // This uses a protected MultiVector constructor, but this
1094  // nonmember function was declared a friend of MultiVector.
1095  //
1096  // The ViewAccepter expression will fail to compile for
1097  // unsupported Kokkos Node types.
1098  return rcp (new MV (map, VAN::template acceptView<Scalar> (view),
1099  LDA, numVectors, HOST_VIEW_CONSTRUCTOR));
1100  }
1101 
1102 } // namespace Tpetra
1103 
1104 
1105 #endif // TPETRA_MULTIVECTOR_DECL_HPP
Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > subView(const Teuchos::Range1D &colRng) const
Return a const MultiVector with const views of selected columns.
Teuchos::RCP< const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > offsetView(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &subMap, size_t offset) const
Return a const MultiVector view of a subset of rows.
virtual void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with the given verbosity level to a FancyOStream.
ArrayRCP< Scalar > ncview_
Nonconst host view created in createViewsNonConst().
void releaseViews() const
Hook for releasing views.
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createMultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t numVectors)
Nonmember MultiVector constructor: make a MultiVector from a given Map.
void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Teuchos::ArrayRCP< Scalar > get1dViewNonConst()
Nonconst persisting (1-D) view of this multivector&#39;s local values.
ViewAccepter provides support for compile-time detection based on Node type, of support for accepting...
void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
void putScalar(const Scalar &value)
Set all values in the multivector with the given value.
size_t getNumVectors() const
Number of columns in the multivector.
size_t getLocalLength() const
Local number of rows on the calling process.
void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< Scalar > > get2dViewNonConst()
Return non-const persisting pointers to values.
void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
bool isConstantStride() const
Whether this multivector has constant stride between columns.
One or more distributed dense vectors.
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > subCopy(const Teuchos::Range1D &colRng) const
Return a MultiVector with copies of selected columns.
bool createViewsNonConstRaisedEfficiencyWarning_
Whether createViewsNonConst() has yet raised an efficiency warning.
GlobalOrdinal global_ordinal_type
The type of global indices.
void replaceMap(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map)
Replace the underlying Map in place.
virtual ~MultiVector()
Destructor (virtual for memory safety of derived classes).
void get1dCopy(Teuchos::ArrayView< Scalar > A, size_t LDA) const
Fill the given array with a copy of this multivector&#39;s local values.
Scalar scalar_type
The type of entries in the vector(s).
void get2dCopy(Teuchos::ArrayView< const Teuchos::ArrayView< Scalar > > ArrayOfPtrs) const
Fill the given array with a copy of this multivector&#39;s local values.
void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
Teuchos::RCP< Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
bool createViewsRaisedEfficiencyWarning_
Whether createViews() has yet raised an efficiency warning.
void createViewsNonConst(Kokkos::ReadWriteOption rwo)
Hook for creating a nonconst view.
Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
Teuchos::RCP< const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
size_t global_size_t
Global size_t object.
void normInf(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
void scale(const Scalar &alpha)
Scale in place: this = alpha*this.
void multiply(Teuchos::ETransp transA, Teuchos::ETransp transB, const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, const Scalar &beta)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
void update(const Scalar &alpha, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update: this = beta*this + alpha*A.
void elementWiseMultiply(Scalar scalarAB, const Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &B, Scalar scalarThis)
Multiply a Vector A elementwise by a MultiVector B.
ArrayRCP< T > getSubArrayRCP(ArrayRCP< T > arr, size_t j) const
Persisting view of j-th column in the given ArrayRCP.
void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
Node node_type
The Kokkos Node type.
void normWeighted(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &weights, const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Sets up and executes a communication plan for a Tpetra DistObject.
CombineMode
Tpetra::Combine Mode enumerable type.
LocalOrdinal local_ordinal_type
The type of local indices.
bool releaseViewsRaisedEfficiencyWarning_
Whether releaseViews() has yet raised an efficiency warning.
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > subViewNonConst(const Teuchos::Range1D &colRng)
Return a MultiVector with views of selected columns.
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > createMultiVectorFromView(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, const Teuchos::ArrayRCP< Scalar > &view, size_t LDA, size_t numVectors)
Nonmember MultiVector constructor with view semantics using user-allocated data.
virtual size_t constantNumberOfPackets() const
Number of packets to send per LID.
ArrayRCP< const Scalar > cview_
Const host view created in createViews().
void dot(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Teuchos::ArrayView< Scalar > &dots) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]) ...
Abstract base class for objects that can be the source of an Import or Export operation.
Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & operator=(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &source)
Assign the contents of source to this multivector (deep copy).
void randomize()
Set all values in the multivector to pseudorandom numbers.
const Kokkos::MultiVector< Scalar, Node > & getLocalMV() const
Return a const reference to the underlying Kokkos::MultiVector object (advanced use only) ...
KMV lclMV_
The Kokkos::MultiVector containing the compute buffer of data.
Describes a parallel distribution of objects over processes.
void meanValue(const Teuchos::ArrayView< Scalar > &means) const
Compute mean (average) value of each vector in multi-vector. The outcome of this routine is undefined...
size_t getStride() const
Stride between columns in the multivector.
MultiVector(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Basic constuctor.
A distributed dense vector.
virtual std::string description() const
A simple one-line description of this object.
void reduce()
Sum values of a locally replicated multivector across all processes.
virtual bool checkSizes(const SrcDistObject &sourceObj)
Whether data redistribution between sourceObj and this object is legal.
Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > offsetViewNonConst(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &subMap, size_t offset)
Return a non-const MultiVector view of a subset of rows.
Teuchos::ArrayRCP< Teuchos::ArrayRCP< const Scalar > > get2dView() const
Return const persisting pointers to values.
void reciprocal(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,j).
Base class for distributed Tpetra objects that support data redistribution.
Array< size_t > whichVectors_
Indices of columns this multivector is viewing.
global_size_t getGlobalLength() const
Global number of rows in the multivector.
void abs(const MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input Multi-vector in target: A = abs(this)
Teuchos::ArrayRCP< const Scalar > get1dView() const
Const persisting (1-D) view of this multivector&#39;s local values.
Kokkos::MultiVector< Scalar, Node > & getLocalMVNonConst()
Return a non-const reference to the underlying Kokkos::MultiVector object (advanced use only) ...
void createViews() const
Hook for creating a const view.
virtual void removeEmptyProcessesInPlace(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &newMap)
Remove processes owning zero rows from the Map and their communicator.