NCBI C++ ToolKit
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members
Vector< T > Class Template Reference

Search Toolkit Book for Vector

#include "njn_vector.hpp"
(Private to src/algo/blast/gumbel_params.)

+ Collaboration diagram for Vector< T >:

Public Member Functions

 Vector ()
 
 Vector (const Vector &vector_)
 
 Vector (const T *begin_, const T *end_)
 
 Vector (size_t m_, const T &a_)
 
virtual ~Vector ()
 
Vectoroperator= (const Vector &vector_)
 
virtual void * create (bool isCopy_=false) const
 
virtual void copy (const T *begin_, const T *end_)
 
virtual void copy (size_t m_, const T &a_)
 
virtual operator bool () const
 
virtual std::ostream & out (std::ostream &ostr_) const
 
virtual std::istream & in (std::istream &istr_)
 
virtual Vectoroperator= (const T &a_)
 
virtual size_t size () const
 
virtual Toperator[] (size_t i_)
 
virtual const Toperator[] (size_t i_) const
 
virtual size_t getM () const
 
virtual const TgetVector () const
 
 Vector (double xi=0.0, double yi=0.0, double zi=0.0)
 
 Vector (const Vector &v)
 
Vectoroperator= (const Vector &v)
 
void Set (double xs, double ys, double zs)
 
bool operator== (const Vector &other)
 
bool operator!= (const Vector &other)
 
double & operator[] (unsigned int i)
 
double operator[] (unsigned int i) const
 
Vectoroperator+= (const Vector &v)
 
Vectoroperator-= (const Vector &v)
 
Vectoroperator*= (double f)
 
Vectoroperator/= (double f)
 
double length (void) const
 
double lengthSquared (void) const
 
void normalize (void)
 

Public Attributes

double x
 
double y
 
double z
 

Private Member Functions

virtual void init (size_t m_)
 
virtual void free ()
 

Private Attributes

size_t d_m
 
Td_vector_p
 

Friends

Vector operator- (const Vector &a)
 
Vector operator+ (const Vector &a, const Vector &b)
 
Vector operator- (const Vector &a, const Vector &b)
 
Vector operator* (const Vector &v, double f)
 
Vector operator* (double f, const Vector &v)
 
Vector operator/ (const Vector &v, double f)
 
double vector_dot (const Vector &a, const Vector &b)
 
Vector vector_cross (const Vector &a, const Vector &b)
 

Detailed Description

template<typename T>
class Vector< T >

Definition at line 51 of file njn_vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/6]

template<typename T >
Vector< T >::Vector
inline

Definition at line 108 of file njn_vector.hpp.

◆ Vector() [2/6]

template<typename T >
Vector< T >::Vector ( const Vector< T > &  vector_)
inline

◆ Vector() [3/6]

template<typename T >
Vector< T >::Vector ( const T begin_,
const T end_ 
)
inline

Definition at line 113 of file njn_vector.hpp.

References copy().

◆ Vector() [4/6]

template<typename T >
Vector< T >::Vector ( size_t  m_,
const T a_ 
)
inline

Definition at line 122 of file njn_vector.hpp.

References copy().

◆ ~Vector()

template<typename T >
Vector< T >::~Vector
inlinevirtual

Definition at line 131 of file njn_vector.hpp.

References free().

◆ Vector() [5/6]

template<typename T >
Vector< T >::Vector ( double  xi = 0.0,
double  yi = 0.0,
double  zi = 0.0 
)
inline

Definition at line 49 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ Vector() [6/6]

template<typename T >
Vector< T >::Vector ( const Vector< T > &  v)
inline

Definition at line 53 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

Member Function Documentation

◆ copy() [1/2]

template<typename T >
void Vector< T >::copy ( const T begin_,
const T end_ 
)
inlinevirtual

Definition at line 149 of file njn_vector.hpp.

References assert, free(), i, and init().

◆ copy() [2/2]

template<typename T >
void Vector< T >::copy ( size_t  m_,
const T a_ 
)
inlinevirtual

Definition at line 167 of file njn_vector.hpp.

References free(), i, and init().

◆ create()

template<typename T >
void * Vector< T >::create ( bool  isCopy_ = false) const
inlinevirtual

Definition at line 141 of file njn_vector.hpp.

◆ free()

template<typename T >
void Vector< T >::free
inlineprivatevirtual

Definition at line 330 of file njn_vector.hpp.

◆ getM()

template<typename T >
virtual size_t Vector< T >::getM ( ) const
inlinevirtual

Definition at line 77 of file njn_vector.hpp.

References Vector< T >::d_m.

◆ getVector()

template<typename T >
virtual const T* Vector< T >::getVector ( ) const
inlinevirtual

Definition at line 78 of file njn_vector.hpp.

References Vector< T >::d_vector_p.

◆ in()

template<typename T >
std::istream & Vector< T >::in ( std::istream &  istr_)
inlinevirtual

◆ init()

template<typename T >
void Vector< T >::init ( size_t  m_)
inlineprivatevirtual

Definition at line 322 of file njn_vector.hpp.

References T.

◆ length()

template<typename T >
double Vector< T >::length ( void  ) const
inline

Definition at line 135 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

Referenced by OpenGLRenderer::NewView(), and Vector< T >::normalize().

◆ lengthSquared()

