Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Real2.cc
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/* Real2.cc (C) 2000-2023 */
9/* */
10/* Vecteur à 2 dimensions de 'Real'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/Real2.h"
15#include "arcane/utils/Iostream.h"
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
20namespace Arcane
21{
22
23/*---------------------------------------------------------------------------*/
24/*---------------------------------------------------------------------------*/
25
26std::istream& Real2::
27assign(std::istream& i)
28{
29 i >> x >> ws >> y;
30 return i;
31}
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36std::ostream& Real2::
37print(std::ostream& o) const
38{
39 o << x << ' ' << y;
40 return o;
41}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45
46std::ostream& Real2::
47printXy(std::ostream& o) const
48{
49 o << '(' << x << ',' << y << ')';
50 return o;
51}
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56} // namespace Arcane
57
58/*---------------------------------------------------------------------------*/
59/*---------------------------------------------------------------------------*/
std::ostream & printXy(std::ostream &o) const
Ecrit le couple sur le flot o sous la forme (x,y)
Definition Real2.cc:47
constexpr ARCCORE_HOST_DEVICE Real2 & assign(Real ax, Real ay)
Affecte à l'instance le couple (ax,ay,az)
Definition Real2.h:182
std::ostream & print(std::ostream &o) const
Ecrit le couple sur le flot o lisible par un assign()
Definition Real2.cc:37
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Real y
deuxième composante du couple
Definition Real2.h:35
Real x
première composante du couple
Definition Real2.h:34