JDFTx  1.3.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vector3< scalar > Class Template Reference

Generic 3-vector. More...

#include <vector3.h>

Public Member Functions

__hostanddev__ scalar & operator[] (int k)
 Access element.
__hostanddev__ const scalar & operator[] (int k) const
 Access element.
__hostanddev__ scalar & x ()
__hostanddev__ scalar & y ()
__hostanddev__ scalar & z ()
__hostanddev__ const scalar & x () const
__hostanddev__ const scalar & y () const
__hostanddev__ const scalar & z () const
__hostanddev__ bool isNonzero () const
 true if any component nonzero
__hostanddev__ vector3 (scalar a=0, scalar b=0, scalar c=0)
 Construct from elements.
 vector3 (std::vector< scalar > a)
 convert from std::vector
template<typename scalar2 >
__hostanddev__ vector3 (const vector3< scalar2 > &a)
 convert scalar type
__hostanddev__ vector3 operator+ (const vector3 &a) const
__hostanddev__ vector3 operator+= (const vector3 &a)
__hostanddev__ vector3 operator+ (const scalar a) const
__hostanddev__ vector3 operator+= (const scalar a)
__hostanddev__ vector3 operator- () const
__hostanddev__ vector3 operator- (const vector3 &a) const
__hostanddev__ vector3 operator-= (const vector3 &a)
__hostanddev__ vector3 operator/ (scalar s) const
__hostanddev__ vector3operator/= (scalar s)
__hostanddev__ scalar length_squared () const
__hostanddev__ scalar length () const
void print (FILE *fp, const char *format) const
 print to file / stream
__hostanddev__ bool operator== (const vector3 &w) const
__hostanddev__ bool operator< (const vector3 &w) const
 comparison in lexicographic order

Detailed Description

template<typename scalar = double>
class vector3< scalar >

Generic 3-vector.

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