]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/full-storage.cc
release: 0.1.8
[lilypond.git] / flower / full-storage.cc
index fd0d9f550be4a1c9b341e002bd404ef8492087eb..34dcdad1b8ceb1bed7e181dbf5bd2fedc43ecc0d 100644 (file)
@@ -12,7 +12,7 @@
 void
 Full_storage::operator=(Full_storage const &fs)
 {
-    resize(fs.height_i_, fs.width_i_);
+    resize (fs.height_i_, fs.width_i_);
     OK();
     fs.OK();
     for (int i=0; i<height_i_; i++)
@@ -26,9 +26,9 @@ Full_storage::OK() const
 {
 #ifndef NDEBUG
 
-    assert(max_height_i_ >= height_i_ && max_width_i_ >= width_i_);
-    assert(height_i_ >= 0 && width_i_ >= 0);
-    assert(els_p_p_||!max_height_i_);
+    assert (max_height_i_ >= height_i_ && max_width_i_ >= width_i_);
+    assert (height_i_ >= 0 && width_i_ >= 0);
+    assert (els_p_p_||!max_height_i_);
 #endif
 }
 
@@ -44,24 +44,24 @@ Full_storage::~Full_storage()
 
 void
 
-Full_storage::resize(int rows, int cols)
+Full_storage::resize (int rows, int cols)
 {
     OK();
-    resize_cols(rows);
-    resize_rows(cols);
+    resize_cols (rows);
+    resize_rows (cols);
 }
 
 
 
 bool
-Full_storage::mult_ok(int i, int ) const
+Full_storage::mult_ok (int i, int) const
 {
     return i < height_i_;
 }
 
 
 bool
-Full_storage::trans_ok(int , int j) const
+Full_storage::trans_ok (int , int j) const
 {
        return j < width_i_;
 } 
@@ -69,9 +69,9 @@ Full_storage::trans_ok(int , int j) const
 
 
 void
-Full_storage::trans_next(int &i, int &j) const
+Full_storage::trans_next (int &i, int &j) const
 {
-    assert(trans_ok(i,j));
+    assert (trans_ok (i,j));
     i++;
     if (i >= height_i_) {
        i=0;
@@ -81,9 +81,9 @@ Full_storage::trans_next(int &i, int &j) const
 
 
 void
-Full_storage::mult_next(int &i, int &j) const
+Full_storage::mult_next (int &i, int &j) const
 {
-    assert(mult_ok(i,j));
+    assert (mult_ok (i,j));
     j++;
     if (j >= width_i_) {
        j=0;
@@ -93,9 +93,9 @@ Full_storage::mult_next(int &i, int &j) const
 
 
 void
-Full_storage::delete_column(int k)
+Full_storage::delete_column (int k)
 {
-    assert(0 <= k &&k<width_i_);    
+    assert (0 <= k &&k<width_i_);    
     for (int i=0; i< height_i_ ; i++)
        for (int j=k+1; j <width_i_; j++)
            els_p_p_[i][j-1]=els_p_p_[i][j];
@@ -104,9 +104,9 @@ Full_storage::delete_column(int k)
 
 
 void
-Full_storage::delete_row(int k)
+Full_storage::delete_row (int k)
 {
-    assert(0 <= k &&k<height_i_);
+    assert (0 <= k &&k<height_i_);
     for (int i=k+1; i < height_i_ ; i++)
        for (int j=0; j < width_i_; j++)
            els_p_p_[i-1][j]=els_p_p_[i][j];
@@ -116,10 +116,10 @@ Full_storage::delete_row(int k)
 
 
 void
-Full_storage::insert_row(int k)
+Full_storage::insert_row (int k)
 {
-    assert(0 <= k&& k <=height_i_);
-    resize_cols(height_i_+1);
+    assert (0 <= k&& k <=height_i_);
+    resize_cols (height_i_+1);
     for (int i=height_i_-1; i > k ; i--)
        for (int j=0; j <width_i_; j++)
            els_p_p_[i][j]=els_p_p_[i-1][j];
@@ -127,19 +127,19 @@ Full_storage::insert_row(int k)
 }
 
 bool
-Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * right)const
+Full_storage::try_right_multiply (Matrix_storage * dest, Matrix_storage const * right)const
 {
-    if (dest->name() != Full_storage::static_name() ||
-       right->name() != Full_storage::static_name())
+    if (dest->name() != Full_storage::static_name () ||
+       right->name() != Full_storage::static_name ())
        return false;
 
     Full_storage *d_l = (Full_storage*)dest;
     Full_storage *r_l = (Full_storage*)right;
     
-    d_l->set_size(height_i_, r_l->width_i_);
+    d_l->set_size (height_i_, r_l->width_i_);
     for (int i=0; i < d_l->height_i_; i++)
        for (int j = 0; j < d_l->width_i_; j++) {
-           Real &r(d_l->els_p_p_[i][j]);
+           Real &r (d_l->els_p_p_[i][j]);
            r=0.0;
            for (int k = 0; k < width_i_; k++)
                r += els_p_p_[i][k] * r_l->els_p_p_[k][j];
@@ -151,7 +151,7 @@ Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * r
 }
 IMPLEMENT_IS_TYPE_B1(Full_storage,Matrix_storage);
 void
-Full_storage::resize_cols(int newh)
+Full_storage::resize_cols (int newh)
 {
     if (newh <= max_height_i_) {
        height_i_=newh;
@@ -172,20 +172,20 @@ Full_storage::resize_cols(int newh)
 
 
 
-Full_storage::Full_storage(Matrix_storage*m)
+Full_storage::Full_storage (Matrix_storage*m)
 {
-    set_size(m->rows(), m->cols());
+    set_size (m->rows(), m->cols ());
     if ( !m->is_type_b ( Full_storage::static_name()))
        for (int i=0; i<height_i_; i++)
            for (int j=0; j<width_i_; j++)
                els_p_p_[i][j]=0.0;
-    for (int i,j=0; m->mult_ok(i,j); m->mult_next(i,j))
-       els_p_p_[i][j] = m->elem(i,j);
+    for (int i,j=0; m->mult_ok (i,j); m->mult_next (i,j))
+       els_p_p_[i][j] = m->elem (i,j);
 }
 
 
 void
-Full_storage::resize_rows(int neww)
+Full_storage::resize_rows (int neww)
 {
     if (neww <= max_width_i_) {
        width_i_=neww;