29 #ifndef SCIMATH_RIGIDVECTOR_H
30 #define SCIMATH_RIGIDVECTOR_H
32 #include <casacore/casa/aips.h>
33 #include <casacore/casa/Arrays/Vector.h>
34 #include <casacore/casa/BasicSL/Complex.h>
35 #include <casacore/casa/iosfwd.h>
40 template <
class T, Int n>
class SquareMatrix;
148 for (
Int i=0; i<n; i++)
v_p[i]=T(0);
152 for (
Int i=0; i<n; i++)
v_p[i]=
c;
177 const T& v4,
const T& v5) {
183 for (
Int i=0; i<n; i++)
v_p[i]=v[i];
187 for (
Int i=0; i<n; i++)
v_p[i]=v(i);
200 for (
Int i=0; i<n; i++)
v_p[i]=v(i);
205 for (
Int i=0; i<n; i++)
v_p[i]=
c;
215 for (
Int i=0; i<n; i++)
v_p[i]+=v.
v_p[i];
219 for (
Int i=0; i<n; i++)
v_p[i]*=v.
v_p[i];
224 for (
Int i=0; i<n; i++)
v_p[i]-=v.
v_p[i];
229 for (
Int i=0; i<n; i++)
v_p[i]*=val;
244 for (
Int i=0; i<n; i++) v(i)=
v_p[i];
297 #ifndef CASACORE_NO_AUTO_TEMPLATES
298 #include <casacore/scimath/Mathematics/RigidVector.tcc>
RigidVector(const RigidVector< T, n > &v)
Copy constructor, copy semantics.
RigidVector< T, n > & operator=(const Vector< T > &v)
Assign from a Vector.
RigidVector(const T v[n])
Construct from a c-array (copy semantics)
RigidVector(const T &v0, const T &v1)
Construct a 2-element vector, fails for wrong size vectors.
friend ostream & operator<<(ostream &os, const RigidVector< T, n > &v)
Write out a RigidVector using the Vector output method.
RigidVector(const Vector< T > &v)
Construct from a Vector.
friend RigidVector< T, n > operator-(const RigidVector< T, n > &l, const RigidVector< T, n > &r)
Subtract two RigidVectors.
RigidVector< T, n > & operator*=(const SquareMatrix< T, n > &m)
Multiply vector by matrix: v*=M is equivalent to v=M*v;.
friend RigidVector< T, n > operator*(const RigidVector< T, n > &v, const T &f)
Multiply a RigidVector by a scalar.
RigidVector< T, n > & operator+=(const RigidVector< T, n > &v)
Addition
RigidVector(const T &v0, const T &v1, const T &v2, const T &v3)
Construct a 4-element vector, fails for wrong size vectors.
RigidVector()
RigidVector(Int dummy) { for (Int i=0; i<n; i++) v_p[i]=T(0); } Default constructor.
RigidVector< T, n > & operator=(const RigidVector< T, n > &v)
Assign from a RigidVector.
Vector< T > vector() const
Convert to a regular Vector.
RigidVector< T, n > & operator-=(const RigidVector< T, n > &v)
Subtraction.
friend RigidVector< Complex, 4 > operator*(const SquareMatrix< Complex, 4 > &m, const RigidVector< Float, 4 > &v)
Special matrix multiply of Complex matrix * Float vector.
const T & operator()(Int i) const
Indexing by const reference.
RigidVector< T, n > & operator*=(const T &val)
Multiplication by scalar.
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 &c)
Construct from scalar, sets all elements to c.
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, const T &v4, const T &v5)
Construct a 6-element vector, fails for wrong size vectors.
friend RigidVector< T, n > operator+(const RigidVector< T, n > &l, const RigidVector< T, n > &r)
Add two RigidVectors.
friend RigidVector< T, n > operator*(const T &f, const RigidVector< T, n > &v)
Multiply a RigidVector by a scalar.
friend T operator*(const RigidVector< T, n > &l, const RigidVector< T, n > &r)
The innerproduct of 2 RigidVectors.
RigidVector< T, n > & operator=(const T &c)
Assign a scalar, sets all elements to c.
T & operator()(Int i)
Indexing by reference.
RigidVector< T, n > & operator*=(const RigidVector< T, n > &v)
T v_p[n]
// The following are needed for Image<RigidVector>
RigidVector< T, n > & operator-()
Negation.
RigidVector< T, n > sqrt(const RigidVector< T, n > &v)
Square Root.
const Double c
Fundamental physical constants (SI units):
this file contains all the compiler specific defines
LatticeExprNode sum(const LatticeExprNode &expr)
RigidVector< Float, 4 > operator*(const SquareMatrix< Float, 4 > &m, const RigidVector< Float, 4 > &v)
Multiply vector by matrix.
RigidVector< Complex, 4 > operator*(const SquareMatrix< Complex, 4 > &m, const RigidVector< Complex, 4 > &v)
Multiply vector by matrix.