Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
MatrixVectorOperationsT.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/*---------------------------------------------------------------------------*/
8/* MatrixVectorOperationsT.h (C) 2014 */
9/* */
10/* Arithmetic operators for matrices and vectors. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_MATRIX_VECTOR_OPERATIONS_H
13#define ARCANE_MATRIX_VECTOR_OPERATIONS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17//#include "arcane/ArcaneTypes.h"
18//#include "arcane/matrix/MatrixExpressionT.h"
19
20#include "MatrixExpressionT.h"
21#include "VectorExpressionT.h"
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26ARCANE_BEGIN_NAMESPACE
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31
32
36template <class M, class V>
37 class VectorAXPY: public VectorExpr<VectorAXPY<M,V> >
38{
39 public:
41 const VectorExpr<V>& y);
42
43 ~VectorAXPY() {}
44
45 const IndexedSpace& domain() const;
46
47 private:
48 M const & m_a;
49 V const & m_x;
50};
51
52
53template<class M, class V>
54 VectorAXPY<M,V> operator+(const MatrixExpr<M>& a, const VectorExpr<V>& x)
55{
56 return VectorAXPY<M,V>(a,x);
57}
58
59template <class M, class V>
60 VectorAXPY<M,V>::VectorAXPY(const MatrixExpr<M>& a,
61 const VectorExpr<V>& y)
62 :m_a(a),m_x(x)
63{
64
65}
66
67template <class M, class V>
68const IndexedSpace&
69VectorAXPY<M,V>::domain() const ()
70{
71 if (!m_a.maps_from().isCompatible(m_x.domain())) {
72 // Throw an exception.
73 }
74
75 return m_a.maps_to();
76}
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81ARCANE_END_NAMESPACE
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86#endif // ARCANE_MATRIX_VECTOR_OPERATIONS_H
Indexed set/space to define matrix and vector support.
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
Matrix Helper class to handle add and scalar multiply.
Class to inherite to perform matrix computations.