2 #ifndef vnl_complex_ops_hxx_ 3 #define vnl_complex_ops_hxx_ 16 # include <vcl_msvc_warnings.h> 25 for (
unsigned i=0; i<n; ++i)
33 for (
unsigned i=0; i<n; ++i)
34 dst[i] = std::complex<T>(re[i], im[i]);
147 vnl_real(std::complex<T>
const* C, T* R,
unsigned int n)
149 for (
unsigned int i=0; i<n; ++i)
150 R[i] = std::real(C[i]);
161 for (; cIt != C.
end(); ++cIt, ++rIt)
162 *rIt = std::real(*cIt);
174 for (; cIt != C.
end(); ++cIt, ++rIt)
175 *rIt = std::real(*cIt);
187 for (; cIt != C.
end(); ++cIt, ++rIt)
188 *rIt = std::real(*cIt);
200 for (; cIt != C.
end(); ++cIt, ++rIt)
201 *rIt = std::real(*cIt);
218 vnl_imag(std::complex<T>
const* C, T* I,
unsigned int n)
220 for (
unsigned int i=0; i<n; ++i)
221 I[i] = std::imag(C[i]);
232 for (; cIt != C.
end(); ++cIt, ++rIt)
233 *rIt = std::imag(*cIt);
245 for (; cIt != C.
end(); ++cIt, ++rIt)
246 *rIt = std::imag(*cIt);
258 for (; cIt != C.
end(); ++cIt, ++rIt)
259 *rIt = std::imag(*cIt);
271 for (; cIt != C.
end(); ++cIt, ++rIt)
272 *rIt = std::imag(*cIt);
278 #define VNL_COMPLEX_OPS_INSTANTIATE(T) \ 279 template VNL_EXPORT void vnl_complexify(T const *, std::complex<T > *, unsigned); \ 280 template VNL_EXPORT void vnl_complexify(T const *, T const *, std::complex<T > *, unsigned); \ 282 template VNL_EXPORT vnl_vector<std::complex<T > > vnl_complexify(vnl_vector<T > const &); \ 283 template VNL_EXPORT vnl_vector<std::complex<T > > vnl_complexify(vnl_vector<T > const &, vnl_vector<T > const &); \ 284 template VNL_EXPORT vnl_matrix<std::complex<T > > vnl_complexify(vnl_matrix<T > const &); \ 285 template VNL_EXPORT vnl_matrix<std::complex<T > > vnl_complexify(vnl_matrix<T > const &, vnl_matrix<T > const &); \ 286 template VNL_EXPORT vnl_diag_matrix<std::complex<T > > vnl_complexify(vnl_diag_matrix<T > const &); \ 287 template VNL_EXPORT vnl_diag_matrix<std::complex<T > > vnl_complexify(vnl_diag_matrix<T > const &,vnl_diag_matrix<T > const&); \ 288 template VNL_EXPORT vnl_sym_matrix<std::complex<T > > vnl_complexify(vnl_sym_matrix<T > const &); \ 289 template VNL_EXPORT vnl_sym_matrix<std::complex<T > > vnl_complexify(vnl_sym_matrix<T > const &,vnl_sym_matrix<T > const&); \ 291 template VNL_EXPORT void vnl_real(std::complex<T > const*, T*, unsigned int); \ 292 template VNL_EXPORT void vnl_imag(std::complex<T > const*, T*, unsigned int); \ 294 template VNL_EXPORT vnl_vector<T > vnl_real(vnl_vector<std::complex<T > > const&); \ 295 template VNL_EXPORT vnl_vector<T > vnl_imag(vnl_vector<std::complex<T > > const&); \ 297 template VNL_EXPORT vnl_matrix<T > vnl_real(vnl_matrix<std::complex<T > > const&); \ 298 template VNL_EXPORT vnl_matrix<T > vnl_imag(vnl_matrix<std::complex<T > > const&); \ 300 template VNL_EXPORT vnl_diag_matrix<T > vnl_real(vnl_diag_matrix<std::complex<T > > const&); \ 301 template VNL_EXPORT vnl_diag_matrix<T > vnl_imag(vnl_diag_matrix<std::complex<T > > const&); \ 303 template VNL_EXPORT vnl_sym_matrix<T > vnl_real(vnl_sym_matrix<std::complex<T > > const&); \ 304 template VNL_EXPORT vnl_sym_matrix<T > vnl_imag(vnl_sym_matrix<std::complex<T > > const&) 306 #endif // vnl_complex_ops_hxx_ unsigned int size() const
Return the total number of elements stored by the matrix.
unsigned int cols() const
Return the number of columns.
iterator end()
Iterator pointing to element beyond end of data.
Functions to create complex vectors and matrices from real ones.
unsigned int rows() const
Return the number of rows.
unsigned int cols() const
Return the number of columns.
size_t size() const
Return the length, number of elements, dimension of this vector.
VNL_EXPORT vnl_vector< T > vnl_real(vnl_vector< std::complex< T > > const &C)
Vector of real parts of vnl_vector<std::complex<T> >.
iterator begin()
Iterator pointing to start of data.
iterator end()
Iterator pointing to element beyond end of data.
Functions to return the imaginary parts of complex arrays, vectors, matrices.
unsigned int rows() const
Return the number of rows.
iterator begin()
Iterator pointing to start of data.
unsigned int size() const
Return the total number of elements stored by the matrix.
An ordinary mathematical matrix.
VNL_EXPORT vnl_vector< T > vnl_imag(vnl_vector< std::complex< T > > const &C)
Vector of imaginary parts of vnl_vector<std::complex<T> >.
Mathematical vector class, templated by type of element.
VNL_EXPORT vnl_vector< std::complex< T > > vnl_complexify(vnl_vector< T > const &R)
Return complexified version of real vector R.
Functions to return the real parts of complex arrays, vectors, matrices.
T * iterator
Type defs for iterators.
unsigned int size() const
Return the total number of elements stored by the matrix.
stores a diagonal matrix as a single vector.
unsigned int rows() const
Return the number of rows.
vnl_vector< T >::iterator iterator
stores a symmetric matrix as just the diagonal and lower triangular part.