19#include <alien/ref/data/block/VBlockMatrix.h>
21#include <alien/ref/AlienRefSemantic.h>
22#include <alien/utils/ICopyOnWriteObject.h>
33VBlockMatrix::VBlockMatrix()
40VBlockMatrix::VBlockMatrix(
const VBlock& block,
const MatrixDistribution& dist)
42 new MultiMatrixImpl(dist.rowSpace().clone(), dist.colSpace().clone(), dist.clone()))
44 m_impl->setBlockInfos(&block);
49VBlockMatrix::VBlockMatrix(
50const VBlock& row_block,
const VBlock& col_block,
const MatrixDistribution& dist)
52 new MultiMatrixImpl(dist.rowSpace().clone(), dist.colSpace().clone(), dist.clone()))
54 m_impl->setRowBlockInfos(&row_block);
55 m_impl->setColBlockInfos(&col_block);
60VBlockMatrix::VBlockMatrix(Integer nrows, Integer ncols, Integer nrows_local,
61 const VBlock& row_block,
const VBlock& col_block, IMessagePassingMng* parallel_mng)
63 new MultiMatrixImpl(std::make_shared<Space>(nrows), std::make_shared<Space>(ncols),
64 std::make_shared<MatrixDistribution>(
65 MatrixDistribution(nrows, ncols, nrows_local, parallel_mng))))
67 m_impl->setRowBlockInfos(&row_block);
68 m_impl->setColBlockInfos(&col_block);
73VBlockMatrix::VBlockMatrix(Integer nrows, Integer ncols,
const VBlock& row_block,
74 const VBlock& col_block, IMessagePassingMng* parallel_mng)
75: m_impl(new MultiMatrixImpl(std::make_shared<Space>(nrows),
76 std::make_shared<Space>(ncols),
77 std::make_shared<MatrixDistribution>(MatrixDistribution(nrows, ncols, parallel_mng))))
79 m_impl->setRowBlockInfos(&row_block);
80 m_impl->setColBlockInfos(&col_block);
85VBlockMatrix::VBlockMatrix(VBlockMatrix&& matrix)
86: m_impl(std::move(matrix.m_impl))
92VBlockMatrix::operator=(VBlockMatrix&& matrix)
94 m_impl = std::move(matrix.m_impl);
100void VBlockMatrix::init(
const VBlock& block,
const MatrixDistribution& dist)
102 m_impl.reset(
new MultiMatrixImpl(
103 dist.rowSpace().clone(), dist.colSpace().clone(), dist.clone()));
104 m_impl->setBlockInfos(&block);
109void VBlockMatrix::free()
116void VBlockMatrix::clear()
131VBlockMatrix::distribution()
const
133 return m_impl->distribution();
141 return m_impl->rowSpace();
149 return m_impl->colSpace();
154void VBlockMatrix::setUserFeature(String feature)
156 m_impl->setFeature(feature);
161bool VBlockMatrix::hasUserFeature(String feature)
const
163 return m_impl->hasFeature(feature);
169VBlockMatrix::vblock()
const
171 const VBlock* block = m_impl->vblock();
175 throw FatalErrorException(
176 A_FUNCINFO,
"Requesting for block information but none was provided");
182VBlockMatrix::rowBlock()
const
184 const VBlock* block = m_impl->rowBlock();
188 throw FatalErrorException(
189 A_FUNCINFO,
"Requesting for block information but none was provided");
195VBlockMatrix::colBlock()
const
197 const VBlock* block = m_impl->colBlock();
201 throw FatalErrorException(
202 A_FUNCINFO,
"Requesting for block information but none was provided");
Interface for algebraic space objects.
Computes a matrix distribution.
Multi matrices representation container.
Implementation of an algebraic space.
void visit(ICopyOnWriteMatrix &) const
Visit method.
MultiMatrixImpl * impl()
Get the multimatrix implementation.
const ISpace & colSpace() const
Get col space associated to the matrix.
const ISpace & rowSpace() const
Get row space associated to the matrix.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --