Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/paramin-beta/vector.h
[mareframe] / trunk / paramin-beta / vector.h Repository:
ViewVC logotype

Annotation of /trunk/paramin-beta/vector.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef vector_h
2 :     #define vector_h
3 :    
4 :     #include "paramin.h"
5 :    
6 :     typedef double DFP;
7 :    
8 :     /** \class Vector
9 :     This class implements a Vector[0..dim-1] of type DFP. It facilitates Vector manipulation. Class Vector contains functions for Vector output and input, Vector comparison functions, functions for addition, subtraction and mulitplication, functions for finding Vector magnitude and normalize Vector
10 :     */
11 :    
12 :     class Vector {
13 :     public:
14 :     /**
15 :     * \brief This is the default constructor
16 :     */
17 :     Vector();
18 :     /**
19 :     * \brief This constructor initializes a Vector of value zero
20 :     * \param n is the size of the Vector
21 :     */
22 :     Vector(int n);
23 :     /**
24 :     * \brief This constructor initializes a Vector with f
25 :     * \param numVar is the size of the Vector
26 :     * \param f is a double* of size numVar
27 :     */
28 :     Vector(DFP* f, int numVar);
29 :     /**
30 :     * \brief This constructor initializes a Vector with values from another Vector object
31 :     * \param v is a Vector
32 :     */
33 :     Vector(const Vector& v);
34 :     /**
35 :     * \brief This is the default destructor
36 :     */
37 :     ~Vector();
38 :     /**
39 :     * \brief Returns the length of the Vector
40 :     */
41 :     int dimension() const;
42 :     /**
43 :     * \brief Returns the sum of two Vectors (positionwise)
44 :     * \param v1
45 :     * \param v2
46 :     */
47 :     friend Vector operator + (const Vector& v1, const Vector& v2);
48 :     /**
49 :     * \brief Returns the subtraction of v2 to v1 (positionwise)
50 :     * \param v1 is the Vector subtracted from
51 :     * \param v2 is the subtracting Vector
52 :     */
53 :     friend Vector operator - (const Vector& v1, const Vector& v2);
54 :     /**
55 :     * \brief Returns -V1
56 :     * \param v1
57 :     */
58 :     friend Vector operator - (const Vector& v1);
59 :     /**
60 :     * \brief Returns a*v1
61 :     * \param a is the scalar
62 :     */
63 :     friend Vector operator * (DFP a, const Vector& v1);
64 :     /**
65 :     * \brief Returns a*v1
66 :     * \param a is the scalar
67 :     */
68 :     friend Vector operator * (const Vector& v1, DFP a);
69 :     /**
70 :     * \brief Returns the dot product of v1 and v2
71 :     * \param v1 a Vector
72 :     * \param v2 a Vector
73 :     */
74 :     friend DFP operator * (const Vector& v1, const Vector& v2);
75 :    
76 :     friend int operator < (const Vector& v1, const Vector& v2);
77 :     friend int operator > (const Vector& v1, const Vector& v2);
78 :     friend int operator == (const Vector& v1, const Vector& v2);
79 :     friend int operator != (const Vector& v1, const Vector& v2);
80 :     Vector& operator = (const Vector& v);
81 :     DFP& operator [] (int i) const;
82 :     void setValue(DFP f);
83 :     DFP magnitude();
84 :     friend Vector normalize(Vector& v1);
85 :     friend ostream& operator << (ostream& os, const Vector& v1);
86 :     friend istream& operator >> (istream& is, Vector& v1);
87 :     private:
88 :     DFP* p;
89 :     int dim;
90 :     };
91 :    
92 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge