ISAAC
Overview :: Library Doc :: Server Doc :: JSON Commands

In Situ Animation of Accelerated Computations

isaac_vector.hpp
Go to the documentation of this file.
1 /* This file is part of ISAAC.
2  *
3  * ISAAC is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as
5  * published by the Free Software Foundation, either version 3 of the
6  * License, or (at your option) any later version.
7  *
8  * ISAAC is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public
14  * License along with ISAAC. If not, see <www.gnu.org/licenses/>. */
15 
16 #pragma once
17 
18 #include "isaac_defines.hpp"
19 
20 namespace isaac
21 {
22 
23 template <
24  typename Type,
25  size_t Size
26 >
28 {
29  Type value[Size];
30  Type& operator[] (size_t const& index)
31  {
32  return value[index];
33  }
35  {
36  if (this != &rhs)
37  {
38  ISAAC_ELEM_ITERATE( index )
39  value[index] = rhs[index];
40  }
41  return *this;
42  }
44  {
46  ISAAC_ELEM_ITERATE( index )
47  result[index] = lhs[index] + rhs[index];
48  return result;
49  }
50 };
51 
52 
53 
54 
55 } //namespace isaac;
Type & operator[](size_t const &index)
Definition: isaac.hpp:60
#define ISAAC_ELEM_ITERATE(NAME)
const IsaacVector< Type, Size > operator+(IsaacVector< Type, Size > const &lhs, IsaacVector< Type, Size > const &rhs)
IsaacVector< Type, Size > & operator=(IsaacVector< Type, Size > const &rhs)