Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
Stokhos_ReducedQuadratureFactory.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Stokhos Package
5 // Copyright (2009) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef STOKHOS_REDUCED_QUADRATURE_FACTORY_HPP
43 #define STOKHOS_REDUCED_QUADRATURE_FACTORY_HPP
44 
45 #include "Teuchos_RCP.hpp"
46 #include "Teuchos_Array.hpp"
47 #include "Teuchos_BLAS.hpp"
48 #include "Teuchos_LAPACK.hpp"
52 
53 namespace Stokhos {
54 
64  template <typename ordinal_type, typename value_type>
66  public:
67 
69 
73 
76 
83  const Teuchos::Array<value_type>& weights) const;
84 
85  protected:
86 
90  const Teuchos::Array<value_type>& weights,
94  ) const;
95 
99  const Teuchos::Array<value_type>& weights,
103  ) const;
104 
108  const Teuchos::Array<value_type>& weights,
112  ) const;
113 
118  const Teuchos::Array<value_type>& weights,
122  ) const;
123 
128  const Teuchos::Array<value_type>& weights,
132  ) const;
133 
138  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
139 
140  void solver_TRSM(
144  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
145 
146  void solver_GLPK(
150  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
151 
152  void solver_CLP(
156  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
157 
158  void solver_CLP_IP(
162  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
163 
164  void solver_qpOASES(
168  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
169 
174  Teuchos::ETransp transa, Teuchos::EUplo uplo) const;
175 
178  const value_type tol) const;
179 
183  ordinal_type n_choose_k(const ordinal_type& n, const ordinal_type& k) const;
184 
185  private:
186 
187  // Prohibit copying
189 
190  // Prohibit Assignment
192 
193  protected:
194 
197 
199  std::string reduction_method;
200 
202  std::string solver_method;
203 
206 
208  bool verbose;
209 
212 
215 
218 
219  }; // class ReducedQuadratureFactory
220 
221 } // Namespace Stokhos
222 
223 // Include template definitions
225 
226 #endif
Teuchos_ParameterList.hpp
Stokhos::ReducedQuadratureFactory::reducedQuadrature_Q_Squared_CPQR
void reducedQuadrature_Q_Squared_CPQR(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, Teuchos::RCP< Teuchos::Array< value_type > > &red_weights, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_points, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_values) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:266
Stokhos::ReducedQuadratureFactory::reduction_tol
value_type reduction_tol
Dimension reduction tolerance.
Definition: Stokhos_ReducedQuadratureFactory.hpp:211
Teuchos_RCP.hpp
Stokhos::ReducedQuadratureFactory::solver_CompressedSensing
void solver_CompressedSensing(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:1231
Stokhos::ReducedQuadratureFactory::createReducedQuadrature
virtual Teuchos::RCP< const Stokhos::UserDefinedQuadrature< ordinal_type, value_type > > createReducedQuadrature(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q2, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights) const
Get reduced quadrature object.
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:86
Stokhos::ReducedQuadratureFactory::verbose
bool verbose
Whether to print a bunch of stuff out.
Definition: Stokhos_ReducedQuadratureFactory.hpp:208
Stokhos::ReducedQuadratureFactory::reducedQuadrature_Q_Squared_CPQR2
void reducedQuadrature_Q_Squared_CPQR2(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, Teuchos::RCP< Teuchos::Array< value_type > > &red_weights, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_points, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_values) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:395
Stokhos::ReducedQuadratureFactory::blas
Teuchos::BLAS< ordinal_type, value_type > blas
Definition: Stokhos_ReducedQuadratureFactory.hpp:217
Stokhos::ReducedQuadratureFactory::objective_value
value_type objective_value
Value used in LP-based objective function.
Definition: Stokhos_ReducedQuadratureFactory.hpp:214
Stokhos::ReducedQuadratureFactory::eliminate_dependent_rows
bool eliminate_dependent_rows
Whether to eliminate dependent rows in constraints.
Definition: Stokhos_ReducedQuadratureFactory.hpp:205
TotalOrderBasisUnitTest::value_type
double value_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:70
Stokhos_UserDefinedQuadrature.hpp
Teuchos::BLAS< ordinal_type, value_type >
Teuchos_Array.hpp
Stokhos::ReducedQuadratureFactory::solver_GLPK
void solver_GLPK(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:823
Teuchos_LAPACK.hpp
Teuchos::RCP
Stokhos::ReducedQuadratureFactory::~ReducedQuadratureFactory
virtual ~ReducedQuadratureFactory()
Destructor.
Definition: Stokhos_ReducedQuadratureFactory.hpp:75
Teuchos::Array< value_type >
Q2
Definition: gram_schmidt_example3.cpp:79
Stokhos::ReducedQuadratureFactory::reduction_method
std::string reduction_method
Reduction method.
Definition: Stokhos_ReducedQuadratureFactory.hpp:199
Stokhos::ReducedQuadratureFactory::reducedQuadrature_Q_Squared
void reducedQuadrature_Q_Squared(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, Teuchos::RCP< Teuchos::Array< value_type > > &red_weights, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_points, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_values) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:160
TotalOrderBasisUnitTest::ordinal_type
int ordinal_type
Definition: Stokhos_LexicographicTreeBasisUnitTest.cpp:69
Stokhos::ReducedQuadratureFactory::params
Teuchos::ParameterList params
Algorithm parameters.
Definition: Stokhos_ReducedQuadratureFactory.hpp:196
Stokhos::ReducedQuadratureFactory::n_choose_k
ordinal_type n_choose_k(const ordinal_type &n, const ordinal_type &k) const
Compute bionomial coefficient (n ; k) = n!/( k! (n-k)! )
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:1305
Stokhos::ReducedQuadratureFactory::solver_CLP_IP
void solver_CLP_IP(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:1050
Stokhos
Top-level namespace for Stokhos classes and functions.
Definition: Stokhos_AbstractPreconditionerFactory.hpp:48
Stokhos::ReducedQuadratureFactory::ReducedQuadratureFactory
ReducedQuadratureFactory(const Teuchos::ParameterList &params)
Constructor.
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:71
Stokhos::ReducedQuadratureFactory::solver_method
std::string solver_method
Underdetermined solver method.
Definition: Stokhos_ReducedQuadratureFactory.hpp:202
Teuchos_SerialDenseMatrix.hpp
Stokhos::ReducedQuadratureFactory::underdetermined_solver
void underdetermined_solver(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:762
Stokhos::ReducedQuadratureFactory::lapack
Teuchos::LAPACK< ordinal_type, value_type > lapack
Definition: Stokhos_ReducedQuadratureFactory.hpp:216
Stokhos::ReducedQuadratureFactory::computeRank
ordinal_type computeRank(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &R, const value_type tol) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:1271
Stokhos::ReducedQuadratureFactory::solver_CLP
void solver_CLP(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:943
cusp::detail::device::x
const IndexType const IndexType const IndexType const IndexType const ValueType const ValueType * x
Definition: csr_vector.h:260
Stokhos::ReducedQuadratureFactory::solver_qpOASES
void solver_qpOASES(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:1157
A
Teuchos::SerialDenseVector< ordinal_type, value_type >
Teuchos_BLAS.hpp
Stokhos::ReducedQuadratureFactory
Generate a basis from a given set of PCE expansions that is orthogonal with respect to the product me...
Definition: Stokhos_ReducedQuadratureFactory.hpp:65
Stokhos::ReducedQuadratureFactory::reducedQuadrature_Q2_CPQR
void reducedQuadrature_Q2_CPQR(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q2, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, Teuchos::RCP< Teuchos::Array< value_type > > &red_weights, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_points, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_values) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:643
Stokhos::ReducedQuadratureFactory::operator=
ReducedQuadratureFactory & operator=(const ReducedQuadratureFactory &)
Teuchos::SerialDenseMatrix< ordinal_type, value_type >
Stokhos::ReducedQuadratureFactory::reducedQuadrature_Q2
void reducedQuadrature_Q2(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &Q2, const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &F, const Teuchos::Array< value_type > &weights, Teuchos::RCP< Teuchos::Array< value_type > > &red_weights, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_points, Teuchos::RCP< Teuchos::Array< Teuchos::Array< value_type > > > &red_values) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:548
Teuchos::ParameterList
Stokhos::ReducedQuadratureFactory::solver_TRSM
void solver_TRSM(const Teuchos::SerialDenseMatrix< ordinal_type, value_type > &A, const Teuchos::SerialDenseVector< ordinal_type, value_type > &b, Teuchos::SerialDenseVector< ordinal_type, value_type > &x, Teuchos::ETransp transa, Teuchos::EUplo uplo) const
Definition: Stokhos_ReducedQuadratureFactoryImp.hpp:789
Teuchos::LAPACK< ordinal_type, value_type >
Teuchos::EUplo
EUplo
Stokhos_ReducedQuadratureFactoryImp.hpp
Teuchos::ETransp
ETransp