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