2 #ifndef vnl_vector_fixed_hxx_ 3 #define vnl_vector_fixed_hxx_ 14 # include <vcl_msvc_warnings.h> 18 template<
class T,
unsigned int n>
22 #if VNL_CONFIG_CHECK_BOUNDS && (!defined NDEBUG) 28 template<
class T,
unsigned int n>
32 #if VNL_CONFIG_CHECK_BOUNDS && (!defined NDEBUG) 38 template<
class T,
unsigned int n>
43 template<
class T,
unsigned int n>
48 template<
class T,
unsigned int n>
53 template<
class T,
unsigned int n>
58 template<
class T,
unsigned int n>
64 ret[i] = f( data_[i] );
68 template<
class T,
unsigned int n>
74 ret[i] = f( data_[i] );
78 template<
class T,
unsigned int n>
85 this->data_[i] =
v[i-start];
89 template <
class T,
unsigned int n>
93 for (
unsigned int i=0; 2*i+1 < n; ++i )
98 template <
class T,
unsigned int n>
102 for (
size_type i = 0; i < this->size(); ++i )
110 template <
class T,
unsigned int n>
115 for (
size_type i = 0; i < this->size(); ++i )
116 if ( !( (*
this)[i] == zero) )
123 template <
class T,
unsigned int n>
127 for (
size_type i = 0; i < this->size(); ++i)
130 return s.good() || s.eof();
133 template <
class T,
unsigned int n>
137 if (this->is_finite())
140 std::cerr << __FILE__
": *** NAN FEVER **\n" << *
this;
144 template <
class T,
unsigned int n>
148 if (this->size() > 0)
150 for (
size_type i=1; i < this->size(); ++i)
151 s <<
' ' << (*
this)[i];
154 template <
class T,
unsigned int n>
158 #if VNL_CONFIG_CHECK_BOUNDS 159 if (i >= this->size())
162 return this->data_[i];
168 #define VNL_VECTOR_FIXED_INSTANTIATE(T,n) \ 169 template class VNL_EXPORT vnl_vector_fixed<T,n > 171 #endif // vnl_vector_fixed_hxx_ T & operator()(unsigned int i)
Return reference to the element at specified index.
void swap(double &a, double &b)
bool is_finite() const
Return true if it's finite.
void assert_finite_internal() const
See assert_finite().
Namespace with standard math functions.
bool is_zero() const
Return true iff all the entries are zero.
T & operator[](const size_t i)
Return the i-th element.
T get(unsigned int i) const
Get value at element i.
vnl_vector_fixed< T, n > apply(T(*f)(T))
Apply f to each element.
bool read_ascii(std::istream &s)
Read from text stream.
T const * data_block() const
Access the contiguous block storing the elements in the vector.
bool isfinite(vnl_bignum const &x)
Mathematical vector class, templated by type of element.
Fixed length stack-stored, space-efficient vector.
Fixed length stack-stored vector.
vnl_vector_fixed & update(vnl_vector< T > const &, unsigned int start=0)
Replaces elements with index beginning at start, by values of v. O(n).
void vnl_error_vector_index(char const *fcn, int index)
Raise exception for invalid index.
vnl_vector_fixed & flip()
Reverse the order of the elements.
void print(std::ostream &s) const
Display the vector.