Arcane  4.2.1.0
Developer 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-2026 */
9/* */
10/* 2-dimensional vector of 'Real'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arccore/base/Real2.h"
15
16#include <iostream>
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27std::istream& Real2::
28assign(std::istream& i)
29{
30 i >> x >> std::ws >> y;
31 return i;
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37std::ostream& Real2::
38print(std::ostream& o) const
39{
40 o << x << ' ' << y;
41 return o;
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47std::ostream& Real2::
48printXy(std::ostream& o) const
49{
50 o << '(' << x << ',' << y << ')';
51 return o;
52}
53
54/*---------------------------------------------------------------------------*/
55/*---------------------------------------------------------------------------*/
56
57} // namespace Arcane
58
59/*---------------------------------------------------------------------------*/
60/*---------------------------------------------------------------------------*/
std::ostream & printXy(std::ostream &o) const
Writes the pair to stream o in the form (x,y).
Definition Real2.cc:48
std::ostream & print(std::ostream &o) const
Writes the pair to stream o readable by an assign().
Definition Real2.cc:38
constexpr __host__ __device__ Real2 & assign(Real ax, Real ay)
Assigns the triplet (ax,ay,az) to the instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Real y
second component of the pair
Real x
first component of the pair