KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Functions
l_int_vector.h File Reference

Definition for the Int_vector class, a thin wrapper on the KJB Int_vector struct and its related functionality. More...

#include "l/l_debug.h"
#include "l/l_int_vector.h"
#include "l/l_sys_io.h"
#include "l/l_sys_lib.h"
#include "l_cpp/l_util.h"
#include "l_cpp/l_exception.h"
#include <vector>
#include <boost/concept_check.hpp>

Go to the source code of this file.

Classes

class  kjb::Int_vector
 This class implements vectors, in the linear-algebra sense, restricted to integer-valued elements. More...
 

Namespaces

 boost
 
 boost::archive
 
 kjb
 Classes and functions for dealing with trajectory files.
 

Functions

Int_vector kjb::create_random_int_vector (int length)
 Construct a vector with random contents. More...
 
Int_vector kjb::create_vector_from_vector_section (const Int_vector &iv, int begin, int length)
 Construct a vector by deep-copying a section of another vector. More...
 
Int_vector kjb::operator* (const Int_vector &op1, const Int_matrix &op2)
 Return product of this (as a row-vec) times matrix on the right. More...
 
Int_vector kjb::operator* (const Int_matrix &op1, const Int_vector &op2)
 Compute product of this matrix (on the left) and a column vector (on the right). More...
 
Int_vector kjb::operator* (const Int_vector &op1, Int_vector::Value_type op2)
 Scalar multiply, resulting in a new vector, e.g., v * 6. More...
 
Int_vector kjb::operator* (Int_vector::Value_type op1, const Int_vector &op2)
 Scalar multiplication of a vector. More...
 
Int_vector kjb::operator/ (const Int_vector &op1, Int_vector::Value_type op2)
 Scalar integer division, yielding a new vector. More...
 
Int_vector kjb::operator+ (const Int_vector &op1, const Int_vector &op2)
 Add two vectors, creating a new vector, e.g., v + w. More...
 
Int_vector kjb::operator- (const Int_vector &op1, const Int_vector &op2)
 Subtract one vector from another, resulting in a new vector, e.g., v - w. More...
 
Int_vector kjb::operator- (const Int_vector &op1)
 Return the negation of a vector, as in (-v), resulting in a new vector. More...
 
std::ostream & kjb::operator<< (std::ostream &out, const Int_vector &m)
 Display vector contents in an ASCII format. More...
 
bool kjb::operator== (const Int_vector &op1, const Int_vector::Impl_type &op2)
 Test for exact equality between vectors. More...
 
bool kjb::operator== (const Int_vector::Impl_type &op1, const Int_vector &op2)
 Test for exact equality between vectors. More...
 
bool kjb::operator!= (const Int_vector &op1, const Int_vector::Impl_type &op2)
 Test for (any) inequality between vectors. More...
 
bool kjb::operator!= (const Int_vector::Impl_type &op1, const Int_vector &op2)
 Test for inequality between vectors. More...
 
bool kjb::operator== (const Int_vector &op1, const Int_vector &op2)
 Test for exact equality between vectors. More...
 
bool kjb::operator!= (const Int_vector &op1, const Int_vector &op2)
 Test for (any) inequality between vectors. More...
 
bool kjb::operator< (const Int_vector &op1, const Int_vector &op2)
 Test weak lexicographic ordering between vectors. More...
 
bool kjb::operator<= (const Int_vector &op1, const Int_vector &op2)
 Test lexicographic ordering between vectors. More...
 
bool kjb::operator> (const Int_vector &op1, const Int_vector &op2)
 Test lexicographic ordering between vectors. More...
 
bool kjb::operator>= (const Int_vector &op1, const Int_vector &op2)
 Test lexicographic ordering between vectors. More...
 
Int_vector::Value_type kjb::max_abs_difference (const Int_vector &op1, const Int_vector &op2)
 Return the maximum of the absolute values of the elementwise difference between two vectors, provided they have the same length. More...
 
long int kjb::dot (const Int_vector &op1, const Int_vector &op2)
 Returns dot product of this and op2. More...
 
Int_vector kjb::cross (const Int_vector &op1, const Int_vector &op2)
 Compute cross product of op1 and op2. More...
 
double kjb::norm2 (const Int_vector &op1)
 Compute l2-norm of vector. More...
 
double kjb::vector_distance (const Int_vector &op1, const Int_vector &op2)
 Compute the Euclidian distance between two vectors. More...
 
double kjb::vector_distance_squared (const Int_vector &op1, const Int_vector &op2)
 Compute the square of the Euclidian distance between two vectors. More...
 

Detailed Description

Definition for the Int_vector class, a thin wrapper on the KJB Int_vector struct and its related functionality.

Author
Kobus Barnard
Luca Del Pero
Kyle Simek
Andrew Predoehl
Ernesto Brau

If you make changes to this file, PLEASE CONSIDER making parallel changes to m_vector.h, whose structure closely parallels the structure of this file. Tip: use vimdiff on both files to show the parallel structure.

Although this class has much the same interface as class Vector, they are not derived from a common abstract interface, because (1) we want as much speed as possible – this code should be eligible to put inside a tight inner loop; and (2) I don't know whether that would be useful.