Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
AlephCudaVector.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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/* cnc_vector.h (C) 2000-2012 */
9/* */
10/*---------------------------------------------------------------------------*/
11/*---------------------------------------------------------------------------*/
12#ifndef _CNC_INTERFACE_VECTOR_H_
13#define _CNC_INTERFACE_VECTOR_H_
14
15
16ARCANE_BEGIN_NAMESPACE
17
18
19template <class T> class CNC_Vector{
20public:
21 typedef CNC_Vector<T> thisclass ;
22
23 CNC_Vector(unsigned int size = 0, unsigned int alignment = 1);
24
26
27//---------------------------------------------------------------------------//
28
30 void allocate(unsigned int size, unsigned int alignment = 1);
31
32//---------------------------------------------------------------------------//
33
34 void set_all(const T& value) ;
35
36//---------------------------------------------------------------------------//
37
38 T& operator()(unsigned int i) ;
39//---------------------------------------------------------------------------//
40
41 const T& operator()(unsigned int i) const ;
42
43//---------------------------------------------------------------------------//
44
45 T& operator[](unsigned int index) ;
46//---------------------------------------------------------------------------//
47
48 const T& operator[](unsigned int index) const;
49
50//---------------------------------------------------------------------------//
51
52 T& from_linear_index(unsigned int index);
53
54//---------------------------------------------------------------------------//
55
56 const T& from_linear_index(unsigned int index) const;
57//---------------------------------------------------------------------------//
58
59 unsigned int size() const;
60
61//---------------------------------------------------------------------------//
62
63 unsigned int alignment() const;
64
65//---------------------------------------------------------------------------//
66
67 void clear();
68
69//---------------------------------------------------------------------------//
70
72 const T* data() const ;
73
74//---------------------------------------------------------------------------//
75
77 T* data();
78
79//---------------------------------------------------------------------------//
80
81 unsigned int mem_usage() const ;
82//---------------------------------------------------------------------------//
83
84 void print () const;
85
86//---------------------------------------------------------------------------//
87
88protected:
89 T* data_ ;
90 unsigned int size_ ;
91 char* base_mem_ ;
92 unsigned int alignment_ ;
93
94//---------------------------------------------------------------------------//
95
96 void deallocate() ;
97
98//---------------------------------------------------------------------------//
99
100private:
101 CNC_Vector(const thisclass& rhs) ;
102 thisclass& operator=(const thisclass& rhs) ;
103} ;
104
105
106ARCANE_END_NAMESPACE
107
108#endif
109
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120