Arcane  v3.16.0.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
IMathFunctor.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/* IMathFunctor.h (C) 2000-2011 */
9/* */
10/* Interface d'un fonctor pour une fonction mathématiques. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_IMATHFUNCTOR_H
13#define ARCANE_UTILS_IMATHFUNCTOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22ARCANE_BEGIN_NAMESPACE
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26/*!
27 * \brief Interface d'une fonction mathématique binaire.
28 */
29template<typename Arg1,typename Arg2,typename ReturnType>
31{
32 public:
33
34 //! Libère les ressources
36
37 public:
38
39 //! Exécute la méthode associé
40 virtual ReturnType apply(Arg1 a1,Arg2 a2) =0;
41
42 //! Exécute la méthode associé
44 {
45 for( Integer i=0,n=result.size(); i<n; ++i )
46 result[i] = apply(a1[i],a2[i]);
47 }
48};
49
50/*---------------------------------------------------------------------------*/
51/*---------------------------------------------------------------------------*/
52
53ARCANE_END_NAMESPACE
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58#endif
59
Fichier de configuration d'Arcane.
Vue modifiable d'un tableau d'un type T.
constexpr Integer size() const noexcept
Retourne la taille du tableau.
Vue constante d'un tableau de type T.
Interface d'une fonction mathématique binaire.
virtual void apply(ConstArrayView< Arg1 > a1, ConstArrayView< Arg2 > a2, ArrayView< ReturnType > result)
Exécute la méthode associé
virtual ~IBinaryMathFunctor()
Libère les ressources.
virtual ReturnType apply(Arg1 a1, Arg2 a2)=0
Exécute la méthode associé
Int32 Integer
Type représentant un entier.