[go: up one dir, main page]

Menu

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

Download this file

69 lines (48 with data), 1.6 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
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef VECTOR_S_H
#define VECTOR_S_H 1
#include <stdio.h>
#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 * data;
public:
type missing;
vector_s();
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();
void set_default_missing();
void resize (int n);
void resize (int n, type m);
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);
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);
int size();
operator type * ();
void print(FILE *fs);
};
}
#endif