Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
SimpleCSRMatrixMult.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7#pragma once
8
9#include <alien/kernels/simple_csr/SimpleCSRMatrix.h>
10#include <alien/kernels/simple_csr/SimpleCSRPrecomp.h>
11#include <alien/kernels/simple_csr/SimpleCSRVector.h>
12
13namespace Alien::SimpleCSRInternal
14{
15
16/*@! Classe amie de SimpleCSRMatrix pour externaliser plus rapidement (mais moins
17 * proprement)
18 * le produit matrice vecteur */
19template <typename ValueT>
21{
22 public:
24 typedef ValueT ValueType;
25 typedef SimpleCSRMatrix<ValueType> MatrixType;
26 typedef SimpleCSRVector<ValueType> VectorType;
27
28 public:
30 SimpleCSRMatrixMultT(const MatrixType& matrix);
31
34
35 public:
36 void synchronize(VectorType& x) const;
37
39 void mult(const VectorType& x, VectorType& y) const;
40 void mult(const UniqueArray<Real>& x, UniqueArray<Real>& y) const;
41
42 void addLMult(Real alpha, const VectorType& x, VectorType& y) const;
43 void addUMult(Real alpha, const VectorType& x, VectorType& y) const;
44
45 void computeDiag(VectorType& y) const;
46 void multDiag(VectorType& y) const;
47 void computeInvDiag(VectorType& y) const;
48 void multInvDiag(VectorType& y) const;
49
50 private:
51 void _synchronize(VectorType& x) const;
52 void _parallelMult(const VectorType& x, VectorType& y) const;
53 void _parallelMult(const UniqueArray<Real>& x, UniqueArray<Real>& y) const;
54
55 void _seqMult(const VectorType& x, VectorType& y) const;
56 void _seqMult(const UniqueArray<Real>& x, UniqueArray<Real>& y) const;
57
58 void _seqAddLMult(Real alpha, const VectorType& x, VectorType& y) const;
59 void _seqAddUMult(Real alpha, const VectorType& x, VectorType& y) const;
60
61 void _synchronizeBlock(VectorType& x) const;
62 void _parallelMultBlock(const VectorType& x, VectorType& y) const;
63
64 void _seqMultBlock(const VectorType& x, VectorType& y) const;
65
66 void _synchronizeVariableBlock(VectorType& x) const;
67 void _parallelMultVariableBlock(const VectorType& x, VectorType& y) const;
68
69 void _seqMultVariableBlock(const VectorType& x, VectorType& y) const;
70
71 private:
72 const MatrixType& m_matrix_impl;
73};
74
75} // namespace Alien::SimpleCSRInternal
76
77#include "SimpleCSRMatrixMultT.h"
SimpleCSRMatrixMultT(const MatrixType &matrix)
Constructeur de la classe.
void mult(const VectorType &x, VectorType &y) const
Matrix vector product.
virtual ~SimpleCSRMatrixMultT()
Destructeur de la classe.