-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrixStructure.cpp
More file actions
109 lines (81 loc) · 2.26 KB
/
MatrixStructure.cpp
File metadata and controls
109 lines (81 loc) · 2.26 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// MatrixStructure.cpp
//
// Base class for matrix storage structure.
// A size_t is used for indexing. Indexing starts at 1.
//
// 1 february 1999 RD Started
//
// (C) Datasim Component Technology 1999
#ifndef MatrixStructure_cpp
#define MatrixStructure_cpp
#include "MatrixStructure.hpp"
// Constructors & destructor
template <class V>
MatrixStructure<V>::MatrixStructure()
{ // Default constructor
}
template <class V>
MatrixStructure<V>::MatrixStructure(const MatrixStructure<V>& source)
{ // Copy constructor
}
template <class V>
MatrixStructure<V>::~MatrixStructure()
{ // Destructor
}
// Selectors
template <class V>
inline const V& MatrixStructure<V>::Element(size_t row, size_t column) const
{ // Get element at position
// Use the subscripting operator of derived class
return (*this)[row][column];
}
template <class V>
size_t MatrixStructure<V>::MinRowIndex() const
{ // Return the minimum row index
// Always ONE
return 1;
}
template <class V>
size_t MatrixStructure<V>::MaxRowIndex() const
{ // Return the maximum row index
// Always row size . use the Rows() function of derived classes
return Rows();
}
template <class V>
size_t MatrixStructure<V>::MinColumnIndex() const
{ // Return the minimum column index
// Always ONE
return 1;
}
template <class V>
size_t MatrixStructure<V>::MaxColumnIndex() const
{ // Return the maximum column index
// Always column size. use the Columns() function of derived classes
return Columns();
}
// Modifiers
template <class V>
inline void MatrixStructure<V>::Element(size_t row, size_t column, const V& val)
{ // Change element at position
// Use the subscripting operator of derived class
(*this)[row][column]=val;
}
// Operators
template <class V>
MatrixStructure<V>& MatrixStructure<V>::operator = (const MatrixStructure<V>& source)
{ // Assignment operator
return *this;
}
template <class V>
inline V& MatrixStructure<V>::operator () (size_t row, size_t column)
{ // Get element at position
// Use the subscripting operator of derived class
return (*this)[row][column];
}
template <class V>
inline const V& MatrixStructure<V>::operator () (size_t row, size_t column) const
{ // Get element at position
// Use the subscripting operator of derived class
return (*this)[row][column];
}
#endif // MatrixStructure_cpp