mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 21:10:33 +05:00
Fix Vec<> comparison operator
- Iterate over size of Vec<> (thx Joachim) - Declare it const (otherwise pybind compares the pointers to the data arrays instead)
This commit is contained in:
parent
05e6456ec2
commit
a0921a5e7f
@ -120,9 +120,12 @@ namespace netgen
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator== (const Vec<D,T> &a)
|
bool operator== (const Vec<D,T> &a) const
|
||||||
{
|
{
|
||||||
return x[0]==a.x[0] && x[1]==a.x[1] && x[2]==a.x[2];
|
bool res = true;
|
||||||
|
for (auto i : Range(D))
|
||||||
|
res &= (x[i]==a.x[i]);
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
T & operator() (int i) { return x[i]; }
|
T & operator() (int i) { return x[i]; }
|
||||||
|
Loading…
Reference in New Issue
Block a user