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);
}
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;
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;
\end{itemize}
*/
-struct PCol {
+class PCol {
+public:
PointerList<Item const *> its;
PointerList<Spanner const *> 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
/// 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_;
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&){}
};