// arrange the loops in a way that we keep write operations low, (writing is
// usually more costly than reading), even though we need to access the data
// in src not in a contiguous way.
- for (size_type i = 0; i < m; i++)
- for (size_type j = 0; j < n; j++)
+ for (size_type i = 0; i < m; ++i)
+ for (size_type j = 0; j < n; ++j)
{
number2 add_value = adding ? dst(i, j) : 0.;
- for (size_type k = 0; k < l; k++)
+ for (size_type k = 0; k < l; ++k)
add_value += static_cast<number2>((*this)(i, k)) *
static_cast<number2>((src(k, j)));
dst(i, j) = add_value;
// optimized gemm operation in case the matrix is big, so this shouldn't be
// too bad.
else
- for (size_type i = 0; i < m; i++)
- for (size_type j = 0; j < n; j++)
+ for (size_type i = 0; i < m; ++i)
+ for (size_type j = 0; j < n; ++j)
{
number2 add_value = adding ? dst(i, j) : 0.;
- for (size_type k = 0; k < l; k++)
+ for (size_type k = 0; k < l; ++k)
add_value += static_cast<number2>((*this)(k, i)) *
static_cast<number2>((src(k, j)));
dst(i, j) = add_value;
else
// arrange the loops in a way that we keep write operations low, (writing is
// usually more costly than reading).
- for (size_type i = 0; i < m; i++)
- for (size_type j = 0; j < n; j++)
+ for (size_type i = 0; i < m; ++i)
+ for (size_type j = 0; j < n; ++j)
{
number2 add_value = adding ? dst(i, j) : 0.;
- for (size_type k = 0; k < l; k++)
+ for (size_type k = 0; k < l; ++k)
add_value += static_cast<number2>((*this)(i, k)) *
static_cast<number2>(src(j, k));
dst(i, j) = add_value;
// in the calling matrix in a non-contiguous way, possibly leading to cache
// misses. However, we should usually end up in the optimized gemm operation
// in case the matrix is big, so this shouldn't be too bad.
- for (size_type i = 0; i < m; i++)
- for (size_type j = 0; j < n; j++)
+ for (size_type i = 0; i < m; ++i)
+ for (size_type j = 0; j < n; ++j)
{
number2 add_value = adding ? dst(i, j) : 0.;
- for (size_type k = 0; k < l; k++)
+ for (size_type k = 0; k < l; ++k)
add_value += static_cast<number2>((*this)(k, i)) *
static_cast<number2>(src(j, k));
dst(i, j) = add_value;
/* reinit *this to 0 */
this->reinit(A.m(), A.n());
- for (size_type i = 0; i < this->n_cols(); i++)
+ for (size_type i = 0; i < this->n_cols(); ++i)
{
double SLik2 = 0.0;
- for (size_type j = 0; j < i; j++)
+ for (size_type j = 0; j < i; ++j)
{
double SLikLjk = 0.0;
- for (size_type k = 0; k < j; k++)
+ for (size_type k = 0; k < j; ++k)
{
SLikLjk += (*this)(i, k) * (*this)(j, k);
};
ExcMessage("Vectors V, W must be the same size."));
this->reinit(V.size(), V.size());
- for (size_type i = 0; i < this->n(); i++)
+ for (size_type i = 0; i < this->n(); ++i)
{
- for (size_type j = 0; j < this->n(); j++)
+ for (size_type j = 0; j < this->n(); ++j)
{
(*this)(i, j) = V(i) * W(j);
}
AssertIndexRange(src_r_i, src_r_j + 1);
AssertIndexRange(src_c_i, src_c_j + 1);
- for (size_type i = 0; i < src_r_j - src_r_i + 1; i++)
- for (size_type j = 0; j < src_c_j - src_c_i + 1; j++)
+ for (size_type i = 0; i < src_r_j - src_r_i + 1; ++i)
+ for (size_type j = 0; j < src_c_j - src_c_i + 1; ++j)
{
const unsigned int src_r_index = static_cast<unsigned int>(i + src_r_i);
const unsigned int src_c_index = static_cast<unsigned int>(j + src_c_i);
AssertIndexRange(src_r_i, src_r_j + 1);
AssertIndexRange(src_c_j, src_c_j + 1);
- for (size_type i = 0; i < src_r_j - src_r_i + 1; i++)
- for (size_type j = 0; j < src_c_j - src_c_i + 1; j++)
+ for (size_type i = 0; i < src_r_j - src_r_i + 1; ++i)
+ for (size_type j = 0; j < src_c_j - src_c_i + 1; ++j)
{
const unsigned int dst_r_index = static_cast<unsigned int>(i + dst_r);
const unsigned int dst_c_index = static_cast<unsigned int>(j + dst_c);
dst = 0;
- for (size_type i = 0; i < m(); i++)
+ for (size_type i = 0; i < m(); ++i)
{
- for (size_type j = cols->rowstart[i]; j < cols->rowstart[i + 1]; j++)
+ for (size_type j = cols->rowstart[i]; j < cols->rowstart[i + 1]; ++j)
{
const size_type p = cols->colnums[j];
dst(p) += typename OutVector::value_type(val[j]) *
Assert(!PointerComparison::equal(&src, &dst), ExcSourceEqualsDestination());
- for (size_type i = 0; i < m(); i++)
- for (size_type j = cols->rowstart[i]; j < cols->rowstart[i + 1]; j++)
+ for (size_type i = 0; i < m(); ++i)
+ for (size_type j = cols->rowstart[i]; j < cols->rowstart[i + 1]; ++j)
{
const size_type p = cols->colnums[j];
dst(p) += typename OutVector::value_type(val[j]) *
size_type j;
somenumber s;
- for (size_type i = 0; i < n; i++)
+ for (size_type i = 0; i < n; ++i)
{
s = 0.;
- for (j = cols->rowstart[i]; j < cols->rowstart[i + 1]; j++)
+ for (j = cols->rowstart[i]; j < cols->rowstart[i + 1]; ++j)
{
const size_type p = cols->colnums[j];
if (p != SparsityPattern::invalid_entry)
i--) // this time, i is signed, but always positive!
{
s = 0.;
- for (j = cols->rowstart[i]; j < cols->rowstart[i + 1]; j++)
+ for (j = cols->rowstart[i]; j < cols->rowstart[i + 1]; ++j)
{
const size_type p = cols->colnums[j];
if (p != SparsityPattern::invalid_entry)