Alien  1.3.0
User 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:
23 //! Template parameter
24 typedef ValueT ValueType;
25 typedef SimpleCSRMatrix<ValueType> MatrixType;
26 typedef SimpleCSRVector<ValueType> VectorType;
27
28 public:
29 //! Constructeur de la classe
30 SimpleCSRMatrixMultT(const MatrixType& matrix);
31
32 //! Destructeur de la classe
34
35 public:
36 void synchronize(VectorType& x) const;
37
38 //! Matrix vector product
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 lowerUpperSynchronize(const VectorType& x, VectorType& y) const;
46 void upperLowerSynchronize(const VectorType& x, VectorType& y) const;
47
48 void computeDiag(VectorType& y) const;
49 void multDiag(VectorType& y) const;
50 void computeInvDiag(VectorType& y) const;
51 void multInvDiag(VectorType& y) const;
52
53 private:
54 void _synchronize(VectorType& x) const;
55 void _parallelMult(const VectorType& x, VectorType& y) const;
56 void _parallelMult(const UniqueArray<Real>& x, UniqueArray<Real>& y) const;
57
58 void _seqMult(const VectorType& x, VectorType& y) const;
59 void _seqMult(const UniqueArray<Real>& x, UniqueArray<Real>& y) const;
60
61 void _seqAddLMult(Real alpha, const VectorType& x, VectorType& y) const;
62 void _seqAddUMult(Real alpha, const VectorType& x, VectorType& y) const;
63
64 void _synchronizeBlock(VectorType& x) const;
65 void _parallelMultBlock(const VectorType& x, VectorType& y) const;
66
67 void _seqMultBlock(const VectorType& x, VectorType& y) const;
68
69 void _synchronizeVariableBlock(VectorType& x) const;
70 void _parallelMultVariableBlock(const VectorType& x, VectorType& y) const;
71
72 void _seqMultVariableBlock(const VectorType& x, VectorType& y) const;
73
74 private:
75 const MatrixType& m_matrix_impl;
76};
77
78} // namespace Alien::SimpleCSRInternal
79
80#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.