RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
vector_t.h
Go to the documentation of this file.
1 //
2 // File = vector_t.h
3 //
4 
5 #ifndef _VECTOR_T_H_
6 #define _VECTOR_T_H_
7 
8 #include "complex.h"
9 #include "matrix_t.h"
10 
11 //=======================================
12 template <class T>
13 class matrix;
14 template <class T>
15 class rowvec;
16 template <class T>
17 class colvec;
18 
19 template <class T>
20 class vector
21 {
22 protected:
23  struct vrep
24  {
25  T* f;
26  int refcnt;
27  int orig_indx;
28  int length;
29  int max_indx;
30  } * p;
31  int Is_Temp;
32  vector(void);
33 
34 public:
35  // vector( int origin, int size, int is_row_vec);
36  vector(int origin, int size);
37  vector(vector<T>& x);
38  void PurgeData(void);
39  ~vector(void);
41  vector<T>& operator=(T x);
42  vector<T>& operator/(T x);
43  T* array(void);
44  T& operator[](int);
46  // vector<T>& operator*( matrix &m2);
47  // friend vector<T>& matrix<T>::operator*( vector<T> &v2);
48  friend class matrix<T>;
49  friend class rowvec<T>;
50  friend class colvec<T>;
51 };
52 
53 template <class T>
54 class rowvec : public vector<T>
55 {
56 public:
57  // constructors
58  rowvec(void);
59  ~rowvec(void);
60  rowvec(int origin, int size);
61 
62  // row vector times matrix
64 
66 
67  // transpose operator
69 
70  // row vector times column vector
71  T& operator*(colvec<T>& v2);
72  // T operator*(colvec<T> &v2);
73  friend class colvec<T>;
74  // friend rowvec<T>* transpose( colvec<T> *x);
75  // friend colvec<T>& transpose( rowvec<T> &x);
76 };
77 
78 //=======================================
79 template <class T>
80 class colvec : public vector<T>
81 {
82 public:
83  // constructor
84  colvec(void);
85  colvec(int origin, int size);
86  ~colvec(void);
87 
88  // column vector time row vector
90 
92 
93  // transpose operator
95 
96  friend class rowvec<T>;
97  // friend rowvec<T>* transpose( colvec<T> *x);
98  // friend colvec<T>& transpose( rowvec<T> &x);
99 };
100 
101 template <class T>
103 
104 #endif
Definition: matrix_t.h:6
void PurgeData(void)
Definition: vector_t.cpp:260
rowvec(void)
Definition: vector_t.cpp:20
struct vector::vrep * p
vector< T > & operator=(vector< T > &vec)
Definition: vector_t.cpp:416
~rowvec(void)
Definition: vector_t.cpp:302
colvec< T > & operator!()
Definition: vector_t.cpp:67
Definition: matrix_t.h:8
int orig_indx
Definition: vector_t.h:27
int refcnt
Definition: vector_t.h:26
int length
Definition: vector_t.h:28
rowvec< T > & operator!()
Definition: vector_t.cpp:42
matrix< T > & operator*(rowvec< T > &v2)
Definition: vector_t.cpp:208
int max_indx
Definition: vector_t.h:29
T & operator[](int)
Definition: vector_t.cpp:528
rowvec< T > & operator=(vector< T > &vec)
Definition: vector_t.cpp:446
rowvec< T > & operator*(matrix< T > &m2)
Definition: vector_t.cpp:133
vector< T > & operator*(matrix< T > &m2)
Definition: vector_t.cpp:536
rowvec< T > * transpose(colvec< T > *)
vector< T > & operator/(T x)
Definition: vector_t.cpp:387
~vector(void)
Definition: vector_t.cpp:322
int Is_Temp
Definition: vector_t.h:31
~colvec(void)
Definition: vector_t.cpp:312
colvec(void)
Definition: vector_t.cpp:184
T * array(void)
Definition: vector_t.cpp:349
vector(void)
Definition: vector_t.cpp:247
colvec< T > & operator=(vector< T > &vec)
Definition: vector_t.cpp:476