From: fred Date: Thu, 31 Jul 1997 01:11:45 +0000 (+0000) Subject: lilypond-0.0.78 X-Git-Tag: release/1.5.59~6104 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=ec27fa06a3f9c5b34e942367d28fb20ca95b77cb;p=lilypond.git lilypond-0.0.78 --- diff --git a/flower/include/diagonal-storage.hh b/flower/include/diagonal-storage.hh new file mode 100644 index 0000000000..517c5cd814 --- /dev/null +++ b/flower/include/diagonal-storage.hh @@ -0,0 +1,65 @@ +/* + diagonal-storage.hh -- declare Diagonal_storage + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef DIAGONAL_STORAGE_HH +#define DIAGONAL_STORAGE_HH +#include "full-storage.hh" + +/** + Store a single-band matrix; + + INVARIANT + + Diagonal_storage(i,j) == band_(i, j-i + band_size_i()) + + band_.cols() == 2 * band_size_i() + 1 + + */ +class Diagonal_storage : public Matrix_storage { + Full_storage band_; + +public: + void set_band_size(int b); + int band_size_i()const; + + void assert_valid(int i, int j) const; + bool band_elt_b(int,int )const; + void resize_dim(int); + + virtual void resize_rows(int d) { resize_dim (d); } + virtual void resize_cols(int d) { resize_dim(d); } + virtual int dim() const; + + virtual int rows() const ; + virtual int cols() const ; + + + virtual void resize(int i, int j); + virtual void resize(int i); + + virtual Real& elem(int i,int j); + virtual Real elem(int i, int j) const; + Diagonal_storage(Matrix_storage* , int band_i); + Diagonal_storage(); + void OK() const; + + virtual void insert_row(int k); + virtual void delete_row(int k); + virtual void delete_column(int k); + + ~Diagonal_storage(); + virtual bool mult_ok(int i, int j)const; + virtual void mult_next(int &i, int &j) const ; + virtual bool trans_ok(int i, int j) const; + virtual void trans_next(int &i, int &j) const; + VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const *)const; +}; +#endif // DIAGONAL_STORAGE_HH