]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.78
authorfred <fred>
Thu, 31 Jul 1997 01:11:45 +0000 (01:11 +0000)
committerfred <fred>
Thu, 31 Jul 1997 01:11:45 +0000 (01:11 +0000)
flower/include/diagonal-storage.hh [new file with mode: 0644]

diff --git a/flower/include/diagonal-storage.hh b/flower/include/diagonal-storage.hh
new file mode 100644 (file)
index 0000000..517c5cd
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+  diagonal-storage.hh -- declare Diagonal_storage
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#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