44 #ifndef STOKHOS_SPARSE_3_TENSOR_UTILITIES_HPP
45 #define STOKHOS_SPARSE_3_TENSOR_UTILITIES_HPP
53 #include "EpetraExt_RowMatrixOut.h"
65 template <
typename ordinal_type,
typename value_type>
86 for (
typename Cijk_type::k_iterator k_it=Cijk.
k_begin();
87 k_it!=Cijk.
k_end(); ++k_it) {
88 for (
typename Cijk_type::kj_iterator j_it = Cijk.
j_begin(k_it);
89 j_it != Cijk.
j_end(k_it); ++j_it) {
91 for (
typename Cijk_type::kji_iterator i_it = Cijk.
i_begin(j_it);
92 i_it != Cijk.
i_end(j_it); ++i_it) {
113 template <
typename ordinal_type,
typename value_type>
127 for (
typename Cijk_type::k_iterator k_it=Cijk.
k_begin();
128 k_it!=Cijk.
k_end(); ++k_it) {
129 for (
typename Cijk_type::kj_iterator j_it = Cijk.
j_begin(k_it);
130 j_it != Cijk.
j_end(k_it); ++j_it) {
132 for (
typename Cijk_type::kji_iterator i_it = Cijk.
i_begin(j_it);
133 i_it != Cijk.
i_end(j_it); ++i_it) {
146 template <
typename ordinal_type,
typename value_type>
152 const std::string& file)
159 EpetraExt::RowMatrixToMatrixMarketFile(file.c_str(), mat);
162 template <
typename ordinal_type,
typename value_type>
167 const std::string& file)
174 EpetraExt::RowMatrixToMatrixMarketFile(file.c_str(), mat);
179 #endif // SPARSE_3_TENSOR_UTILITIES_HPP
k_iterator k_begin() const
Iterator pointing to first k entry.
Data structure storing a sparse 3-tensor C(i,j,k) in a a compressed format.
void sparse3Tensor2MatrixMarket(const Stokhos::OrthogPolyBasis< ordinal_type, value_type > &basis, const Stokhos::Sparse3Tensor< ordinal_type, value_type > &Cijk, const Epetra_Comm &comm, const std::string &file)
kj_iterator j_begin(const k_iterator &k) const
Iterator pointing to first j entry for given k.
int InsertGlobalIndices(int_type GlobalRow, int NumIndices, int_type *Indices)
int FillComplete(bool OptimizeDataStorage=true)
kj_iterator j_end(const k_iterator &k) const
Iterator pointing to last j entry for given k.
int PutScalar(double ScalarConstant)
Abstract base class for multivariate orthogonal polynomials.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
k_iterator k_end() const
Iterator pointing to last k entry.
Stokhos::Sparse3Tensor< int, double > Cijk_type
Teuchos::RCP< Epetra_CrsGraph > sparse3Tensor2CrsGraph(const Stokhos::OrthogPolyBasis< ordinal_type, value_type > &basis, const Stokhos::Sparse3Tensor< ordinal_type, value_type > &Cijk, const Epetra_Comm &comm)
Build an Epetra_CrsGraph from a sparse 3 tensor.
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.