Go to the documentation of this file.
68 const Range& c)
const {
70 mdata,
mvr,
msr,
mbr,
mpr,
mrr,
mcr, v, s, b, p, r, c);
83 mdata +
OFFSET(c),
mvr,
msr,
mbr,
mpr,
mrr, v, s, b, p, r);
92 const Range& c)
const {
95 mdata +
OFFSET(r),
mvr,
msr,
mbr,
mpr,
mcr, v, s, b, p, c);
104 const Range& c)
const {
107 mdata +
OFFSET(p),
mvr,
msr,
mbr,
mrr,
mcr, v, s, b, r, c);
116 const Range& c)
const {
119 mdata +
OFFSET(b),
mvr,
msr,
mpr,
mrr,
mcr, v, s, p, r, c);
128 const Range& c)
const {
131 mdata +
OFFSET(s),
mvr,
mbr,
mpr,
mrr,
mcr, v, b, p, r, c);
140 const Range& c)
const {
143 mdata +
OFFSET(v),
msr,
mbr,
mpr,
mrr,
mcr, s, b, p, r, c);
218 const Range& c)
const {
231 const Range& c)
const {
244 const Range& c)
const {
257 const Range& c)
const {
270 const Range& c)
const {
283 const Range& c)
const {
296 const Range& c)
const {
309 const Range& c)
const {
322 const Range& c)
const {
335 const Range& c)
const {
489 const Range& c)
const {
503 const Range& c)
const {
517 const Range& c)
const {
531 const Range& c)
const {
545 const Range& c)
const {
559 const Range& c)
const {
573 const Range& c)
const {
587 const Range& c)
const {
601 const Range& c)
const {
615 const Range& c)
const {
897 a.msr.mextent * a.mbr.mextent * a.mpr.mextent * a.mrr.mextent *
919 : mvr(v), msr(s), mbr(b), mpr(p), mrr(r), mcr(c), mdata(
data) {
961 if (ip != end_page) {
966 for (; ip != end_page; ++ip) {
987 return Tensor6View(
mdata,
mvr,
msr,
mbr,
mpr,
mrr,
mcr, v, s, b, p, r, c);
999 return Tensor5View(
mdata +
OFFSET(c),
mvr,
msr,
mbr,
mpr,
mrr, v, s, b, p, r);
1010 return Tensor5View(
mdata +
OFFSET(r),
mvr,
msr,
mbr,
mpr,
mcr, v, s, b, p, c);
1021 return Tensor5View(
mdata +
OFFSET(p),
mvr,
msr,
mbr,
mrr,
mcr, v, s, b, r, c);
1032 return Tensor5View(
mdata +
OFFSET(b),
mvr,
msr,
mpr,
mrr,
mcr, v, s, p, r, c);
1043 return Tensor5View(
mdata +
OFFSET(s),
mvr,
mbr,
mpr,
mrr,
mcr, v, b, p, r, c);
1054 return Tensor5View(
mdata +
OFFSET(v),
msr,
mbr,
mpr,
mrr,
mcr, s, b, p, r, c);
1722 throw std::runtime_error(
1723 "A Tensor6View can only be converted to a plain C-array if it's pointing to a continuous block of data");
1745 throw std::runtime_error(
1746 "A Tensor6View can only be converted to a plain C-array if it's pointing to a continuous block of data");
1870 assert(
nbooks() ==
x.nbooks());
1871 assert(
npages() ==
x.npages());
1872 assert(
nrows() ==
x.nrows());
1873 assert(
ncols() ==
x.ncols());
1877 for (; p != ep; ++p, ++xp) {
1887 assert(
nbooks() ==
x.nbooks());
1888 assert(
npages() ==
x.npages());
1889 assert(
nrows() ==
x.nrows());
1890 assert(
ncols() ==
x.ncols());
1894 for (; p != ep; ++p, ++xp) {
1904 assert(
nbooks() ==
x.nbooks());
1905 assert(
npages() ==
x.npages());
1906 assert(
nrows() ==
x.nrows());
1907 assert(
ncols() ==
x.ncols());
1911 for (; p != ep; ++p, ++xp) {
1921 assert(
nbooks() ==
x.nbooks());
1922 assert(
npages() ==
x.npages());
1923 assert(
nrows() ==
x.nrows());
1924 assert(
ncols() ==
x.ncols());
1928 for (; p != ep; ++p, ++xp) {
1939 a.msr.mextent * a.mbr.mextent * a.mpr.mextent *
1940 a.mrr.mextent * a.mcr.mextent),
1998 :
ConstTensor6View(
data, pv, ps, pb, pp, pr, pc, nv,
ns, nb, np, nr, nc) {
2009 for (; origin !=
end; ++origin, ++target) {
2018 for (; target !=
end; ++target) {
2032 Range(0, v, s * b * p * r * c),
2033 Range(0, s, b * p * r * c),
2034 Range(0, b, p * r * c),
2045 Range(0, v, s * b * p * r * c),
2046 Range(0, s, b * p * r * c),
2047 Range(0, b, p * r * c),
2053 std::fill_n(
mdata, v * s * b * p * r * c, fill);
2250 assert(
y.nvitrines() ==
x.nvitrines());
2251 assert(
y.nshelves() ==
x.nshelves());
2252 assert(
y.nbooks() ==
x.nbooks());
2253 assert(
y.npages() ==
x.npages());
2254 assert(
y.nrows() ==
x.nrows());
2255 assert(
y.ncols() ==
x.ncols());
2260 for (; xi != xe; ++xi, ++yi) {
2276 for (; xi != xe; ++xi) {
2280 if (maxi > themax) themax = maxi;
2295 for (; xi != xe; ++xi) {
2299 if (mini < themin) themin = mini;
2328 return tv(v, s, b, p, r, c);
ConstTensor6View()=default
ConstIterator6D begin() const
Return const iterator to first sub-tensor.
Index nshelves() const
Returns the number of shelves.
The declarations of all the exception classes.
void resize(Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
Range mvr
The vitrine range of mdata that is actually used.
Range mbr
The book range of mdata that is actually used.
Index npages() const
Returns the number of pages.
Iterator6D end()
Return iterator behind last sub-tensor.
void swap(Tensor6 &t1, Tensor6 &t2)
Swaps two objects.
Index nvitrines(Workspace &ws) noexcept
Tensor6 & operator=(const Tensor6 &x)
Assignment operator from another tensor.
Index nrows() const
Returns the number of rows.
Vector y(Workspace &ws) noexcept
Tensor6View & operator/=(Numeric x)
Division by scalar.
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
std::ostream & operator<<(std::ostream &os, const ConstTensor6View &v)
Output operator.
Index nshelves(Workspace &ws) noexcept
Index mstart
The start index.
#define CHECK(x)
Implementation of Tensors of Rank 6.
Range mrr
The row range of mdata that is actually used.
Tensor6View & operator+=(Numeric x)
Addition of scalar.
ConstIterator5D begin() const
Return const iterator to first shelf.
A constant view of a Tensor4.
Tensor6View & operator*=(Numeric x)
Multiplication by scalar.
Tensor6View & operator-=(Numeric x)
Subtraction of scalar.
Index nvitrines() const
Returns the number of vitrines.
Numeric * mdata
Pointer to the plain C array that holds the data.
Range mpr
The page range of mdata that is actually used.
Const version of Iterator6D.
ConstIterator6D end() const
Return const iterator behind last sub-tensor.
Iterator5D end()
Return iterator behind last shelf.
Numeric debug_tensor6view_get_elem(Tensor6View &tv, Index v, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Range msr
The shelf range of mdata that is actually used.
A constant view of a Tensor6.
NUMERIC Numeric
The type to use for all floating point numbers.
void transform(Tensor6View y, double(&my_func)(double), ConstTensor6View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
Index npages(Workspace &ws) noexcept
const Numeric * get_c_array() const
Conversion to plain C-array.
ConstTensor6View operator()(const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
Iterator6D begin()
Return iterator to first sub-tensor.
void copy(ConstIterator6D origin, const ConstIterator6D &end, Iterator6D target)
Copy data between begin and end to target.
Numeric min(const ConstTensor6View &x)
Min function, tensor version.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
Tensor6View & operator=(const ConstTensor6View &v)
Assignment operator.
The outermost iterator class for rank 6 tensors.
Index nbooks() const
Returns the number of books.
A constant view of a Matrix.
Numeric max(const ConstTensor6View &x)
Max function, tensor version.
Index nrows(Workspace &ws) noexcept
Index mextent
The number of elements.
Range mcr
The column range of mdata that is actually used.
A constant view of a Tensor3.
Iterator5D begin()
Return iterator to first shelf.
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
Index ncols(Workspace &ws) noexcept
virtual ~Tensor6()
Destructor for Tensor6.
A constant view of a Vector.
ConstIterator5D end() const
Return const iterator behind last shelf.
Index ncols() const
Returns the number of columns.
Index nbooks(Workspace &ws) noexcept
A constant view of a Tensor5.
Tensor6View operator()(const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
bool empty() const
Check if variable is empty.