Vector<Number> &Vector<Number>::operator*= (const Number factor)
{
AssertIsFinite(factor);
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
this->val[i] *= factor;
return *this;
const Vector<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
Assert(down_V.size()==this->size(),
ExcMessage("Cannot add two vectors with different numbers of elements"));
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_V[i]);
this->val[i] += down_V[i];
const Vector<Number> &down_V = dynamic_cast<const Vector<Number>&>(V);
Assert(down_V.size()==this->size(),
ExcMessage("Cannot subtract two vectors with different numbers of elements"));
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_V[i]);
this->val[i] -= down_V[i];
Assert(down_V.size()==this->size(),
ExcMessage("Cannot compute the scalar product "
"of two vectors with different numbers of elements"));
+ const size_type size = this->size();
Number value = 0.;
- for (unsigned int i=0; i<this->size(); ++i)
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_V[i]);
value += this->val[i]*down_V[i];
AssertIsFinite(a);
Assert(down_V.size()==this->size(),
ExcMessage("Cannot add two vectors with different numbers of elements"));
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_V[i]);
this->val[i] += a*down_V[i];
AssertIsFinite(b);
Assert(down_W.size()==this->size(),
ExcMessage("Cannot add two vectors with different numbers of elements"));
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_V[i]);
AssertIsFinite(down_W[i]);
dynamic_cast<const Vector<Number>&>(scaling_factors);
Assert(down_scaling_factors.size()==this->size(),
ExcMessage("Cannot add two vectors with different numbers of elements"));
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
AssertIsFinite(down_scaling_factors[i]);
this->val[i] *= down_scaling_factors[i];
{
real_type scale = 0.;
real_type sum = 1.;
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
{
if (this->val[i] != Number())
{
typename VectorSpaceVector<Number>::real_type Vector<Number>::linfty_norm() const
{
typename ReadWriteVector<Number>::real_type norm = 0.;
- for (unsigned int i=0; i<this->size(); ++i)
+ const size_type size = this->size();
+ for (size_type i=0; i<size; ++i)
norm = std::max(std::abs(this->val[i]),norm);
return norm;