4 Full_storage::operator=(Full_storage
const &fs
)
9 for (int i
=0; i
<h
; i
++)
10 for (int j
=0; j
<w
; j
++)
11 els
[i
][j
]= fs
.els
[i
][j
];
15 Full_storage::OK() const
19 assert(maxh
>= h
&& maxw
>= w
);
20 assert(h
>= 0 && w
>= 0);
25 Full_storage::resize_cols(int newh
)
32 Real
** newa
=new Real
*[newh
];
37 newa
[j
] = new Real
[maxw
];
45 Full_storage::resize_rows(int neww
)
51 for (int i
=0; i
< maxh
; i
++) {
52 Real
* newa
= new Real
[neww
];
53 for (int k
=0; k
< w
; k
++)
62 Full_storage::~Full_storage() {
63 for (int i
=0; i
< maxh
; i
++)
69 Full_storage::resize(int rows
, int cols
)
79 Full_storage::mult_ok(int i
, int j
) const
85 Full_storage::trans_ok(int i
, int j
) const
92 Full_storage::trans_next(int &i
, int &j
) const
94 assert(trans_ok(i
,j
));
103 Full_storage::mult_next(int &i
, int &j
) const
105 assert(mult_ok(i
,j
));
114 Full_storage::delete_column(int k
)
116 assert(0 <= k
&&k
<w
);
117 for (int i
=0; i
< h
; i
++)
118 for (int j
=k
+1; j
<w
; j
++)
119 els
[i
][j
-1]=els
[i
][j
];
123 Full_storage::delete_row(int k
)
125 assert(0 <= k
&&k
<h
);
126 for (int i
=k
+1; i
< h
; i
++)
127 for (int j
=0; j
< w
; j
++)
128 els
[i
-1][j
]=els
[i
][j
];
134 Full_storage::insert_row(int k
)
136 assert(0 <= k
&& k
<=h
);
138 for (int i
=h
-1; i
> k
; i
--)
139 for (int j
=0; j
<w
; j
++)
140 els
[i
][j
]=els
[i
-1][j
];
146 Full_storage::row(int n
) const
149 for (int j
= 0; j
< w
; j
++)
155 Full_storage::column(int n
) const
159 for (int i
= 0; i
<h
; i
++)
165 Full_storage::Full_storage(Full_storage
&s
)
171 Full_storage::clone()
173 return new Full_storage(*this);
178 virtual_smat::get_full(int n
, int m
)
180 return new Full_storage(n
,m
);