Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RANDOMBLOCKMATRIX_BUILDER_IMPL_HPP
00031 #define RANDOMBLOCKMATRIX_BUILDER_IMPL_HPP
00032
00033 #include "TSFRandomBlockMatrixBuilderDecl.hpp"
00034 #include "TSFSimpleBlockOpDecl.hpp"
00035 #include "TSFRandomSparseMatrixBuilderDecl.hpp"
00036
00037
00038
00039 #ifndef HAVE_TEUCHOS_EXPLICIT_INSTANTIATION
00040 #include "TSFSimpleBlockOpImpl.hpp"
00041 #include "TSFRandomSparseMatrixBuilderImpl.hpp"
00042 #endif
00043
00044 using namespace TSFExtended;
00045 using namespace Teuchos;
00046
00047
00048 namespace TSFExtended
00049 {
00050
00051 template <class Scalar>
00052 inline RandomBlockMatrixBuilder<Scalar>
00053 ::RandomBlockMatrixBuilder(const VectorSpace<Scalar>& d,
00054 const VectorSpace<Scalar>& r,
00055 double blockDensity,
00056 double onProcDensity,
00057 double offProcDensity,
00058 const VectorType<double>& type)
00059 : OperatorBuilder<double>(d, r, type), op_()
00060 {
00061 RCP<SimpleBlockOp<Scalar> > b =
00062 rcp(new SimpleBlockOp<Scalar>(this->domain(), this->range()));
00063 RCP<LinearOpBase<Scalar> > p = b;
00064 op_ = p;
00065
00066 for (int i=0; i<this->range().numBlocks(); i++)
00067 {
00068 for (int j=0; j<this->domain().numBlocks(); j++)
00069 {
00070 RandomSparseMatrixBuilder<Scalar> builder(this->domain().getBlock(j),
00071 this->range().getBlock(i),
00072 onProcDensity,
00073 offProcDensity,
00074 this->vecType());
00075 op_.setBlock(i, j, builder.getOp());
00076 }
00077 }
00078 b->endBlockFill();
00079 }
00080 }
00081
00082 #endif