14 template <
class S,
class T>
15 void vnl_copy(S
const *
const src, T *
const dst,
const unsigned n)
17 for (
unsigned int i=0; i<n; ++i)
21 template <
class S,
class T>
24 assert(src.size() == dst.size());
25 vnl_copy(src.begin(), dst.begin(), src.size());
31 #define VNL_COPY_INSTANTIATE0(S, T) \ 32 template void VNL_EXPORT vnl_copy(S const * const, T * const, const unsigned ) 37 #ifndef __hppa // assembler bug on HP? 41 #define vnl_copy_macro(S, D) \ 43 VNL_EXPORT void vnl_copy(std::complex<S> const * const src, std::complex<D> * const dst, const unsigned n) \ 45 for (unsigned int i=0; i<n; ++i) \ 46 dst[i] = std::complex<D>((D)std::real(src[i]), (D)std::imag(src[i])); \ 55 #define vnl_copy_dumb(S) \ 57 VNL_EXPORT void vnl_copy(S const * const src, S *const dst, const unsigned n) \ 59 for (unsigned int i=0; i<n; ++i) \ 68 #define VNL_COPY_INSTANTIATE(S, T) \ 69 template VNL_EXPORT void vnl_copy(vnl_vector<S > const &, vnl_vector<T > &); \ 70 template VNL_EXPORT void vnl_copy(vnl_matrix<S > const &, vnl_matrix<T > &); \ 71 template VNL_EXPORT void vnl_copy(vnl_diag_matrix<S > const &, vnl_diag_matrix<T > &) 76 #define VNL_COPY_INSTANTIATE_twoway(S, T) \ 77 VNL_COPY_INSTANTIATE(S, T); \ 78 VNL_COPY_INSTANTIATE(T, S) 82 #ifndef __hppa // assembler bug on HP? An ordinary mathematical matrix.
VNL_EXPORT void vnl_copy(S const *const src, T *const dst, const unsigned n)
Easy conversion between vectors and matrices templated over different types.
#define vnl_copy_macro(S, D)
#define VNL_COPY_INSTANTIATE0(S, T)
#define VNL_COPY_INSTANTIATE_twoway(S, T)
#define VNL_COPY_INSTANTIATE(S, T)
Contains class for diagonal matrices.