Thyra  Version of the Day
Thyra_DefaultMultiVectorProductVector_def.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
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 Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_HPP
43 #define THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_HPP
44 
45 
46 #include "Thyra_DefaultMultiVectorProductVector_decl.hpp"
47 #include "Thyra_DefaultMultiVectorProductVectorSpace.hpp"
48 #include "Thyra_AssertOp.hpp"
49 #include "Teuchos_Assert.hpp"
50 
51 
52 namespace Thyra {
53 
54 
55 // Constructors/initializers/accessors
56 
57 
58 template <class Scalar>
60 {
61  uninitialize();
62 }
63 
64 
65 template <class Scalar>
67  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &productSpace_in,
68  const RCP<MultiVectorBase<Scalar> > &multiVec
69  )
70 {
71 #ifdef TEUCHOS_DEBUG
72  TEUCHOS_TEST_FOR_EXCEPT(is_null(productSpace_in));
75  "DefaultMultiVectorProductVector<Scalar>::initialize(productSpace,multiVec)",
76  *multiVec->range(), *productSpace_in->getBlock(0)
77  );
78  TEUCHOS_ASSERT_EQUALITY( multiVec->domain()->dim(), productSpace_in->numBlocks());
79 #endif
80 
81  numBlocks_ = productSpace_in->numBlocks();
82 
83  productSpace_ = productSpace_in;
84 
85  multiVec_ = multiVec;
86 
87 }
88 
89 
90 template <class Scalar>
92  const RCP<const DefaultMultiVectorProductVectorSpace<Scalar> > &productSpace_in,
93  const RCP<const MultiVectorBase<Scalar> > &multiVec
94  )
95 {
96 #ifdef TEUCHOS_DEBUG
97  TEUCHOS_TEST_FOR_EXCEPT(is_null(productSpace_in));
100  "DefaultMultiVectorProductVector<Scalar>::initialize(productSpace_in,multiVec)",
101  *multiVec->range(), *productSpace_in->getBlock(0)
102  );
103  TEUCHOS_ASSERT_EQUALITY( multiVec->domain()->dim(), productSpace_in->numBlocks() );
104 #endif
105 
106  numBlocks_ = productSpace_in->numBlocks();
107 
108  productSpace_ = productSpace_in;
109 
110  multiVec_ = multiVec;
111 
112 }
113 
114 
115 template <class Scalar>
118 {
119  return multiVec_.getNonconstObj();
120 }
121 
122 
123 template <class Scalar>
126 {
127  return multiVec_.getConstObj();
128 }
129 
130 
131 template <class Scalar>
133 {
134  numBlocks_ = 0;
135  productSpace_ = Teuchos::null;
136  multiVec_.uninitialize();
137 }
138 
139 
140 // Overridden from Teuchos::Describable
141 
142 
143 template<class Scalar>
145 {
146  std::ostringstream oss;
147  oss
149  << "{"
150  << "dim="<<this->space()->dim()
151  << ",numColumns = "<<numBlocks_
152  << "}";
153  return oss.str();
154 }
155 
156 template<class Scalar>
158  Teuchos::FancyOStream &out_arg,
159  const Teuchos::EVerbosityLevel verbLevel
160  ) const
161 {
162  using Teuchos::OSTab;
163  using Teuchos::describe;
164  RCP<FancyOStream> out = rcp(&out_arg,false);
165  OSTab tab(out);
166  switch(verbLevel) {
168  case Teuchos::VERB_LOW:
169  *out << this->description() << std::endl;
170  break;
172  case Teuchos::VERB_HIGH:
174  {
175  *out
177  << "dim=" << this->space()->dim()
178  << "}\n";
179  OSTab tab2(out);
180  *out << "multiVec = " << Teuchos::describe(*multiVec_.getConstObj(),verbLevel);
181  break;
182  }
183  default:
184  TEUCHOS_TEST_FOR_EXCEPT(true); // Should never get here!
185  }
186 }
187 
188 
189 // Overridden from ProductVectorBase
190 
191 
192 template <class Scalar>
195 {
196 #ifdef TEUCHOS_DEBUG
197  TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( k, 0, numBlocks_ );
198 #endif
199  return multiVec_.getNonconstObj()->col(k);
200 }
201 
202 
203 template <class Scalar>
206 {
207 #ifdef TEUCHOS_DEBUG
208  TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( k, 0, numBlocks_ );
209 #endif
210  return multiVec_.getConstObj()->col(k);
211 }
212 
213 
214 // Overridden from ProductMultiVectorBase
215 
216 
217 template <class Scalar>
220 {
221  return productSpace_;
222 }
223 
224 
225 template <class Scalar>
227 {
228 #ifdef TEUCHOS_DEBUG
229  TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE( k, 0, numBlocks_ );
230 #endif
231  return multiVec_.isConst();
232 }
233 
234 
235 template <class Scalar>
238 {
239  return getNonconstVectorBlock(k);
240 }
241 
242 
243 template <class Scalar>
246 {
247  return getVectorBlock(k);
248 }
249 
250 
251 // Overridden public functions from VectorBase
252 
253 
254 template <class Scalar>
257 {
258  return productSpace_;
259 }
260 
261 
262 // protected
263 
264 
265 // Overridden protected functions from VectorBase
266 
267 
268 template <class Scalar>
270  Scalar l,
271  Scalar u
272  )
273 {
274  for(int k = 0; k < numBlocks_; ++k) {
275  multiVec_.getNonconstObj()->col(k)->randomize(l, u);
276  }
277 }
278 
279 
280 template <class Scalar>
282  const VectorBase<Scalar>& x
283  )
284 {
285 #ifdef TEUCHOS_DEBUG
286  TEUCHOS_ASSERT(productSpace_->isCompatible(*x.space()));
287 #endif
288  // Apply operation block-by-block if mv is also a ProductVector
290  = Teuchos::rcp_dynamic_cast<const ProductVectorBase<Scalar> >(Teuchos::rcpFromRef(x));
291  if (nonnull(pv)) {
292  for(int k = 0; k < numBlocks_; ++k) {
293  multiVec_.getNonconstObj()->col(k)->abs(*pv->getVectorBlock(k));
294  }
295  } else {
297  }
298 }
299 
300 
301 template <class Scalar>
303  const VectorBase<Scalar>& x
304  )
305 {
306 #ifdef TEUCHOS_DEBUG
307  TEUCHOS_ASSERT(productSpace_->isCompatible(*x.space()));
308 #endif
309  // Apply operation block-by-block if mv is also a ProductVector
311  = Teuchos::rcp_dynamic_cast<const ProductVectorBase<Scalar> >(Teuchos::rcpFromRef(x));
312  if (nonnull(pv)) {
313  for(int k = 0; k < numBlocks_; ++k) {
314  multiVec_.getNonconstObj()->col(k)->reciprocal(*pv->getVectorBlock(k));
315  }
316  } else {
318  }
319 }
320 
321 
322 template <class Scalar>
324  const VectorBase<Scalar>& x
325  )
326 {
327 #ifdef TEUCHOS_DEBUG
328  TEUCHOS_ASSERT(productSpace_->isCompatible(*x.space()));
329 #endif
330  // Apply operation block-by-block if mv is also a ProductVector
332  = Teuchos::rcp_dynamic_cast<const ProductVectorBase<Scalar> >(Teuchos::rcpFromRef(x));
333  if (nonnull(pv)) {
334  for(int k = 0; k < numBlocks_; ++k) {
335  multiVec_.getNonconstObj()->col(k)->ele_wise_scale(*pv->getVectorBlock(k));
336  }
337  } else {
339  }
340 }
341 
342 
343 template <class Scalar>
346  const VectorBase<Scalar>& x
347  ) const
348 {
349 #ifdef TEUCHOS_DEBUG
350  TEUCHOS_ASSERT(productSpace_->isCompatible(*x.space()));
351 #endif
352  // Apply operation block-by-block if mv is also a ProductVector
353  typedef ScalarTraits<Scalar> ST;
355  = Teuchos::rcp_dynamic_cast<const ProductVectorBase<Scalar> >(Teuchos::rcpFromRef(x));
356  if (nonnull(pv)) {
357  typename ST::magnitudeType norm = ST::magnitude(ST::zero());
358  for(int k = 0; k < numBlocks_; ++k) {
359  typename ST::magnitudeType subNorm
360  = multiVec_.getConstObj()->col(k)->norm_2(*pv->getVectorBlock(k));
361  norm += subNorm*subNorm;
362  }
363  return ST::magnitude(ST::squareroot(norm));
364  } else {
366  }
367 }
368 
369 
370 template <class Scalar>
372  const RTOpPack::RTOpT<Scalar> &op,
373  const ArrayView<const Ptr<const VectorBase<Scalar> > > &vecs,
374  const ArrayView<const Ptr<VectorBase<Scalar> > > &targ_vecs,
375  const Ptr<RTOpPack::ReductTarget> &reduct_obj,
376  const Ordinal global_offset
377  ) const
378 {
379  this->getDefaultProductVector()->applyOp(
380  op, vecs, targ_vecs, reduct_obj, global_offset );
381 }
382 
383 
384 template <class Scalar>
386  const Range1D& rng_in, RTOpPack::ConstSubVectorView<Scalar>* sub_vec
387  ) const
388 {
389  this->getDefaultProductVector()->acquireDetachedView(rng_in,sub_vec);
390 }
391 
392 
393 template <class Scalar>
396  ) const
397 {
398  this->getDefaultProductVector()->releaseDetachedView(sub_vec);
399 }
400 
401 
402 template <class Scalar>
404  const Range1D& rng_in, RTOpPack::SubVectorView<Scalar>* sub_vec
405  )
406 {
407  TEUCHOS_TEST_FOR_EXCEPT("ToDo: Implement DefaultMultiVectorProductVector<Scalar>::acquireNonconstDetachedVectorViewImpl(...)!");
408 }
409 
410 
411 template <class Scalar>
414  )
415 {
416  TEUCHOS_TEST_FOR_EXCEPT("ToDo: Implement DefaultMultiVectorProductVector<Scalar>::commitNonconstDetachedVectorViewImpl(...)!");
417 }
418 
419 
420 template <class Scalar>
423  )
424 {
425  TEUCHOS_TEST_FOR_EXCEPT("ToDo: Implement DefaultMultiVectorProductVector<Scalar>::setSubVector(...)!");
426 }
427 
428 
429 // Overridden protected functions from VectorBase
430 
431 
432 template <class Scalar>
434 {
435  multiVec_.getNonconstObj()->assign(alpha);
436 }
437 
438 
439 template <class Scalar>
441  const MultiVectorBase<Scalar>& mv
442  )
443 {
444 #ifdef TEUCHOS_DEBUG
445  TEUCHOS_ASSERT_EQUALITY(mv.domain()->dim(), 1);
446  TEUCHOS_ASSERT(productSpace_->isCompatible(*mv.range()));
447 #endif
449  = Teuchos::rcp_dynamic_cast<const ProductMultiVectorBase<Scalar> >(Teuchos::rcpFromRef(mv));
450  if (nonnull(pv)) {
451  for(int k = 0; k < numBlocks_; ++k) {
452  multiVec_.getNonconstObj()->col(k)->assign(*pv->getMultiVectorBlock(k));
453  }
454  } else {
456  }
457 }
458 
459 
460 template <class Scalar>
462 {
463  multiVec_.getNonconstObj()->scale(alpha);
464 }
465 
466 
467 template <class Scalar>
469  Scalar alpha,
470  const MultiVectorBase<Scalar>& mv
471  )
472 {
473 #ifdef TEUCHOS_DEBUG
474  TEUCHOS_ASSERT_EQUALITY(mv.domain()->dim(), 1);
475  TEUCHOS_ASSERT(productSpace_->isCompatible(*mv.range()));
476 #endif
478  = Teuchos::rcp_dynamic_cast<const ProductMultiVectorBase<Scalar> >(Teuchos::rcpFromRef(mv));
479  if (nonnull(pv)) {
480  for(int k = 0; k < numBlocks_; ++k) {
481  multiVec_.getNonconstObj()->col(k)->update(alpha, *pv->getMultiVectorBlock(k));
482  }
483  } else {
485  }
486 }
487 
488 
489 template <class Scalar>
491  const ArrayView<const Scalar>& alpha,
492  const ArrayView<const Ptr<const MultiVectorBase<Scalar> > >& mv,
493  const Scalar& beta
494  )
495 {
496 #ifdef TEUCHOS_DEBUG
497  TEUCHOS_ASSERT_EQUALITY(alpha.size(), mv.size());
498  for (Ordinal i = 0; i < mv.size(); ++i) {
499  TEUCHOS_ASSERT_EQUALITY(mv[i]->domain()->dim(), 1);
500  TEUCHOS_ASSERT(productSpace_->isCompatible(*mv[i]->range()));
501  }
502 #endif
503 
504  // Apply operation block-by-block if each element of mv is also a ProductMultiVector
505  bool allCastsSuccessful = true;
507  for (Ordinal i = 0; i < mv.size(); ++i) {
508  pvs[i] = Teuchos::ptr_dynamic_cast<const ProductMultiVectorBase<Scalar> >(mv[i]);
509  if (pvs[i].is_null()) {
510  allCastsSuccessful = false;
511  break;
512  }
513  }
514 
515  if (allCastsSuccessful) {
516  Array<RCP<const MultiVectorBase<Scalar> > > blocks_rcp(pvs.size());
517  Array<Ptr<const MultiVectorBase<Scalar> > > blocks(pvs.size());
518  for (int k = 0; k < numBlocks_; ++k) {
519  for (Ordinal i = 0; i < pvs.size(); ++i) {
520  blocks_rcp[i] = pvs[i]->getMultiVectorBlock(k);
521  blocks[i] = blocks_rcp[i].ptr();
522  }
523  multiVec_.getNonconstObj()->col(k)->linear_combination(alpha, blocks(), beta);
524  }
525  } else {
527  }
528 }
529 
530 
531 template <class Scalar>
533  const MultiVectorBase<Scalar>& mv,
534  const ArrayView<Scalar>& prods
535  ) const
536 {
537 #ifdef TEUCHOS_DEBUG
538  TEUCHOS_ASSERT_EQUALITY(mv.domain()->dim(), 1);
539  TEUCHOS_ASSERT_EQUALITY(prods.size(), 1);
540  TEUCHOS_ASSERT(productSpace_->isCompatible(*mv.range()));
541 #endif
543  = Teuchos::rcp_dynamic_cast<const ProductMultiVectorBase<Scalar> >(Teuchos::rcpFromRef(mv));
544  if (nonnull(pv)) {
545  prods[0] = ScalarTraits<Scalar>::zero();
546  for(int k = 0; k < numBlocks_; ++k) {
547  Scalar prod;
548  multiVec_.getConstObj()->col(k)->dots(*pv->getMultiVectorBlock(k), Teuchos::arrayView(&prod, 1));
549  prods[0] += prod;
550  }
551  } else {
553  }
554 }
555 
556 
557 template <class Scalar>
559  const ArrayView<typename ScalarTraits<Scalar>::magnitudeType>& norms
560  ) const
561 {
562 #ifdef TEUCHOS_DEBUG
563  TEUCHOS_ASSERT_EQUALITY(norms.size(), 1);
564 #endif
565  typedef ScalarTraits<Scalar> ST;
566  norms[0] = ST::magnitude(ST::zero());
567  for(int k = 0; k < numBlocks_; ++k) {
568  norms[0] += multiVec_.getConstObj()->col(k)->norm_1();
569  }
570 }
571 
572 
573 template <class Scalar>
575  const ArrayView<typename ScalarTraits<Scalar>::magnitudeType>& norms
576  ) const
577 {
578 #ifdef TEUCHOS_DEBUG
579  TEUCHOS_ASSERT_EQUALITY(norms.size(), 1);
580 #endif
581  typedef ScalarTraits<Scalar> ST;
582  norms[0] = ST::magnitude(ST::zero());
583  for(int k = 0; k < numBlocks_; ++k) {
584  typename ST::magnitudeType subNorm = multiVec_.getConstObj()->col(k)->norm_2();
585  norms[0] += subNorm*subNorm;
586  }
587  norms[0] = ST::magnitude(ST::squareroot(norms[0]));
588 }
589 
590 
591 template <class Scalar>
593  const ArrayView<typename ScalarTraits<Scalar>::magnitudeType>& norms
594  ) const
595 {
596 #ifdef TEUCHOS_DEBUG
597  TEUCHOS_ASSERT_EQUALITY(norms.size(), 1);
598 #endif
599  typedef ScalarTraits<Scalar> ST;
600  norms[0] = ST::magnitude(ST::zero());
601  for(int k = 0; k < numBlocks_; ++k) {
602  typename ST::magnitudeType subNorm = multiVec_.getConstObj()->col(k)->norm_inf();
603  if (subNorm > norms[0])
604  norms[0] = subNorm;
605  }
606 }
607 
608 
609 // private
610 
611 
612 template <class Scalar>
615 {
616 
617  // This function exists since in general we can not create views of a column
618  // vectors and expect the changes to be mirrored in the mulit-vector
619  // automatically. Later, we might be able to change this once we have a
620  // Thyra::MultiVectorBase::hasDirectColumnVectorView() function and it
621  // returns true. Until then, this is the safe way to do this ...
622 
624  for ( int k = 0; k < numBlocks_; ++k) {
625  vecArray.push_back(multiVec_.getConstObj()->col(k));
626  }
627 
628  return Thyra::defaultProductVector<Scalar>(
629  productSpace_->getDefaultProductVectorSpace(),
630  vecArray()
631  );
632 
633 }
634 
635 
636 } // namespace Thyra
637 
638 
639 #endif // THYRA_DEFAULT_MULTI_VECTOR_PRODUCT_VECTOR_HPP
Thyra::DefaultMultiVectorProductVector::acquireNonconstDetachedVectorViewImpl
void acquireNonconstDetachedVectorViewImpl(const Range1D &rng, RTOpPack::SubVectorView< Scalar > *sub_vec)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:403
Thyra::VectorDefaultBase::eleWiseScaleImpl
virtual void eleWiseScaleImpl(const VectorBase< Scalar > &x)
Default implementation of ele_wise_scale using RTOps.
Definition: Thyra_VectorDefaultBase_def.hpp:241
is_null
bool is_null(const boost::shared_ptr< T > &p)
Thyra::DefaultMultiVectorProductVector::norms2Impl
virtual void norms2Impl(const ArrayView< typename ScalarTraits< Scalar >::magnitudeType > &norms) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:574
TEUCHOS_TEST_FOR_EXCEPT
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Thyra::DefaultMultiVectorProductVector::absImpl
virtual void absImpl(const VectorBase< Scalar > &x)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:281
Thyra::DefaultMultiVectorProductVector::norm2WeightedImpl
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2WeightedImpl(const VectorBase< Scalar > &x) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:345
Thyra::DefaultMultiVectorProductVector::describe
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:157
Thyra::DefaultMultiVectorProductVector::updateImpl
virtual void updateImpl(Scalar alpha, const MultiVectorBase< Scalar > &mv)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:468
Thyra::DefaultMultiVectorProductVector
Concrete implementation of a product vector which is really composed out of the columns of a multi-ve...
Definition: Thyra_DefaultMultiVectorProductVector_decl.hpp:70
Thyra::VectorDefaultBase::absImpl
virtual void absImpl(const VectorBase< Scalar > &x)
Default implementation of abs using RTOps.
Definition: Thyra_VectorDefaultBase_def.hpp:221
Thyra::DefaultMultiVectorProductVector::initialize
void initialize(const RCP< const DefaultMultiVectorProductVectorSpace< Scalar > > &productSpace, const RCP< MultiVectorBase< Scalar > > &multiVec)
Initialize with a non-const multi-vector.
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:66
Teuchos::ScalarTraits::zero
static T zero()
Thyra::DefaultMultiVectorProductVector::applyOpImpl
void applyOpImpl(const RTOpPack::RTOpT< Scalar > &op, const ArrayView< const Ptr< const VectorBase< Scalar > > > &vecs, const ArrayView< const Ptr< VectorBase< Scalar > > > &targ_vecs, const Ptr< RTOpPack::ReductTarget > &reduct_obj, const Ordinal global_offset) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:371
Thyra::DefaultMultiVectorProductVector::description
std::string description() const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:144
Teuchos::Describable::description
virtual std::string description() const
Thyra::MultiVectorDefaultBase::linearCombinationImpl
virtual void linearCombinationImpl(const ArrayView< const Scalar > &alpha, const ArrayView< const Ptr< const MultiVectorBase< Scalar > > > &mv, const Scalar &beta)
Default implementation of linear_combination using RTOps.
Definition: Thyra_MultiVectorDefaultBase_def.hpp:147
Thyra::LinearOpBase::domain
virtual RCP< const VectorSpaceBase< Scalar > > domain() const =0
Return a smart pointer for the domain space for this operator.
Thyra::LinearOpBase::range
virtual RCP< const VectorSpaceBase< Scalar > > range() const =0
Return a smart pointer for the range space for this operator.
Thyra::VectorDefaultBase::reciprocalImpl
virtual void reciprocalImpl(const VectorBase< Scalar > &x)
Default implementation of reciprocal using RTOps.
Definition: Thyra_VectorDefaultBase_def.hpp:231
VERB_DEFAULT
VERB_DEFAULT
Thyra::DefaultMultiVectorProductVector::assignMultiVecImpl
virtual void assignMultiVecImpl(const MultiVectorBase< Scalar > &mv)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:440
Thyra::MultiVectorDefaultBase::assignMultiVecImpl
virtual void assignMultiVecImpl(const MultiVectorBase< Scalar > &mv)
Default implementation of assign(MV) using RTOps.
Definition: Thyra_MultiVectorDefaultBase_def.hpp:104
Thyra::DefaultMultiVectorProductVector::DefaultMultiVectorProductVector
DefaultMultiVectorProductVector()
Construct to uninitialized.
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:59
Teuchos::Array::push_back
void push_back(const value_type &x)
Thyra::DefaultMultiVectorProductVector::randomizeImpl
virtual void randomizeImpl(Scalar l, Scalar u)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:269
Thyra::DefaultMultiVectorProductVector::getNonconstMultiVectorBlock
RCP< MultiVectorBase< Scalar > > getNonconstMultiVectorBlock(const int k)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:237
VERB_LOW
VERB_LOW
TEUCHOS_ASSERT
#define TEUCHOS_ASSERT(assertion_test)
RTOpPack::ConstSubVectorView
rcp
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Teuchos::EVerbosityLevel
EVerbosityLevel
Thyra::DefaultMultiVectorProductVector::norms1Impl
virtual void norms1Impl(const ArrayView< typename ScalarTraits< Scalar >::magnitudeType > &norms) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:558
Thyra::DefaultMultiVectorProductVector::getNonconstMultiVector
RCP< MultiVectorBase< Scalar > > getNonconstMultiVector()
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:117
Thyra::DefaultMultiVectorProductVector::productSpace
RCP< const ProductVectorSpaceBase< Scalar > > productSpace() const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:219
Thyra::DefaultMultiVectorProductVector::linearCombinationImpl
virtual void linearCombinationImpl(const ArrayView< const Scalar > &alpha, const ArrayView< const Ptr< const MultiVectorBase< Scalar > > > &mv, const Scalar &beta)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:490
Teuchos::ArrayView
Teuchos::RCP
VERB_HIGH
VERB_HIGH
Teuchos::Ptr
Thyra::Ordinal
Teuchos::Ordinal Ordinal
Type for the dimension of a vector space. `*.
Definition: Thyra_OperatorVectorTypes.hpp:127
TEUCHOS_ASSERT_EQUALITY
#define TEUCHOS_ASSERT_EQUALITY(val1, val2)
Thyra::DefaultMultiVectorProductVector::getMultiVectorBlock
RCP< const MultiVectorBase< Scalar > > getMultiVectorBlock(const int k) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:245
Teuchos::Array
Thyra::DefaultMultiVectorProductVector::getNonconstVectorBlock
RCP< VectorBase< Scalar > > getNonconstVectorBlock(const int k)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:194
Thyra::VectorBase::space
virtual RCP< const VectorSpaceBase< Scalar > > space() const =0
Return a smart pointer to the vector space that this vector belongs to.
Thyra::DefaultMultiVectorProductVector::setSubVectorImpl
void setSubVectorImpl(const RTOpPack::SparseSubVectorT< Scalar > &sub_vec)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:421
Thyra::DefaultMultiVectorProductVector::getVectorBlock
RCP< const VectorBase< Scalar > > getVectorBlock(const int k) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:205
VERB_MEDIUM
VERB_MEDIUM
Teuchos::basic_FancyOStream
Teuchos::ArrayView::size
size_type size() const
Thyra::DefaultMultiVectorProductVector::reciprocalImpl
virtual void reciprocalImpl(const VectorBase< Scalar > &x)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:302
Thyra::DefaultMultiVectorProductVectorSpace
Standard concrete implementation of a product vector space that creates product vectors fromed implic...
Definition: Thyra_DefaultMultiVectorProductVector_decl.hpp:55
Thyra::MultiVectorBase::col
RCP< const VectorBase< Scalar > > col(Ordinal j) const
Calls colImpl().
Definition: Thyra_MultiVectorBase_decl.hpp:641
Thyra::MultiVectorBase
Interface for a collection of column vectors called a multi-vector.
Definition: Thyra_MultiVectorBase_decl.hpp:493
Teuchos::ScalarTraits
Thyra::DefaultMultiVectorProductVector::releaseDetachedVectorViewImpl
void releaseDetachedVectorViewImpl(RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:394
TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE
#define TEUCHOS_ASSERT_IN_RANGE_UPPER_EXCLUSIVE(index, lower_inclusive, upper_exclusive)
THYRA_ASSERT_VEC_SPACES
#define THYRA_ASSERT_VEC_SPACES(FUNC_NAME, VS1, VS2)
This is a very useful macro that should be used to validate that two vector spaces are compatible.
Definition: Thyra_AssertOp.hpp:188
Thyra::DefaultMultiVectorProductVector::normsInfImpl
virtual void normsInfImpl(const ArrayView< typename ScalarTraits< Scalar >::magnitudeType > &norms) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:592
Thyra::ProductVectorBase
Base interface for product vectors.
Definition: Thyra_ProductVectorBase.hpp:87
Thyra::VectorDefaultBase::norm2WeightedImpl
virtual Teuchos::ScalarTraits< Scalar >::magnitudeType norm2WeightedImpl(const VectorBase< Scalar > &x) const
Default implementation of norm_2 (weighted) using RTOps.
Definition: Thyra_VectorDefaultBase_def.hpp:304
Thyra::ProductMultiVectorBase
Base interface for product multi-vectors.
Definition: Thyra_ProductMultiVectorBase.hpp:66
Thyra::DefaultMultiVectorProductVector::blockIsConst
bool blockIsConst(const int k) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:226
RTOpPack::SubVectorView
Thyra::DefaultMultiVectorProductVector::dotsImpl
virtual void dotsImpl(const MultiVectorBase< Scalar > &mv, const ArrayView< Scalar > &prods) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:532
RTOpPack::SparseSubVectorT
RTOpPack::RTOpT< Scalar >
Thyra::DefaultMultiVectorProductVector::assignImpl
virtual void assignImpl(Scalar alpha)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:433
Thyra::MultiVectorDefaultBase::updateImpl
virtual void updateImpl(Scalar alpha, const MultiVectorBase< Scalar > &mv)
Default implementation of update using RTOps.
Definition: Thyra_MultiVectorDefaultBase_def.hpp:134
Thyra::DefaultMultiVectorProductVector::space
RCP< const VectorSpaceBase< Scalar > > space() const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:256
Thyra::DefaultMultiVectorProductVector::eleWiseScaleImpl
virtual void eleWiseScaleImpl(const VectorBase< Scalar > &x)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:323
nonnull
bool nonnull(const boost::shared_ptr< T > &p)
Thyra::VectorBase
Abstract interface for finite-dimensional dense vectors.
Definition: Thyra_OperatorVectorTypes.hpp:370
Thyra::DefaultMultiVectorProductVector::acquireDetachedVectorViewImpl
void acquireDetachedVectorViewImpl(const Range1D &rng, RTOpPack::ConstSubVectorView< Scalar > *sub_vec) const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:385
Thyra::DefaultMultiVectorProductVector::scaleImpl
virtual void scaleImpl(Scalar alpha)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:461
Thyra::DefaultMultiVectorProductVector::commitNonconstDetachedVectorViewImpl
void commitNonconstDetachedVectorViewImpl(RTOpPack::SubVectorView< Scalar > *sub_vec)
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:412
Thyra::MultiVectorDefaultBase::dotsImpl
virtual void dotsImpl(const MultiVectorBase< Scalar > &mv, const ArrayView< Scalar > &prods) const
Default implementation of dots using RTOps.
Definition: Thyra_MultiVectorDefaultBase_def.hpp:221
Teuchos::ScalarTraits::magnitudeType
T magnitudeType
VERB_EXTREME
VERB_EXTREME
Teuchos::Range1D
Thyra::DefaultMultiVectorProductVector::uninitialize
void uninitialize()
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:132
OSTab
basic_OSTab< char > OSTab
Thyra::DefaultMultiVectorProductVector::getMultiVector
RCP< const MultiVectorBase< Scalar > > getMultiVector() const
Definition: Thyra_DefaultMultiVectorProductVector_def.hpp:125