26 #ifndef JSPACE_VECTOR_UTIL_HPP
27 #define JSPACE_VECTOR_UTIL_HPP
37 template<
typename container_t>
38 bool compare(container_t
const & lhs, container_t
const & rhs,
typename container_t::value_type precision)
43 if (lhs.size() != rhs.size()) {
46 typename container_t::const_iterator il(lhs.begin());
47 typename container_t::const_iterator ir(rhs.begin());
48 typename container_t::const_iterator il_end(lhs.end());
49 for (; il != il_end; ++il, ++ir) {
50 if (fabs(*il - *ir) > precision) {
58 template<
typename container_t>
59 void zero(container_t & vv)
61 std::fill(vv.begin(), vv.end(), 0);
68 ostream & operator << (ostream & os, vector<double>
const & rhs);
72 #endif // JSPACE_VECTOR_UTIL_HPP