19#include <alien/ref/data/block/BlockVector.h>
21#include <alien/ref/AlienRefSemantic.h>
22#include <alien/utils/ICopyOnWriteObject.h>
33BlockVector::BlockVector()
40BlockVector::BlockVector(
const Block& block,
const VectorDistribution& dist)
41: m_impl(new MultiVectorImpl(dist.space().clone(), dist.clone()))
43 m_impl->setBlockInfos(&block);
48BlockVector::BlockVector(Integer nrows, Integer nrows_local,
const Block& block,
49 IMessagePassingMng* parallel_mng)
50: m_impl(new MultiVectorImpl(std::make_shared<Space>(nrows),
51 std::make_shared<VectorDistribution>(
52 VectorDistribution(nrows, nrows_local, parallel_mng))))
54 m_impl->setBlockInfos(&block);
59BlockVector::BlockVector(
60Integer nrows,
const Block& block, IMessagePassingMng* parallel_mng)
61: m_impl(new MultiVectorImpl(std::make_shared<Space>(nrows),
62 std::make_shared<VectorDistribution>(VectorDistribution(nrows, parallel_mng))))
64 m_impl->setBlockInfos(&block);
69BlockVector::BlockVector(BlockVector&& vector)
70: m_impl(std::move(vector.m_impl))
76BlockVector::operator=(BlockVector&& vector)
78 m_impl = std::move(vector.m_impl);
84void BlockVector::init(
const Block& block,
const VectorDistribution& dist)
86 m_impl.reset(
new MultiVectorImpl(dist.space().clone(), dist.clone()));
87 m_impl->setBlockInfos(&block);
92void BlockVector::free()
99void BlockVector::clear()
109 return m_impl->space();
122BlockVector::distribution()
const
124 return m_impl->distribution();
129void BlockVector::setUserFeature(String feature)
131 m_impl->setFeature(feature);
136bool BlockVector::hasUserFeature(String feature)
const
138 return m_impl->hasFeature(feature);
142BlockVector::block()
const
144 const Block* block = m_impl->block();
148 throw FatalErrorException(
149 A_FUNCINFO,
"Requesting for block information but none was provided");
const ISpace & space() const override
Get the space associated to the vector.
MultiVectorImpl * impl() override
Get the multivector implementation.
void visit(ICopyOnWriteVector &) const override
Visit method.
Implementation of an algebraic space.
Computes a vector distribution.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --