Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Stokhos_BasisInteractionGraph.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef STOKHOS_BASIS_INTERACTION_GRAPH_HPP
11 #define STOKHOS_BASIS_INTERACTION_GRAPH_HPP
12 
14 #include "Stokhos_ProductBasis.hpp"
15 #include "Teuchos_RCP.hpp"
16 
17 #include <vector>
18 
19 namespace Stokhos {
20 
22  public:
25  BasisInteractionGraph(const Stokhos::OrthogPolyBasis<int,double> & max_basis,bool onlyUseLinear=false,int porder=-1);
27  const Stokhos::ProductBasis<int,double> & rowBasis,
28  const Stokhos::ProductBasis<int,double> & colBasis,bool onlyUseLinear=false,int porder=-1);
29 
32  bool onlyUseLinear=false,int porder=-1);
33 
36  const Stokhos::ProductBasis<int,double> & rowBasis,
37  const Stokhos::ProductBasis<int,double> & colBasis,bool onlyUseLinear=false,int porder=-1);
38 
40  void initialize(const Stokhos::OrthogPolyBasis<int,double> & max_basis,
42  int porder=-1);
43 
45  void initialize(const Stokhos::ProductBasis<int,double> & max_basis,
47  const Stokhos::ProductBasis<int,double> & rowBasis,
48  const Stokhos::ProductBasis<int,double> & colBasis,int porder=-1);
49 
51  const std::vector<std::size_t> & activeIndices(std::size_t i) const
52  { return vecLookup_[i]; }
53 
55  bool operator()(std::size_t i,std::size_t j) const;
56 
58  std::size_t numNonZeros() const;
59 
61  std::size_t rowCount() const
62  { return vecLookup_.size(); }
63 
65  std::size_t colCount() const
66  { return numCols_; }
67 
68  void printGraph(std::ostream & os) const;
69 
70  protected:
71  std::size_t numCols_;
72 
73  std::vector<std::vector<std::size_t> > vecLookup_;
74 
76  };
77 
78 } // namespace Stokhos
79 
80 #endif // STOKHOS_BASIS_INTERACTION_GRAPH_HPP
std::size_t colCount() const
What is the number of columns.
std::size_t numNonZeros() const
How many non zeros are in this graph.
const std::vector< std::size_t > & activeIndices(std::size_t i) const
Grab active indicies in graph for row 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.
std::vector< std::vector< std::size_t > > vecLookup_
std::size_t rowCount() const
What is the number of rows.