]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libvtv/testsuite/template-list.cc
3 extern "C" int printf(const char *, ...);
9 Subscriptor() : counter(1) {}
11 virtual ~Subscriptor()
21 template <int dim
> struct Function
23 Function(int i
): value(dim
+ i
) {}
27 template <int dim
> struct Triangulation
32 template <int dim
> struct Exercise_2_3
38 struct SetUpBase
: public Subscriptor
41 const Function
<dim
> get_boundary_values () const = 0;
44 const Function
<dim
> get_right_hand_side () const = 0;
47 // void create_coarse_grid (Triangulation<dim> &coarse_grid) const = 0;
50 template <class Traits
, int dim
>
51 struct SetUp
: public SetUpBase
<dim
>
56 const Function
<dim
> get_boundary_values () const
57 { return Function
<dim
>(Traits::DIM
); }
60 const Function
<dim
> get_right_hand_side () const
61 { return Function
<dim
>(Traits::DIM
); }
64 // void create_coarse_grid (Triangulation<dim> &coarse_grid) const;
66 // static const typename Traits::BoundaryValues boundary_values;
67 // static const typename Traits::RightHandSide right_hand_side;
75 SetUp<Exercise_2_3<1000>, 2> s1a;
76 SetUp<Exercise_2_3<2000>, 1> s2;
77 SetUp<Exercise_2_3<2000>, 2> s2a;
78 return s1->get_boundary_values().value + s1a.get_boundary_values().value +
79 s2.get_boundary_values().value + s2a.get_boundary_values().value +
80 s1->get_right_hand_side().value + s1a.get_right_hand_side().value +
81 s2.get_right_hand_side().value + s2a.get_right_hand_side().value;
84 SetUp
<Exercise_2_3
<1000>, 1> * s1
= new SetUp
<Exercise_2_3
<1000>, 1>();
85 printf("%d\n", s1
->get_boundary_values().value
);
88 SetUp
<Exercise_2_3
<1000>, 1> s1
;
89 printf("%d\n", s1
.get_boundary_values().value
);