39 #include "m/m_vector.h"
40 #include "m/m_vec_norm.h"
41 #include "m/m_vec_metric.h"
49 #ifdef KJB_HAVE_BST_SERIAL
50 #include <boost/serialization/access.hpp>
89 #ifdef KJB_HAVE_BST_SERIAL
90 friend class boost::serialization::access;
128 static const char*
const BAD_SEGMENT;
135 void throw_bad_bounds(
int )
const;
151 template<
typename InputIterator_>
152 void m_initialize_dispatch(InputIterator_ begin_,
153 InputIterator_ end_, std::input_iterator_tag);
161 template<
typename ForwardIterator_>
162 void m_initialize_dispatch(ForwardIterator_ begin_, ForwardIterator_ end_, std::forward_iterator_tag)
164 const size_type n = std::distance(begin_, end_);
165 m_ensure_capacity(n);
167 m_vector->length = n;
169 std::copy(begin_, end_, this->
begin());
186 ETX( kjb_c::get_target_vector(&m_vector,
length) );
202 ETX( kjb_c::get_target_vector(&m_vector, static_cast<int>(length)) );
218 ETX( kjb_c::get_target_vector(&m_vector, static_cast<int>(length)) );
230 ETX( kjb_c::get_initialized_vector(&m_vector, length, num) );
242 ETX( kjb_c::get_target_vector(&m_vector, length) );
243 std::copy( data, data + length, m_vector -> elements );
262 ETX( kjb_c::get_target_vector(&m_vector, length) );
263 std::copy( data, data + length, m_vector -> elements );
287 : m_vector( vec_ptr )
292 ETX( kjb_c::get_target_vector(&m_vector, 0) );
306 Vector(
const std::vector<double>& src);
317 ETX( kjb_c::get_initialized_vector(&m_vector, 1, val) );
343 ETX( kjb_c::get_target_vector(&m_vector, 2) );
344 m_vector->elements[0] = val1;
345 m_vector->elements[1] = val2;
357 ETX( kjb_c::get_target_vector(&m_vector, 3) );
358 m_vector->elements[0] = val1;
359 m_vector->elements[1] = val2;
360 m_vector->elements[2] = val3;
372 ETX( kjb_c::get_target_vector(&m_vector, 4) );
373 m_vector->elements[0] = val1;
374 m_vector->elements[1] = val2;
375 m_vector->elements[2] = val3;
376 m_vector->elements[3] = val4;
394 ETX( kjb_c::copy_vector(&m_vector, &vec_ref) );
423 Vector(
const std::string& file_name);
437 ETX( kjb_c::copy_vector(&m_vector, vec_ref.m_vector) );
442 #ifdef KJB_HAVE_CXX11
447 : m_vector( nullptr )
449 m_vector = vec_ref.m_vector;
450 vec_ref.m_vector = 0;
472 template<
typename InputIterator_>
473 Vector(InputIterator_ begin_, InputIterator_ end_)
476 ETX( kjb_c::get_target_vector(&m_vector, 8) );
477 m_vector->length = 0;
479 typedef typename std::iterator_traits<InputIterator_>::
480 iterator_category IterCategory_;
481 m_initialize_dispatch(begin_, end_, IterCategory_());
493 kjb_c::free_vector(m_vector);
504 return m_vector ->
length;
539 return iterator(m_vector->elements);
559 return iterator(m_vector->elements + m_vector->length);
620 m_ensure_capacity(capacity);
634 ETX( kjb_c::get_random_vector(&m_vector, length) );
674 ETX( kjb_c::get_zero_vector(&m_vector, length) );
709 get_target_vector(&m_vector, 1);
720 get_target_vector(&m_vector, 2);
732 get_target_vector(&m_vector, 3);
745 get_target_vector(&m_vector, 4);
769 if ( m_vector != &vec_ref )
772 ETX( kjb_c::copy_vector(&m_vector, &vec_ref) );
783 #ifdef KJB_HAVE_CXX11
792 kjb_c::free_vector( m_vector );
793 m_vector = other.m_vector;
908 return m_vector -> elements[
i ];
922 return m_vector -> elements[
i ];
980 throw_bad_bounds( i );
1031 template<
typename InputIterator>
1032 void insert(
iterator position, InputIterator begin_, InputIterator end_);
1046 template<
typename InputIterator>
1047 void assign(InputIterator begin_, InputIterator end_);
1077 m_vector->length = 0;
1130 m_ensure_capacity(m_vector->length + 1);
1133 assert(m_vector->length <= m_vector->max_length);
1134 m_vector->elements[ (m_vector->length - 1) ] = x;
1158 ETX(kjb_c::write_row_vector_full_precision( m_vector, filename ));
1173 ETX(kjb_c::write_col_vector_with_header( m_vector, filename ));
1183 void read(
const char* filename = 0 )
1186 ETX(kjb_c::read_vector( &m_vector, filename ));
1198 void write(
const char* filename = 0 )
const
1221 ETX( kjb_c::ow_multiply_vector_by_scalar(m_vector, op2) );
1243 ETX( kjb_c::ow_multiply_vectors(m_vector, op2.m_vector) );
1256 ETX( kjb_c::ow_divide_vector_by_scalar(m_vector, op2) );
1278 ETX( kjb_c::ow_divide_vectors(m_vector, op2.m_vector) );
1290 ETX( kjb_c::ow_add_vectors(m_vector, op2.m_vector) );
1320 ETX( kjb_c::ow_subtract_vectors(m_vector, op2.m_vector) );
1390 "Vector is empty; min is undefined" );
1392 if ( 0 == min_index )
1396 return kjb_c::min_vector_element(m_vector);
1400 *min_index = kjb_c::get_min_vector_element(m_vector, &min_val);
1431 "Vector is empty; max is undefined" );
1433 if ( 0 == max_index )
1437 return kjb_c::max_vector_element(m_vector);
1441 *max_index = kjb_c::get_max_vector_element(m_vector, &max_val);
1493 return kjb_c::vector_magnitude(m_vector);
1504 return kjb_c::sum_vector_squared_elements(m_vector);
1515 return kjb_c::sum_vector_elements(m_vector);
1527 kjb_c::normalize_vector(&m_vector, m_vector, method);
1542 template <
class View_type>
1543 void init_from_view_(
const View_type& vec_view);
1545 template<
class Archive>
1546 void serialize(Archive &ar,
const unsigned int version)
1562 template<
typename InputIterator_>
1563 void Vector::m_initialize_dispatch
1565 InputIterator_ begin_,
1566 InputIterator_ end_,
1567 std::input_iterator_tag
1570 for(; begin_ != end_; ++begin_)
1578 template<
typename InputIterator>
1582 InputIterator begin_,
1587 const size_type offset = position - begin();
1588 assert(offset <= size());
1590 m_ensure_capacity(m_vector->length + N);
1591 position = begin() + offset;
1595 m_vector->length += N;
1599 if(position == 0 && m_vector->length == N)
1601 position = m_vector->elements;
1605 std::copy(position, old_end, position + N);
1608 std::copy(begin_, end_, position);
1611 template<
typename InputIterator>
1620 template <
class View_type>
1621 void Vector::init_from_view_(
const View_type& vec_view)
1623 Vector result(vec_view.size());
1624 for(
int i = 0;
i < vec_view.size(); ++
i)
1626 result[
i] = vec_view[
i];
1646 kjb_c::Vector* result = 0;
1647 ETX( kjb_c::get_random_vector( &result, length ) );
1669 return Vector(length, 0.0);
1685 kjb_c::Vector* outvec = 0;
1687 "Failure in create_vector_from_vector_section : allocation error or bad indices");
1711 Vector
operator*(
const Vector& op1,
const Matrix& op2);
1721 Vector
operator*(
const Matrix& op1,
const Vector& op2 );
1732 return Vector(op1) *= op2;
1759 return Vector(op1) /= op2;
1772 return Vector(op1) += op2;
1785 return Vector(op1) -= op2;
1798 return op1 * (-1.0);
1840 return !(op1 == op2);
1896 bool operator<(
const Vector& op1,
const Vector &op2);
1904 return (op1 < op2) || (op1 == op2);
1913 return !(op1 < op2) && !(op1 == op2);
1922 return !(op1 < op2);
1933 std::ostream&
operator<<(std::ostream& out,
const Vector&
m);
2009 Vector
cross(
const Vector& op1,
const Vector& op2);
2112 template<
class InputIterator>
2117 for(InputIterator p = first; p != last; p++)
2125 for(InputIterator p = first; p != last; p++)
2127 for(
int i = 0;
i < p->get_length();
i++)
2129 ret[size +
i] = (*p)[
i];
2143 template<
class OutputIterator>
2153 for(
int i = 0;
i < n;
i++)
2168 Int_vector
floor(
const Vector& realv );
Vector & subtract(const Vector &op2)
Subtract vector from self, in-place, just like v -= delta_v.
Definition: m_vector.h:1336
Vector & resize(int new_length, Value_type pad=Value_type(0))
Resize vector, retaining previous values.
Definition: m_vector.cpp:242
Generic_vector_view< Vector > Vector_view
Definition: m_vector.h:64
double * pointer
Definition: m_vector.h:110
Vector & cross_with(const Vector &op2)
Compute cross product of op1 and op2.
Definition: m_vector.cpp:543
kjb::Vector create_uniformly_spaced_vector(double a, double b, unsigned n)
Definition: m_vector.cpp:667
double vector_distance(const Int_vector &op1, const Int_vector &op2)
Compute the Euclidian distance between two vectors.
Definition: l_int_vector.h:1569
Int_vector cross(const Int_vector &op1, const Int_vector &op2)
Compute cross product of op1 and op2.
Definition: l_int_vector.cpp:381
Vector & ew_multiply(const Vector &op2)
Element wise multiplication of two vectors.
Definition: m_vector.h:1241
void pop_back()
Returns the last element of the vector.
Definition: m_vector.h:1142
Vector & operator/=(Value_type op2)
Scalar division of self, in-place.
Definition: m_vector.h:1253
Vector create_zero_vector(int length)
Construct a vector containing zeroes.
Definition: m_vector.h:1666
#define ETX(a)
Definition: l_exception.h:67
double vector_distance_squared(const Int_vector &op1, const Int_vector &op2)
Compute the square of the Euclidian distance between two vectors.
Definition: l_int_vector.h:1581
Int_matrix::Value_type max(const Int_matrix &mat)
Return the maximum value in this matrix.
Definition: l_int_matrix.h:1397
reference back()
Returns the last element of the vector.
Definition: m_vector.h:1107
Vector create_random_vector(int length)
Construct a vector with values drawn from a uniform distribution over [0,1].
Definition: m_vector.h:1643
iterator insert(iterator position, value_type t)
A copy of t is inserted before position.
Definition: m_vector.cpp:282
size_type size() const
Alias to get_length(). Required to comply with stl Container concept.
Definition: m_vector.h:510
Vector & negate()
Negate self, in-place, just like v *= (-1).
Definition: m_vector.h:1347
bool empty() const
Returns true iff size is zero. Required to comply with stl Container concept.
Definition: m_vector.h:526
Vector cat_vectors(const Vector &first, const Vector &second)
Concatenate two vectors.
Definition: m_vector.h:2099
void write_col(const char *filename=0) const
Write vector as a column to a file, or to standard output.
Definition: m_vector.h:1170
Vector & divide(Value_type op2)
Scalar division of self, in-place, just like v /= 2.
Definition: m_vector.h:1265
Vector normalized(kjb_c::Norm_method method=kjb_c::NORMALIZE_BY_MAGNITUDE) const
non=mutating version of "normalize()"
Definition: m_vector.h:1534
Vector & replace(const Vector &iv, int offset, int begin, int length)
Copy elements from input vector iv into this vector, starting at some offset, leaving the rest of thi...
Definition: m_vector.cpp:222
Vector & operator+=(const Vector &op2)
Add vector to self, in-place, e.g., v += delta_v.
Definition: m_vector.h:1287
std::reverse_iterator< const_iterator > const_reverse_iterator
const Iterator type
Definition: m_vector.h:120
const_reverse_iterator rbegin() const
Definition: m_vector.h:587
int get_length() const
Return the length of the vector.
Definition: m_vector.h:501
Object thrown when an argument is of the wrong size or dimensions.
Definition: l_exception.h:426
Vector(int length, const Value_type *data)
Initialize from an array of doubles, of given length.
Definition: m_vector.h:238
iterator erase(iterator position)
erase element at position and shift all elements after p up by 1.
Definition: m_vector.cpp:343
Vector(unsigned long length)
Allocate vector of given length; contents are uninitialized.
Definition: m_vector.h:214
Int_matrix::Value_type max_abs_difference(const Int_matrix &op1, const Int_matrix &op2)
Find the largest difference between two matrices.
Definition: l_int_matrix.h:1364
double Value_type
data type of the elements
Definition: m_vector.h:101
const value_type * const_iterator
Definition: m_vector.h:118
void swap(Perspective_camera &cam1, Perspective_camera &cam2)
Swap two cameras.
Definition: perspective_camera.h:599
kjb_c::Vector Impl_type
the underlying implementation
Definition: m_vector.h:102
std::vector< Vector > get_transpose(const std::vector< Vector > &m)
Treat a std::vector of kjb::Vectors as a matrix and get its 'transpose'.
Definition: m_vector.cpp:631
const Value_type & at(int i) const
Safely subscript vector, e.g., A.at(10), to get an rvalue.
Definition: m_vector.h:1005
Value_type & at(int i)
Safely subscript vector, e.g., A.at(10), to get an lvalue.
Definition: m_vector.h:991
Vector Vec_type
the associated vector type
Definition: m_vector.h:105
void write_row(const char *filename=0) const
Write vector as a row to a file, or to standard output.
Definition: m_vector.h:1155
void push_back(Value_type x)
inserts an element at the back of the vector in amortized constant time.
Definition: m_vector.h:1128
bool operator<(const Face_detection &f1, const Face_detection &f2)
Compares to boxes using middle of box. Needed because we have associated containers of these...
Definition: d_facecom.cpp:147
Image operator-(const Image &im1, const Image &im2)
Subtract two images.
Definition: i_image.h:843
Vector(InputIterator_ begin_, InputIterator_ end_)
"Range constructor"
Definition: m_vector.h:473
#define KJB_THROW(ex)
Definition: l_exception.h:46
int size_type
Definition: m_vector.h:121
void read(const char *filename=0)
Read vector from a file, or from standard input.
Definition: m_vector.h:1183
double & reference
Definition: m_vector.h:112
Vector & set(Value_type val1, Value_type val2, Value_type val3)
Convert to a 3-vector and set its values to the arguments.
Definition: m_vector.h:730
Value_type(* Mapper)(Value_type)
element transformer fun
Definition: m_vector.h:106
This class implements vectors, in the linear-algebra sense, with real-valued elements.
Definition: m_vector.h:87
Vector & randomize(int length)
Clobber current vector; resize and fill with random values.
Definition: m_vector.h:631
Impl_type *& get_underlying_representation_with_guilt()
Get pointer to the underlying kjb_c::Vector C struct.
Definition: m_vector.h:857
bool operator>=(const Int_vector &op1, const Int_vector &op2)
Test lexicographic ordering between vectors.
Definition: l_int_vector.h:1494
Vector & zero_out()
Clobber current vector contents with zeroes.
Definition: m_vector.h:684
Generic_matrix_view< Matrix > Mat_view_type
view type of the associated matrix type
Definition: m_vector.h:104
Value_type & operator[](int i)
Subscript vector like a C array, e.g., A[10], returning an lvalue.
Definition: m_vector.h:905
size_t length(const C &cner)
Counts the total number of elements in a 2D STL-style container.
Definition: l_util.h:17
Object thrown when a function cannot generate a valid result.
Definition: l_exception.h:516
reference front()
Returns the first element of the vector.
Definition: m_vector.h:1086
int difference_type
Definition: m_vector.h:122
const_reference front() const
Returns the first element of the vector.
Definition: m_vector.h:1097
Image operator+(const Image &op1, const Image &op2)
Add two images.
Definition: i_image.h:834
kjb::Matrix hat() const
Construct an "equivalent" skew-symmetric matrix from 3-vector.
Definition: m_vector.cpp:516
double value_type
Definition: m_vector.h:109
value_type * iterator
Definition: m_vector.h:117
const Value_type & operator()(int i) const
Fortran-style vector subscript, e.g., A(10), to get an rvalue.
Definition: m_vector.h:945
Vector & operator=(const Mat_view_type &vec_ref)
Assignment operator: assign from a single-row matrix-view.
Definition: m_vector.cpp:213
reverse_iterator rbegin()
Definition: m_vector.h:577
void clear()
delete all elements from vector
Definition: m_vector.h:1075
void kjb_serialize(Archive &ar, KJB_readable_writable &obj, const unsigned int version)
Definition: l_serialization.h:170
Vector & operator=(const Vector &src)
Assignment operator: assign from a kjb::Vector, a C++ object.
Definition: m_vector.h:805
Vector(Value_type val)
Create a single-element vector.
Definition: m_vector.h:313
Vector & operator=(const Impl_type &vec_ref)
Assignment operator: assign from a kjb_c::Vector, a C struct.
Definition: m_vector.h:767
~Vector()
Destructor – which just calls the KJB destructor.
Definition: m_vector.h:490
const double * const_pointer
Definition: m_vector.h:111
Vector(Value_type val1, Value_type val2)
Create a two-vector.
Definition: m_vector.h:339
Vector & zero_out(int length)
Clone of randomize(int)
Definition: m_vector.h:671
iterator end()
Definition: m_vector.h:557
Vector(Value_type val1, Value_type val2, Value_type val3, Value_type val4)
Create a four-vector.
Definition: m_vector.h:368
iterator begin()
Definition: m_vector.h:537
Definition: m_mat_view.h:55
Value_type & operator()(int i)
Fortran-style vector subscript, e.g., A(10), to get an lvalue.
Definition: m_vector.h:932
Vector(Value_type val1, Value_type val2, Value_type val3)
Create a three-vector.
Definition: m_vector.h:353
Int_matrix floor(const Matrix &m)
Definition: m_matrix.cpp:2026
x
Definition: APPgetLargeConnectedEdges.m:100
Vector & set(Value_type val)
Clone of zero_out(int)
Definition: m_vector.h:707
Vector & operator-=(const Vector &op2)
Subtract vector from self, in-place, e.g., v -= delta_v.
Definition: m_vector.h:1317
void reserve(int capacity)
Definition: m_vector.h:618
double get_max_abs_difference(const Vector &op2) const
returns the sum of the element-wise differences between this vector and the input vector ...
Definition: m_vector.cpp:475
const Value_type & operator[](int i) const
Subscript vector like a C array, e.g., A[10], returning an rvalue.
Definition: m_vector.h:919
Value_type magnitude() const
Return this vector's magnitude.
Definition: m_vector.h:1490
This class implements vectors, in the linear-algebra sense, restricted to integer-valued elements...
Definition: l_int_vector.h:83
const_reference back() const
Returns the last element of the vector.
Definition: m_vector.h:1118
Vec_type & mapcar(Mapper)
Transform the elements of a vector.
Definition: m_vector.cpp:502
Vector & multiply(Value_type op2)
Scalar multiply self, in-place, just like v *= 6.
Definition: m_vector.h:1230
bool operator>(const Int_vector &op1, const Int_vector &op2)
Test lexicographic ordering between vectors.
Definition: l_int_vector.h:1485
void check_bounds(int i) const
Test whether a subscript is valid, throw an exception if not.
Definition: m_vector.h:975
std::ofstream & operator<<(std::ofstream &out, const Quaternion &q)
Definition: turntable_camera.cpp:77
Vector & set(Value_type val1, Value_type val2)
Convert to a 2-vector and set its values to the arguments.
Definition: m_vector.h:718
Image operator/(const Image &op1, double op2)
Scale an image in channel space, yielding a new image.
Definition: i_image.h:825
const_iterator end() const
Definition: m_vector.h:567
#define KJB_THROW_2(ex, msg)
Definition: l_exception.h:48
void write(const char *filename=0) const
Write vector to a file, or to standard output.
Definition: m_vector.h:1198
bool operator!=(const Int_matrix &op1, const Int_matrix::Impl_type &op2)
Test for any difference between two matrices.
Definition: l_int_matrix.h:1274
Vector(int length=0)
Allocate vector of given length; contents are uninitialized.
Definition: m_vector.h:182
void swap(kjb::Gsl_Multimin_fdf &m1, kjb::Gsl_Multimin_fdf &m2)
Swap two wrapped multimin objects.
Definition: gsl_multimin.h:693
Value_type max(int *max_index) const
Find maximum element in the vector, both its value and index.
Definition: m_vector.h:1425
Matrix Mat_type
the associated matrix type
Definition: m_vector.h:103
Vector & normalize(kjb_c::Norm_method method=kjb_c::NORMALIZE_BY_MAGNITUDE)
Normalize vector in place by choice of method (default by magnitude).
Definition: m_vector.h:1524
bool operator==(const Int_matrix &op1, const Int_matrix::Impl_type &op2)
Test for exact equality between two matrices.
Definition: l_int_matrix.cpp:218
Int_vector create_vector_from_vector_section(const Int_vector &iv, int begin, int length)
Construct a vector by deep-copying a section of another vector.
Definition: l_int_vector.h:1252
#define ETX_2(a, msg)
Definition: l_exception.h:78
Vector(const Vector &vec_ref)
Copy ctor – calls the kjb_c function to copy a vector.
Definition: m_vector.h:433
Vector & randomize()
Clobber current vector contents with random values.
Definition: m_vector.h:647
Vector create_gauss_random_vector(int length)
Construct a vector with values drawn from a standard Gaussian distribution (mean 0, variance 1);.
Definition: m_vector.cpp:390
Int_matrix::Value_type min(const Int_matrix &mat)
Return the minimum value in this matrix.
Definition: l_int_matrix.h:1385
double norm1(const Vector &op)
Compute L1-norm of vector.
Definition: m_vector.h:2020
Vector(int length, Value_type num)
Allocate vector of given length; initialize all elts to 'num'.
Definition: m_vector.h:226
Vector & operator*=(Value_type op2)
Scalar multiply self, in-place, e.g., v *= 6.
Definition: m_vector.h:1218
size_type max_size() const
Maximum size vector can ever have. Currently defined as INT_MAX.
Definition: m_vector.h:518
std::reverse_iterator< iterator > reverse_iterator
Definition: m_vector.h:119
Vector(unsigned length)
Allocate vector of given length; contents are uninitialized.
Definition: m_vector.h:198
const_iterator begin() const
Definition: m_vector.h:547
void swap(Vector &other)
Swap the representations of two vectors.
Definition: m_vector.h:884
Object thrown when an argument to a function is not acceptable.
Definition: l_exception.h:377
Definition: m_vec_view.h:56
Vector & set(Value_type val1, Value_type val2, Value_type val3, Value_type val4)
Convert to a 4-vector and set its values to the arguments.
Definition: m_vector.h:743
Vector(int length, const float *data)
Initialize from an array of floats, of given length.
Definition: m_vector.h:258
const Generic_vector_view< const Vector > Const_vector_view
Definition: m_vector.h:67
double norm2(const Int_vector &op1)
Compute l2-norm of vector.
Definition: l_int_vector.h:1558
get the indices of edges in each direction for i
Definition: APPgetLargeConnectedEdges.m:48
This class implements matrices, in the linear-algebra sense, with real-valued elements.
Definition: m_matrix.h:94
long int dot(const Int_vector &op1, const Int_vector &op2)
Returns dot product of this and op2.
Definition: l_int_vector.h:1532
for m
Definition: APPgetLargeConnectedEdges.m:64
double vector_distance(const Vector &op1, const Vector &op2)
Compute the Euclidian distance between two vectors.
Definition: m_vector.h:2052
Vector & add(const Vector &op2)
Add vector to self, in-place, just like v += delta_v.
Definition: m_vector.h:1306
double const_reference
Definition: m_vector.h:113
reverse_iterator rend()
Definition: m_vector.h:597
Support for error handling exception classes in libKJB.
std::ostream & stream_write_vector(std::ostream &ost, const Vector &v)
Write vector to an output stream so it can be read with read_vector.
Definition: m_vector.cpp:598
Value_type magnitude_squared() const
Return this vector's squared magnitude.
Definition: m_vector.h:1501
const Impl_type * get_c_vector() const
Get const pointer to the underlying kjb_c::Vector C struct.
Definition: m_vector.h:844
bool operator<=(const Int_vector &op1, const Int_vector &op2)
Test lexicographic ordering between vectors.
Definition: l_int_vector.h:1476
Gsl_Vector operator*(double scalar, const Gsl_Vector &vector)
multiply scalar and vector, scalar written on the left side
Definition: gsl_vector.h:661
void assign(size_type N, value_type t)
Resizes to N, filling all values with t.
Definition: m_vector.cpp:306
Vector & ew_divide(const Vector &op2)
Element wise division of two vectors; result is stored in first.
Definition: m_vector.h:1276
std::istream & stream_read_vector(std::istream &ist, Vector &v)
Read vector from an input stream.
Definition: m_vector.cpp:615
Vector(Impl_type *vec_ptr)
Conversion ctor: claim ownership of an existing vector pointer (i.e., make a shallow copy)...
Definition: m_vector.h:286
OutputIterator separate_vector(const Vector &vec, int sz, OutputIterator result)
Separate the given vector into vectors of the give size; the vectors will be output into the output i...
Definition: m_vector.h:2144
Vector(const Impl_type &vec_ref)
Ctor copies contents (i.e., deep copy) of an existing vector.
Definition: m_vector.h:390
const_reverse_iterator rend() const
Definition: m_vector.h:607
Impl_type * get_underlying_representation_unsafe()
Get pointer to the underlying kjb_c::Vector C struct.
Definition: m_vector.h:873
Value_type min(int *min_index) const
Find minimum element in the vector, both its value and index.
Definition: m_vector.h:1384
Value_type sum_vector_elements() const
Return this vector's elements sum.
Definition: m_vector.h:1512