Xpetra Version of the Day
Loading...
Searching...
No Matches
Xpetra_BlockedVector_def.hpp
Go to the documentation of this file.
1// @HEADER
2//
3// ***********************************************************************
4//
5// Xpetra: A linear algebra interface package
6// Copyright 2012 Sandia Corporation
7//
8// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9// the U.S. Government retains certain rights in this software.
10//
11// Redistribution and use in source and binary forms, with or without
12// modification, are permitted provided that the following conditions are
13// met:
14//
15// 1. Redistributions of source code must retain the above copyright
16// notice, this list of conditions and the following disclaimer.
17//
18// 2. Redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution.
21//
22// 3. Neither the name of the Corporation nor the names of the
23// contributors may be used to endorse or promote products derived from
24// this software without specific prior written permission.
25//
26// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37//
38// Questions? Contact
39// Jonathan Hu (jhu@sandia.gov)
40// Andrey Prokopenko (aprokop@sandia.gov)
41// Tobias Wiesner (tawiesn@sandia.gov)
42// Ray Tuminaro (rstumin@sandia.gov)
43//
44// ***********************************************************************
45//
46// @HEADER
47#ifndef XPETRA_BLOCKEDVECTOR_DEF_HPP
48#define XPETRA_BLOCKEDVECTOR_DEF_HPP
49
51
52#include "Xpetra_BlockedMultiVector.hpp"
53#include "Xpetra_Exceptions.hpp"
54
55
56
57namespace Xpetra {
58
59
60
61template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
64 : Xpetra::BlockedMultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>(map, 1, zeroOut)
65{ }
66
67
68template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
74
75
76template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
82
83
84template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
88
89
90template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
94{
95 assign(rhs); // dispatch to protected virtual method
96 return *this;
97}
98
99
100template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
101void
103replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar& value)
104{
105 BlockedMultiVector::replaceGlobalValue(globalRow, vectorIndex, value);
106}
107
108
109template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
110void
112sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar& value)
113{
114 BlockedMultiVector::sumIntoGlobalValue(globalRow, vectorIndex, value);
115}
116
117
118template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
119void
121replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar& value)
122{
123 BlockedMultiVector::replaceLocalValue(myRow, vectorIndex, value);
124}
125
126
127template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
128void
130sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar& value)
131{
132 BlockedMultiVector::sumIntoLocalValue(myRow, vectorIndex, value);
133}
134
135
136template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
137void
139replaceGlobalValue(GlobalOrdinal globalRow, const Scalar& value)
140{
141 BlockedMultiVector::replaceGlobalValue(globalRow, 0, value);
142}
143
144
145template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
146void
148sumIntoGlobalValue(GlobalOrdinal globalRow, const Scalar& value)
149{
150 BlockedMultiVector::sumIntoGlobalValue(globalRow, 0, value);
151}
152
153template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
154void
156replaceLocalValue(LocalOrdinal myRow, const Scalar& value)
157{
159}
160
161template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
162void
164sumIntoLocalValue(LocalOrdinal myRow, const Scalar& value)
165{
167}
168
169template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
170void
176
177template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
184
185template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
192
193template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
200
201template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
208
209template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
210void
217
218template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
219Scalar
227
228template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
229void
236
237template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
238void
245
246template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
247void
254
255template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
256void
263
264template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
265void
267update(const Scalar& alpha,
269 const Scalar& beta)
270{
271 BlockedMultiVector::update(alpha, A, beta);
272 return;
273}
274
275template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
276void
278update(const Scalar& alpha,
280 const Scalar& beta,
282 const Scalar& gamma)
283{
284 BlockedMultiVector::update(alpha, A, beta, B, gamma);
285 return;
286}
287
288template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
291norm1() const
292{
294 Array norm = Array(1);
295 this->norm1(norm);
296 return norm[ 0 ];
297}
298
299template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
309
310
311template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
321
322
323template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
324void
330
331
332template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
333void
339
340
341template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
342void
348
349
350template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
351void
353meanValue(const Teuchos::ArrayView<Scalar>& /* means */) const
354{
355 throw Xpetra::Exceptions::RuntimeError("BlockedVector::meanValue: Not (yet) supported by BlockedVector.");
356}
357
358
359template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
360Scalar
362meanValue() const
363{
364 throw Xpetra::Exceptions::RuntimeError("BlockedVector::meanValue: Not (yet) supported by BlockedVector.");
365}
366
367
368template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
369void
371multiply(Teuchos::ETransp /* transA */,
372 Teuchos::ETransp /* transB */,
373 const Scalar& /* alpha */,
376 const Scalar& /* beta */)
377{
378 throw Xpetra::Exceptions::RuntimeError("BlockedVector::multiply: Not (yet) supported by BlockedVector.");
379}
380
381
382template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
383void
385multiply(Teuchos::ETransp /* transA */,
386 Teuchos::ETransp /* transB */,
387 const Scalar& /* alpha */,
390 const Scalar& /* beta */)
391{
392 throw Xpetra::Exceptions::RuntimeError("BlockedVector::multiply: Not (yet) supported by BlockedVector.");
393}
394
395
396template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
397void
399elementWiseMultiply( Scalar /* scalarAB */,
402 Scalar /* scalarThis */)
403{
404 throw Xpetra::Exceptions::RuntimeError("BlockedVector::elementWiseMultiply: Not (yet) supported by BlockedVector.");
405}
406
407
408template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
409void
411elementWiseMultiply( Scalar /* scalarAB */,
414 Scalar /* scalarThis */)
415{
416 XPETRA_TEST_FOR_EXCEPTION(B.getMap()->isSameAs(*(this->getMap())) == false,
418 "BlockedVector::elementWiseMultipy: B must have same blocked map than this.");
419 TEUCHOS_TEST_FOR_EXCEPTION(A.getMap()->getLocalNumElements() != B.getMap()->getLocalNumElements(),
421 "BlockedVector::elementWiseMultipy: A has "
422 << A.getMap()->getLocalNumElements() << " elements, B has " << B.getMap()->getLocalNumElements()
423 << ".");
424 TEUCHOS_TEST_FOR_EXCEPTION(A.getMap()->getGlobalNumElements() != B.getMap()->getGlobalNumElements(),
426 "BlockedVector::elementWiseMultipy: A has " << A.getMap()->getGlobalNumElements()
427 << " elements, B has "
428 << B.getMap()->getGlobalNumElements() << ".");
429
430 RCP<const BlockedMap> bmap = this->getBlockedMap();
433 RCP<const BlockedVector> bbmvec = Teuchos::rcp_dynamic_cast<const BlockedVector>(bmvec);
434 TEUCHOS_TEST_FOR_EXCEPTION(bbmvec.is_null() == true,
436 "BlockedVector::elementWiseMultipy: B must be a BlockedVector.");
437
438 // TODO implement me
439 /*RCP<Xpetra::MapExtractor<Scalar,LocalOrdinal,GlobalOrdinal,Node> > me = Teuchos::rcp(new
440 Xpetra::MapExtractor<Scalar,LocalOrdinal,GlobalOrdinal,Node>(bmap));
441
442 for(size_t m = 0; m < bmap->getNumMaps(); m++) {
443 // TODO introduce BlockedVector objects and "skip" this expensive ExtractVector call
444 RCP<const Xpetra::Vector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > pd = me->ExtractVector(rcpA,m,bmap->getThyraMode());
445 XPETRA_TEST_FOR_EXCEPTION(pd->getMap()->isSameAs(*(this->getBlockedMap()->getMap(m,bmap->getThyraMode())))==false,
446 Xpetra::Exceptions::RuntimeError, "BlockedVector::elementWiseMultipy: sub map of B does not fit with sub map of this.");
447 this->getMultiVector(m,bmap->getThyraMode())->elementWiseMultiply(scalarAB,*pd,*(bbmvec->getMultiVector(m,bmap->getThyraMode())),scalarThis);
448 }*/
449}
450
451
452template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
453size_t
459
460
461template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
462size_t
464getLocalLength() const
465{
467 "BlockedVector::getLocalLength: routine not implemented. It has no value as one must iterate on the partial vectors.");
469}
470
471
472template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
475getGlobalLength() const
476{
477 return this->getBlockedMap()->getFullMap()->getGlobalNumElements();
478}
479
480
481template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
482bool
485{
487 "BlockedVector::isSameSize: routine not implemented. It has no value as one must iterate on the partial vectors.");
489}
490
491
492template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
493std::string
495description() const
496{
497 return std::string("BlockedVector");
498}
499
500
501template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
502void
505{
506 out << description() << std::endl;
507 for(size_t r = 0; r < this->getBlockedMap()->getNumMaps(); r++)
508 {
509 getMultiVector(r)->describe(out, verbLevel);
510 }
511}
512
513
514template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
515void
521
522
523template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
524void
527 const Import& /* importer */,
528 CombineMode /* CM */)
529{
530 throw Xpetra::Exceptions::RuntimeError("BlockedVector::doImport: Not supported by BlockedVector.");
531}
532
533
534template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
535void
538 const Import& /* importer */,
539 CombineMode /* CM */)
540{
541 throw Xpetra::Exceptions::RuntimeError("BlockedVector::doExport: Not supported by BlockedVector.");
542}
543
544
545template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
546void
549 const Export& /* exporter */,
550 CombineMode /* CM */)
551{
552 throw Xpetra::Exceptions::RuntimeError("BlockedVector::doImport: Not supported by BlockedVector.");
553}
554
555
556template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
557void
560 const Export& /* exporter */,
561 CombineMode /* CM */)
562{
563 throw Xpetra::Exceptions::RuntimeError("BlockedVector::doExport: Not supported by BlockedVector.");
564}
565
566
567template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
568void
570setSeed(unsigned int seed)
571{
572 for(size_t r = 0; r < this->getBlockedMap()->getNumMaps(); ++r)
573 {
574 getMultiVector(r)->setSeed(seed);
575 }
576}
577
578
579template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
580void
582randomize(bool bUseXpetraImplementation)
583{
584 for(size_t r = 0; r < this->getBlockedMap()->getNumMaps(); ++r)
585 {
586 getMultiVector(r)->randomize(bUseXpetraImplementation);
587 }
588}
589
590
591template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
592void
594randomize(const Scalar& minVal, const Scalar& maxVal, bool bUseXpetraImplementation)
595{
596 for(size_t r = 0; r < this->getBlockedMap()->getNumMaps(); ++r)
597 {
598 getMultiVector(r)->randomize(minVal, maxVal, bUseXpetraImplementation);
599 }
600}
601
602
603template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
604void
612
613
614template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
615void
623
624 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
627 getMap() const
628 {
629 XPETRA_MONITOR("BlockedVector::getMap");
630 return this->getBlockedMap();
631 }
632
633
634 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
641
642
643 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
646 getMultiVector(size_t r, bool bThyraMode) const
647 {
648 return BlockedMultiVector::getMultiVector(r, bThyraMode);
649 }
650
651
652 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
653 void
662
663
664 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
671
672
673 template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
674 void
680
681
682 // template<class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
683 // virtual void BlockedVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>::
684 // assign (const XpetrA::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& rhs)
685 // {
686 // throw Xpetra::Exceptions::RuntimeError("BlockedVector::assign: Not supported by BlockedVector.");
687 // }
688
689} // Xpetra namespace
690
691
692#endif // XPETRA_BLOCKEDVECTOR_DEF_HPP
#define XPETRA_MONITOR(funcName)
#define XPETRA_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
bool is_null() const
virtual void putScalar(const Scalar &value)
Set all values in the multivector with the given value.
virtual void sumIntoLocalValue(LocalOrdinal, size_t, const Scalar &)
Add value to existing value, using local (row) index.
virtual Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this multivector.
Teuchos::RCP< MultiVector > getMultiVector(size_t r) const
return partial multivector associated with block row r
void setMultiVector(size_t r, Teuchos::RCP< const MultiVector > v, bool bThyraMode)
set partial multivector associated with block row r
virtual Teuchos::RCP< const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
virtual Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this multivector.
virtual void dot(const MultiVector &, const Teuchos::ArrayView< Scalar > &) const
Compute dot product of each corresponding pair of vectors, dots[i] = this[i].dot(A[i]).
virtual void reciprocal(const MultiVector &)
Put element-wise reciprocal values of input Multi-vector in target, this(i,j) = 1/A(i,...
virtual void sumIntoGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Add value to existing value, using global (row) index.
virtual void replaceLocalValue(LocalOrdinal, size_t, const Scalar &)
Replace value, using local (row) index.
Teuchos::RCP< MultiVector > Merge() const
merge BlockedMultiVector blocks to a single MultiVector
virtual Teuchos::RCP< Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
virtual void replaceGlobalValue(GlobalOrdinal, size_t, const Scalar &)
Replace value, using global (row) index.
virtual void norm2(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
virtual void assign(const MultiVector &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
virtual void scale(const Scalar &alpha)
Scale the current values of a multi-vector, this = alpha*this.
virtual void normInf(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute Inf-norm of each vector in multi-vector.
virtual void update(const Scalar &alpha, const MultiVector &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
virtual void abs(const MultiVector &)
Put element-wise absolute values of input Multi-vector in target: A = abs(this).
virtual void norm1(const Teuchos::ArrayView< typename Teuchos::ScalarTraits< Scalar >::magnitudeType > &norms) const
Compute 1-norm of each vector in multi-vector.
virtual void replaceMap(const RCP< const Map > &map)
virtual void multiply(Teuchos::ETransp, Teuchos::ETransp, const Scalar &, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Scalar &)
Matrix-matrix multiplication: this = beta*this + alpha*op(A)*op(B).
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Merge() const
merge BlockedVector blocks to a single Vector
virtual size_t getLocalLength() const
Local number of rows on the calling process.
virtual void replaceMap(const RCP< const Map > &map)
virtual std::string description() const
A simple one-line description of this object.
BlockedVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > & operator=(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Assignment operator: Does a deep copy.
virtual void Xpetra_randomize()
Set vector values to random numbers. XPetra implementation.
virtual Teuchos::RCP< const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVector(size_t j) const
Return a Vector which is a const view of column j.
virtual Teuchos::ArrayRCP< const Scalar > getData(size_t j) const
Const view of the local values in a particular vector of this vector.
virtual void randomize(bool bUseXpetraImplementation=false)
Set multi-vector values to random numbers.
Teuchos::RCP< const Map > getMap() const
Access function for the underlying Map this DistObject was constructed with.
virtual void dot(const Xpetra::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]).
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2() const
Compute 2-norm of vector.
virtual void sumIntoLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using local (row) index.
virtual Teuchos::RCP< Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getVectorNonConst(size_t j)
Return a Vector which is a nonconst view of column j.
void setMultiVector(size_t r, Teuchos::RCP< const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > v, bool bThyraMode)
set partial Vector associated with block row r
virtual void reciprocal(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise reciprocal values of input vector in target, this(i,j) = 1/A(i,j).
virtual void putScalar(const Scalar &value)
Set all values in the vector with the given value.
virtual void setSeed(unsigned int seed)
Set seed for Random function.
virtual void doExport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Import &, CombineMode)
Export.
BlockedVector(const Teuchos::RCP< const BlockedMap > &map, bool zeroOut=true)
Constructor.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm1() const
Compute 1-norm of vector.
virtual void replaceLocalValue(LocalOrdinal myRow, size_t vectorIndex, const Scalar &value)
Replace value, using local (row) index.
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.
virtual void sumIntoGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Add value to existing value, using global (row) index.
virtual void scale(const Scalar &alpha)
Scale the current values of a vector, this = alpha*this.
virtual void replaceGlobalValue(GlobalOrdinal globalRow, size_t vectorIndex, const Scalar &value)
Replace value, using global (row) index.
virtual Teuchos::ArrayRCP< Scalar > getDataNonConst(size_t j)
View of the local values in a particular vector of this vector.
virtual void elementWiseMultiply(Scalar, const Xpetra::Vector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, Scalar)
Multiply a Vector A elementwise by a MultiVector B.
virtual size_t getNumVectors() const
Number of columns in the Vector.
virtual void doImport(const DistObject< Scalar, LocalOrdinal, GlobalOrdinal, Node > &, const Import &, CombineMode)
Import.
virtual Scalar meanValue() const
Compute mean (average) value of this Vector.
virtual bool isSameSize(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &) const
Local number of rows on the calling process.
virtual void update(const Scalar &alpha, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Scalar &beta)
Update multi-vector values with scaled values of A, this = beta*this + alpha*A.
virtual global_size_t getGlobalLength() const
Global number of rows in the Vector.
virtual void assign(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &rhs)
Implementation of the assignment operator (operator=); does a deep copy.
Teuchos::RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > getMultiVector(size_t r) const
return partial Vector associated with block row r
virtual ~BlockedVector()
Destructor.
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType normInf() const
Compute Inf-norm in vector.
virtual void abs(const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A)
Put element-wise absolute values of input vector in target: A = abs(this).
virtual Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > getMap() const =0
The Map describing the parallel distribution of this object.
Exception throws to report errors in the internal logical of the program.
virtual void Xpetra_randomize()
Set multi-vector values to random numbers. XPetra implementation.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
#define TEUCHOS_UNREACHABLE_RETURN(dummyReturnVal)
Xpetra namespace
size_t global_size_t
Global size_t object.
CombineMode
Xpetra::Combine Mode enumerable type.