Skip to content

Commit

Permalink
IOSS, EJOIN: Analyzer fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdsjaar committed Oct 9, 2024
1 parent 0f7dffb commit a885f00
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 22 deletions.
10 changes: 5 additions & 5 deletions packages/seacas/applications/ejoin/EJ_vector3d.C
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
vector3d::vector3d(double X, double Y, double Z) : x(X), y(Y), z(Z) {}

//----------------------------------------------------------------------------
vector3d::vector3d(double location[3]) : x(location[0]), y(location[1]), z(location[2]) {}
vector3d::vector3d(const double location[3]) : x(location[0]), y(location[1]), z(location[2]) {}

void vector3d::set(double X, double Y, double Z)
{
Expand All @@ -35,14 +35,14 @@ vector3d &vector3d::reverse()
return *this;
}

bool vector3d::operator==(const vector3d &from) const
bool operator==(const vector3d &lhs, const vector3d &rhs)
{
return (x == from.x && y == from.y && z == from.z);
return (lhs.x == rhs.x && lhs.y == rhs.y && lhs.z == rhs.z);
}

bool vector3d::operator!=(const vector3d &from) const
bool operator!=(const vector3d &lhs, const vector3d &rhs)
{
return (x != from.x || y != from.y || z != from.z);
return (lhs.x != rhs.x || lhs.y != rhs.y || lhs.z == rhs.z);
}

vector3d operator+(const vector3d &lhs, const vector3d &rhs)
Expand Down
21 changes: 11 additions & 10 deletions packages/seacas/applications/ejoin/EJ_vector3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ class vector3d
public:
vector3d() = default;
vector3d(double X, double Y, double Z);
explicit vector3d(double location[3]);
explicit vector3d(const double location[3]);

double x{}, y{}, z{};

bool operator==(const vector3d &from) const;
bool operator!=(const vector3d &from) const;
void set(double X, double Y, double Z);
void set(const double location[3]);
vector3d &reverse();
Expand All @@ -30,17 +28,20 @@ class vector3d
vector3d &operator*=(double scalar);
vector3d &operator/=(double scalar);

friend bool operator==(const vector3d &lhs, const vector3d &rhs);
friend bool operator!=(const vector3d &lhs, const vector3d &rhs);

friend vector3d operator*(double scalar, const vector3d &from);
friend vector3d operator*(const vector3d &lhs, double scalar);
friend vector3d operator/(const vector3d &lhs, double scalar);

friend vector3d operator+(const vector3d &lhs, const vector3d &rhs);
friend vector3d operator-(const vector3d &lhs, const vector3d &rhs);

double length() const;
vector3d cross(const vector3d &from) const;
};

vector3d operator*(double scalar, const vector3d &from);
vector3d operator*(const vector3d &lhs, double scalar);
vector3d operator/(const vector3d &lhs, double scalar);

vector3d operator+(const vector3d &lhs, const vector3d &rhs);
vector3d operator-(const vector3d &lhs, const vector3d &rhs);

//----------------------------------------------------------------------------
inline vector3d vector3d::cross(const vector3d &from) const
{
Expand Down
14 changes: 7 additions & 7 deletions packages/seacas/libraries/ioss/src/main/vector3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ class vector3d
vector3d &operator*=(double scalar);
vector3d &operator/=(double scalar);

friend vector3d operator*(double scalar, const vector3d &from);
friend vector3d operator*(const vector3d &lhs, double scalar);
friend vector3d operator/(const vector3d &lhs, double scalar);

friend vector3d operator+(const vector3d &lhs, const vector3d &rhs);
friend vector3d operator-(const vector3d &lhs, const vector3d &rhs);

double length() const;
double normalize(double tolerance = 1e-06);
vector3d cross(const vector3d &from) const;
static vector3d plane_normal(const vector3d &v1, const vector3d &v2, const vector3d &v3);
};

vector3d operator*(double scalar, const vector3d &from);
vector3d operator*(const vector3d &lhs, double scalar);
vector3d operator/(const vector3d &lhs, double scalar);

vector3d operator+(const vector3d &lhs, const vector3d &rhs);
vector3d operator-(const vector3d &lhs, const vector3d &rhs);

//----------------------------------------------------------------------------
inline vector3d vector3d::cross(const vector3d &from) const
{
Expand Down

0 comments on commit a885f00

Please sign in to comment.