const auto Ct = transpose_operator(C);
static GrowingVectorMemory<Domain> vector_memory;
- Domain *k = vector_memory.alloc();
+ typename VectorMemory<Domain>::Pointer k (vector_memory);
linop.reinit_domain_vector(*k, /*bool fast=*/ false);
constraint_matrix.distribute(*k);
v += Ct * (right_hand_side - linop **k);
-
- vector_memory.free(k);
};
// lambda capture expressions are a C++14 feature...
deallog.push("Power method");
- VectorType *Vy = this->memory.alloc ();
+ typename VectorMemory<VectorType>::Pointer Vy (this->memory);
VectorType &y = *Vy;
y.reinit (x);
- VectorType *Vr = this->memory.alloc ();
+ typename VectorMemory<VectorType>::Pointer Vr (this->memory);
VectorType &r = *Vr;
r.reinit (x);
conv = this->iteration_status (iter, std::fabs(1./length-1./old_length), x);
}
- this->memory.free(Vy);
- this->memory.free(Vr);
-
deallog.pop();
// in case of failure: throw exception
{
static GrowingVectorMemory<Range> vector_memory;
- Range *i = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer i (vector_memory);
op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true);
comp.apply(*i);
op.vmult(v, *i);
-
- vector_memory.free(i);
};
return_comp.apply_add = [op, comp](Domain &v)
{
static GrowingVectorMemory<Range> vector_memory;
- Range *i = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer i (vector_memory);
op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true);
comp.apply(*i);
op.vmult_add(v, *i);
-
- vector_memory.free(i);
};
return return_comp;
{
static GrowingVectorMemory<Range> vector_memory;
- Range *i = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer i (vector_memory);
op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true);
comp.apply(*i);
op.Tvmult(v, *i);
-
- vector_memory.free(i);
};
return_comp.apply_add = [op, comp](Domain &v)
{
static GrowingVectorMemory<Range> vector_memory;
- Range *i = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer i (vector_memory);
op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true);
comp.apply(*i);
op.Tvmult_add(v, *i);
-
- vector_memory.free(i);
};
return return_comp;