source: molecuilder/src/vector.hpp@ e292c10

Last change on this file since e292c10 was e292c10, checked in by Frederik Heber <heber@…>, 17 years ago

VolumeOfConvexEnvelope: Works!

VolumeOfConvexEnvelope has been analysed into various smaller functions and approach is working.
two new files: boundary.?pp
various new functions:
class Tesselation with AddPoint(), TesselateOnBoundary() and GuessStartingTriangle() does the actual tesselation
CreateClustersinWater() will create the repetition of the cluster with correct spacing (unfinished).
GetDiametersOfCluster() calculate the greatest diameter in projection per axis
GetBoundaryPoints() gets the boundary on the convex envelope by projection for a molecular cluster
GetCommonEndpoint() finds the endpoint two lines are sharing

  • Property mode set to 100644
File size: 2.0 KB
Line 
1#ifndef VECTOR_HPP_
2#define VECTOR_HPP_
3
4/** Single vector.
5 * basically, just a x[3] but with helpful functions
6 */
7class vector {
8 public:
9 double x[NDIM];
10
11 vector();
12 vector(double x1, double x2, double x3);
13 ~vector();
14
15 double Distance(const vector *y) const;
16 double PeriodicDistance(const vector *y, const double *cell_size) const;
17 double ScalarProduct(const vector *y) const;
18 double Projection(const vector *y) const;
19 double Norm() const ;
20 double Angle(vector *y) const;
21
22 void AddVector(const vector *y);
23 void SubtractVector(const vector *y);
24 void CopyVector(const vector *y);
25 void RotateVector(const vector *y, const double alpha);
26 void ProjectOntoPlane(const vector *y);
27 void Zero();
28 void One(double one);
29 void Init(double x1, double x2, double x3);
30 void Normalize();
31 void Translate(const vector *x);
32 void Mirror(const vector *x);
33 void Scale(double **factor);
34 void Scale(double *factor);
35 void Scale(double factor);
36 void MatrixMultiplication(double *M);
37 void InverseMatrixMultiplication(double *M);
38 void KeepPeriodic(ofstream *out, double *matrix);
39 void LinearCombinationOfVectors(const vector *x1, const vector *x2, const vector *x3, double *factors);
40
41 double CutsPlaneAt(vector *A, vector *B, vector *C);
42 bool GetOneNormalVector(const vector *x1);
43 bool MakeNormalVector(const vector *y1);
44 bool MakeNormalVector(const vector *y1, const vector *y2);
45 bool MakeNormalVector(const vector *x1, const vector *x2, const vector *x3);
46 bool SolveSystem(vector *x1, vector *x2, vector *y, double alpha, double beta, double c);
47 bool LSQdistance(vector **vectors, int dim);
48
49 void AskPosition(double *cell_size, bool check);
50 bool Output(ofstream *out) const;
51};
52
53ofstream& operator<<(ofstream& ost, vector& m);
54vector& operator+=(vector& a, const vector& b);
55vector& operator*=(vector& a, const double m);
56vector& operator*(const vector& a, const double m);
57vector& operator+(const vector& a, const vector& b);
58
59#endif /*VECTOR_HPP_*/
Note: See TracBrowser for help on using the repository browser.