14#include "arcane/datatype/RealArray2Variant.h"
16#include "arcane/utils/FatalErrorException.h"
17#include "arcane/utils/NumMatrix.h"
32extern "C++" ARCANE_CORE_EXPORT
void
33_arcaneTestRealArray2Variant()
36 Real data[4] = { 2.4, 5.6, 3.3, 4.4 };
44 for (
Integer v = 0; v < nb_variants; ++v) {
45 std::cout <<
"A" << v <<
"=[ ";
46 for (
Integer i = 0; i < variants[v].dim1Size(); ++i) {
48 for (
Integer j = 0; j < variants[v].dim2Size(); ++j)
49 std::cout << variants[v][i][j] <<
" ";
55#if defined(ARCANE_HAS_ACCELERATOR_API)
59 Span<const Real> variant2_span(variant2.data(), variant2.dim1Size() * variant2.dim2Size());
60 std::cout <<
"NUM_DATA =" << num_data.to1DSpan() <<
"\n";
61 std::cout <<
"NUM_DATA_COPY=" << num_data_copy.to1DSpan() <<
"\n";
62 if (num_data_copy.to1DSpan() != num_data.to1DSpan())
71 RealN2x2 c22(n22_variant);
72 RealN3x3 c33(n33_variant);
75 std::cout <<
"Z=" << z.vx().vx() <<
"\n";
79 std::cout <<
"V1=" << i <<
" " << j <<
" v=" << m33(i, j) <<
"\n";
80 for (
Integer i = 0; i < 3; ++i) {
83 std::cout <<
"V2=" << i <<
" " << j <<
" v=" << lc(j) <<
"\n";
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Various mathematical functions.
View for a constant 2D array.
Multi-dimensional arrays for numerical types accessible on accelerators.
Small fixed-size matrix containing RowSize rows and ColumnSize columns.
Class managing a 2-dimensional real vector.
Class managing a 2x2 matrix of reals.
Class managing a 3-dimensional real vector.
Class managing a 3x3 real matrix.
Variant that can contain the types ConstArray2View, Real2x2, and Real3x3.
View of an array of elements of type T.
__host__ __device__ Real matrixDeterminant(Real3x3 m)
Calculates the determinant of a 3x3 matrix.
Real3x3 matrix3x3Prod(Real3x3 m1, Real3x3 m2)
Multiplication of 2 3x3 matrices.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
double Real
Type representing a real number.