Opened 9 years ago

Closed 8 years ago

#11196 closed enhancement (fixed)

Compute heights of Dyck words and compare them

Reported by: hivert Owned by: hivert
Priority: major Milestone: sage-4.7.2
Component: combinatorics Keywords: Dyck words, height, sd31
Cc: sage-combinat Merged in: sage-4.7.2.alpha0
Authors: Florent Hivert Reviewers: Mike Hansen
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by hivert)

Currently one can only compute the maximal height of a Dyck word. The patch add computing the sequence of heights and also comparing two Dyck words.

Since I needed it, I also added two function to compute a Dyck word from its heights sequence and to compute a minimal Dyck word knowing a lower bound for the heights.

Apply :

Attachments (1)

trac_11196-dyck_word_heights_compare-fh.2.patch (11.1 KB) - added by hivert 8 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by hivert

  • Status changed from new to needs_review

comment:2 follow-up: Changed 8 years ago by mhansen

I posted a new patch which just fixes a small typo in the docstring. I think that HeightPoset should be renamed to height_poset since that's what one would expect.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 8 years ago by hivert

Thanks you for the review !

Replying to mhansen:

I posted a new patch which just fixes a small typo in the docstring. I think that HeightPoset should be renamed to height_poset since that's what one would expect.

Even if it is actually a class ?

comment:4 in reply to: ↑ 3 Changed 8 years ago by mhansen

Replying to hivert:

Even if it is actually a class ?

I think so since it's more of a shortcut instead of defining a HeightPoset? outside of the class and then having a height_poset method which returns an object of that type.

comment:5 Changed 8 years ago by hivert

  • Description modified (diff)

Hi Mike,

I just uploaded a new patch which address your comment. It also add a two new function related to heights.

How did you manage to replace my patch ? I got an error saying that I don't have the right to remove yours. Maybe its because you are a trac admin.

comment:6 Changed 8 years ago by mhansen

  • Keywords sd31 added
  • Reviewers set to Mike Hansen
  • Status changed from needs_review to positive_review

Looks good to me.

comment:7 Changed 8 years ago by jdemeyer

  • Milestone changed from sage-4.7.1 to sage-4.7.2

comment:8 Changed 8 years ago by jdemeyer

  • Merged in set to sage-4.7.2.alpha0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.