Ignore:
Timestamp:
Aug 19, 2009, 12:30:21 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
78dac6
Parents:
27459a (diff), 6c09a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'VectorUnitTest' into ConcaveHull

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.hpp

    r27459a rdaf5d6  
    55
    66#include "helpers.hpp"
     7
     8#include <gsl/gsl_vector.h>
     9#include <gsl/gsl_multimin.h>
    710
    811class Vector;
     
    2427  double PeriodicDistanceSquared(const Vector *y, const double *cell_size) const;
    2528  double ScalarProduct(const Vector *y) const;
    26   double Projection(const Vector *y) const;
    2729  double Norm() const;
    2830  double NormSquared() const;
    2931  double Angle(const Vector *y) const;
    30   bool IsNull() const;
     32  bool IsZero() const;
     33  bool IsOne() const;
     34  bool IsNormalTo(const Vector *normal) const;
    3135
    3236  void AddVector(const Vector *y);
    3337  void SubtractVector(const Vector *y);
    3438  void CopyVector(const Vector *y);
     39  void CopyVector(const Vector y);
    3540  void RotateVector(const Vector *y, const double alpha);
    3641  void VectorProduct(const Vector *y);
    3742  void ProjectOntoPlane(const Vector *y);
     43  void ProjectIt(const Vector *y);
     44  Vector Projection(const Vector *y) const;
    3845  void Zero();
    3946  void One(double one);
     
    6471
    6572ostream & operator << (ostream& ost, const Vector &m);
    66 //Vector& operator+=(Vector& a, const Vector& b);
    67 //Vector& operator*=(Vector& a, const double m);
    68 //Vector& operator*(const Vector& a, const double m);
    69 //Vector& operator+(const Vector& a, const Vector& b);
     73bool operator==(const Vector& a, const Vector& b);
     74Vector& operator+=(Vector& a, const Vector& b);
     75Vector& operator-=(Vector& a, const Vector& b);
     76Vector& operator*=(Vector& a, const double m);
     77Vector& operator*(const Vector& a, const double m);
     78Vector& operator*(const double m, const Vector& a);
     79Vector& operator+(const Vector& a, const Vector& b);
     80Vector& operator-(const Vector& a, const Vector& b);
     81
     82// some algebraic matrix stuff
     83#define RDET3(a) ((a)[0]*(a)[4]*(a)[8] + (a)[3]*(a)[7]*(a)[2] + (a)[6]*(a)[1]*(a)[5] - (a)[2]*(a)[4]*(a)[6] - (a)[5]*(a)[7]*(a)[0] - (a)[8]*(a)[1]*(a)[3])  //!< hard-coded determinant of a 3x3 matrix
     84#define RDET2(a0,a1,a2,a3) ((a0)*(a3)-(a1)*(a2))                      //!< hard-coded determinant of a 2x2 matrix
     85
     86
    7087
    7188#endif /*VECTOR_HPP_*/
Note: See TracChangeset for help on using the changeset viewer.