-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMRVecIndex.h
81 lines (59 loc) · 1.51 KB
/
CMRVecIndex.h
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
68
69
70
71
72
73
74
75
76
77
78
#ifndef CMRVECINDEX_H
#define CMRVECINDEX_H
#include "Definitions.h"
namespace Daetk
{
///
class CMRVecIndex
/** This class is used to index unit stride subvectors of CMRVec's. */
{
public:
///
CMRVecIndex();
/** Create a CMRVecIndex that accesses the entire vector */
///
CMRVecIndex( int i1);
/** Create a CMRVecIndex that accesses the element i1 */
///
CMRVecIndex( int i1, int i2);
/** Create a CMRVecIndex that accesses a subvector starting at i1
and ending at i2 */
///
CMRVecIndex(const CMRVecIndex &s);
/** Create a copy of s */
///
int start() const;
/** Return the first index of subvectors accessed by this CMRVecIndex */
///
int end() const;
/** Return the last index of subvectors accessed by this CMRVecIndex */
///
int length() const;
/** Return the length of a subvector accessed by this CMRVecIndex */
///
bool all() const;
/** Return true if the CMRVecIndex accesses an entire vector */
///
CMRVecIndex& operator=(const CMRVecIndex& VI);
/** Copy I */
///
CMRVecIndex operator+(int i);
/** Return a CMRVecIndex with start=this->start_+i and
end=this->end_+i */
///
CMRVecIndex& operator+=(int i);
/** Add i to start and end */
///
CMRVecIndex operator-(int i);
/** Return a CMRVecIndex with start= this->start_-i and
end=this->end_-i */
///
CMRVecIndex& operator-=(int i);
/** Subtract i from start and end */
private:
int start_;
int end_;
bool all_;
};
}//Daetk
#endif