Template object creation problem

hi
i wnt to create a template object which takes templates as arguments .

The below code gives me error

1
2
3
4
length_type nrange = 4;
typedef Convolution<vsip::Vector,nonsym,support_full> con; 
Vector<value_type> ran(nrange);
con c(ran,Domain<1>(nrange));


The error is

1
2
3
4
ds.cpp:106: error: no matching function for call to `vsip::Convolution<vsip::Vector,  nonsym,  support_full, vsip::VSIP_DEFAULT_VALUE_TYPE, 0u,  alg_time>::Convolution(vsip::Vector<std::complex<float>, vsip::Dense<1u, std::complex<float>, vsip::tuple<0u, 1u, 2u>, vsip::Local_map> >&, vsip::Domain<1u>)'
/usr/local/include/vsip/core/signal/conv.hpp:129: note: candidates are: vsip::Convolution<ConstViewT, Symm, Supp, T, N_times, A_hint>::Convolution(const vsip::Convolution<ConstViewT, Symm, Supp, T, N_times, A_hint>&) [with ConstViewT = vsip::Vector, vsip::symmetry_type Symm =  nonsym, vsip::support_region_type Supp =  support_full, T = vsip::VSIP_DEFAULT_VALUE_TYPE, unsigned int N_times = 0u, vsip::alg_hint_type A_hint =  alg_time]
../ds.cpp:117:5: warning: no newline at end of file
make: *** [ds.o] Error 1 


The class Convolution definition is
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
template <template <typename, typename> class ConstViewT,
	  symmetry_type                       Symm,
	  support_region_type                 Supp,
	  typename                            T = VSIP_DEFAULT_VALUE_TYPE,
	  unsigned                            N_times = 0,
          alg_hint_type                       A_hint = alg_time>
class Convolution
  : public impl::profile::Accumulator<impl::profile::signal>,
#if VSIP_IMPL_REF_IMPL
    public impl::cvsip::Convolution<impl::Dim_of_view<ConstViewT>::dim,
                                    Symm, Supp, float, N_times, A_hint>
#else
    public impl::dispatcher::Dispatcher<
             impl::dispatcher::Conv_tag<impl::Dim_of_view<ConstViewT>::dim,
                                        Symm,
                                        Supp,
                                        T,
                                        N_times,
                                        A_hint> >::backend_type
#endif
{
  // Implementation compile-time constants.
private: 
  static dimension_type const dim = impl::Dim_of_view<ConstViewT>::dim;

  typedef impl::profile::Accumulator<impl::profile::signal> accumulator_type;

#if VSIP_IMPL_REF_IMPL
  typedef impl::cvsip::Convolution<impl::Dim_of_view<ConstViewT>::dim,
                                   Symm, Supp, float, N_times, A_hint> base_type;
#else
  typedef typename impl::dispatcher::Dispatcher<
                   impl::dispatcher::Conv_tag<dim,
                                              Symm,
                                              Supp,
                                              T,
                                              N_times,
                                              A_hint> >::backend_type base_type;
#endif

public:
  template <typename Block>
  Convolution(ConstViewT<T, Block> filter_coeffs,
	      Domain<dim> const&   input_size,
	      length_type          decimation = 1)
    VSIP_THROW((std::bad_alloc))
      : accumulator_type(impl::signal_detail::Description<dim, T>::tag
                         ("Convolution",
                          impl::extent(impl::conv_output_size
                                       (Supp, view_domain(filter_coeffs), 
                                        input_size, decimation)),
                          impl::extent(filter_coeffs)),
                         impl::signal_detail::Op_count_conv<dim, T>::value
                         (impl::extent(impl::conv_output_size
                                       (Supp, view_domain(filter_coeffs),
                                        input_size, decimation)),
                          impl::extent(filter_coeffs))),
        base_type(filter_coeffs, input_size, decimation)
  {
    assert(decimation >= 1);
    assert(Symm == nonsym ? (filter_coeffs.size() <=   input_size.size())
			  : (filter_coeffs.size() <= 2*input_size.size()));
  }



The Vector definition is

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
template <typename T, typename Block>
class Vector : public vsip::impl_View<vsip::Vector,Block>
{
  typedef vsip::impl_View<vsip::Vector,Block> impl_base_type;
  typedef typename impl::Lvalue_factory_type<Block>::type impl_factory_type;

public:
  // Compile-time values.
  static dimension_type const dim = 1;
  typedef Block                                      block_type;
  typedef typename block_type::value_type            value_type;
  typedef typename impl_factory_type::reference_type reference_type;
  typedef typename impl_factory_type::const_reference_type
		const_reference_type;

private:
  // Implementation compile-time values.
  typedef typename block_type::map_type             impl_map_type;

  // [view.vector.subview_types]
  // Override subview_type and make it writable.
  typedef impl::Subset_block<block_type> impl_subblock_type;

public:
  typedef Vector<T, impl_subblock_type>      subview_type;

  // [view.vector.constructors]
  Vector(length_type len, T const& value,
	 impl_map_type const& map = impl_map_type())
    : impl_base_type(len, value, map, impl::disambiguate)
  {}

  explicit Vector(length_type len,
	          impl_map_type const& map = impl_map_type())
    : impl_base_type(len, map)
  {}



How do i create the object of Convolution class.

EDIT:- Complete definition is at http://www.codesourcery.com/public/vsiplplusplus/sourceryvsipl++-1.4/reference/index.html
click vsip in the left coloum and then sources for Convolution in the right coloumn.
Topic archived. No new replies allowed.