50 : vecLookup_(flm.vecLookup_), onlyUseLinear_(flm.onlyUseLinear_)
54 : onlyUseLinear_(onlyUseLinear)
69 : onlyUseLinear_(onlyUseLinear)
78 initialize(masterBasis,*Cijk,rowBasis,colBasis,porder);
83 bool onlyUseLinear,
int porder)
84 : onlyUseLinear_(onlyUseLinear)
93 : onlyUseLinear_(onlyUseLinear)
97 initialize(masterBasis,Cijk,rowBasis,colBasis,porder);
113 Cijk_type::k_iterator k_end = Cijk.
k_end();
114 if (onlyUseLinear_) {
116 k_end = Cijk.
find_k(dim+1);
119 vecLookup_.resize(max_basis.
size());
120 numCols_ = vecLookup_.size();
124 for(Cijk_type::k_iterator k_it=Cijk.
k_begin(); k_it!=k_end; ++k_it) {
125 for(Cijk_type::kj_iterator j_it = Cijk.
j_begin(k_it); j_it != Cijk.
j_end(k_it); ++j_it) {
127 for(Cijk_type::kji_iterator i_it = Cijk.
i_begin(j_it); i_it != Cijk.
i_end(j_it); ++i_it) {
129 vecLookup_[i].push_back(j);
143 vecLookup_.resize(rowBasis.
size());
146 numCols_ = colBasis.
size();
149 std::vector<int> rowIndexToMasterIndex(rowBasis.
size());
150 for(
int i=0;i<rowBasis.
size();i++)
151 rowIndexToMasterIndex[i] = masterBasis.
index(rowBasis.
term(i));
154 std::vector<int> colIndexToMasterIndex(colBasis.
size());
155 for(
int i=0;i<colBasis.
size();i++)
156 colIndexToMasterIndex[i] = masterBasis.
index(colBasis.
term(i));
159 for(
int r=0;r<rowBasis.
size();r++) {
160 int masterRow = rowIndexToMasterIndex[r];
161 for(
int c=0;c<colBasis.
size();c++) {
162 int masterCol = colIndexToMasterIndex[c];
165 bool activeRC = masterBig(masterRow,masterCol);
169 vecLookup_[r].push_back(c);
176 const std::vector<std::size_t> & indices = activeIndices(i);
177 return indices.end() != std::find(indices.begin(),indices.end(),
j);
182 for(std::size_t r=0;r<rowCount();r++) {
183 for(std::size_t c=0;c<colCount();c++)
184 if(
operator()(r,c)) os <<
" * ";
193 for(std::size_t r=0;r<rowCount();r++)
194 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.