template<typename T >
double Vector< T >::lengthSquared ( void  ) const
inline

Definition at line 139 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ normalize()

template<typename T >
void Vector< T >::normalize ( void  )
inline

◆ operator bool()

template<typename T >
Vector< T >::operator bool ( void  ) const
inlinevirtual

Definition at line 182 of file njn_vector.hpp.

◆ operator!=()

template<typename T >
bool Vector< T >::operator!= ( const Vector< T > &  other)
inline

Definition at line 70 of file vector_math.hpp.

◆ operator*=()

template<typename T >
Vector& Vector< T >::operator*= ( double  f)
inline

Definition at line 121 of file vector_math.hpp.

References f, Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator+=()

template<typename T >
Vector& Vector< T >::operator+= ( const Vector< T > &  v)
inline

Definition at line 99 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator-=()

template<typename T >
Vector& Vector< T >::operator-= ( const Vector< T > &  v)
inline

Definition at line 108 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator/=()

template<typename T >
Vector& Vector< T >::operator/= ( double  f)
inline

Definition at line 130 of file vector_math.hpp.

References f, Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator=() [1/3]

template<typename T >
Vector< T > & Vector< T >::operator= ( const T a_)
inlinevirtual

Definition at line 185 of file njn_vector.hpp.

References copy().

◆ operator=() [2/3]

template<typename T >
Vector& Vector< T >::operator= ( const Vector< T > &  v)
inline

Definition at line 57 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator=() [3/3]

template<typename T >
Vector< T > & Vector< T >::operator= ( const Vector< T > &  vector_)
inline

Definition at line 134 of file njn_vector.hpp.

References copy().

◆ operator==()

template<typename T >
bool Vector< T >::operator== ( const Vector< T > &  other)
inline

Definition at line 66 of file vector_math.hpp.

References Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator[]() [1/4]

template<typename T >
T & Vector< T >::operator[] ( size_t  i_)
inlinevirtual

Definition at line 310 of file njn_vector.hpp.

◆ operator[]() [2/4]

template<typename T >
const T & Vector< T >::operator[] ( size_t  i_) const
inlinevirtual

Definition at line 316 of file njn_vector.hpp.

◆ operator[]() [3/4]

template<typename T >
double& Vector< T >::operator[] ( unsigned int  i)
inline

Definition at line 74 of file vector_math.hpp.

References ERR_POST, Error(), i, Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ operator[]() [4/4]

template<typename T >
double Vector< T >::operator[] ( unsigned int  i) const
inline

Definition at line 83 of file vector_math.hpp.

References ERR_POST, Error(), i, Vector< T >::x, Vector< T >::y, and Vector< T >::z.

◆ out()

template<typename T >
std::ostream & Vector< T >::out ( std::ostream &  ostr_) const
inlinevirtual

Definition at line 193 of file njn_vector.hpp.

References assert, clearFormat(), getFormat(), HUMAN, i, MACHINE, and USING_SCOPE.

◆ Set()

template<typename T >
void Vector< T >::Set ( double  xs,
double  ys,
double  zs 
)
inline

◆ size()

template<typename T >
size_t Vector< T >::size ( void  ) const
inlinevirtual

Definition at line 304 of file njn_vector.hpp.

Referenced by StructureSet::CenterViewOnAlignedResidues().

Friends And Related Function Documentation

◆ operator* [1/2]

template<typename T >
Vector operator* ( const Vector< T > &  v,
double  f 
)
friend

Definition at line 113 of file vector_math.hpp.

◆ operator* [2/2]

template<typename T >
Vector operator* ( double  f,
const Vector< T > &  v 
)
friend

Definition at line 117 of file vector_math.hpp.

◆ operator+

template<typename T >
Vector operator+ ( const Vector< T > &  a,
const Vector< T > &  b 
)
friend

Definition at line 95 of file vector_math.hpp.

◆ operator- [1/2]

template<typename T >
Vector operator- ( const Vector< T > &  a)
friend

Definition at line 91 of file vector_math.hpp.

◆ operator- [2/2]

template<typename T >
Vector operator- ( const Vector< T > &  a,
const Vector< T > &  b 
)
friend

Definition at line 104 of file vector_math.hpp.

◆ operator/

template<typename T >
Vector operator/ ( const Vector< T > &  v,
double  f 
)
friend

Definition at line 126 of file vector_math.hpp.

◆ vector_cross

template<typename T >
Vector vector_cross ( const Vector< T > &  a,
const Vector< T > &  b 
)
friend

Definition at line 151 of file vector_math.hpp.

◆ vector_dot

template<typename T >
double vector_dot ( const Vector< T > &  a,
const Vector< T > &  b 
)
friend

Definition at line 147 of file vector_math.hpp.

Member Data Documentation

◆ d_m

template<typename T >
size_t Vector< T >::d_m
private

Definition at line 82 of file njn_vector.hpp.

Referenced by Vector< T >::getM().

◆ d_vector_p

template<typename T >
T* Vector< T >::d_vector_p
private

Definition at line 83 of file njn_vector.hpp.

Referenced by Vector< T >::getVector().

◆ x

template<typename T >
double Vector< T >::x

◆ y

template<typename T >
double Vector< T >::y

◆ z

template<typename T >
double Vector< T >::z

The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:30 2024 by modify_doxy.py rev. 669887