]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/full-storage.icc
c919bf1ac904abe1b75f2b40f6bb43c6ac135136
[lilypond.git] / flower / include / full-storage.icc
1 /*
2   full-storage.icc -- implement Full_storage inline functions
3
4   source file of the Flower Library
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef FULL_STORAGE_ICC
11 #define FULL_STORAGE_ICC
12
13
14 INLINE void
15 Full_storage::init()
16 {
17   els_p_p_=0;
18   height_i_=width_i_=max_height_i_=max_width_i_=0;
19 }
20 INLINE bool
21 Full_storage::valid (int i, int j) const
22 {
23   return (i>=0 && i < height_i_)
24         && (j < width_i_ && j >=0);
25 }
26
27
28 INLINE
29 Full_storage::Full_storage (Full_storage const&s)
30 {
31   init();
32   (*this) = s;
33 }
34
35 INLINE Real& 
36 Full_storage::elem (int i,int j)
37 {
38   assert (valid (i,j));
39   return els_p_p_[i][j];
40 }
41
42 INLINE Real
43 Full_storage::elem (int i, int j) const {
44   assert (valid (i,j));
45   return els_p_p_[i][j];
46 }
47
48 INLINE
49 Full_storage::Full_storage() {
50   init();
51 }
52
53
54 INLINE int
55 Full_storage::rows() const
56 {
57   return height_i_;
58 }
59 INLINE int
60 Full_storage::cols() const
61 {
62   return width_i_;
63 }
64 INLINE int
65 Full_storage::dim() const
66 {
67   assert (rows()==cols ());
68   return rows();
69 }
70
71 INLINE void
72 Full_storage::resize (int i)
73 {
74   resize (i,i);
75 }
76
77 INLINE   
78 Full_storage::Full_storage (int i,int j)
79 {
80   init();
81   set_size (i,j);
82 }
83
84 INLINE 
85 Full_storage::Full_storage (int i)
86 {
87   init();
88   set_size (i);
89 }
90  
91 INLINE
92 IMPLEMENT_VIRTUAL_COPY_CONS(Full_storage,Matrix_storage);
93
94 #endif // FULL_STORAGE_ICC