Ignore:
Timestamp:
Apr 7, 2010, 3:45:38 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Children:
0f55b2
Parents:
770138
Message:

Made data internal data-structure of vector class private

  • Replaced occurences of access to internals with operator
  • moved Vector-class into LinAlg-Module
  • Reworked Vector to allow clean modularization
  • Added Plane class to describe arbitrary planes in 3d space
File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.hpp

    r770138 r71910a  
    2424class Vector {
    2525  public:
    26     double x[NDIM];
    2726
    2827  Vector();
    2928  Vector(const double x1, const double x2, const double x3);
     29  Vector(const Vector& src);
    3030  ~Vector();
    3131
     
    4848  void CopyVector(const Vector * const y);
    4949  void CopyVector(const Vector &y);
    50   void RotateVector(const Vector * const y, const double alpha);
    5150  void VectorProduct(const Vector * const y);
    5251  void ProjectOntoPlane(const Vector * const y);
     
    6362  void Scale(const double factor);
    6463  void MatrixMultiplication(const double * const M);
    65   void InverseMatrixMultiplication(const double * const M);
     64  bool InverseMatrixMultiplication(const double * const M);
    6665  void KeepPeriodic(const double * const matrix);
    6766  void LinearCombinationOfVectors(const Vector * const x1, const Vector * const x2, const Vector * const x3, const double * const factors);
    6867  double CutsPlaneAt(const Vector * const A, const Vector * const B, const Vector * const C) const;
    69   bool GetIntersectionWithPlane(const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector);
    70   bool GetIntersectionOfTwoLinesOnPlane(const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *Normal = NULL);
    7168  bool GetOneNormalVector(const Vector * const x1);
    72   bool MakeNormalVector(const Vector * const y1);
    73   bool MakeNormalVector(const Vector * const y1, const Vector * const y2);
    74   bool MakeNormalVector(const Vector * const x1, const Vector * const x2, const Vector * const x3);
    75   bool SolveSystem(Vector * x1, Vector * x2, Vector * y, const double alpha, const double beta, const double c);
    76   bool LSQdistance(const Vector ** vectors, int dim);
    77   void AskPosition(const double * const cell_size, const bool check);
    78   void Output() const;
     69  bool MakeNormalTo(const Vector &y1);
     70  //bool SolveSystem(Vector * x1, Vector * x2, Vector * y, const double alpha, const double beta, const double c);
    7971  bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const;
    8072  void WrapPeriodically(const double * const M, const double * const Minv);
     73
     74  // Accessors ussually come in pairs... and sometimes even more than that
     75  double& operator[](size_t i);
     76  const double& operator[](size_t i) const;
     77  double& at(size_t i);
     78  const double& at(size_t i) const;
     79
     80  // Assignment operator
     81  Vector &operator=(const Vector& src);
     82
     83  // Access to internal structure
     84  double* get();
     85
     86private:
     87  double x[NDIM];
    8188
    8289};
Note: See TracChangeset for help on using the changeset viewer.