Ignore:
Timestamp:
Oct 27, 2009, 4:11:22 PM (16 years ago)
Author:
Frederik Heber <heber@…>
Children:
069034
Parents:
55a71b
Message:

Huge refactoring to make const what is const (ticket #38), continued.

  • too many changes because of too many cross-references to be able to list them up here.
  • NOTE that "make check" runs fine and did catch several error.
  • note that we had to use const_iterator several times when the map, ... was declared const.
  • at times we changed an allocated LinkedCell LCList(...) into

const LinkedCell *LCList;
LCList = new LinkedCell(...);

  • also mutable (see ticket #5) was used, e.g. for molecule::InternalPointer (PointCloud changes are allowed, because they are just accounting).

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • molecuilder/src/vector.hpp

    r55a71b ra9b2a0a  
    3030  ~Vector();
    3131
    32   double Distance(const Vector *y) const;
    33   double DistanceSquared(const Vector *y) const;
    34   double DistanceToPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset);
    35   double PeriodicDistance(const Vector *y, const double *cell_size) const;
    36   double PeriodicDistanceSquared(const Vector *y, const double *cell_size) const;
    37   double ScalarProduct(const Vector *y) const;
     32  double Distance(const Vector * const y) const;
     33  double DistanceSquared(const Vector * const y) const;
     34  double DistanceToPlane(ofstream *out, const Vector * const PlaneNormal, const Vector * const PlaneOffset) const;
     35  double PeriodicDistance(const Vector * const y, const double * const cell_size) const;
     36  double PeriodicDistanceSquared(const Vector * const y, const double * const cell_size) const;
     37  double ScalarProduct(const Vector * const y) const;
    3838  double Norm() const;
    3939  double NormSquared() const;
    40   double Angle(const Vector *y) const;
     40  double Angle(const Vector * const y) const;
    4141  bool IsZero() const;
    4242  bool IsOne() const;
    43   bool IsNormalTo(const Vector *normal) const;
     43  bool IsNormalTo(const Vector * const normal) const;
    4444
    45   void AddVector(const Vector *y);
    46   void SubtractVector(const Vector *y);
    47   void CopyVector(const Vector *y);
    48   void CopyVector(const Vector y);
    49   void RotateVector(const Vector *y, const double alpha);
    50   void VectorProduct(const Vector *y);
    51   void ProjectOntoPlane(const Vector *y);
    52   void ProjectIt(const Vector *y);
    53   Vector Projection(const Vector *y) const;
     45  void AddVector(const Vector * const y);
     46  void SubtractVector(const Vector * const y);
     47  void CopyVector(const Vector * const y);
     48  void CopyVector(const Vector &y);
     49  void RotateVector(const Vector * const y, const double alpha);
     50  void VectorProduct(const Vector * const y);
     51  void ProjectOntoPlane(const Vector * const y);
     52  void ProjectIt(const Vector * const y);
     53  Vector Projection(const Vector * const y) const;
    5454  void Zero();
    55   void One(double one);
    56   void Init(double x1, double x2, double x3);
     55  void One(const double one);
     56  void Init(const double x1, const double x2, const double x3);
    5757  void Normalize();
    58   void Translate(const Vector *x);
    59   void Mirror(const Vector *x);
    60   void Scale(double **factor);
    61   void Scale(double *factor);
    62   void Scale(double factor);
    63   void MatrixMultiplication(const double *M);
    64   double * InverseMatrix(double *A);
    65   void InverseMatrixMultiplication(const double *M);
    66   void KeepPeriodic(ofstream *out, double *matrix);
    67   void LinearCombinationOfVectors(const Vector *x1, const Vector *x2, const Vector *x3, double *factors);
    68   double CutsPlaneAt(Vector *A, Vector *B, Vector *C);
    69   bool GetIntersectionWithPlane(ofstream *out, Vector *PlaneNormal, Vector *PlaneOffset, Vector *Origin, Vector *LineVector);
    70   bool GetIntersectionOfTwoLinesOnPlane(ofstream *out, Vector *Line1a, Vector *Line1b, Vector *Line2a, Vector *Line2b, const Vector *Normal = NULL);
    71   bool GetOneNormalVector(const Vector *x1);
    72   bool MakeNormalVector(const Vector *y1);
    73   bool MakeNormalVector(const Vector *y1, const Vector *y2);
    74   bool MakeNormalVector(const Vector *x1, const Vector *x2, const Vector *x3);
    75   bool SolveSystem(Vector *x1, Vector *x2, Vector *y, double alpha, double beta, double c);
    76   bool LSQdistance(Vector **vectors, int dim);
    77   void AskPosition(double *cell_size, bool check);
     58  void Translate(const Vector * const x);
     59  void Mirror(const Vector * const x);
     60  void Scale(const double ** const factor);
     61  void Scale(const double * const factor);
     62  void Scale(const double factor);
     63  void MatrixMultiplication(const double * const M);
     64  double * InverseMatrix(const double * const A);
     65  void InverseMatrixMultiplication(const double * const M);
     66  void KeepPeriodic(ofstream *out, const double * const matrix);
     67  void LinearCombinationOfVectors(const Vector * const x1, const Vector * const x2, const Vector * const x3, const double * const factors);
     68  double CutsPlaneAt(const Vector * const A, const Vector * const B, const Vector * const C) const;
     69  bool GetIntersectionWithPlane(ofstream *out, const Vector * const PlaneNormal, const Vector * const PlaneOffset, const Vector * const Origin, const Vector * const LineVector);
     70  bool GetIntersectionOfTwoLinesOnPlane(ofstream *out, const Vector * const Line1a, const Vector * const Line1b, const Vector * const Line2a, const Vector * const Line2b, const Vector *Normal = NULL);
     71  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);
    7878  bool Output(ofstream *out) const;
    79   bool IsInParallelepiped(const Vector offset, const double *parallelepiped) const;
    80   void WrapPeriodically(const double *M, const double *Minv);
     79  bool IsInParallelepiped(const Vector &offset, const double * const parallelepiped) const;
     80  void WrapPeriodically(const double * const M, const double * const Minv);
    8181};
    8282
Note: See TracChangeset for help on using the changeset viewer.