4 #ifndef CPPQEDCORE_QUANTUMDATA_ARRAYBASE_H_INCLUDED
5 #define CPPQEDCORE_QUANTUMDATA_ARRAYBASE_H_INCLUDED
7 #include "ArrayBaseFwd.h"
13 #include <boost/utility.hpp>
27 explicit ArrayBase(
const ArrayLow& arrayLow) : arrayLow_(arrayLow) {}
39 const ArrayLow& getArray()
const {
return arrayLow_;}
40 ArrayLow& getArray() {
return const_cast<ArrayLow&
>(
static_cast<const ArrayBase*
>(
this)->getArray());}
45 void operator+=(
const ArrayBase& arrayBase) {arrayLow_+=arrayBase.arrayLow_;}
46 void operator-=(
const ArrayBase& arrayBase) {arrayLow_-=arrayBase.arrayLow_;}
51 template<
typename OTHER>
52 void operator*=(
const OTHER& dc) {arrayLow_*=dc;}
54 template<
typename OTHER>
55 void operator/=(
const OTHER& dc) {arrayLow_/=dc;}
76 double frobeniusNorm()
const {
return sqrt(sum(blitzplusplus::sqrAbs(arrayLow_)));}
88 #endif // CPPQEDCORE_QUANTUMDATA_ARRAYBASE_H_INCLUDED
Comprises the common functionalities of StateVector and DensityOperator.
ArrayBase & operator=(const ArrayLow &arrayLow)
Assignment with by-value semantics (like the assignment of a blitz::Array).
Comprises classes representing the state of composite quantum systems and providing various interface...
const CVector vectorView() const
1d view created on the fly via blitzplusplus::unaryArray.
blitz::Array< dcomp,RANK > CArray
A complex array of arbitrary arity.
CArray< 1 > CVector
Complex vector.
ArrayBase(const ArrayLow &arrayLow)
By-reference semantics (basically the copy of a blitz::Array). Apart from this, copying is not possib...
defines the typedef linalg::CMatrix and some helpers
const blitz::Array< T, 1 > unaryArray(const blitz::Array< T, RANK > &)
Returns a unary view of array
double frobeniusNorm() const
The entrywise array norm.
Declares extensions for creating vector & matrix views of blitz::Arrays.
CArray< RANK > ArrayLow
The underlying storage.
Helpers for complex blitz::Arrays, e.g. Hermitian conjugation of multi-matrices.