Changeset 3219a0 for molecuilder/src


Ignore:
Timestamp:
Aug 3, 2009, 4:44:16 PM (16 years ago)
Author:
Saskia Metzler <metzler@…>
Children:
a87d5e6
Parents:
b65771
Message:

new function isNull(), output operator takes const argument

Location:
molecuilder/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.cpp

    rb65771 r3219a0  
    253253};
    254254
     255/** Checks whether vector has all components zero.
     256 * @return true - vector is zero, false - vector is not
     257 */
     258bool Vector::IsNull()
     259{
     260  return (fabs(x[0]+x[1]+x[2]) < MYEPSILON);
     261};
     262
    255263/** Calculates the angle between this and another vector.
    256264 * \param *y array to second vector
     
    358366};
    359367
    360 ostream& operator<<(ostream& ost,Vector& m)
     368ostream& operator<<(ostream& ost, const Vector& m)
    361369{
    362370        ost << "(";
  • molecuilder/src/vector.hpp

    rb65771 r3219a0  
    2323        double Norm() const ;
    2424        double Angle(const Vector *y) const;
     25        bool IsNull();
     26
    2527
    2628        void AddVector(const Vector *y);
     
    5456};
    5557
    56 ostream & operator << (ostream& ost, Vector &m);
     58ostream & operator << (ostream& ost, const Vector &m);
    5759//Vector& operator+=(Vector& a, const Vector& b);
    5860//Vector& operator*=(Vector& a, const double m);
Note: See TracChangeset for help on using the changeset viewer.