gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
STensor53.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 #ifndef STENSOR53_H_
6 #define STENSOR53_H_
7 
8 class STensor53 {
9 protected:
10  double _val[3][3][3][3][3];
11 
12 public:
13  STensor53(const double val = 0);
14  STensor53(const STensor53 &src);
15  inline double &operator()(int i, int j, int k, int l, int m)
16  {
17  return _val[i][j][k][l][m];
18  };
19  inline double operator()(int i, int j, int k, int l, int m) const
20  {
21  return _val[i][j][k][l][m];
22  };
23  STensor53 &operator=(const STensor53 &other)
24  {
25  for(int i = 0; i < 3; i++)
26  for(int j = 0; j < 3; j++)
27  for(int k = 0; k < 3; k++)
28  for(int l = 0; l < 3; l++)
29  for(int m = 0; m < 3; m++)
30  _val[i][j][k][l][m] = other._val[i][j][k][l][m];
31  return *this;
32  };
34  {
35  for(int i = 0; i < 3; i++)
36  for(int j = 0; j < 3; j++)
37  for(int k = 0; k < 3; k++)
38  for(int l = 0; l < 3; l++)
39  for(int m = 0; m < 3; m++)
40  _val[i][j][k][l][m] += other._val[i][j][k][l][m];
41  return *this;
42  };
44  {
45  for(int i = 0; i < 3; i++)
46  for(int j = 0; j < 3; j++)
47  for(int k = 0; k < 3; k++)
48  for(int l = 0; l < 3; l++)
49  for(int m = 0; m < 3; m++)
50  _val[i][j][k][l][m] -= other._val[i][j][k][l][m];
51  return *this;
52  };
53  STensor53 &operator*=(const double &other)
54  {
55  for(int i = 0; i < 3; i++)
56  for(int j = 0; j < 3; j++)
57  for(int k = 0; k < 3; k++)
58  for(int l = 0; l < 3; l++)
59  for(int m = 0; m < 3; m++) _val[i][j][k][l][m] *= other;
60  return *this;
61  };
62 };
63 
64 #endif // STENSOR53_H_
STensor53::operator()
double & operator()(int i, int j, int k, int l, int m)
Definition: STensor53.h:15
STensor53
Definition: STensor53.h:8
STensor53::operator()
double operator()(int i, int j, int k, int l, int m) const
Definition: STensor53.h:19
STensor53::operator+=
STensor53 & operator+=(const STensor53 &other)
Definition: STensor53.h:33
STensor53::_val
double _val[3][3][3][3][3]
Definition: STensor53.h:10
STensor53::operator-=
STensor53 & operator-=(const STensor53 &other)
Definition: STensor53.h:43
STensor53::operator*=
STensor53 & operator*=(const double &other)
Definition: STensor53.h:53
STensor53::STensor53
STensor53(const double val=0)
Definition: STensor53.cpp:8
STensor53::operator=
STensor53 & operator=(const STensor53 &other)
Definition: STensor53.h:23