[go: up one dir, main page]

Menu

[r320]: / libpetey / vector_s.h  Maximize  Restore  History

Download this file

57 lines (41 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef VECTOR_S_H
#define VECTOR_S_H 1
#include "petey_pointer.h"
namespace libpetey {
//sortable vector class
//a vector class, designed for (at the moment) removing duplicates
//within a list through sorting...
template <class type>
class vector_s {
protected:
int nel;
int array_size;
type missing;
type * data;
public:
vector_s(int n);
vector_s(int n, type m);
vector_s(type *dt, int n, int ncp_flag=0);
vector_s(type **dt, int n);
~vector_s();
vector_s<type> & operator = (vector_s<type> &other);
vector_s(vector_s<type> &other);
type & operator [] (int ind);
int operator == (vector_s<type> &other);
int operator > (vector_s<type> &other);
int operator < (vector_s<type> &other);
int operator >= (vector_s<type> &other);
int operator <= (vector_s<type> &other);
vector_s<type> & operator + (vector_s<type> &other);
vector_s<type> & operator - (vector_s<type> &other);
vector_s<type> & operator * (vector_s<type> &other);
vector_s<type> & operator / (vector_s<type> &other);
vector_s<type> & operator + (type &b);
vector_s<type> & operator - (const type &b);
vector_s<type> & operator * (const double &k);
vector_s<type> & operator / (const double &k);
vector_s<type> int size();
* operator type * ();
};
}
#endif