Alien  1.3.0
Developer documentation
Loading...
Searching...
No Matches
ILinearAlgebra.h
Go to the documentation of this file.
1/*
2 * Copyright 2020 IFPEN-CEA
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 * SPDX-License-Identifier: Apache-2.0
17 */
18
23
24#pragma once
25
26#include <alien/utils/Precomp.h>
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Alien
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37class IVector;
38class IMatrix;
39
40/*---------------------------------------------------------------------------*/
41/*---------------------------------------------------------------------------*/
42
48{
49 public:
51 virtual ~ILinearAlgebra() {}
52
53 public:
59 virtual Arccore::Real norm0(const IVector& x) const = 0;
60
66 virtual Arccore::Real norm1(const IVector& x) const = 0;
67
73 virtual Arccore::Real norm2(const IVector& x) const = 0;
74
81 virtual void mult(const IMatrix& a, const IVector& x, IVector& r) const = 0;
82
89 virtual void axpy(Real alpha, const IVector& x, IVector& y) const = 0;
90
96 virtual void copy(const IVector& x, IVector& r) const = 0;
97
104 virtual Arccore::Real dot(const IVector& x, const IVector& y) const = 0;
105};
106
107/*---------------------------------------------------------------------------*/
108/*---------------------------------------------------------------------------*/
109
110} // namespace Alien
111
112/*---------------------------------------------------------------------------*/
113/*---------------------------------------------------------------------------*/
Interface for linear algebra.
virtual Arccore::Real norm0(const IVector &x) const =0
Computes norm 0 of a vector.
virtual void mult(const IMatrix &a, const IVector &x, IVector &r) const =0
Computes a matrix vector product.
virtual Arccore::Real dot(const IVector &x, const IVector &y) const =0
Computes the dot product of two vectors.
virtual Arccore::Real norm2(const IVector &x) const =0
Computes norm 2 of a vector.
virtual ~ILinearAlgebra()
Free resources.
virtual Arccore::Real norm1(const IVector &x) const =0
Computes norm 1 of a vector.
virtual void copy(const IVector &x, IVector &r) const =0
Copy a vector.
virtual void axpy(Real alpha, const IVector &x, IVector &y) const =0
Computes y += alpa * x.
Interface for all matrices.
Definition IMatrix.h:51
Interface for all vectors.
Definition IVector.h:51
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition BackEnd.h:17