From 518f04ef3d01a6531c587297f8aa21c1f0f70025 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:36:56 +0000 Subject: [PATCH] lilypond-0.0.45 --- flower/matrix.cc | 9 ++++++--- lily/include/p-col.hh | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/flower/matrix.cc b/flower/matrix.cc index 9d229c0ae1..885d69f683 100644 --- a/flower/matrix.cc +++ b/flower/matrix.cc @@ -201,9 +201,10 @@ Matrix::set_product(Matrix const &m1, Matrix const &m2) void Matrix::insert_row(Vector v, int k) { + int c = cols(); assert(v.dim()==cols()); dat->insert_row(k); - for (int j=0; j < cols(); j++) + for (int j=0; j < c; j++) dat->elem(k,j)=v(j); } @@ -212,7 +213,8 @@ void Matrix::swap_columns(int c1, int c2) { assert(c1>=0&& c1 < cols()&&c2 < cols() && c2 >=0); - for (int i=0; i< rows(); i++) { + int r = rows(); + for (int i=0; i< r; i++) { Real r=dat->elem(i,c1); dat->elem(i,c1) = dat->elem(i,c2); dat->elem(i,c2)=r; @@ -223,7 +225,8 @@ void Matrix::swap_rows(int c1, int c2) { assert(c1>=0&& c1 < rows()&&c2 < rows() && c2 >=0); - for (int i=0; i< cols(); i++) { + int c = cols(); + for (int i=0; i< c; i++) { Real r=dat->elem(c1,i); dat->elem(c1,i) = dat->elem(c2,i); dat->elem(c2,i)=r; diff --git a/lily/include/p-col.hh b/lily/include/p-col.hh index 48d6c62a19..2a2dd92afc 100644 --- a/lily/include/p-col.hh +++ b/lily/include/p-col.hh @@ -20,12 +20,11 @@ \end{itemize} */ -struct PCol { +class PCol { +public: PointerList its; PointerList stoppers, starters; - - /** prebreak is put before end of line. if broken here, then (*this) column is discarded, and prebreak is put at end of line, owned by Col @@ -42,8 +41,10 @@ struct PCol { /// if lines are broken then this column is in #line# Line_of_score const *line_l_; - /// if lines are broken then this column x-coord #hpos# - Real hpos; + /** if lines are broken then this column x-coord #hpos# if not + known, then hpos == -1.(ugh?) */ + + Real hpos; // should use ptr? PScore * pscore_l_; @@ -68,13 +69,20 @@ struct PCol { signed compare on columns. @return < 0 if c1 < c2. - */static int compare(const PCol &c1, const PCol &c2); - + */ + static int compare(const PCol &c1, const PCol &c2); + void set_rank(int); void OK() const; void set_breakable(); void print()const; private: + + /** + The ranking: left is smaller than right + -1 is uninitialised. + */ + int rank_i_; PCol(PCol const&){} }; -- 2.39.5