Function vector_out (o2scl)

O2scl : Function List

template<class vec_t>
void o2scl::vector_out(std::ostream &os, size_t n, const vec_t &v, bool endline = false)

Output the first n elements of a vector to a stream, os.

No trailing space is output after the last element, and an endline is output only if endline is set to true. If the parameter n is zero, this function silently does nothing.

This works with any class vec_t which has an operator[] which returns either the value of or a reference to the ith element and the element type has its own output operator which has been defined.

template<class vec_t>
void o2scl::vector_out(std::ostream &os, const vec_t &v, bool endline = false)

Output a vector to a stream.

No trailing space is output after the last element, and an endline is output only if endline is set to true. If the parameter n is zero, this function silently does nothing.

This works with any class vec_t which has an operator[] which returns either the value of or a reference to the ith element and the element type has its own output operator which has been defined.