+ Dimension_cache*d= dim_cache_[a]->parent_l_;
+ return d ? d->elt_l_ : 0;
+}
+
+Score_element *
+Score_element::common_refpoint (Link_array<Score_element> gs, Axis a) const
+{
+ Dimension_cache * common = dim_cache_[a];
+ for (int i=0; i < gs.size (); i++)
+ {
+ common = common->common_refpoint (gs[i]->dim_cache_[a]);
+ }
+
+ return common->element_l ();
+}
+
+char const *
+Score_element::name () const
+{
+ return classname (this);
+}
+
+
+void
+Score_element::set_parent (Score_element *g, Axis a)
+{
+ dim_cache_[a]->parent_l_ = g ? g->dim_cache_[a]: 0;
+}
+
+void
+Score_element::fixup_refpoint ()
+{
+ for (int a = X_AXIS; a < NO_AXES; a ++)
+ {
+ Axis ax = (Axis)a;
+ Score_element * par = parent_l (ax);
+
+ if (!par)
+ continue;
+
+ if (par->line_l () != line_l ())
+ {
+ Score_element * newpar = par->find_broken_piece (line_l ());
+ set_parent (newpar, ax);
+ }
+
+ if (Item * i = dynamic_cast<Item*> (this))
+ {
+ Item *pari = dynamic_cast<Item*> (par);
+
+ if (pari && i)
+ {
+ Direction my_dir = i->break_status_dir () ;
+ if (my_dir!= pari->break_status_dir())
+ {
+ Item *newpar = pari->find_broken_piece (my_dir);
+ set_parent (newpar, ax);
+ }
+ }
+ }
+ }