30 #ifndef RYTHMOS_RK_BUTCHER_TABLEAU_BASE_HPP
31 #define RYTHMOS_RK_BUTCHER_TABLEAU_BASE_HPP
33 #include "Rythmos_Types.hpp"
34 #include "Teuchos_Describable.hpp"
35 #include "Teuchos_ParameterListAcceptor.hpp"
36 #include "Teuchos_VerboseObject.hpp"
37 #include "Teuchos_SerialDenseMatrix.hpp"
38 #include "Teuchos_SerialDenseVector.hpp"
43 template<
class Scalar>
44 class RKButcherTableauBase :
45 virtual public Teuchos::Describable,
46 virtual public Teuchos::ParameterListAcceptor,
47 virtual public Teuchos::VerboseObject<RKButcherTableauBase<Scalar> >
51 virtual int numStages()
const = 0;
53 virtual const Teuchos::SerialDenseMatrix<int,Scalar>& A()
const = 0;
55 virtual const Teuchos::SerialDenseVector<int,Scalar>& b()
const = 0;
57 virtual const Teuchos::SerialDenseVector<int,Scalar>& bhat()
const = 0;
59 virtual const Teuchos::SerialDenseVector<int,Scalar>& c()
const = 0;
61 virtual int order()
const = 0;
63 virtual bool isEmbeddedMethod()
const = 0;
65 virtual bool operator== (
const RKButcherTableauBase<Scalar>& rkbt)
const;
67 virtual void setDescription(std::string longDescription) = 0;
72 template<
class Scalar>
73 bool RKButcherTableauBase<Scalar>::operator== (
const RKButcherTableauBase<Scalar>& rkbt)
const
75 if (this->numStages() != rkbt.numStages()) {
78 if (this->order() != rkbt.order()) {
81 int N = rkbt.numStages();
83 const Teuchos::SerialDenseVector<int,Scalar> b_ = this->b();
84 const Teuchos::SerialDenseVector<int,Scalar> c_ = this->c();
85 const Teuchos::SerialDenseVector<int,Scalar> other_b = rkbt.b();
86 const Teuchos::SerialDenseVector<int,Scalar> other_c = rkbt.c();
87 for (
int i=0 ; i<N ; ++i) {
88 if (b_(i) != other_b(i)) {
91 if (c_(i) != other_c(i)) {
96 const Teuchos::SerialDenseMatrix<int,Scalar>& A_ = this->A();
97 const Teuchos::SerialDenseMatrix<int,Scalar>& other_A = rkbt.A();
98 for (
int i=0 ; i<N ; ++i) {
99 for (
int j=0 ; j<N ; ++j) {
100 if (A_(i,j) != other_A(i,j)) {
111 #endif // RYTHMOS_RK_BUTCHER_TABLEAU_BASE_HPP