Commit 0ae1086b by Francois Gygi

added operator[]

git-svn-id: http://qboxcode.org/svn/qb/branches/efield@1579 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 35830cc4
......@@ -45,6 +45,14 @@ class D3vector
else return z;
}
double operator[] (const int &i) const
{
assert(i>=0 && i <3);
if ( i == 0 ) return x;
else if ( i == 1 ) return y;
else return z;
}
bool operator==(const D3vector &rhs) const
{
return x == rhs.x && y == rhs.y && z == rhs.z;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment