Ravelin
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
CONST_SHAREDVECTORN Class Reference

A generic N-dimensional floating point vector. More...

#include <SharedVectorN.h>

Public Member Functions

 CONST_SHAREDVECTORN ()
 Default constructor - constructs an empty vector.
 
 CONST_SHAREDVECTORN (unsigned len, unsigned inc, unsigned start, SharedResizable< REAL > data)
 Constructs a shared vector using the given arguments.
 
 CONST_SHAREDVECTORN (const SHAREDVECTORN &source)
 
 CONST_SHAREDVECTORN (const CONST_SHAREDVECTORN &source)
 
const SHAREDVECTORN get () const
 Gets this object as a standard shared vector. More...
 
void reset_from (const SHAREDVECTORN &source)
 Constructs a shared vector from another shared vector.
 
void reset_from (const CONST_SHAREDVECTORN &source)
 Constructs a shared vector from another shared vector.
 
unsigned size () const
 
REAL norm_inf () const
 
REAL norm1 () const
 
REAL norm () const
 
REAL norm_sq () const
 
CONST_SHAREDVECTORN segment (unsigned start, unsigned end) const
 Gets a shared subvector of this subvector.
 
CONST_SHAREDVECTORNresize (unsigned N, bool preserve=false)
 Does nothing.
 
const REAL * data () const
 
CONST_SHAREDVECTORNresize (unsigned m, unsigned n, bool preserve=false)
 
void reset ()
 Resets the shared structure.
 
unsigned rows () const
 
unsigned columns () const
 
unsigned leading_dim () const
 
unsigned inc () const
 
const REAL & operator[] (unsigned i) const
 Returns the desired component of this vector.
 
const REAL * data (unsigned i) const
 Gets the appropriate data element.
 
CONST_COLUMN_ITERATOR segment_iterator (unsigned start, unsigned end) const
 
CONST_COLUMN_ITERATOR column_iterator_begin () const
 
CONST_COLUMN_ITERATOR column_iterator_end () const
 
CONST_COLUMN_ITERATOR begin () const
 
CONST_COLUMN_ITERATOR end () const
 
CONST_ROW_ITERATOR row_iterator_begin () const
 
CONST_ROW_ITERATOR row_iterator_end () const
 
bool is_finite () const
 Returns true if all components of this vector are not infinite and not NaN, and false otherwise.
 
template<class V >
V & get_sub_vec (unsigned start, unsigned end, V &v) const
 Gets a sub-vector from this vector. More...
 
template<class V >
bool operator< (const V &v) const
 Compares two vectors lexographically.
 
template<class V >
bool operator== (const V &v) const
 Compares two vectors. More...
 
template<class V >
REAL dot (const V &v) const
 Computes the dot-product between two vectors.
 
template<class V >
V & select (const std::vector< bool > &indices, V &v) const
 Gets a subvector (not necessarily contiguous)
 
template<class ForwardIterator , class V >
V & select (ForwardIterator idx_begin, ForwardIterator idx_end, V &v) const
 Gets a subvector (not necessarily contiguous)
 

Static Public Member Functions

static REAL norm (const CONST_SHAREDVECTORN &v)
 
static REAL norm_sq (const CONST_SHAREDVECTORN &v)
 
template<class V1 , class V2 >
static REAL dot (const V1 &v1, const V2 &v2)
 Computes the dot-product between two vectors.
 
static REAL norm_inf (const CONST_SHAREDVECTORN &v)
 Computes the infinity norm of this vector.
 
static REAL norm1 (const CONST_SHAREDVECTORN &v)
 Computes the l1-norm of this vector.
 

Protected Attributes

SharedResizable< REAL > _data
 
unsigned _start
 
unsigned _inc
 
unsigned _len
 

Friends

class VECTORN
 
class MATRIXN
 
class MATRIX2
 
class MATRIX3
 
class SHAREDVECTORN
 
class SHAREDMATRIXN
 
class CONST_SHAREDMATRIXN
 

Detailed Description

A generic N-dimensional floating point vector.

Member Function Documentation

const SHAREDVECTORN CONST_SHAREDVECTORN::get ( ) const

Gets this object as a standard shared vector.

Note
const-ness is not enforced by my compiler!
template<class V >
V& CONST_SHAREDVECTORN::get_sub_vec ( unsigned  start,
unsigned  end,
V &  v 
) const
inline

Gets a sub-vector from this vector.

Parameters
start_idxthe starting index (inclusive)
end_idxthe ending index (exclusive)
template<class V >
bool CONST_SHAREDVECTORN::operator== ( const V &  v) const
inline

Compares two vectors.

Note
this method exists solely for convenience of use with iterators

The documentation for this class was generated from the following files: