2 #ifndef vnl_io_vector_fixed_hxx_ 3 #define vnl_io_vector_fixed_hxx_ 8 #include <vsl/vsl_binary_io.h> 9 #include <vsl/vsl_b_read_block_old.h> 10 #include <vsl/vsl_block_binary.h> 14 template<
class T,
unsigned int n>
17 constexpr
short io_version_no = 2;
26 template<
class T,
unsigned int n>
38 if ( n == stream_n ) {
39 vsl_b_read_block_old(is, p.
begin(), n);
41 std::cerr <<
"I/O ERROR: vsl_b_read(vsl_b_istream&, vnl_vector_fixed<T,n>&)\n" 42 <<
" Expected n="<<n<<
", got "<<stream_n<<
'\n';
43 is.is().clear(std::ios::badbit);
50 if ( n == stream_n ) {
53 std::cerr <<
"I/O ERROR: vsl_b_read(vsl_b_istream&, vnl_vector_fixed<T,n>&)\n" 54 <<
" Expected n="<<n<<
", got "<<stream_n<<
'\n';
55 is.is().clear(std::ios::badbit);
61 std::cerr <<
"I/O ERROR: vsl_b_read(vsl_b_istream&, vnl_vector_fixed<T,n>&)\n" 62 <<
" Unknown version number "<< ver <<
'\n';
63 is.is().clear(std::ios::badbit);
70 template<
class T,
unsigned int n>
73 os<<
"Len: "<<p.
size()<<
" [fixed] (";
74 for (
unsigned int i =0; i < p.
size() && i < 5; ++i )
76 if (p.
size() > 5) os <<
" ...";
80 #define VNL_IO_VECTOR_FIXED_INSTANTIATE(T,n) \ 81 template void vsl_print_summary(std::ostream &, const vnl_vector_fixed<T,n > &); \ 82 template void vsl_b_read(vsl_b_istream &, vnl_vector_fixed<T,n > &); \ 83 template void vsl_b_write(vsl_b_ostream &, const vnl_vector_fixed<T,n > &) 85 #endif // vnl_io_vector_fixed_hxx_ void vsl_print_summary(std::ostream &os, vnl_bignum const &b)
Print human readable summary of object to a stream.
unsigned int size() const
Length of the vector.
void vsl_b_read(vsl_b_istream &is, vnl_bignum &v)
Binary load vnl_bignum from stream.
void vsl_b_write(vsl_b_ostream &os, vnl_bignum const &v)
Binary save vnl_bignum to stream.
T const * data_block() const
Access the contiguous block storing the elements in the vector.
Fixed length stack-stored, space-efficient vector.
iterator begin()
Iterator pointing to start of data.