Go to the documentation of this file.
71 const Range& c)
const {
73 mdata,
mlr,
mvr,
msr,
mbr,
mpr,
mrr,
mcr, l, v, s, b, p, r, c);
82 const Range& c)
const {
85 mdata +
OFFSET(l),
mvr,
msr,
mbr,
mpr,
mrr,
mcr, v, s, b, p, r, c);
98 mdata +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mpr,
mrr, l, v, s, b, p, r);
111 mdata +
OFFSET(l) +
OFFSET(c),
mvr,
msr,
mbr,
mpr,
mrr, v, s, b, p, r);
121 const Range& c)
const {
124 mdata +
OFFSET(r),
mlr,
mvr,
msr,
mbr,
mpr,
mcr, l, v, s, b, p, c);
133 const Range& c)
const {
137 mdata +
OFFSET(l) +
OFFSET(r),
mvr,
msr,
mbr,
mpr,
mcr, v, s, b, p, c);
147 const Range& c)
const {
150 mdata +
OFFSET(p),
mlr,
mvr,
msr,
mbr,
mrr,
mcr, l, v, s, b, r, c);
159 const Range& c)
const {
163 mdata +
OFFSET(l) +
OFFSET(p),
mvr,
msr,
mbr,
mrr,
mcr, v, s, b, r, c);
173 const Range& c)
const {
176 mdata +
OFFSET(b),
mlr,
mvr,
msr,
mpr,
mrr,
mcr, l, v, s, p, r, c);
185 const Range& c)
const {
189 mdata +
OFFSET(l) +
OFFSET(b),
mvr,
msr,
mpr,
mrr,
mcr, v, s, p, r, c);
199 const Range& c)
const {
202 mdata +
OFFSET(s),
mlr,
mvr,
mbr,
mpr,
mrr,
mcr, l, v, b, p, r, c);
211 const Range& c)
const {
215 mdata +
OFFSET(l) +
OFFSET(s),
mvr,
mbr,
mpr,
mrr,
mcr, v, b, p, r, c);
225 const Range& c)
const {
228 mdata +
OFFSET(v),
mlr,
msr,
mbr,
mpr,
mrr,
mcr, l, s, b, p, r, c);
237 const Range& c)
const {
241 mdata +
OFFSET(l) +
OFFSET(v),
msr,
mbr,
mpr,
mrr,
mcr, s, b, p, r, c);
255 mdata +
OFFSET(r) +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mpr, l, v, s, b, p);
290 mdata +
OFFSET(p) +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mrr, l, v, s, b, r);
325 mdata +
OFFSET(b) +
OFFSET(c),
mlr,
mvr,
msr,
mpr,
mrr, l, v, s, p, r);
360 mdata +
OFFSET(s) +
OFFSET(c),
mlr,
mvr,
mbr,
mpr,
mrr, l, v, b, p, r);
395 mdata +
OFFSET(v) +
OFFSET(c),
mlr,
msr,
mbr,
mpr,
mrr, l, s, b, p, r);
426 const Range& c)
const {
430 mdata +
OFFSET(p) +
OFFSET(r),
mlr,
mvr,
msr,
mbr,
mcr, l, v, s, b, c);
439 const Range& c)
const {
461 const Range& c)
const {
465 mdata +
OFFSET(b) +
OFFSET(r),
mlr,
mvr,
msr,
mpr,
mcr, l, v, s, p, c);
474 const Range& c)
const {
496 const Range& c)
const {
500 mdata +
OFFSET(s) +
OFFSET(r),
mlr,
mvr,
mbr,
mpr,
mcr, l, v, b, p, c);
509 const Range& c)
const {
531 const Range& c)
const {
535 mdata +
OFFSET(v) +
OFFSET(r),
mlr,
msr,
mbr,
mpr,
mcr, l, s, b, p, c);
544 const Range& c)
const {
566 const Range& c)
const {
570 mdata +
OFFSET(b) +
OFFSET(p),
mlr,
mvr,
msr,
mrr,
mcr, l, v, s, r, c);
579 const Range& c)
const {
601 const Range& c)
const {
605 mdata +
OFFSET(s) +
OFFSET(p),
mlr,
mvr,
mbr,
mrr,
mcr, l, v, b, r, c);
614 const Range& c)
const {
636 const Range& c)
const {
640 mdata +
OFFSET(v) +
OFFSET(p),
mlr,
msr,
mbr,
mrr,
mcr, l, s, b, r, c);
649 const Range& c)
const {
671 const Range& c)
const {
675 mdata +
OFFSET(s) +
OFFSET(b),
mlr,
mvr,
mpr,
mrr,
mcr, l, v, p, r, c);
684 const Range& c)
const {
706 const Range& c)
const {
710 mdata +
OFFSET(v) +
OFFSET(b),
mlr,
msr,
mpr,
mrr,
mcr, l, s, p, r, c);
719 const Range& c)
const {
741 const Range& c)
const {
745 mdata +
OFFSET(v) +
OFFSET(s),
mlr,
mbr,
mpr,
mrr,
mcr, l, b, p, r, c);
754 const Range& c)
const {
1196 const Range& c)
const {
1217 const Range& c)
const {
1238 const Range& c)
const {
1259 const Range& c)
const {
1280 const Range& c)
const {
1301 const Range& c)
const {
1322 const Range& c)
const {
1343 const Range& c)
const {
1364 const Range& c)
const {
1385 const Range& c)
const {
1406 const Range& c)
const {
1427 const Range& c)
const {
1448 const Range& c)
const {
1469 const Range& c)
const {
1490 const Range& c)
const {
1511 const Range& c)
const {
1532 const Range& c)
const {
1553 const Range& c)
const {
1574 const Range& c)
const {
1595 const Range& c)
const {
1616 const Range& c)
const {
1636 const Range& c)
const {
1657 const Range& c)
const {
1677 const Range& c)
const {
1698 const Range& c)
const {
1718 const Range& c)
const {
1739 const Range& c)
const {
1759 const Range& c)
const {
1780 const Range& c)
const {
1800 const Range& c)
const {
2231 const Range& c)
const {
2251 const Range& c)
const {
2508 a.mvr.mextent * a.msr.mextent * a.mbr.mextent * a.mpr.mextent *
2509 a.mrr.mextent * a.mcr.mextent),
2532 : mlr(l), mvr(v), msr(s), mbr(b), mpr(p), mrr(r), mcr(c), mdata(
data) {
2577 if (ip != end_page) {
2582 for (; ip != end_page; ++ip) {
2604 mdata,
mlr,
mvr,
msr,
mbr,
mpr,
mrr,
mcr, l, v, s, b, p, r, c);
2616 mdata +
OFFSET(l),
mvr,
msr,
mbr,
mpr,
mrr,
mcr, v, s, b, p, r, c);
2629 mdata +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mpr,
mrr, l, v, s, b, p, r);
2642 mdata +
OFFSET(l) +
OFFSET(c),
mvr,
msr,
mbr,
mpr,
mrr, v, s, b, p, r);
2655 mdata +
OFFSET(r),
mlr,
mvr,
msr,
mbr,
mpr,
mcr, l, v, s, b, p, c);
2668 mdata +
OFFSET(l) +
OFFSET(r),
mvr,
msr,
mbr,
mpr,
mcr, v, s, b, p, c);
2681 mdata +
OFFSET(p),
mlr,
mvr,
msr,
mbr,
mrr,
mcr, l, v, s, b, r, c);
2694 mdata +
OFFSET(l) +
OFFSET(p),
mvr,
msr,
mbr,
mrr,
mcr, v, s, b, r, c);
2707 mdata +
OFFSET(b),
mlr,
mvr,
msr,
mpr,
mrr,
mcr, l, v, s, p, r, c);
2720 mdata +
OFFSET(l) +
OFFSET(b),
mvr,
msr,
mpr,
mrr,
mcr, v, s, p, r, c);
2733 mdata +
OFFSET(s),
mlr,
mvr,
mbr,
mpr,
mrr,
mcr, l, v, b, p, r, c);
2746 mdata +
OFFSET(l) +
OFFSET(s),
mvr,
mbr,
mpr,
mrr,
mcr, v, b, p, r, c);
2759 mdata +
OFFSET(v),
mlr,
msr,
mbr,
mpr,
mrr,
mcr, l, s, b, p, r, c);
2772 mdata +
OFFSET(l) +
OFFSET(v),
msr,
mbr,
mpr,
mrr,
mcr, s, b, p, r, c);
2786 mdata +
OFFSET(r) +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mpr, l, v, s, b, p);
2821 mdata +
OFFSET(p) +
OFFSET(c),
mlr,
mvr,
msr,
mbr,
mrr, l, v, s, b, r);
2856 mdata +
OFFSET(b) +
OFFSET(c),
mlr,
mvr,
msr,
mpr,
mrr, l, v, s, p, r);
2891 mdata +
OFFSET(s) +
OFFSET(c),
mlr,
mvr,
mbr,
mpr,
mrr, l, v, b, p, r);
2926 mdata +
OFFSET(v) +
OFFSET(c),
mlr,
msr,
mbr,
mpr,
mrr, l, s, b, p, r);
2961 mdata +
OFFSET(p) +
OFFSET(r),
mlr,
mvr,
msr,
mbr,
mcr, l, v, s, b, c);
2996 mdata +
OFFSET(b) +
OFFSET(r),
mlr,
mvr,
msr,
mpr,
mcr, l, v, s, p, c);
3031 mdata +
OFFSET(s) +
OFFSET(r),
mlr,
mvr,
mbr,
mpr,
mcr, l, v, b, p, c);
3066 mdata +
OFFSET(v) +
OFFSET(r),
mlr,
msr,
mbr,
mpr,
mcr, l, s, b, p, c);
3101 mdata +
OFFSET(b) +
OFFSET(p),
mlr,
mvr,
msr,
mrr,
mcr, l, v, s, r, c);
3136 mdata +
OFFSET(s) +
OFFSET(p),
mlr,
mvr,
mbr,
mrr,
mcr, l, v, b, r, c);
3171 mdata +
OFFSET(v) +
OFFSET(p),
mlr,
msr,
mbr,
mrr,
mcr, l, s, b, r, c);
3206 mdata +
OFFSET(s) +
OFFSET(b),
mlr,
mvr,
mpr,
mrr,
mcr, l, v, p, r, c);
3241 mdata +
OFFSET(v) +
OFFSET(b),
mlr,
msr,
mpr,
mrr,
mcr, l, s, p, r, c);
3276 mdata +
OFFSET(v) +
OFFSET(s),
mlr,
mbr,
mpr,
mrr,
mcr, l, b, p, r, c);
5000 throw std::runtime_error(
5001 "A Tensor7View can only be converted to a plain C-array if it's pointing to a continuous block of data");
5026 throw std::runtime_error(
5027 "A Tensor7View can only be converted to a plain C-array if it's pointing to a continuous block of data");
5157 assert(
nbooks() ==
x.nbooks());
5158 assert(
npages() ==
x.npages());
5159 assert(
nrows() ==
x.nrows());
5160 assert(
ncols() ==
x.ncols());
5164 for (; p != ep; ++p, ++xp) {
5175 assert(
nbooks() ==
x.nbooks());
5176 assert(
npages() ==
x.npages());
5177 assert(
nrows() ==
x.nrows());
5178 assert(
ncols() ==
x.ncols());
5182 for (; p != ep; ++p, ++xp) {
5193 assert(
nbooks() ==
x.nbooks());
5194 assert(
npages() ==
x.npages());
5195 assert(
nrows() ==
x.nrows());
5196 assert(
ncols() ==
x.ncols());
5200 for (; p != ep; ++p, ++xp) {
5211 assert(
nbooks() ==
x.nbooks());
5212 assert(
npages() ==
x.npages());
5213 assert(
nrows() ==
x.nrows());
5214 assert(
ncols() ==
x.ncols());
5218 for (; p != ep; ++p, ++xp) {
5229 a.mvr.mextent * a.msr.mextent * a.mbr.mextent *
5230 a.mpr.mextent * a.mrr.mextent * a.mcr.mextent),
5294 data, pl, pv, ps, pb, pp, pr, pc, nl, nv,
ns, nb, np, nr, nc) {
5305 for (; origin !=
end; ++origin, ++target) {
5314 for (; target !=
end; ++target) {
5328 Range(0, l, v * s * b * p * r * c),
5329 Range(0, v, s * b * p * r * c),
5330 Range(0, s, b * p * r * c),
5331 Range(0, b, p * r * c),
5342 Range(0, l, v * s * b * p * r * c),
5343 Range(0, v, s * b * p * r * c),
5344 Range(0, s, b * p * r * c),
5345 Range(0, b, p * r * c),
5351 std::fill_n(
mdata, l * v * s * b * p * r * c, fill);
5567 assert(
y.nlibraries() ==
x.nlibraries());
5568 assert(
y.nvitrines() ==
x.nvitrines());
5569 assert(
y.nshelves() ==
x.nshelves());
5570 assert(
y.nbooks() ==
x.nbooks());
5571 assert(
y.npages() ==
x.npages());
5572 assert(
y.nrows() ==
x.nrows());
5573 assert(
y.ncols() ==
x.ncols());
5578 for (; xi != xe; ++xi, ++yi) {
5594 for (; xi != xe; ++xi) {
5598 if (maxi > themax) themax = maxi;
5613 for (; xi != xe; ++xi) {
5617 if (mini < themin) themin = mini;
5653 return tv(l, v, s, b, p, r, c);
Const version of Iterator7D.
Index nlibraries(Workspace &ws) noexcept
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.
Iterator7D begin()
Return iterator to first sub-tensor.
Range msr
The shelf range of mdata that is actually used.
std::ostream & operator<<(std::ostream &os, const ConstTensor7View &v)
Output operator.
Index ncols() const
Returns the number of columns.
A constant view of a Tensor7.
Tensor7View & operator-=(Numeric x)
Subtraction of scalar.
Iterator6D end()
Return iterator behind last sub-tensor.
Range mrr
The row range of mdata that is actually used.
Range mlr
The library range of mdata that is actually used.
void swap(Tensor7 &t1, Tensor7 &t2)
Swaps two objects.
Implementation of Tensors of Rank 7.
Index nvitrines(Workspace &ws) noexcept
Vector y(Workspace &ws) noexcept
G0 G2 FVC Y DV Numeric Numeric Numeric Zeeman LowerQuantumNumbers void * data
Tensor7View operator()(const Range &l, const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c)
ConstIterator7D begin() const
Return const iterator to first sub-tensor.
Index nshelves(Workspace &ws) noexcept
Index mstart
The start index.
Tensor7View & operator+=(Numeric x)
Addition of scalar.
#define CHECK(x)
Implementation of Tensors of Rank 6.
virtual ~Tensor7()
Destructor for Tensor7.
void copy(ConstIterator7D origin, const ConstIterator7D &end, Iterator7D target)
Copy data between begin and end to target.
Index nlibraries() const
Returns the number of libraries.
A constant view of a Tensor4.
void resize(Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Resize function.
ConstIterator6D end() const
Return const iterator behind last sub-tensor.
Tensor7View & operator=(const ConstTensor7View &v)
Assignment operator.
Index nvitrines() const
Returns the number of vitrines.
void transform(Tensor7View y, double(&my_func)(double), ConstTensor7View x)
A generic transform function for tensors, which can be used to implement mathematical functions opera...
bool empty() const
Check if variable is empty.
Index npages() const
Returns the number of pages.
A constant view of a Tensor6.
NUMERIC Numeric
The type to use for all floating point numbers.
ConstIterator7D end() const
Return const iterator behind last sub-tensor.
Index npages(Workspace &ws) noexcept
const Numeric * get_c_array() const
Conversion to plain C-array.
Iterator6D begin()
Return iterator to first sub-tensor.
Iterator7D end()
Return iterator behind last sub-tensor.
Range mpr
The page range of mdata that is actually used.
Range mvr
The vitrine range of mdata that is actually used.
constexpr Rational end(Rational Ju, Rational Jl, Polarization type) noexcept
Gives the largest M for a polarization type of this transition.
A constant view of a Matrix.
ConstTensor7View operator()(const Range &l, const Range &v, const Range &s, const Range &b, const Range &p, const Range &r, const Range &c) const
Tensor7View & operator/=(Numeric x)
Division by scalar.
Index nrows(Workspace &ws) noexcept
Range mbr
The book range of mdata that is actually used.
Index mextent
The number of elements.
Index nbooks() const
Returns the number of books.
Numeric max(const ConstTensor7View &x)
Max function, tensor version.
Tensor7View & operator*=(Numeric x)
Multiplication by scalar.
A constant view of a Tensor3.
Tensor7 & operator=(const Tensor7 &x)
Assignment operator from another tensor.
ConstTensor7View()=default
Vector x(Workspace &ws) noexcept
INDEX Index
The type to use for all integer numbers and indices.
Index nrows() const
Returns the number of rows.
Index ncols(Workspace &ws) noexcept
Range mcr
The column range of mdata that is actually used.
A constant view of a Vector.
Numeric debug_tensor7view_get_elem(Tensor7View &tv, Index l, Index v, Index s, Index b, Index p, Index r, Index c)
Helper function to access tensor elements.
Index nbooks(Workspace &ws) noexcept
Numeric min(const ConstTensor7View &x)
Min function, tensor version.
A constant view of a Tensor5.
Numeric * mdata
Pointer to the plain C array that holds the data.