Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Real2x2.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/* Real2x2.cc (C) 2000-2023 */
9/* */
10/* 2x2 matrix of 'Real'. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/utils/ArcanePrecomp.h"
15#include "arcane/utils/Iostream.h"
16#include "arcane/utils/Real2x2.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27std::istream& Real2x2::
28assign(std::istream& i)
29{
30 i >> x >> ws >> y;
31 return i;
32}
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
37std::ostream& Real2x2::
38print(std::ostream& o) const
39{
40 o << x << ' ' << y;
41 return o;
42}
43
44/*---------------------------------------------------------------------------*/
45/*---------------------------------------------------------------------------*/
46
47std::ostream& Real2x2::
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 & print(std::ostream &o) const
Writes the pair to the stream o readable by an assign().
Definition Real2x2.cc:38
Real2 x
First component.
Definition Real2x2.h:112
std::ostream & printXy(std::ostream &o) const
Writes the pair to the stream o in the form (x,y,z).
Definition Real2x2.cc:48
Real2 y
Second component.
Definition Real2x2.h:113
constexpr __host__ __device__ Real2x2 & assign(Real2 ax, Real2 ay)
Assigns the pair (ax,ay) to the instance.
Definition Real2x2.h:145
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --