Function vector_out (o2scl)¶
-
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 totrue
. If the parametern
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 totrue
. If the parametern
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.