Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Real2.cc
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/*---------------------------------------------------------------------------*/
8/* Real2.cc (C) 2000-2023 */
9/* */
10/* 2-dimensional vector of '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
Writes the pair to stream o in the form (x,y).
Definition Real2.cc:47
std::ostream & print(std::ostream &o) const
Writes the pair to stream o readable by an assign().
Definition Real2.cc:37
constexpr __host__ __device__ Real2 & assign(Real ax, Real ay)
Assigns the triplet (ax,ay,az) to the instance.
Definition Real2.h:193
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Real y
second component of the pair
Definition Real2.h:35
Real x
first component of the pair
Definition Real2.h:34