48 #include "EpetraExt_BlockUtility.h"
62 epetraCijk(epetraCijk_),
63 Cijk(epetraCijk->getParallelCijk()),
67 only_use_linear(false),
68 determOffset_(EpetraExt::BlockUtility::CalculateOffset(determ_graph->RowMap()))
70 scale_op = params->
get(
"Scale Operator by Inverse Basis Norms",
true);
93 if (!include_mean && index(k_begin) == 0)
95 if (only_use_linear) {
96 int dim = sg_basis->dimension();
97 k_end = Cijk->find_k(dim+1);
108 j_it != Cijk->j_end(k_it); ++j_it) {
109 int j = epetraCijk->GCID(index(j_it));
111 i_it != Cijk->i_end(j_it); ++i_it) {
112 int i = epetraCijk->GRID(index(i_it));
113 double c = value(i_it);
116 this->SumIntoGlobalBlock_Deterministic(c, *block, i, j);
147 std::vector<int> Indices(MaxIndices);
148 std::vector<double> Values(MaxIndices);
153 determBlock.
ExtractMyRowCopy( i, MaxIndices, NumIndices, &Values[0], &Indices[0] );
156 for(
int l = 0; l < NumIndices; ++l ) {
157 Indices[l] = Col + COffset_*determColMap.
GID(Indices[l]);
161 int BaseRow = determMap.
GID(i);
162 ierr = this->SumIntoGlobalValues(ROffset_*BaseRow + Row, NumIndices, &Values[0], &Indices[0]);
163 if (ierr != 0) std::cout <<
"WARNING InterlacedOperator::SumIntoBlock_Deterministic SumIntoGlobalValues err = " << ierr <<
164 "\n\t Row " << ROffset_*BaseRow + Row <<
", Col start " << Indices[0] << std::endl;
bool only_use_linear
Flag indicating whether to only use linear terms.
InterlacedOperator(const Teuchos::RCP< const EpetraExt::MultiComm > &sg_comm, const Teuchos::RCP< const Stokhos::OrthogPolyBasis< int, double > > &sg_basis, const Teuchos::RCP< const Stokhos::EpetraSparse3Tensor > &epetraCijk, const Teuchos::RCP< const Epetra_CrsGraph > &base_graph, const Teuchos::RCP< Teuchos::ParameterList > ¶ms)
Constructor.
virtual const Epetra_Map & RowMatrixRowMap() const =0
T & get(ParameterList &l, const std::string &name)
virtual Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > getSGPolynomial()
Get SG polynomial.
virtual ~InterlacedOperator()
Destructor.
virtual void setupOperator(const Teuchos::RCP< Stokhos::EpetraOperatorOrthogPoly > &poly)
Setup operator.
Bi-directional iterator for traversing a sparse array.
int NumMyElements() const
virtual int MaxNumEntries() const =0
bool scale_op
Flag indicating whether operator be scaled with <^2>
void SumIntoGlobalBlock_Deterministic(double alpha, const Epetra_RowMatrix &determBlock, int Row, int Col)
Sum into global matrix.
bool include_mean
Flag indicating whether to include mean term.
CRS matrix of dense blocks.
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
virtual const Epetra_Map & RowMatrixColMap() const =0