|
casacore
|
#include <RigidVector.h>
Public Member Functions | |
| RigidVector () | |
| RigidVector(Int dummy) { for (Int i=0; i<n; i++) v_p[i]=T(0); } Default constructor. | |
| RigidVector (const T &c) | |
| Construct from scalar, sets all elements to c. | |
| RigidVector (const T &v0, const T &v1) | |
| Construct a 2-element vector, fails for wrong size vectors. | |
| RigidVector (const T &v0, const T &v1, const T &v2) | |
| Construct a 3-element vector, fails for wrong size vectors. | |
| RigidVector (const T &v0, const T &v1, const T &v2, const T &v3) | |
| Construct a 4-element vector, fails for wrong size vectors. | |
| RigidVector (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4) | |
| Construct a 5-element vector, fails for wrong size vectors. | |
| RigidVector (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5) | |
| Construct a 6-element vector, fails for wrong size vectors. | |
| RigidVector (const T v[n]) | |
| Construct from a c-array (copy semantics). | |
| RigidVector (const Vector< T > &v) | |
| Construct from a Vector. | |
| RigidVector (const RigidVector< T, n > &v) | |
| Copy constructor, copy semantics. | |
| RigidVector< T, n > & | operator= (const RigidVector< T, n > &v) |
| Assign from a RigidVector. | |
| RigidVector< T, n > & | operator= (const Vector< T > &v) |
| Assign from a Vector. | |
| RigidVector< T, n > & | operator= (const T &c) |
| Assign a scalar, sets all elements to c. | |
| RigidVector< T, n > & | operator- () |
| Negation. | |
| RigidVector< T, n > & | operator+= (const RigidVector< T, n > &v) |
| Addition. | |
| RigidVector< T, n > & | operator*= (const RigidVector< T, n > &v) |
| RigidVector< T, n > & | operator-= (const RigidVector< T, n > &v) |
| Subtraction. | |
| RigidVector< T, n > & | operator*= (const T &val) |
| Multiplication by scalar. | |
| RigidVector< T, n > & | operator*= (const SquareMatrix< T, n > &m) |
| Multiply vector by matrix: v*=M is equivalent to v=M*v;. | |
| T & | operator() (Int i) |
| Indexing by reference. | |
| const T & | operator() (Int i) const |
| Indexing by const reference. | |
| Vector< T > | vector () const |
| Convert to a regular Vector. | |
| RigidVector< T, n > | sqrt (const RigidVector< T, n > &v) |
| Square Root. | |
Protected Attributes | |
| T | v_p [n] |
| // The following are needed for Image<RigidVector> | |
Friends | |
| RigidVector< T, n > | operator+ (const RigidVector< T, n > &l, const RigidVector< T, n > &r) |
| Add two RigidVectors. | |
| RigidVector< T, n > | operator- (const RigidVector< T, n > &l, const RigidVector< T, n > &r) |
| Subtract two RigidVectors. | |
| T | operator* (const RigidVector< T, n > &l, const RigidVector< T, n > &r) |
| The innerproduct of 2 RigidVectors. | |
| RigidVector< T, n > | operator* (const T &f, const RigidVector< T, n > &v) |
| Multiply a RigidVector by a scalar. | |
| RigidVector< T, n > | operator* (const RigidVector< T, n > &v, const T &f) |
| Multiply a RigidVector by a scalar. | |
| ostream & | operator<< (ostream &os, const RigidVector< T, n > &v) |
| Write out a RigidVector using the Vector output method. | |
| RigidVector< Complex, 4 > | operator* (const SquareMatrix< Complex, 4 > &m, const RigidVector< Float, 4 > &v) |
| Special matrix multiply of Complex matrix * Float vector. | |
Fast Vector classes with fixed (templated) length
Public interface
RigidVector is a vector with a size fixed at compile time, i.e. Rigid as compared to the normal Vector class.
RigidVector is a specialized Vector class for short (<25 elements) vectors. It has a size fixed at compile time, avoids new and delete and uses copy semantics throughout. Unlike Vectors, RigidVectors have fixed zero origin and no strides, allowing fast indexing. The more common mathematical operations are defined for RigidVector, allowing element by element arithmetic, innerproduct and matrix multiplication (by a SquareMatrix). Conversion to and from normal vectors is provided.
The standard Vector class is rather inefficient for short vectors, this class is designed for speed and simplicity.
Definition at line 101 of file RigidVector.h.
|
inline |
RigidVector(Int dummy) { for (Int i=0; i<n; i++) v_p[i]=T(0); } Default constructor.
Definition at line 143 of file RigidVector.h.
References v_p.
Referenced by operator*, operator*, operator*, operator*, operator*=(), operator*=(), operator*=(), operator+, operator+=(), operator-(), operator-, operator-=(), operator<<, operator=(), operator=(), operator=(), RigidVector(), and sqrt().
|
inline |
Construct from scalar, sets all elements to c.
Definition at line 147 of file RigidVector.h.
References v_p.
|
inline |
Construct a 2-element vector, fails for wrong size vectors.
Definition at line 151 of file RigidVector.h.
References v_p.
|
inline |
Construct a 3-element vector, fails for wrong size vectors.
Definition at line 157 of file RigidVector.h.
References v_p.
|
inline |
Construct a 4-element vector, fails for wrong size vectors.
Definition at line 164 of file RigidVector.h.
References v_p.
|
inline |
Construct a 5-element vector, fails for wrong size vectors.
Definition at line 172 of file RigidVector.h.
References v_p.
|
inline |
Construct a 6-element vector, fails for wrong size vectors.
Definition at line 181 of file RigidVector.h.
References v_p.
|
inline |
Construct from a c-array (copy semantics).
Definition at line 191 of file RigidVector.h.
References v_p.
|
inline |
|
inline |
Copy constructor, copy semantics.
Definition at line 199 of file RigidVector.h.
References RigidVector(), and v_p.
|
inline |
|
inline |
|
inline |
Definition at line 227 of file RigidVector.h.
References RigidVector(), and v_p.
| RigidVector< T, n > & casacore::RigidVector< T, n >::operator*= | ( | const SquareMatrix< T, n > & | m | ) |
Multiply vector by matrix: v*=M is equivalent to v=M*v;.
References RigidVector().
|
inline |
Multiplication by scalar.
Definition at line 237 of file RigidVector.h.
References RigidVector(), and v_p.
|
inline |
|
inline |
|
inline |
|
inline |
Assign from a RigidVector.
Definition at line 203 of file RigidVector.h.
References RigidVector(), and v_p.
|
inline |
Assign a scalar, sets all elements to c.
Definition at line 213 of file RigidVector.h.
References RigidVector(), and v_p.
|
inline |
Assign from a Vector.
Definition at line 208 of file RigidVector.h.
References RigidVector(), and v_p.
| RigidVector< T, n > casacore::RigidVector< T, n >::sqrt | ( | const RigidVector< T, n > & | v | ) |
Square Root.
References RigidVector().
|
inline |
Convert to a regular Vector.
Definition at line 251 of file RigidVector.h.
References v_p.
Referenced by operator<<.
|
friend |
The innerproduct of 2 RigidVectors.
Definition at line 114 of file RigidVector.h.
References RigidVector(), casacore::sum(), and v_p.
|
friend |
Multiply a RigidVector by a scalar.
Definition at line 125 of file RigidVector.h.
References RigidVector().
|
friend |
Special matrix multiply of Complex matrix * Float vector.
References RigidVector().
|
friend |
Multiply a RigidVector by a scalar.
Definition at line 120 of file RigidVector.h.
References RigidVector().
|
friend |
|
friend |
|
friend |
Write out a RigidVector using the Vector output method.
Definition at line 130 of file RigidVector.h.
References RigidVector(), and vector().
|
protected |
// The following are needed for Image<RigidVector>
static IPosition shape() {return IPosition(1,n);}
static void* newCopyInfo (const TableRecord& record, const IPosition& sourceElementShape);
static void deleteCopyInfo (void*);
static void set (void* copyInfo, void* out, const Array<T>& in, const IPosition& shape); static void get (void* copyInfo, Array<T>& out, const void* in, const IPosition& shape);
Definition at line 276 of file RigidVector.h.
Referenced by operator()(), operator()(), operator*, operator*=(), operator*=(), operator+=(), operator-(), operator-=(), operator=(), operator=(), operator=(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), RigidVector(), and vector().