if (m == 0)
return;
- static GrowingVectorMemory<typename Range::BlockType> vector_memory;
- typename Range::BlockType *tmp = vector_memory.alloc();
+ static GrowingVectorMemory<typename Range::BlockType> vector_memory;
+ typename VectorMemory<typename Range::BlockType>::Pointer tmp (vector_memory);
diagonal_inverse.block(0, 0).vmult_add(v.block(0), u.block(0));
*tmp *= -1.;
diagonal_inverse.block(i, i).vmult_add(v.block(i),*tmp);
}
-
- vector_memory.free(tmp);
};
return return_op;
ExcDimensionMismatch(diagonal_inverse.n_block_cols(), m));
Assert(v.n_blocks() == m, ExcDimensionMismatch(v.n_blocks(), m));
Assert(u.n_blocks() == m, ExcDimensionMismatch(u.n_blocks(), m));
- static GrowingVectorMemory<typename Range::BlockType> vector_memory;
- typename Range::BlockType *tmp = vector_memory.alloc();
+ static GrowingVectorMemory<typename Range::BlockType> vector_memory;
+ typename VectorMemory<typename Range::BlockType>::Pointer tmp (vector_memory);
if (m == 0)
return;
*tmp *= -1.;
diagonal_inverse.block(i, i).vmult_add(v.block(i),*tmp);
}
-
- vector_memory.free(tmp);
};
return return_op;
{
static GrowingVectorMemory<Intermediate> vector_memory;
- Intermediate *i = vector_memory.alloc();
+ typename VectorMemory<Intermediate>::Pointer i (vector_memory);
second_op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true);
second_op.vmult(*i, u);
first_op.vmult(v, *i);
- vector_memory.free(i);
};
return_op.vmult_add = [first_op, second_op](Range &v, const Domain &u)
{
static GrowingVectorMemory<Intermediate> vector_memory;
- Intermediate *i = vector_memory.alloc();
+ typename VectorMemory<Intermediate>::Pointer i (vector_memory);
second_op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true);
second_op.vmult(*i, u);
first_op.vmult_add(v, *i);
- vector_memory.free(i);
};
return_op.Tvmult = [first_op, second_op](Domain &v, const Range &u)
{
static GrowingVectorMemory<Intermediate> vector_memory;
- Intermediate *i = vector_memory.alloc();
+ typename VectorMemory<Intermediate>::Pointer i (vector_memory);
first_op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true);
first_op.Tvmult(*i, u);
second_op.Tvmult(v, *i);
- vector_memory.free(i);
};
return_op.Tvmult_add = [first_op, second_op](Domain &v, const Range &u)
{
static GrowingVectorMemory<Intermediate> vector_memory;
- Intermediate *i = vector_memory.alloc();
+ typename VectorMemory<Intermediate>::Pointer i (vector_memory);
first_op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true);
first_op.Tvmult(*i, u);
second_op.Tvmult_add(v, *i);
- vector_memory.free(i);
};
return return_op;
{
static GrowingVectorMemory<Range> vector_memory;
- Range *v2 = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer v2 (vector_memory);
op.reinit_range_vector(*v2, /*bool omit_zeroing_entries =*/ false);
solver.solve(op, *v2, u, preconditioner);
v += *v2;
- vector_memory.free(v2);
};
return_op.Tvmult = [op, &solver, &preconditioner](Range &v, const Domain &u)
{
static GrowingVectorMemory<Range> vector_memory;
- Range *v2 = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer v2 (vector_memory);
op.reinit_range_vector(*v2, /*bool omit_zeroing_entries =*/ false);
solver.solve(transpose_operator(op), *v2, u, preconditioner);
v += *v2;
- vector_memory.free(v2);
};
return return_op;
{
static GrowingVectorMemory<Range> vector_memory;
- Range *i = vector_memory.alloc();
+ typename VectorMemory<Range>::Pointer i (vector_memory);
i->reinit(v, /*bool omit_zeroing_entries =*/true);
function(*i, u);
v += *i;
else
v = *i;
-
- vector_memory.free(i);
}