16 : vecLookup_(flm.vecLookup_), onlyUseLinear_(flm.onlyUseLinear_)
20 : onlyUseLinear_(onlyUseLinear)
35 : onlyUseLinear_(onlyUseLinear)
44 initialize(masterBasis,*Cijk,rowBasis,colBasis,porder);
49 bool onlyUseLinear,
int porder)
50 : onlyUseLinear_(onlyUseLinear)
59 : onlyUseLinear_(onlyUseLinear)
63 initialize(masterBasis,Cijk,rowBasis,colBasis,porder);
79 Cijk_type::k_iterator k_end = Cijk.
k_end();
82 k_end = Cijk.
find_k(dim+1);
85 vecLookup_.resize(max_basis.
size());
86 numCols_ = vecLookup_.size();
90 for(Cijk_type::k_iterator k_it=Cijk.
k_begin(); k_it!=k_end; ++k_it) {
91 for(Cijk_type::kj_iterator j_it = Cijk.
j_begin(k_it); j_it != Cijk.
j_end(k_it); ++j_it) {
93 for(Cijk_type::kji_iterator i_it = Cijk.
i_begin(j_it); i_it != Cijk.
i_end(j_it); ++i_it) {
95 vecLookup_[i].push_back(j);
109 vecLookup_.resize(rowBasis.
size());
112 numCols_ = colBasis.
size();
115 std::vector<int> rowIndexToMasterIndex(rowBasis.
size());
116 for(
int i=0;i<rowBasis.
size();i++)
117 rowIndexToMasterIndex[i] = masterBasis.
index(rowBasis.
term(i));
120 std::vector<int> colIndexToMasterIndex(colBasis.
size());
121 for(
int i=0;i<colBasis.
size();i++)
122 colIndexToMasterIndex[i] = masterBasis.
index(colBasis.
term(i));
125 for(
int r=0;r<rowBasis.
size();r++) {
126 int masterRow = rowIndexToMasterIndex[r];
127 for(
int c=0;c<colBasis.
size();c++) {
128 int masterCol = colIndexToMasterIndex[c];
131 bool activeRC = masterBig(masterRow,masterCol);
135 vecLookup_[r].push_back(c);
142 const std::vector<std::size_t> & indices = activeIndices(i);
143 return indices.end() != std::find(indices.begin(),indices.end(),
j);
148 for(std::size_t r=0;r<rowCount();r++) {
149 for(std::size_t c=0;c<colCount();c++)
150 if(
operator()(r,c)) os <<
" * ";
159 for(std::size_t r=0;r<rowCount();r++)
160 nnz += activeIndices(r).size();
k_iterator k_begin() const
Iterator pointing to first k entry.
void printGraph(std::ostream &os) const
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeTripleProductTensor() const =0
Compute triple product tensor.
kj_iterator j_begin(const k_iterator &k) const
Iterator pointing to first j entry for given k.
std::size_t numNonZeros() const
How many non zeros are in this graph.
virtual ordinal_type dimension() const =0
Return dimension of basis.
kj_iterator j_end(const k_iterator &k) const
Iterator pointing to last j entry for given k.
virtual ordinal_type index(const MultiIndex< ordinal_type > &term) const =0
Get index of the multivariate polynomial given orders of each coordinate.
virtual const MultiIndex< ordinal_type > & term(ordinal_type i) const =0
Get orders of each coordinate polynomial given an index i.
void initialize(const Stokhos::OrthogPolyBasis< int, double > &max_basis, const Stokhos::Sparse3Tensor< int, double > &Cijk, int porder=-1)
Setup the lookup graph.
bool operator()(std::size_t i, std::size_t j) const
Is there an entry for (i,j) in the graph.
k_iterator k_end() const
Iterator pointing to last k entry.
k_iterator find_k(ordinal_type k) const
Return k iterator for given index k.
Stokhos::Sparse3Tensor< int, double > Cijk_type
virtual Teuchos::RCP< Stokhos::Sparse3Tensor< ordinal_type, value_type > > computeLinearTripleProductTensor() const =0
Compute linear triple product tensor where k = 0,1.
kji_iterator i_begin(const kj_iterator &j) const
Iterator pointing to first i entry for given j and k.
kji_iterator i_end(const kj_iterator &j) const
Iterator pointing to last i entry for given j and k.
virtual ordinal_type size() const =0
Return total size of basis.