19#include <alien/ref/data/block/BlockMatrix.h>
21#include <alien/ref/AlienRefSemantic.h>
22#include <alien/utils/ICopyOnWriteObject.h>
33BlockMatrix::BlockMatrix()
40BlockMatrix::BlockMatrix(
const Block& block,
const MatrixDistribution& dist)
42 new MultiMatrixImpl(dist.rowSpace().clone(), dist.colSpace().clone(), dist.clone()))
44 m_impl->setBlockInfos(&block);
49BlockMatrix::BlockMatrix(Integer nrows, Integer ncols, Integer nrows_local,
50 const Block& block, IMessagePassingMng* parallel_mng)
52 new MultiMatrixImpl(std::make_shared<Space>(nrows), std::make_shared<Space>(ncols),
53 std::make_shared<MatrixDistribution>(
54 MatrixDistribution(nrows, ncols, nrows_local, parallel_mng))))
56 m_impl->setBlockInfos(&block);
61BlockMatrix::BlockMatrix(
62Integer nrows, Integer ncols,
const Block& block, IMessagePassingMng* parallel_mng)
63: m_impl(new MultiMatrixImpl(std::make_shared<Space>(nrows),
64 std::make_shared<Space>(ncols),
65 std::make_shared<MatrixDistribution>(MatrixDistribution(nrows, ncols, parallel_mng))))
67 m_impl->setBlockInfos(&block);
72BlockMatrix::BlockMatrix(BlockMatrix&& matrix)
73: m_impl(std::move(matrix.m_impl))
79BlockMatrix::operator=(BlockMatrix&& matrix)
81 m_impl = std::move(matrix.m_impl);
87void BlockMatrix::init(
const Block& block,
const MatrixDistribution& dist)
89 m_impl.reset(
new MultiMatrixImpl(
90 dist.rowSpace().clone(), dist.colSpace().clone(), dist.clone()));
91 m_impl->setBlockInfos(&block);
96void BlockMatrix::free()
103void BlockMatrix::clear()
118BlockMatrix::distribution()
const
120 return m_impl->distribution();
128 return m_impl->rowSpace();
136 return m_impl->colSpace();
141void BlockMatrix::setUserFeature(String feature)
143 m_impl->setFeature(feature);
148bool BlockMatrix::hasUserFeature(String feature)
const
150 return m_impl->hasFeature(feature);
156BlockMatrix::block()
const
158 const Block* block = m_impl->block();
162 throw FatalErrorException(
163 A_FUNCINFO,
"Requesting for block information but none was provided");
MultiMatrixImpl * impl()
Get the multimatrix implementation.
const ISpace & rowSpace() const
Get row space associated to the matrix.
void visit(ICopyOnWriteMatrix &) const
Visit method.
const ISpace & colSpace() const
Get col space associated to the matrix.
Interface for algebraic space objects.
Computes a matrix distribution.
Multi matrices representation container.
Implementation of an algebraic space.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --