From ad530bf3fcb80d4ba7f0a53e7bfb1076a4c5c256 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 19:32:26 +0000 Subject: [PATCH] lilypond-0.0.32 --- input/Makefile | 2 +- input/coriolan-alto.ly | 15 ++- input/error.ly | 7 +- input/kortjakje.ly | 11 +- input/maartje.ly | 22 ++-- input/martien.ly | 76 +++---------- input/pavane.ly | 25 ++--- input/rhythm.ly | 60 +++++++++++ input/scales.ly | 12 +-- input/scsii-menuetto.ly | 31 +++--- input/standchen.ly | 22 ++-- input/twinkle.ly | 10 +- src/parser.y | 231 +++++++++++++++------------------------- src/qlp.cc | 19 ++-- src/qlpsolve.cc | 11 +- src/stem.cc | 4 +- 16 files changed, 238 insertions(+), 320 deletions(-) create mode 100644 input/rhythm.ly diff --git a/input/Makefile b/input/Makefile index c9888dd680..885dcf19a9 100644 --- a/input/Makefile +++ b/input/Makefile @@ -4,7 +4,7 @@ DISTFILES=Makefile kortjakje.ly pavane.ly maartje.ly\ cadenza.ly scales.ly standchen.ly twinkle.ly\ wohltemperirt.ly error.ly\ martien.ly mlalt.ly mlvio1.ly mlvio2.ly mlcello.ly\ - coriolan-alto.ly\ + coriolan-alto.ly rhythm.ly \ standchen.tex pavane.tex scsii-menuetto.tex scsii-menuetto.ly\ martien.tex diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index 959c4d79a3..683141814d 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -14,7 +14,9 @@ alto = music { $ \duration{ 8 } - + \key {$bes es as$} + + } \clef "alto" % these are chords (i.e. non-divisi) % that-s why i-d rather type chords, % but how to type slurs? @@ -68,15 +70,10 @@ alto = music { } score { - staff { melodic music { alto } - commands { - clef "alto" - key $c es as$ % c ??? - } - } + staff { melodic music { alto }} + commands { - meter 4*4 - skip 5:0 + meter {4*4} grouping {4*4} } paper { unitspace 14mm diff --git a/input/error.ly b/input/error.ly index 9cc6311697..922f9ebefd 100644 --- a/input/error.ly +++ b/input/error.ly @@ -1,8 +1,7 @@ mwa = music { $ -% [ a8 a8 a8 a8 a8 ] % assertion fail -% [ a8 a8 a8 ] % assertion fail -% [ a8 ] % assertion fail + [ a8 a8 a8 a8 a8 ] % + [ a8 ] % a ) b ] c % warning & % ok; error a b ) ] % ok; error @@ -37,6 +36,6 @@ score { melodic music { mwa } } commands { - meter 3*4 + meter {3*4} } } diff --git a/input/kortjakje.ly b/input/kortjakje.ly index ba78402109..6da101c266 100644 --- a/input/kortjakje.ly +++ b/input/kortjakje.ly @@ -11,6 +11,7 @@ melodie = music { $ % switch Lilypond in note-mode + \clef\violin \octave {} % set the default octave % the default note duratino is 4 %%% theme @@ -32,7 +33,7 @@ $} % more of this. begeleiding = -$ +$ \clef "bass" % bass-clef \music { % as you can see, the $ sign obliges % you to precede keyword by a backslash: \ \octave { ` } % default octave: 1 below the first octave. @@ -53,16 +54,12 @@ $ bstaf = staff { melodic music { begeleiding } % use the declared music - commands { % commands with Staff-wide impact. - clef "bass" % bass-clef - } } % another one vstaf = staff { melodic music { melodie } - commands { clef "violin" } % default clef is violin clef } @@ -74,9 +71,7 @@ score { unitspace 2.5cm % a whole note takes 2.5 cm ideally. } commands { - meter 2* 4 % a 2/4 meter. - skip 33:0 % skip 32 measures, and generate the bars -% meter 6 8 % another meter + meter {2* 4} % a 2/4 meter. } } diff --git a/input/maartje.ly b/input/maartje.ly index 0f96005edf..9a79cf47c3 100644 --- a/input/maartje.ly +++ b/input/maartje.ly @@ -26,7 +26,7 @@ melody= staff { melodic music{$ - c8 + c8\key{fis cis gis} |r4 r4 r4 r4 |'cis2.. r8 | r4 r8 r16 r32 r32 @@ -45,19 +45,11 @@ staff { |''fis2 | a8 b8 'c8 'd8 |''c8 ```c8 c4 |c4 c4 |c4 \duration{ 16 } `b `a `g `f \duration{ 4} - + \clef\bass |c `b `a `g `f `e `d `c ``b ``a ``g ``f ``e ``d ``c $} - commands { - skip 3:0 - key $ fis cis gis $ - skip 2:0 - key - skip 5:0 - clef bass - } } score { @@ -68,13 +60,13 @@ score { % staff { ritme }%broken for now staff { melody } commands { - meter 4* 4 + meter {4* 4} partial 8 - skip 1:2 + skip 3*2 bar ":|:" - skip 2:0 - meter 2* 4 - skip 19:0 + skip 2*1 + meter {2*4} + } } diff --git a/input/martien.ly b/input/martien.ly index b299340b3a..cf40cc9788 100644 --- a/input/martien.ly +++ b/input/martien.ly @@ -1,3 +1,6 @@ +%%%%%%%%% HAS TO BE ADJUSTED to pl32 + + % martien.ly % % Viola Quartet @@ -23,83 +26,30 @@ score { staff { melodic music { alto } - commands { -% meter 2*4 - clef "alto" - key $fis$ - skip 56:0 - key $bes es as$ - skip 8:0 -% meter 6*8 - skip 8:0 -% meter 2*4 - skip 16:0 - key $fis$ - } } staff { melodic music { violin1 } - commands { -% meter 2*4 - clef "violin" - key $fis$ - skip 56:0 - key $bes es as$ - skip 8:0 -% meter 6*8 - skip 8:0 -% meter 2*4 - skip 16:0 - key $fis$ - } } staff { melodic music { violin2 } - commands { -% meter 2*4 - clef "violin" - key $fis$ - skip 56:0 - key $bes es as$ - skip 8:0 -% meter 6*8 - skip 8:0 -% meter 2*4 - skip 16:0 - key $fis$ - } } staff { melodic music { cello } - commands { -% meter 2*4 - clef "bass" - key $fis$ - skip 56:0 - key $bes es as$ - skip 8:0 -% meter 6*8 - skip 8:0 -% meter 2*4 - skip 16:0 - key $fis$ - } } commands { - meter 2*4 - skip 56:0 - bar "||" - skip 8:0 - meter 6*8 - bar "||" - skip 8:0 - meter 2*4 - bar "||" - skip 16:0 - bar "||" + meter {2*4} + key $fis$ + skip 56*2 + key $bes es as$ + skip 8*2 + meter {6*8} + skip 48*8 + meter {2*4} + skip 16*2 + key $fis$ } paper { % unitspace 16mm diff --git a/input/pavane.ly b/input/pavane.ly index e3b1e50e06..4f0b3b8812 100644 --- a/input/pavane.ly +++ b/input/pavane.ly @@ -15,6 +15,7 @@ staff { melodic music{ $ \octave { ' } + \key{ fis cis } \duration { 8 } % 1 @@ -39,8 +40,8 @@ staff { e4( fis4 () [fis e fis gis] | cis4 `b4())`b8 r8 r4^"tr\`es soutenu" | - \command { \meter 2 *4 } r4 r4 | - \command { \meter 4 *4 } + \meter {2 *4} r4 r4 | + \meter {4 *4} 'cis4_"\dyn ppp"( 'd4 () ['d 'cis 'd 'e] | a4 )gis2. | a4 (b4()[b a b 'cis] | @@ -76,8 +77,9 @@ staff { | [f a 'c] \plet{1/1} 'e4-^ () ['e f-> a-> 'c->] | 'e4._"sf" 'e8()'c4 r4 | r1 | - \command { \meter 2 *4 } r4 r4-\fermata - \command { \meter 4 *4 } + \meter {2 *4} + r4 r4-\fermata + \meter {4 *4} \octave { ' } |d2(( [)d e cis `b] | @@ -94,10 +96,7 @@ staff { )b [fis a b ] 'cis4 b4 | fis2 r2 | r1-\fermata - $} - commands { - key $fis cis $ - } + $} } score { staff { @@ -110,14 +109,12 @@ score { width 12cm } commands { - meter 4 *4 - skip 18:0 - skip 1:0 - skip 20:0 + meter {4 *4} + skip 39*1 bar "|:" - skip 10:0 + skip 10*1 bar ":|" - skip 13:0 + skip 13*1 bar "||" } } \ No newline at end of file diff --git a/input/rhythm.ly b/input/rhythm.ly new file mode 100644 index 0000000000..c74c9d8dcd --- /dev/null +++ b/input/rhythm.ly @@ -0,0 +1,60 @@ +% +% I've got rhythm! +% +% add any impressive examples here, please + +ritme = staff { + melodic + + music { $ + c8 | + + [a8() a8. a8 a16 a16 a16] c4. | % watch the beams! + r32 r32 r16 r8 r4 r2 | + \meter{ 5*16} + + % divide measure in 5 equal parts. Usually it 2+3 or 3+2 + \grouping { 5*16 } + [c8 c16 c8 ] | % watch THIS! + \plet{5/4} [c16 c16 c16 c16]\plet{1/1} | + \meter{ 2*8} + c4 | + c4 c4 c4 c4 + \meter {4*4} + c1 c1 c1 + +% [c16 c16 c16 c16 ] | +% [c16 c16 c16 c16 c16 ] | +% [c16 c16 c16 c16 c16 ] | + + $ } + + commands { % override "commands" section of Score. + partial 1*8 + meter{ 4*4} + } +} +another = staff { + melodic + music { $ + c1 c1 c1 c4 c4 c4 c4 {\meter 4*4} c1 c1 c1 + $ } +} + +yanother = staff { + melodic + music { $ + c1 c1 c1 c4 c4 c4 c4 c1 c1 c1 + $ } +} + +score { + staff{ritme} + staff { another } + staff { yanother } + commands { meter {4*4 }} + paper { + unitspace 2cm + geometric 1.3 + } +} \ No newline at end of file diff --git a/input/scales.ly b/input/scales.ly index 97d8dd89cb..fba2c9ff4d 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -41,9 +41,8 @@ c1 |['c b a g][f e d c] $} - commands { - } } + score { staff { blah @@ -54,11 +53,8 @@ score { geometric 1.4 } commands { - meter 6*8 - skip 6:0 - meter 4*4 - skip 2:0 - skip 11:0 - + meter {6*8} + skip 36*8 + meter {4*4} } } diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 2e7358db48..00fde25284 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -28,7 +28,8 @@ % % because piece is set very tightly %%1 % double comments are included in .tex file ii_menuetto = music { - $ + $\clef"alto" + \key {bes} \octave{} \duration{8} { a2 f2 d2_"\f" } bes4-. | @@ -59,7 +60,7 @@ ii_menuetto = music { % { 'cis2.-\upbow e2. `a2.\stemdown } :||: { 'cis2.-\upbow e2. `a2. } | % :||: %%9 -% \clef "violin" + \clef "violin" % { 'e2 a2_f\stemdown } { 'e2 a2_"\f" } [ 'd( 'e16 )'f16 ] | @@ -76,7 +77,8 @@ ii_menuetto = music { % %13 % { bes2\stemup g4\stemdown } ( ) f4 % { 'c4\stemup e4\stemdown } -% { bes2 g4 } f4 { 'c4 e4 } | % \clef "alto" | +% { bes2 g4 } f4 { 'c4 e4 } | + \clef "alto"% { \multivoice \music { \stem{1} bes2 'c4 } \music { \stem{-1} g4(\stem{-1}) f4 e4 }% ugh @@ -125,24 +127,15 @@ ii_menuetto = music { score { staff { melodic music { ii_menuetto } - commands { - key $bes$ - clef "alto" - skip 8:0 - clef "violin" - skip 5:0 - clef "alto" - skip 12:0 - } } commands { - meter 3*4 - skip 8:0 + meter {3 * 4} + skip {24 * 4}% 8 measures bar ":|:" -% clef "violin" - skip 5:0 -% \clef "alto" - skip 12:0 + + skip {15 * 4} % 5 meas. + + skip {36*4} bar ":||" } paper { @@ -153,4 +146,4 @@ score { geometric 1.4 output "scsii-menuetto.out" } -} +o} diff --git a/input/standchen.ly b/input/standchen.ly index 279cd513be..edc487c9b0 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -35,7 +35,7 @@ %#%% %#%\duration8 %%1 -melodie = music { $ +melodie = music { $ \clef\violin \duration{ 8 } r_"\pp" { [ d `a-| } f-| { d `a-| } f-| { d `a-| ] } | %%2 @@ -194,7 +194,8 @@ melodie = music { $ $ } begeleiding = music { $ - \duration{2} +\clef\bass +\duration{2} `d r4 %%2 ``bes r4 @@ -472,26 +473,19 @@ score { staff { melodic music { melodie } - commands { - key $bes$ - clef "violin" - } } staff { melodic music { begeleiding } - commands { - key $bes$ - clef "bass" - } } commands { - meter 3*4 - skip 4:0 + meter { 3*4 } + key $bes$ + skip 12*4 bar ":|" - skip 32:0 + skip 96*4 bar ":|" - skip 22:0 + skip 66*4 bar "||" } paper { diff --git a/input/twinkle.ly b/input/twinkle.ly index 80b8be6eee..9b081c43fa 100644 --- a/input/twinkle.ly +++ b/input/twinkle.ly @@ -5,7 +5,7 @@ % Copyright: none melodie = music { - $ + $\clef\violin c c | g g | a a | g g | f f | e e | d d8.( e16 | )c2 | % :| @@ -19,7 +19,7 @@ melodie = music { } begeleiding = music { - $ + $\clef \bass \octave{`} c 'c | 'e 'c | 'f 'c | 'e 'c | 'd b | 'c a | f g | c2 | @@ -106,13 +106,11 @@ text3 = music { mstaf = staff { melodic music { melodie } - commands { clef "violin" } } bass_staf = staff { melodic music { begeleiding } - commands { clef "bass" } } @@ -151,8 +149,8 @@ score { unitspace 2.5cm } commands { - meter 2 * 4 - skip 24:0 + meter {2 * 4} + skip 24*2 bar "||" } } diff --git a/src/parser.y b/src/parser.y index 5a307d847d..6c471fc95f 100644 --- a/src/parser.y +++ b/src/parser.y @@ -8,11 +8,12 @@ #include "inputscore.hh" #include "main.hh" #include "keyword.hh" -#include "inputcommand.hh" #include "debug.hh" #include "parseconstruct.hh" #include "dimen.hh" #include "identifier.hh" +#include "commandrequest.hh" +#include "musicalrequest.hh" #ifndef NDEBUG #define YYDEBUG 1 @@ -31,9 +32,8 @@ int fatal_error_i = 0; %union { Request * request; Real real; - Input_command *command; Identifier *id; - Voice *voice; + Voice *voice; Voice_element *el; String *string; const char *consstr; @@ -47,9 +47,8 @@ int fatal_error_i = 0; Moment *moment; Array * strvec; - Array *commandvec; Array *intvec; - + Array *melreqvec; Input_staff *staff; Input_score *score; Symtables * symtables; @@ -69,7 +68,7 @@ int fatal_error_i = 0; %token KEY CLEF TABLE VOICES STEM %token PARTIAL MUSIC GROUPING CADENZA %token END SYMBOLTABLES TEXID TABLE NOTENAMES SCRIPT TEXTSTYLE PLET -%token MARK GOTO +%token GOTO %token IDENTIFIER %token PITCHMOD DURATION RESTNAME @@ -79,7 +78,7 @@ int fatal_error_i = 0; %token DOTS INT %type unit -%type pitch_list +%type pitch_list %type open_request_parens close_request_parens %type declaration %type declarable_identifier @@ -88,15 +87,13 @@ int fatal_error_i = 0; %type default_duration explicit_duration notemode_duration mudela_duration %type notename %type duration_length -%type voice_elt full_element lyrics_elt -%type score_command staff_command position_command +%type voice_elt full_element lyrics_elt command_elt + %type score_block score_body %type staff_block staff_init staff_body %type int -%type int_list intastint_list -%type score_commands_block score_commands_body -%type staff_commands_block staff_commands_body -%type post_request pre_request +%type intastint_list +%type post_request pre_request command_req %type pitchmod %type music %type music_chord music_chord_body @@ -145,7 +142,7 @@ declarable_identifier: declaration: declarable_identifier '=' staff_block { $$ = new Staff_id(*$1, $3); - delete $1; // this sux + delete $1; } | declarable_identifier '=' music_voice { $$ = new M_voice_id(*$1, $3); @@ -172,7 +169,7 @@ declaration: delete $1; } | declarable_identifier error '}' { -// warning( "parse error", lexer->here_ch_c_l() ); + } ; @@ -195,13 +192,13 @@ notename_tab_body: { /* SCORE */ -score_block: SCORE - { define_spots.push(lexer->here_ch_c_l()); } - '{' score_body '}' { +score_block: + SCORE { define_spots.push(lexer->here_ch_c_l()); } + /*cont*/ '{' score_body '}' { $$ = $4; $$->defined_ch_c_l_ = define_spots.pop(); - if (!$$->paper_) - $$->paper_ = default_paper(); + if (!$$->paper_p_) + $$->paper_p_ = default_paper(); /* handle error levels. */ $$->errorlevel_i_ = lexer->errorlevel_i_; @@ -213,68 +210,15 @@ score_body: { $$ = new Input_score; } | score_body staff_block { $$->add($2); } - | score_body score_commands_block { - $$->add(*$2); - delete $2; + | score_body COMMANDS '{' music_voice_body '}' { + $$->set($4); } | score_body paper_block { $$->set($2); } - ; -/* - COMMANDS -*/ -score_commands_block: - COMMANDS '{' score_commands_body '}' { $$ =$3;} - | COMMANDS '{' error '}' { -// warning( "parse error", lexer->here_ch_c_l() ); - } - ; - -score_commands_body: { $$ = new Array; } - | score_commands_body score_command { - $$->push($2); - } - | score_commands_body position_command { - $$->push($2); - } - ; - -staff_commands_block: COMMANDS '{' staff_commands_body '}' { - $$ = $3; } - ; - -staff_commands_body: - /* empty */ { $$ = new Array; } - | staff_commands_body staff_command { - $$->push($2); - } - | staff_commands_body position_command { - $$->push($2); - } - ; + | score_body error { -staff_command: - KEY pitch_list {/*UGH*/ - $$ = get_key_interpret_command(*$2); - delete $2; - } - | CLEF STRING { - $$ = get_clef_interpret_command(*$2); - delete $2; - } - ; - -position_command: - SKIP int ':' duration_length { - $$ = get_skip_command($2, *$4); - delete $4; - } - | GOTO STRING { - $$ = get_goto_command(*$2); - delete $2; } ; - intastint_list: /* */ { $$ =new Array; } | intastint_list int '*' int { @@ -282,28 +226,6 @@ intastint_list: } ; -score_command: - BAR STRING { - $$ = get_bar_command(*$2); - delete $2; - } - | METER int '*' int { - $$ = get_meterchange_command($2, $4); - } - | PARTIAL duration_length { - $$ = get_partial_command(*$2); - delete $2; - } - | GROUPING intastint_list { - $$ = get_grouping_command(*$2); - delete $2; - } - | CADENZA int { - $$ = get_cadenza_toggle($2); - } - ; - - /* PAPER @@ -326,7 +248,7 @@ paper_body: | paper_body UNITSPACE dim { $$->whole_width = $3; } | paper_body GEOMETRIC REAL { $$->geometric_ = $3; } | paper_body error { -// warning( "parse error", lexer->here_ch_c_l() ); + } ; @@ -353,16 +275,14 @@ staff_init: staff_body: staff_init + | staff_body COMMANDS '{' music_voice_body '}' { + $$->set_score_wide($4); + } | staff_body music { $2->set_default_group( "staff_music" + String($$->music_.size())); $$->add($2); } - | staff_body staff_commands_block { - $$->add(*$2); - delete $2; - } | staff_body error { -// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -393,7 +313,6 @@ music_voice_body: $$->add($2); } | music_voice_body error { -// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -411,13 +330,12 @@ music_chord_body: $$->concatenate($2->mchord(true)); } | music_chord_body music { - $$ -> add($2); + $$->add($2); } | music_chord_body full_element { $$ ->add_elt($2); } | music_chord_body error { -// warning( "parse error", lexer->here_ch_c_l() ); } ; @@ -431,40 +349,77 @@ full_element: pre_requests voice_elt post_requests { add_requests($2, post_reqs); $$ = $2; } - | MARK STRING { - $$ = get_mark_element(*$2); + | lyrics_elt + | command_elt + ; + +command_elt: + command_req { + $$ = new Voice_element; + $$->add($1); + $1-> defined_ch_c_l_ = lexer->here_ch_c_l(); + } +/* can't do this, since "| |" has shift/reduce conflict. : + command_elt command_req { .. } +*/ + ; + +command_req: + '|' { + $$ = new Barcheck_req; + } + | BAR STRING { + $$ = new Bar_req(*$2); + delete $2; + } + | METER '{' int '*' int '}' { + Meter_change_req *m = new Meter_change_req; + m->set($3,$5); + $$ = m; + } + | SKIP duration_length { + Skip_req * skip_p = new Skip_req; + skip_p->duration_ = *$2; delete $2; + $$ = skip_p; } - | COMMAND '{' staff_command '}' { $$=get_command_element($3); } - | COMMAND '{' score_command '}' { $$=get_command_element($3); } - | '|' { - req_defined_ch_c_l = lexer->here_ch_c_l(); - $$ = get_barcheck_element(); + | CADENZA int { + $$ = new Cadenza_req($2); + } + | PARTIAL duration_length { + $$ = new Partial_measure_req(*$2); + delete $2; } | STEM '{' int '}' { - req_defined_ch_c_l = lexer->here_ch_c_l(); - $$ = get_stemdir_element($3); + $$ = get_stemdir_req($3); + } + | CLEF STRING { + $$ = new Clef_change_req(*$2); + delete $2; + } + | KEY '{' pitch_list '}' { + Key_change_req *key_p= new Key_change_req; + key_p->melodic_p_arr_ = *$3; + $$ = key_p; + delete $3; + } + | GROUPING '{' intastint_list '}' { + $$ = get_grouping_req(*$3); delete $3; } - | lyrics_elt -/* -+ | pre_requests voice_elt post_requests error '|' { -+ warning( "parse error", lexer->here_ch_c_l() ); -+ } -+ */ ; - + post_requests: { assert(post_reqs.empty()); } | post_requests post_request { + $2->defined_ch_c_l_ = lexer->here_ch_c_l(); post_reqs.push($2); } ; post_request: close_request_parens { - req_defined_ch_c_l = lexer->here_ch_c_l(); $$ = get_request($1); } | script_req @@ -473,22 +428,18 @@ post_request: close_request_parens: '(' { - req_defined_ch_c_l = lexer->here_ch_c_l(); $$='('; } | ']' { - req_defined_ch_c_l = lexer->here_ch_c_l(); $$ = ']'; } ; open_request_parens: ')' { - req_defined_ch_c_l = lexer->here_ch_c_l(); $$=')'; } | '[' { - req_defined_ch_c_l = lexer->here_ch_c_l(); $$='['; } ; @@ -552,6 +503,7 @@ script_dir: pre_requests: | pre_requests pre_request { pre_reqs.push($2); + $2->defined_ch_c_l_ = lexer->here_ch_c_l(); } ; @@ -665,13 +617,15 @@ lyrics_elt: /* UTILITIES -*/ + */ pitch_list: { - $$ = new Array; + $$ = new Array; } | pitch_list NOTENAME { - $$->push($2[0]); - $$->push($2[1]); + Melodic_req *m_p = new Melodic_req; + m_p->notename_i_ = $2[0]; + m_p->accidental_i_ = $2[1]; + $$->push(m_p); } ; @@ -696,14 +650,6 @@ real: ; -int_list: { - $$ = new Array; - } - | int_list int { - $$->push($2); - } - ; - dim: real unit { $$ = $1*$2; } @@ -784,8 +730,6 @@ dinterval: dim dim { void yyerror(const char *s) { -// if ( YYRECOVERING() ) -// return; lexer->LexerError(s); if ( fatal_error_i ) @@ -816,7 +760,8 @@ parse_file(String init, String s) delete lexer; lexer = 0; - assert(define_spots.empty()); + if(!define_spots.empty()) + warning("Braces don't match.",0); } Paperdef* diff --git a/src/qlp.cc b/src/qlp.cc index 1e3e2f67d4..e6696acf39 100644 --- a/src/qlp.cc +++ b/src/qlp.cc @@ -46,6 +46,14 @@ Ineq_constrained_qp::eval (Vector v) { return v * quad * v + lin * v + const_term; } + +/** + eliminate appropriate variables, until we have a Ineq_constrained_qp + then solve that. + + PRE + cons should be ascending + */ Vector Mixed_qp::solve(Vector start) const { @@ -65,6 +73,8 @@ Mixed_qp::solve(Vector start) const /* assume x(idx) == value, and adjust constraints, lin and quad accordingly + + TODO: add const_term */ void Ineq_constrained_qp::eliminate_var(int idx, Real value) @@ -118,15 +128,6 @@ Ineq_constrained_qp::print() const /* *************** */ -/* - eliminate appropriate variables, until we have a Ineq_constrained_qp - then solve that. - - PRE - cons should be ascending - */ - - Mixed_qp::Mixed_qp(int n) : Ineq_constrained_qp(n) { diff --git a/src/qlpsolve.cc b/src/qlpsolve.cc index ed49c2a02f..5738be2f3b 100644 --- a/src/qlpsolve.cc +++ b/src/qlpsolve.cc @@ -133,7 +133,7 @@ Active_constraints::Active_constraints(Ineq_constrained_qp const *op) H=chol.inverse(); } -/* Find the optimum which is in the planes generated by the active +/** Find the optimum which is in the planes generated by the active constraints. */ Vector @@ -158,8 +158,8 @@ min_elt_index(Vector v) return idx; } -///the numerical solving -/** Mordecai Avriel, Nonlinear Programming: analysis and methods (1976) + +/**the numerical solving. Mordecai Avriel, Nonlinear Programming: analysis and methods (1976) Prentice Hall. Section 13.3 @@ -183,8 +183,9 @@ Ineq_constrained_qp::solve(Vector start) const Vector x(start); Vector gradient=quad*x+lin; - - +// Real fvalue = x*quad*x/2 + lin*x + const_term; +// it's no use. + Vector last_gradient(gradient); int iterations=0; diff --git a/src/stem.cc b/src/stem.cc index 2a1f99e21a..b11386afec 100644 --- a/src/stem.cc +++ b/src/stem.cc @@ -10,9 +10,9 @@ const int STEMLEN=7; NAME_METHOD(Stem); + Stem::Stem(int c) //, Moment len) { -// note_length = len; beams_left = 0; beams_right = 0; minnote = 1000; // invalid values @@ -188,7 +188,7 @@ Stem::brew_molecule_p()const return out; Real Stem::hpos()const { - return pcol_l_->hpos + stem_xoffset; + return pcol_l_->hpos + stem_xoffset; // hmm. + offset_.x; } -- 2.39.5