3 #ifndef BARRY_BARRAYDENSECELL_MEAT_HPP
4 #define BARRY_BARRAYDENSECELL_MEAT_HPP 1
6 #define POS(a, b) (a) + (b) * dat->N
8 template<
typename Cell_Type,
typename Data_Type>
13 Cell_Type val =
static_cast<Cell_Type
>(other);
15 Cell_Type old = dat->el.at(
POS(
i,
j));
16 dat->el.at(
POS(
i,
j)) = val;
17 dat->el_rowsums.at(
i) += (val - old);
18 dat->el_colsums.at(
j) += (val - old);
20 Cell_Type old = dat->el[
POS(
i,
j)];
21 dat->el[
POS(
i,
j)] = val;
22 dat->el_rowsums[
i] += (val - old);
23 dat->el_colsums[
j] += (val - old);
30 template<
typename Cell_Type,
typename Data_Type>
34 Cell_Type old = dat->el.at(
POS(
i,
j));
35 dat->el.at(
POS(
i,
j)) = val;
36 dat->el_rowsums.at(
i) += (val - old);
37 dat->el_colsums.at(
j) += (val - old);
39 Cell_Type old = dat->el[
POS(
i,
j)];
40 dat->el[
POS(
i,
j)] = val;
41 dat->el_rowsums[
i] += (val - old);
42 dat->el_colsums[
j] += (val - old);
47 template<
typename Cell_Type,
typename Data_Type>
51 dat->el.at(
POS(
i,
j)) += val;
52 dat->el_rowsums.at(
i) += val;
53 dat->el_colsums.at(
j) += val;
55 dat->el[
POS(
i,
j)] += val;
56 dat->el_rowsums[
i] += val;
57 dat->el_colsums[
j] += val;
62 template<
typename Cell_Type,
typename Data_Type>
66 dat->el.at(
POS(
i,
j)) -= val;
67 dat->el_rowsums.at(
i) -= val;
68 dat->el_colsums.at(
j) -= val;
70 dat->el[
POS(
i,
j)] -= val;
71 dat->el_rowsums[
i] -= val;
72 dat->el_colsums[
j] -= val;
77 template<
typename Cell_Type,
typename Data_Type>
81 Cell_Type old = dat->el.at(
POS(
i,
j));
82 dat->el_colsums.at(
j) += (old * val - old);
83 dat->el_rowsums.at(
i) += (old * val - old);
84 dat->el.at(
POS(
i,
j)) *= val;
86 Cell_Type old = dat->el[
POS(
i,
j)];
87 dat->el_colsums[
j] += (old * val - old);
88 dat->el_rowsums[
i] += (old * val - old);
89 dat->el[
POS(
i,
j)] *= val;
94 template<
typename Cell_Type,
typename Data_Type>
98 Cell_Type old = dat->el.at(
POS(
i,
j));
99 dat->el_rowsums.at(
i) += (old/val - old);
100 dat->el_colsums.at(
j) += (old/val - old);
101 dat->el.at(
POS(
i,
j)) /= val;
103 Cell_Type old = dat->el[
POS(
i,
j)];
104 dat->el_rowsums[
i] += (old/val - old);
105 dat->el_colsums[
j] += (old/val - old);
106 dat->el[
POS(
i,
j)] /= val;
111 template<
typename Cell_Type,
typename Data_Type>
113 return dat->el[
POS(
i,
j)];
116 template<
typename Cell_Type,
typename Data_Type>
118 return dat->el[
POS(
i,
j)] == val;
void operator/=(const Cell_Type &val)
void operator+=(const Cell_Type &val)
bool operator==(const Cell_Type &val) const
BArrayDenseCell< Cell_Type, Data_Type > & operator=(const BArrayDenseCell< Cell_Type, Data_Type > &other)
void operator*=(const Cell_Type &val)
void operator-=(const Cell_Type &val)