From 6dc4e4d14a67f65f337ec1a06466e748c68dcad5 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 30 Jul 1997 23:45:03 +0200 Subject: [PATCH] release: 0.0.78 --- ANNOUNCE | 17 +- AUTHORS.text | 6 +- BUGS | 9 +- Documentation/AUTHORS.pod | 4 + Documentation/CodingStyle.pod | 3 + Documentation/Makefile | 13 +- Documentation/Rules.make | 3 +- Documentation/index.pod | 17 +- Documentation/lilyliterature.pod | 3 + Documentation/links.pod | 31 ++- Documentation/mudela-course.doc | 10 +- Documentation/mudela-man.doc | 21 +- NEWS | 22 +- TODO | 8 +- .version => VERSION | 4 +- bin/Makefile | 27 ++- bin/conflily | 12 +- bin/{convert-mudela => convert-mudela.in} | 2 +- bin/{genheader => genheader.in} | 2 +- bin/make-version | 2 +- bin/{make-website => make-website.in} | 4 +- bin/{mudela-book => mudela-book.in} | 2 +- bin/release | 6 +- bin/{show-latest => show-latest.in} | 2 +- configure | 225 ++++++++++++++------- configure.in | 98 ++++++--- flower/Makefile | 11 +- flower/NEWS | 8 +- flower/{.version => VERSION} | 2 +- flower/choleski.cc | 66 ++++-- flower/configure | 59 +++--- flower/configure.in | 17 +- flower/diagonal-storage.cc | 236 ++++++++++++++++++++++ flower/full-storage.cc | 65 +++--- flower/include/Makefile | 2 +- flower/include/choleski.hh | 6 +- flower/include/diagonal-storage.hh | 65 ++++++ flower/include/flower-debug.hh | 2 +- flower/include/full-storage.hh | 25 +-- flower/include/matrix-storage.hh | 48 +++-- flower/include/matrix.hh | 24 ++- flower/include/virtual-methods.hh | 2 +- flower/matrix-debug.cc | 15 +- flower/matrix-storage.cc | 139 +++++++++++++ flower/matrix.cc | 71 ++++++- flower/string-convert.cc | 4 +- flower/test/Makefile | 7 +- flower/test/mat-test.cc | 60 ++++++ init/Makefile | 9 +- init/bare.ly | 5 - init/engraver.ly | 1 + init/midi.ly | 3 +- init/paper16.ly | 4 +- init/performer.ly | 42 ++-- init/table16.ly | 1 + input/beams.ly | 55 +++-- input/cadenza.ly | 7 +- input/collisions.ly | 30 +-- input/coriolan-alto.ly | 1 + input/error.ly | 39 ---- input/multi.ly | 2 +- input/scsii-menuetto.ly | 12 +- input/slurs.ly | 4 +- input/standchen.ly | 24 +-- input/toccata-fuga-E.ly | 34 ++-- input/wohltemperirt.ly | 8 +- lily/Makefile | 4 +- lily/{.version => VERSION} | 2 +- lily/crescendo.cc | 1 - lily/debug.cc | 2 +- lily/engraver-group.cc | 4 +- lily/include/bar-grav.hh | 2 +- lily/include/bar.hh | 2 +- lily/include/beam.hh | 2 +- lily/include/bow.hh | 2 +- lily/include/break-align-item.hh | 2 +- lily/include/clef-grav.hh | 2 +- lily/include/clef-item.hh | 2 +- lily/include/collision-grav.hh | 2 +- lily/include/collision.hh | 2 +- lily/include/const.hh | 2 - lily/include/crescendo.hh | 2 +- lily/include/dynamic-grav.hh | 2 +- lily/include/elem-group-item.hh | 4 +- lily/include/elem-group.hh | 8 +- lily/include/engraver-group.hh | 2 +- lily/include/engraver.hh | 2 +- lily/include/general-script-def.hh | 2 +- lily/include/global-translator.hh | 2 +- lily/include/head-column.hh | 2 +- lily/include/head-grav.hh | 2 +- lily/include/horizontal-align-item.hh | 2 +- lily/include/identifier.hh | 4 +- lily/include/ineq-constrained-qp.hh | 72 +++++++ lily/include/item.hh | 2 +- lily/include/key-grav.hh | 2 +- lily/include/key-item.hh | 2 +- lily/include/key-performer.hh | 2 +- lily/include/line-group-grav.hh | 4 +- lily/include/local-key-grav.hh | 2 +- lily/include/local-key-item.hh | 2 +- lily/include/lyric-engraver.hh | 2 +- lily/include/lyric-performer.hh | 2 +- lily/include/meter-grav.hh | 2 +- lily/include/meter-performer.hh | 2 +- lily/include/meter.hh | 2 +- lily/include/midi-item.hh | 51 +++-- lily/include/music-iterator.hh | 10 +- lily/include/music-list.hh | 10 +- lily/include/music.hh | 2 +- lily/include/note-column-grav.hh | 2 +- lily/include/note-column.hh | 2 +- lily/include/note-head.hh | 2 +- lily/include/note-performer.hh | 2 +- lily/include/performer-group-performer.hh | 2 +- lily/include/performer.hh | 2 +- lily/include/qlp.hh | 55 +---- lily/include/qlpsolve.hh | 2 +- lily/include/request.hh | 4 +- lily/include/rest-collision-grav.hh | 2 +- lily/include/rest-collision.hh | 2 +- lily/include/rest-column.hh | 2 +- lily/include/score-align-grav.hh | 2 +- lily/include/score-elem.hh | 2 +- lily/include/score-grav.hh | 2 +- lily/include/score-halign-grav.hh | 2 +- lily/include/score-performer.hh | 2 +- lily/include/scoreline.hh | 2 +- lily/include/script-column.hh | 2 +- lily/include/script-def.hh | 2 +- lily/include/script-grav.hh | 2 +- lily/include/script.hh | 2 +- lily/include/slur-grav.hh | 2 +- lily/include/slur.hh | 2 +- lily/include/span-bar-grav.hh | 2 +- lily/include/span-bar.hh | 2 +- lily/include/span-score-bar-grav.hh | 4 +- lily/include/span-score-bar.hh | 4 +- lily/include/spanner-elem-group.hh | 2 +- lily/include/spanner.hh | 2 +- lily/include/staff-performer.hh | 2 +- lily/include/staff-side.hh | 2 +- lily/include/staff-sym-grav.hh | 2 +- lily/include/staff-sym.hh | 2 +- lily/include/staffline.hh | 2 +- lily/include/stem-beam-grav.hh | 2 +- lily/include/stem.hh | 2 +- lily/include/super-elem.hh | 2 +- lily/include/swallow-grav.hh | 2 +- lily/include/swallow-perf.hh | 2 +- lily/include/text-def.hh | 2 +- lily/include/text-grav.hh | 2 +- lily/include/text-item.hh | 2 +- lily/include/text-spanner.hh | 2 +- lily/include/tie-grav.hh | 2 +- lily/include/tie.hh | 2 +- lily/include/translator.hh | 2 +- lily/include/vertical-align-elem.hh | 2 +- lily/include/vertical-align-grav.hh | 2 +- lily/include/vertical-align-spanner.hh | 2 +- lily/include/voice-group-gravs.hh | 2 +- lily/include/voice-group-performer.hh | 41 ---- lily/ineq-constrained-qp.cc | 198 ++++++++++++++++++ lily/item.cc | 2 +- lily/lyric-grav.cc | 3 + lily/meter-performer.cc | 2 - lily/midi-item.cc | 193 +++++++++++++++++- lily/midi-stream.cc | 28 +-- lily/music-iterator.cc | 10 +- lily/parser.y | 3 +- lily/qlp.cc | 67 +----- lily/qlpsolve.cc | 126 +----------- lily/score-align-gravs.cc | 2 +- lily/score-performer.cc | 3 +- lily/staff-performer.cc | 11 +- lily/template4.cc | 1 - lily/template5.cc | 19 +- lily/tex-slur.cc | 8 +- lily/voice-group-performer.cc | 26 --- make/Configure_variables.make.in | 3 + make/Makefile | 8 +- make/Targets.make | 27 +-- make/Template.make | 2 +- make/Toplevel.make.in | 12 +- make/Variables.make | 75 ++++--- make/lilypond.lsm | 18 +- make/lilypond.lsm.in | 10 +- make/lilypond.spec | 10 +- make/lilypond.spec.in | 6 +- mi2mu/Makefile | 4 +- mi2mu/{.version => VERSION} | 0 mi2mu/midi-event.cc | 3 +- mi2mu/my-midi-lexer.cc | 2 +- tex/dimen.tex | 5 +- 194 files changed, 2053 insertions(+), 1042 deletions(-) rename .version => VERSION (74%) rename bin/{convert-mudela => convert-mudela.in} (99%) mode change 100755 => 100644 rename bin/{genheader => genheader.in} (98%) mode change 100755 => 100644 rename bin/{make-website => make-website.in} (99%) mode change 100755 => 100644 rename bin/{mudela-book => mudela-book.in} (99%) mode change 100755 => 100644 rename bin/{show-latest => show-latest.in} (97%) mode change 100755 => 100644 rename flower/{.version => VERSION} (89%) create mode 100644 flower/diagonal-storage.cc create mode 100644 flower/include/diagonal-storage.hh create mode 100644 flower/matrix-storage.cc create mode 100644 flower/test/mat-test.cc delete mode 100644 init/bare.ly delete mode 100644 input/error.ly rename lily/{.version => VERSION} (90%) create mode 100644 lily/include/ineq-constrained-qp.hh delete mode 100644 lily/include/voice-group-performer.hh create mode 100644 lily/ineq-constrained-qp.cc delete mode 100644 lily/voice-group-performer.cc rename mi2mu/{.version => VERSION} (100%) diff --git a/ANNOUNCE b/ANNOUNCE index aadfe22abd..a904214579 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,28 +1,31 @@ - We are proud to announce the birth of "GNU LilyPond 0.1", a.k.a. +Subject: LilyPond 0.1 released - GNU Project music typesetter - Lily 0.1 - born August 1, 1997 + BORN + + August 1, 1997 + + Lily + + (GNU LilyPond 0.1) daughter to Jan 'Janneke' Nieuwenhuizen and Han-Wen 'Wendy' Nienhuys -Lily is a healthy, bouncing baby weighing 335 kilobytes +Lily is a healthy, bouncing baby weighing 340 kilobytes Visiting hours: 24hrs a day at - ftp://pcnov095.win.tue.nl/pub/lilypond/lilypond-0.1.0.tar.gz (Europe) ftp://alpha.gnu.ai.mit.edu/pub/lilypond/lilypond-0.1.0.tar.gz (US) -you can see some babyfood, diapers and pictures at +You can see some babyfood, diapers and pictures at http://www.stack.nl/~hanwen/lilypond/index.html You can send your congratulations to Janneke (jan@digicash.com) and Wendy (hanwen@stack.nl) - [ And now the serious part ] Announcing diff --git a/AUTHORS.text b/AUTHORS.text index a8c72e7a12..5670db31ae 100644 --- a/AUTHORS.text +++ b/AUTHORS.text @@ -36,6 +36,8 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS +o Werner Lemberg , misc bugfixes, some Beam and Stem code. + +o Alexandre Oliva + Your name could be here! If you want to help, then take a look at the SMALLISH PROJECTS section of in the file _T_O_D_O. Some do not involve coding C++ @@ -59,8 +61,6 @@ CCCCOOOONNNNTTTTRRRRIIIIBBBBUUUUTTTTOOOORRRRSS - - -26/Jul/97 LilyPond 0.0.77 1 +30/Jul/97 LilyPond 0.0.77 1 diff --git a/BUGS b/BUGS index 2f3755f292..4743ac6943 100644 --- a/BUGS +++ b/BUGS @@ -1,7 +1,14 @@ [document reintroduced deficiencies.] -midi instrument? +wrong instrument: + +cad = \melodic { \id "Staff" "fr horn"; c4 } + +\score { + \melodic {\cad} +} + ******************* '.' -> lilypond: lexer.l:258: int My_lily_lexer::yylex(): Assertion `cnv == 1' failed. diff --git a/Documentation/AUTHORS.pod b/Documentation/AUTHORS.pod index dd150709fc..cab146ee80 100644 --- a/Documentation/AUTHORS.pod +++ b/Documentation/AUTHORS.pod @@ -43,6 +43,10 @@ testing, general comments. Werner Lemberg , misc bugfixes, some Beam and Stem code. +=item * + +Alexandre Oliva + =back Your name could be here! If you want to help, then take a look at the diff --git a/Documentation/CodingStyle.pod b/Documentation/CodingStyle.pod index 8cf64c424d..7fe901c186 100644 --- a/Documentation/CodingStyle.pod +++ b/Documentation/CodingStyle.pod @@ -97,6 +97,9 @@ If you like using font-lock, you can also add this to your F<.emacs>: the C is a Hungarian notation postfix for C. See below +=head2 MACROS + + =head2 BROKEN CODE diff --git a/Documentation/Makefile b/Documentation/Makefile index a44206b652..ea4a7be9c0 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -32,6 +32,7 @@ DVIFILES = $(addprefix $(outdir)/, $(DOCFILES:.doc=.dvi)) # list of distribution files: # EXTRA_DISTFILES = lelie_icon.gif lelie_logo.gif $(DOCFILES) + default: do-doc # don't do DVI files. They can only be made if lily is installed @@ -40,13 +41,14 @@ do-doc: $(TEXTFILES) html: $(HTMLFILES) htmldist: html - ./$(lily_bindir)/make_website + $(lily_bindir)/make_website +dvi: $(DVIFILES) # generic targets and rules: # -include ./$(depth)/make/Targets.make -include ./$(depth)/make/Rules.make +include $(depth)/make/Targets.make +include $(depth)/make/Rules.make # localclean: @@ -56,10 +58,9 @@ localclean: MAN1FILES = lilypond convert-mudela mi2mu mudela-book MAN1GROFF = $(addprefix $(outdir)/, $(addsuffix .1,$(MAN1FILES))) -localinstall: $(outdir)/lilypond.1 $(outdir)/mudela.5 - $(INSTALL) -d $(mandir)/man5 +localinstall: $(outdir)/lilypond.1 $(INSTALL) -d $(mandir)/man1 - $(INSTALL) -m 755 $(MAN1GROFF) $(mandir)/man1 + $(INSTALL) -m 644 $(MAN1GROFF) $(mandir)/man1 localuninstall: diff --git a/Documentation/Rules.make b/Documentation/Rules.make index 9f1be188b4..71388de3c4 100644 --- a/Documentation/Rules.make +++ b/Documentation/Rules.make @@ -15,8 +15,7 @@ $(outdir)/%.dvi: $(outdir)/%.mudtex mv $(notdir $@) $(outdir) $(outdir)/%.mudtex: %.doc - $(depth)/bin/mudela-book --outdir=$(outdir)/ --outname=$(notdir $@) $< - + $(binout)/mudela-book --outdir=$(outdir)/ --outname=$(notdir $@) $< $(outdir)/%.text: $(outdir)/%.1 groff -man -Tascii $< > $@ diff --git a/Documentation/index.pod b/Documentation/index.pod index 10fdd592d0..cc50a8b595 100644 --- a/Documentation/index.pod +++ b/Documentation/index.pod @@ -1,13 +1,9 @@ =head1 NAME -GNU LilyPond -- the Webpage - -Excuse me for this poor page. I don't really have time for doing this.. +The Homepage of LilyPond -- the GNU Project music typesetter =head1 DESCRIPTION - - GNU LilyPond is a program which converts music definition files into visual or auditive output: it can typeset formatted sheet music to a TeX file and and (mechanical) performances to MIDI files. @@ -133,15 +129,10 @@ DEDICATION =back - =head2 The program - =over 5 - - - =item * @@ -204,14 +195,10 @@ Other packages for printing music. -=item * -Get LilyPond at ftp://pcnov095.win.tue.nl/pub/lilypond ! - - =item * -B and other interesting links +B LilyPond and other interesting links diff --git a/Documentation/lilyliterature.pod b/Documentation/lilyliterature.pod index a4abb247a5..1ea51c9b45 100644 --- a/Documentation/lilyliterature.pod +++ b/Documentation/lilyliterature.pod @@ -41,6 +41,9 @@ New York. [This is as close to the ``standard'' reference work for music notation issues as one is likely to get. MB] +K. Hader. ``Aus der Werkstatt eines Notenstechers'' Waldheim--Eberle +Verlag, Vienna 1948 + MPA. Standard music notation specifications for computer programming. December 1996 diff --git a/Documentation/links.pod b/Documentation/links.pod index e9ffba63ef..9c7edf0a62 100644 --- a/Documentation/links.pod +++ b/Documentation/links.pod @@ -16,15 +16,6 @@ of interest to LilyPond users. LilyPond is part of the GNU Project started by the Free Software Foundation to create a system of free software for the world-community -=item http://www.ssc.com/linux/ - -The Number One Free OS-Kernel: Linux - -=item http:// /linux_soundapps.html - -Dave Philips' Linux sound applications page - - =back =head2 Ftp @@ -104,10 +95,30 @@ For discussions concerning the GNU Music project, to subscribe: send mail with subject "subscribe" to gnu-music-discuss-request@vuse.vanderbilt.edu, - =back Announces of new versions will be sent to info-gnu-music and gnu-music-discuss. +=head2 Backlinks + +=over 4 + +=item http://www.ssc.com/linux/ + +The Number One Free OS-Kernel: Linux + +=item http://www.bright.net/~dlphilp/linux_soundapps.html + +Dave Philips' Linux sound applications page + +=item http://www.medieval.org/emfaq/scores/software.html + +More software for (early) music. + +=item http://www.emry.net/ + +Linux webwatcher. + +=back diff --git a/Documentation/mudela-course.doc b/Documentation/mudela-course.doc index 23fc00cb4e..089b74444c 100644 --- a/Documentation/mudela-course.doc +++ b/Documentation/mudela-course.doc @@ -1,4 +1,8 @@ % -*-LaTeX-*- +% this document should be run through the mudela-book script after lilypond +% has been installed. + + \documentclass{article} \usepackage{a4wide} \title{Mudela and LilyPond crash course} @@ -33,10 +37,10 @@ chords by \verb+<+ and \verb+>+. \begin[verbatim]{mudela} \score { - \melodic { % { means voice - c'4 g'4 % 4 means quaver, 1 beat in 4/4 meter + \melodic { % {...} is a voice + c'4 g'4 % c and g are pitches, 4 is the duration (quaver) c''4 ''c4 % c' is 1 octave up, 'c 1 down. - % <> means a chord + % <...> is a chord } } \end{mudela} diff --git a/Documentation/mudela-man.doc b/Documentation/mudela-man.doc index c4e9c85398..afcf5c4c19 100644 --- a/Documentation/mudela-man.doc +++ b/Documentation/mudela-man.doc @@ -1,4 +1,8 @@ % -*-latex-*- + +% this document should be run through the mudela-book script after lilypond +% has been installed. + \documentclass{article} \usepackage{a4wide} \title{GNU LilyPond input format 0.1} @@ -232,7 +236,7 @@ signifies that this note is part of a triplet (3 in stead of 2). The duration is one and a half quaver (\verb+4.+) times 2/3. Notenames are just a special kind of identifiers, and can be declared -for any language appropriate (see \file{dutch.ini}). The default language +for any language appropriate (see \file{init/dutch.ly}). The default language for notenames is defined to be dutch. In dutch, the notenames are a,b,c,d,e,f and g. Sharps are formed by adding the extension "is", flats by adding ``es'' @@ -291,23 +295,22 @@ error for this reason. Ties connect the noteheads of adjacent notes. They are entered as follows: -\begin[fragment]{mudela} -a4 ~ a4 +\begin[verbatim,fragment]{mudela} +a'4 ~ a''4 \end{mudela} Slurs connect whole chords, and try to avoid crossing stems. They are entered as follows: -\begin{verbatim} -\begin[fragment]{mudela} -a4( )a4 +\begin[verbatim,fragment]{mudela} +a'4( )a''4 \end{mudela} \subsection{Scripts} Symbols which can be put at either side (above or below) of a staff are entered as follows: -\begin[fragment]{mudela} +\begin[verbatim,fragment]{mudela} a-^ % marcato, direction: default a^- % portato, direction: above note a_. % staccato, direction: below note @@ -317,7 +320,7 @@ a-^ % marcato, direction: default c-"marcato" \end{mudela} -If you want to define your own scripts refer to \file{script.ini} for +If you want to define your own scripts refer to \file{init/script.ly} for details. @@ -453,7 +456,7 @@ the same voicegroup share certain characteristics, among others: - beams and stems - scripts -For the actual list, see the init file \file{register.ini} +For the actual list, see the init file \file{init/register.ly} Putting different musical lines in to the same voicegroup effectively makes LilyPond try to form chords of all those lines. Putting diff --git a/NEWS b/NEWS index e6d1201dae..2d7ff005fb 100644 --- a/NEWS +++ b/NEWS @@ -1,9 +1,21 @@ -pl 77.jcn1 - - init/*.ly in dist - - bf: string-convert.cc: return local buf - - bf: debug.cc: - - bf: template4.cc: #includes +pl 78 + - bf: Midi_instrument + - added enable/disable defaults to help. + - incredibly ugly NAME_MEMBERS(); bug. Immediately changed to +DECLARE_MY_RUNTIME_TYPEINFO; + - \stem -1 -> \stem \down in input + - bf: slurchar index + - configure warnings + - preliminary stuff for multiarch building + - #!/usr/bin/perl fixes (AO) + - some Makefile cleanups: now faster. + +pl 77.jcn2 + - Midi_instrument + +****** +july 29 pl 77 - some fixes for internal compiler errors derive from Pointer_list with default dtor gives error with -O2 diff --git a/TODO b/TODO index d0c00112f6..8a0802b5ef 100644 --- a/TODO +++ b/TODO @@ -12,6 +12,10 @@ grep for TODO and ugh/ugr * dots into separate item. + * use String iso Text_def for lyrics. + + * use position 0 for center of staff iso bottom. + * return status * lyrics in chords still fuck up. @@ -185,8 +189,6 @@ INPUTLANGUAGE * Raw request syntax - * subtime with Subtle_reqs - PROJECTS * Do RTTI i.s.o. static_name(), name() and request-junk. @@ -331,7 +333,7 @@ IDEAS - Translators - Complex mudela? - * y -dims in internote? + * y -dims in internote? Staff-space? X-dimensions? * merge Atom and Symbol? diff --git a/.version b/VERSION similarity index 74% rename from .version rename to VERSION index 623bd9d848..85b19ba549 100644 --- a/.version +++ b/VERSION @@ -1,7 +1,7 @@ TOPLEVEL_MAJOR_VERSION = 0 TOPLEVEL_MINOR_VERSION = 0 -TOPLEVEL_PATCH_LEVEL = 77 +TOPLEVEL_PATCH_LEVEL = 78 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf -TOPLEVEL_MY_PATCH_LEVEL = .jcn1 +TOPLEVEL_MY_PATCH_LEVEL = diff --git a/bin/Makefile b/bin/Makefile index 8a6b6654fe..5f98246cec 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -1,24 +1,31 @@ # bin/Makefile -# subdir level: -# depth = .. include $(depth)/make/Include.make -# list of distribution files: -SCRIPTS = clearlily cpgento genheader make_patch \ - lily.efence\ - make-version make-website release convert-mudela show-latest \ - mudela-book conflily -EXTRA_DISTFILES = $(SCRIPTS) +# list of distribution files: +SCRIPTS = clearlily cpgento make_patch lily.efence \ + make-version release conflily +PERL_SCRIPTS_IN = $(wildcard *.in) +PERL_SCRIPTS = $(addprefix $(outdir)/, $(PERL_SCRIPTS_IN:.in=)) +EXTRA_DISTFILES = $(SCRIPTS) $(PERL_SCRIPTS_IN) # +all: $(PERL_SCRIPTS) + +$(outdir)/%: %.in +# cd .. && CONFIG_FILES=bin/$(notdir $@) CONFIG_HEADERS= ./config.status +# mv $(< :.in=) $@ +# this nukes make/out/Configure_variables.make. + sed 's!@PERL@!$(PERL)!' < $< > $@ + chmod 755 $@ + EXECUTABLES=convert-mudela mudela-book localinstall: all $(INSTALL) -d $(bindir) - $(INSTALL) -m 755 convert-mudela $(bindir) - $(INSTALL) -m 755 mudela-book $(bindir) + $(INSTALL) -m 755 $(outdir)/convert-mudela $(bindir) + $(INSTALL) -m 755 $(outdir)/mudela-book $(bindir) localuninstall: rm -f $(bindir)/convert-mudela $(bindir)/mudela-book diff --git a/bin/conflily b/bin/conflily index 4623edacf5..2a495a1308 100755 --- a/bin/conflily +++ b/bin/conflily @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # conflily # ugh: must be executed from lilypond-x.x.x (bin/conflily) @@ -17,16 +17,18 @@ if [ ! -e $HOME/lelie ]; then ln -s $lelie $HOME/lelie fi -rm $lelie/current >& /dev/null +rm $lelie/current 2>&1 > /dev/null current=`basename \`pwd\`` echo ln -s $lelie/$current $lelie/current ln -s $lelie/$current $lelie/current -ln -sf $lelie/current/lily/out/lilypond bin/lilypond -ln -sf $lelie/current/mi2mu/out/mi2mu bin/mi2mu +ln -sf $lelie/current/lily/out/lilypond bin/out/lilypond +ln -sf $lelie/current/mi2mu/out/mi2mu bin/out/mi2mu if [ "x$LILYINCLUDE" = "x" ]; then - export LILYINCLUDE=$lelie/current/init + echo you should make add the following to your login script + echo "export LILYINCLUDE=$lelie/current/init" + echo "export PATH=$PATH:$lelie/current/bin/out/" fi configure --prefix=$root --enable-debugging --enable-printing --enable-checking diff --git a/bin/convert-mudela b/bin/convert-mudela.in old mode 100755 new mode 100644 similarity index 99% rename from bin/convert-mudela rename to bin/convert-mudela.in index 000f5059cb..f1b640c0ae --- a/bin/convert-mudela +++ b/bin/convert-mudela.in @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!@PERL@ -w =head1 TODO diff --git a/bin/genheader b/bin/genheader.in old mode 100755 new mode 100644 similarity index 98% rename from bin/genheader rename to bin/genheader.in index 911b038f6d..9b6bb4d6cb --- a/bin/genheader +++ b/bin/genheader.in @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!@PERL@ -w # generate the standard header of a LilyPond source file. my $fn; diff --git a/bin/make-version b/bin/make-version index 29b768c1e8..d8e79346cd 100755 --- a/bin/make-version +++ b/bin/make-version @@ -3,7 +3,7 @@ #shift; if test "x$1" = x; then - versionfile=".version" + versionfile="VERSION" else versionfile=$1; fi diff --git a/bin/make-website b/bin/make-website.in old mode 100755 new mode 100644 similarity index 99% rename from bin/make-website rename to bin/make-website.in index 8f00d4f9cc..218b94dc32 --- a/bin/make-website +++ b/bin/make-website.in @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!@PERL@ -w # stupid script to generate WWW site. use FileHandle; @@ -14,7 +14,7 @@ my $MAKE="make"; sub get_version { my ($vstr)=(""); - open V, "$depth/.version"; + open V, "$depth/VERSION"; while () { s/#.*$//g; next if (/^ *$/); diff --git a/bin/mudela-book b/bin/mudela-book.in old mode 100755 new mode 100644 similarity index 99% rename from bin/mudela-book rename to bin/mudela-book.in index c56b1050a7..2481b37f16 --- a/bin/mudela-book +++ b/bin/mudela-book.in @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!@PERL@ -w my $mudcount = 0; my $mudela_b = 0; my $outdir = ""; diff --git a/bin/release b/bin/release index 0cd180d68b..d95553a8b6 100755 --- a/bin/release +++ b/bin/release @@ -2,15 +2,15 @@ # script to automate releases -grep -q '^TOP' .version +grep -q '^TOP' VERSION res=$? -if test ! -f .version || test $res != 0; then +if test ! -f VERSION || test $res != 0; then echo not in topleveldir exit 1 fi function setversion() { -eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' .version` +eval `sed -n 's/^\([A-Z_]*\) *= *\(.*\)$/\1=\2/p' VERSION` MJ=$TOPLEVEL_MAJOR_VERSION MI=$TOPLEVEL_MINOR_VERSION diff --git a/bin/show-latest b/bin/show-latest.in old mode 100755 new mode 100644 similarity index 97% rename from bin/show-latest rename to bin/show-latest.in index 066a26fe3b..e87a6ad630 --- a/bin/show-latest +++ b/bin/show-latest.in @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!@PERL@ $reldir="~/musix/releases"; diff --git a/configure b/configure index 25709197dc..53b21410e9 100755 --- a/configure +++ b/configure @@ -14,19 +14,19 @@ ac_default_prefix=/usr/local ac_help="$ac_help enable-printing turn on debug printing" ac_help="$ac_help - disable-checking set runtime checks (assert calls)" + enable-checking set runtime checks (assert calls). Default: on" ac_help="$ac_help - disable-debugging set debug info " + enable-debugging set debug info. Default: on" ac_help="$ac_help - enable-optimise use maximal speed optimisations" + enable-optimise use maximal speed optimisations. Default: off" ac_help="$ac_help - enable-profiling compile with gprof support" + enable-profiling compile with gprof support. Default: off" ac_help="$ac_help mingw-prefix=DIR set the mingw32 directory (standalone windows32 exes)" ac_help="$ac_help tex-prefix=DIR set the tex-directory to find TeX subdirectories. (default: PREFIX)" ac_help="$ac_help - tex-dir=DIR set the directory to put LilyPond TeX files in. " + tex-dir=DIR set the directory to put LilyPond TeX files in. " ac_help="$ac_help mf-dir=DIR set the directory to put LilyPond MetaFont files in." @@ -539,12 +539,21 @@ fi # if given here, these vars are initted at the checking point. +if test x$host = xNONE; then + buildprefix=. +else + buildprefix="$host-build-dir" + mkdir $buildprefix; + for a in `find -type d -and -not -name '*-build-dir'`; do + mkdir $buildprefix/$a; + done +fi printing_b=no checking_b=yes debug_b=yes optimise_b=no profile_b=no - +warn_b=no ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CXXCPP $CPPFLAGS' @@ -660,7 +669,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:664: checking for $ac_word" >&5 +echo "configure:673: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -691,7 +700,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:695: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:704: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -701,11 +710,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -725,12 +734,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:729: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:738: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:734: checking whether we are using GNU C++" >&5 +echo "configure:743: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -739,7 +748,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -754,7 +763,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:758: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:767: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -784,7 +793,7 @@ fi # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:788: checking for $ac_word" >&5 +echo "configure:797: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -840,7 +849,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:844: checking for a BSD compatible install" >&5 +echo "configure:853: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -894,7 +903,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:898: checking for $ac_word" >&5 +echo "configure:907: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -928,7 +937,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:932: checking for $ac_word" >&5 +echo "configure:941: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FIND'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -959,7 +968,10 @@ test -n "$FIND" || FIND="error" if test FIND = error; then - echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2 + + echo "configure: warning: Couldn't find \`find'. Please use --enable-tex-dir" 1>&2 + warn_b=yes + fi @@ -977,12 +989,13 @@ fi + for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:986: checking for $ac_word" >&5 +echo "configure:999: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1016,7 +1029,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1020: checking for $ac_word" >&5 +echo "configure:1033: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_FLEX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1050,7 +1063,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1054: checking for $ac_word" >&5 +echo "configure:1067: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1079,12 +1092,44 @@ test -n "$MAKE" && break done test -n "$MAKE" || MAKE="error" +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1099: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$PERL" in + /*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_PERL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="error" + ;; +esac +fi +PERL="$ac_cv_path_PERL" +if test -n "$PERL"; then + echo "$ac_t""$PERL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + for ac_prog in pod2man do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1088: checking for $ac_word" >&5 +echo "configure:1133: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_PODMAN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1114,13 +1159,13 @@ done test -n "$PODMAN" || PODMAN="error" - + if test "x$TEXPREFIX" = xauto ; then echo $ac_n "checking TeX/MF root dir directory""... $ac_c" 1>&6 -echo "configure:1124: checking TeX/MF root dir directory" >&5 +echo "configure:1169: checking TeX/MF root dir directory" >&5 find_root_prefix="$prefix" @@ -1137,7 +1182,10 @@ echo "configure:1124: checking TeX/MF root dir directory" >&5 if test "x$find_texpostfix" = x; then find_texpostfix='/lib/texmf/tex' - echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2 + + echo "configure: warning: Cannot determine the TeX-directory. Please use --enable-tex-prefix" 1>&2 + warn_b=yes + fi find_texprefix="$find_root_prefix/$find_texpostfix" @@ -1158,14 +1206,17 @@ if test "x$TEXDIR" = xauto ; then echo $ac_n "checking TeX input directory""... $ac_c" 1>&6 -echo "configure:1162: checking TeX input directory" >&5 +echo "configure:1210: checking TeX input directory" >&5 find_dirdir=`(cd $find_texprefix; $FIND ./ -type d -a -name tex -print |sort|head -1|sed 's#^\./##')` if test "x$find_dirdir" = x; then find_dirdir="/tex"; - echo "configure: warning: Cannot determine TeX input subdirectory. Please set from command-line" 1>&2 + + echo "configure: warning: Cannot determine TeX input subdirectory. Please set from command-line" 1>&2 + warn_b=yes + true fi TEXDIR=$find_dirdir @@ -1175,27 +1226,6 @@ echo "configure:1162: checking TeX input directory" >&5 fi -if test "x$MFDIR" = xauto; then - - - - echo $ac_n "checking MF input directory""... $ac_c" 1>&6 -echo "configure:1184: checking MF input directory" >&5 - find_dirdir=`(cd $find_texprefix; - $FIND ./ -type d -a -name source -print |sort|head -1|sed 's#^\./##')` - - - if test "x$find_dirdir" = x; then - find_dirdir="/source"; - echo "configure: warning: Cannot determine MF input subdirectory. Please set from command-line" 1>&2 - true - fi - MFDIR=$find_dirdir - echo "$ac_t""$find_texprefix/$find_dirdir" 1>&6 - - MFDIR="$TEXPREFIX/$MFDIR" - -fi if test $MAKE = "error" then @@ -1204,39 +1234,66 @@ else $MAKE -v| grep GNU > /dev/null if test "$?" = 1 then - echo "configure: warning: Please install *GNU* make" 1>&2 + + echo "configure: warning: Please install *GNU* make" 1>&2 + warn_b=yes + fi fi if test $BISON = "error" then - echo "configure: warning: can't find bison. Please install Bison (1.25 or better)" 1>&2 + + echo "configure: warning: can't find bison. Please install Bison (1.25 or better)" 1>&2 + warn_b=yes + else bison_version=`$BISON --version| sed 's/^.*version 1.//g' ` if test $bison_version -lt 25; then - echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2 + + echo "configure: warning: Your bison is too old (1.$bison_version). Please install 1.25" 1>&2 + warn_b=yes + fi fi +if test $PERL = "error" +then + + echo "configure: warning: can't find perl. You should install Perl (version 5 or better)" 1>&2 + warn_b=yes + + PERL=/usr/bin/perl +fi + if test $PODMAN = "error" then - echo "configure: warning: can't find pod. You should install Perl (version 5 or better)" 1>&2 + + echo "configure: warning: can't find pod. You should install Perl (version 5 or better)" 1>&2 + warn_b=yes + fi if test $FLEX = "error" then - echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2 + + echo "configure: warning: can't find flex. Please install Flex (2.5 or better)" 1>&2 + warn_b=yes + fi if $CXX --version | grep '2\.7' > /dev/null then true else - echo "configure: warning: can't find g++ 2.7" 1>&2 + + echo "configure: warning: can't find g++ 2.7" 1>&2 + warn_b=yes + fi echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6 -echo "configure:1240: checking how to run the C++ preprocessor" >&5 +echo "configure:1297: checking how to run the C++ preprocessor" >&5 if test -z "$CXXCPP"; then if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1249,12 +1306,12 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross CXXCPP="${CXX-g++} -E" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1258: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1315: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -1274,17 +1331,17 @@ echo "$ac_t""$CXXCPP" 1>&6 ac_safe=`echo "FlexLexer.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for FlexLexer.h""... $ac_c" 1>&6 -echo "configure:1278: checking for FlexLexer.h" >&5 +echo "configure:1335: checking for FlexLexer.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1345: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1303,9 +1360,13 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then true else echo "$ac_t""no" 1>&6 -echo "configure: warning: can't find flex header. Please install Flex headers correctly" 1>&2 + + echo "configure: warning: can't find flex header. Please install Flex headers correctly" 1>&2 + warn_b=yes + fi + subdirs="flower" trap '' 1 2 15 @@ -1421,7 +1482,7 @@ done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" -trap 'rm -fr `echo "make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "$buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -1687,9 +1749,9 @@ fi eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" echo $ac_n "checking ""... $ac_c" 1>&6 -echo "configure:1691: checking " >&5 +echo "configure:1753: checking " >&5 -cat << EOF > lib/out/config.hh +cat << EOF > $buildprefix/lib/out/config.hh /* automatically generated by configure */ /* include this file only once! */ @@ -1698,28 +1760,45 @@ cat << EOF > lib/out/config.hh EOF -CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh +CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh -touch make/out/Site.make +touch $buildprefix/make/out/Site.make # ugr -(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh +(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh + ) -# rgu -sed 's/TOPLEVEL_//g' < .version > lily/.version -(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh +(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh ) -echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile +echo '# WARNING : Automatically generated from make/Toplevel.make.in' \ + | cat - make/Toplevel.make.in > Makefile + cat << END For making everything, do: make # GNU make +or if you used --host=SunUltraWitteReus + + make buildprefix=SunUltraWitteReus-build-dir + If you want to make site-wide extensions to the makefiles, please use make/out/Site.make END +if test $warn_b = "yes" ; then +cat < /dev/null if test "$?" = 1 then - AC_MSG_WARN(Please install *GNU* make) + AC_LILY_WARN(Please install *GNU* make) fi fi if test $BISON = "error" then - AC_MSG_WARN(can't find bison. Please install Bison (1.25 or better)) + AC_LILY_WARN(can't find bison. Please install Bison (1.25 or better)) else bison_version=`$BISON --version| sed 's/^.*version 1.//g' ` if test $bison_version -lt 25; then - AC_MSG_WARN(Your bison is too old (1.$bison_version). Please install 1.25) + AC_LILY_WARN(Your bison is too old (1.$bison_version). Please install 1.25) fi fi +if test $PERL = "error" +then + AC_LILY_WARN(can't find perl. You should install Perl (version 5 or better)) + PERL=/usr/bin/perl +fi + if test $PODMAN = "error" then - AC_MSG_WARN(can't find pod. You should install Perl (version 5 or better)) + AC_LILY_WARN(can't find pod. You should install Perl (version 5 or better)) fi if test $FLEX = "error" then - AC_MSG_WARN(can't find flex. Please install Flex (2.5 or better)) + AC_LILY_WARN(can't find flex. Please install Flex (2.5 or better)) fi if $CXX --version | grep '2\.7' > /dev/null then true else - AC_MSG_WARN(can't find g++ 2.7) + AC_LILY_WARN(can't find g++ 2.7) fi AC_CHECK_HEADER(FlexLexer.h, true, - AC_MSG_WARN(can't find flex header. Please install Flex headers correctly)) + AC_LILY_WARN(can't find flex header. Please install Flex headers correctly)) + AC_CONFIG_SUBDIRS(flower) -AC_OUTPUT(make/out/Configure_variables.make:make/Configure_variables.make.in) +AC_OUTPUT($buildprefix/make/out/Configure_variables.make:make/Configure_variables.make.in) @@ -251,7 +273,7 @@ eval "DIR_DATADIR=$datadir" DIR_DATADIR="$DIR_DATADIR/lilypond" AC_MSG_CHECKING -cat << EOF > lib/out/config.hh +cat << EOF > $buildprefix/lib/out/config.hh /* automatically generated by configure */ /* include this file only once! */ @@ -260,29 +282,45 @@ cat << EOF > lib/out/config.hh EOF -CXX="$ac_cv_prog_CXX" bin/make-version >> lib/out/config.hh +CXX="$ac_cv_prog_CXX" bin/make-version >> $buildprefix/lib/out/config.hh -touch make/out/Site.make +touch $buildprefix/make/out/Site.make # ugr -(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh -dnl echo 0 > out/.build +(cd mi2mu; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/mi2mu/out/version.hh + ) -# rgu -sed 's/TOPLEVEL_//g' < .version > lily/.version -(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh +(cd lily; CXX="$ac_cv_prog_CXX" ../bin/make-version > ../$buildprefix/lily/out/version.hh ) -echo '# WARNING : Automatically generated from make/Toplevel.make.in' | cat - make/Toplevel.make.in > Makefile +echo '# WARNING : Automatically generated from make/Toplevel.make.in' \ + | cat - make/Toplevel.make.in > Makefile + cat << END For making everything, do: make # GNU make +or if you used --host=SunUltraWitteReus + + make buildprefix=SunUltraWitteReus-build-dir + If you want to make site-wide extensions to the makefiles, please use make/out/Site.make END +if test $warn_b = "yes" ; then +cat < DECLARE_MY_RUNTIME_TYPEINFO; + - Matrix::band_i() + pl 23: - virtual-methods : static_is_type_b - - Choleski checks no if PARANOID + - Choleski checks off if not PARANOID pl 22: - ACursor and PACursor to give array a List like interface. diff --git a/flower/.version b/flower/VERSION similarity index 89% rename from flower/.version rename to flower/VERSION index 6214501523..fafe5106a4 100644 --- a/flower/.version +++ b/flower/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 1 MINOR_VERSION = 1 -PATCH_LEVEL = 23 +PATCH_LEVEL = 24 # use to send patches, always empty for released version: MY_PATCH_LEVEL = # include separator: "-1" or ".a" # diff --git a/flower/choleski.cc b/flower/choleski.cc index 202e184440..d619b97460 100644 --- a/flower/choleski.cc +++ b/flower/choleski.cc @@ -9,6 +9,9 @@ #include "choleski.hh" const Real EPS = 1e-7; // so sue me. Hard coded +// for testing new Matrix_storage. +//#define PARANOID + Vector Choleski_decomposition::solve(Vector rhs)const { @@ -37,20 +40,11 @@ Choleski_decomposition::solve(Vector rhs)const return x; } -/* - Standard matrix algorithm. - Should add support for banded matrices - */ - -Choleski_decomposition::Choleski_decomposition(Matrix P) - : L(P.dim()), D(P.dim()) +void +Choleski_decomposition::full_matrix_decompose(Matrix const & P) { - int n = P.dim(); - -#ifdef PARANOID - assert((P-P.transposed()).norm()/P.norm() < EPS); -#endif - + + int n = P.dim(); L.unit(); for (int k= 0; k < n; k++) { for (int j = 0; j < k; j++){ @@ -67,6 +61,52 @@ Choleski_decomposition::Choleski_decomposition(Matrix P) D(k) = d; } +} + +void +Choleski_decomposition::band_matrix_decompose(Matrix const &P) +{ + int n = P.dim(); + int b = P.band_i(); + L.unit(); + + for (int i= 0; i < n; i++) { + for (int j = 0 >? i - b; j < i; j++){ + Real sum(0.0); + for (int l=0 >? i - b; l < j; l++) + sum += L(i,l)*L(j,l)*D(l); + L(i,j) = (P(i,j) - sum)/D(j); + } + Real sum=0.0; + + for (int l=0 >? i - b; l < i; l++) + sum += sqr(L(i,l))*D(l); + Real d = P(i,i) - sum; + D(i) = d; + } + L.try_set_band(); + assert ( L.band_i() == P.band_i()); +} + + + + +/* + Standard matrix algorithm. + */ + +Choleski_decomposition::Choleski_decomposition(Matrix const & P) + : L(P.dim()), D(P.dim()) +{ +#ifdef PARANOID + assert((P-P.transposed()).norm()/P.norm() < EPS); +#endif + if (P.band_b()) + band_matrix_decompose(P); + else + full_matrix_decompose(P); + + #ifdef PARANOID assert((original()-P).norm() / P.norm() < EPS); #endif diff --git a/flower/configure b/flower/configure index 5ede2662f7..53ff4301cf 100755 --- a/flower/configure +++ b/flower/configure @@ -534,6 +534,17 @@ optimise_b=yes shared_b=no LIB_SUFFIX=.a +# if given here, these vars are initted at the checking point. +if test x$host = xNONE; then + flowerbuildprefix=. +else + flowerbuildprefix="../$host-build-dir/Flower" + mkdir $flowerbuildprefix; + for a in `find -type d -and -not -name '*-build-dir'`; do + mkdir $flowerbuildprefix/$a; + done +fi + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -567,7 +578,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:571: checking for $ac_word" >&5 +echo "configure:582: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -598,7 +609,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:602: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:613: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -608,11 +619,11 @@ ac_link='${CXX-g++} -o conftest $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $L cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -632,12 +643,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:636: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:647: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:641: checking whether we are using GNU C++" >&5 +echo "configure:652: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -646,7 +657,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:661: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -661,7 +672,7 @@ if test $ac_cv_prog_gxx = yes; then ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:665: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:676: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -689,7 +700,7 @@ else fi echo $ac_n "checking for 8-bit clean memcmp""... $ac_c" 1>&6 -echo "configure:693: checking for 8-bit clean memcmp" >&5 +echo "configure:704: checking for 8-bit clean memcmp" >&5 if eval "test \"`echo '$''{'ac_cv_func_memcmp_clean'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -697,7 +708,7 @@ else ac_cv_func_memcmp_clean=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then ac_cv_func_memcmp_clean=yes else @@ -728,12 +739,12 @@ echo "$ac_t""$ac_cv_func_memcmp_clean" 1>&6 test $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.o" echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:732: checking for vprintf" >&5 +echo "configure:743: checking for vprintf" >&5 if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:774: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_vprintf=yes" else @@ -783,12 +794,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:787: checking for _doprnt" >&5 +echo "configure:798: checking for _doprnt" >&5 if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func__doprnt=yes" else @@ -841,12 +852,12 @@ fi for ac_func in memmem snprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:845: checking for $ac_func" >&5 +echo "configure:856: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -898,7 +909,7 @@ done -CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh +CXX="$ac_cv_prog_CXX" ../bin/make-version > $flowerbuildprefix/out/version.hh trap '' 1 2 15 cat > confcache <<\EOF @@ -1000,7 +1011,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "out/Flower-flags.make:Flower-flags.make.in out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "$flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in $flowerbuildprefix/out/config.hh:config.hh.in" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then @@ -1152,7 +1163,7 @@ ac_eD='%g' if test "${CONFIG_HEADERS+set}" != set; then EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF fi diff --git a/flower/configure.in b/flower/configure.in index cac84bdbb7..619a5fe71e 100644 --- a/flower/configure.in +++ b/flower/configure.in @@ -7,6 +7,17 @@ optimise_b=yes shared_b=no LIB_SUFFIX=.a +# if given here, these vars are initted at the checking point. +if test x$host = xNONE; then + flowerbuildprefix=. +else + flowerbuildprefix="../$host-build-dir/Flower" + mkdir $flowerbuildprefix; + for a in `find -type d -and -not -name '*-build-dir'`; do + mkdir $flowerbuildprefix/$a; + done +fi + AC_ARG_ENABLE(shared, [ enable-shared shared flower library], [shared_b=$enableval]) @@ -33,9 +44,9 @@ AC_PROG_CXX AC_FUNC_MEMCMP AC_FUNC_VPRINTF AC_CHECK_FUNCS(memmem snprintf ) -AC_CONFIG_HEADER(out/config.hh:config.hh.in) +AC_CONFIG_HEADER($flowerbuildprefix/out/config.hh:config.hh.in) -CXX="$ac_cv_prog_CXX" ../bin/make-version > out/version.hh +CXX="$ac_cv_prog_CXX" ../bin/make-version > $flowerbuildprefix/out/version.hh -AC_OUTPUT(out/Flower-flags.make:Flower-flags.make.in) +AC_OUTPUT($flowerbuildprefix/out/Flower-flags.make:Flower-flags.make.in) diff --git a/flower/diagonal-storage.cc b/flower/diagonal-storage.cc new file mode 100644 index 0000000000..3cf2f93d20 --- /dev/null +++ b/flower/diagonal-storage.cc @@ -0,0 +1,236 @@ +/* + diagonal-storage.cc -- implement Diagonal_storage + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + +#include "diagonal-storage.hh" + +int +Diagonal_storage::dim()const +{ + return band_.rows(); +} + +Diagonal_storage::Diagonal_storage() +{ +} + +int +Diagonal_storage::rows() const +{ + return band_.rows(); +} + +int +Diagonal_storage::cols() const +{ + return band_.rows(); +} + +int +Diagonal_storage::band_size_i()const +{ + return (band_.cols()-1)/2; +} + +void +Diagonal_storage::set_band_size(int s) +{ + Full_storage f(dim(), 2*s+1); + for (int i=0; i < dim(); i++) { + int k=-s; + for ( ; k < -band_size_i(); k++) + f.elem(i,k + s) = 0.0; + for ( ; k <= band_size_i()&& k<=s ; k++) + f.elem(i, k + s) = band_.elem(i,k+ band_size_i()); + for( ; k <= s; k++) + f.elem(i, k + s) =0.0; + } + + band_ = f; +} + + + +/* + any takers? + */ +void +Diagonal_storage::insert_row(int ) +{ + assert(false); +} + +void +Diagonal_storage::delete_row(int ) +{ + assert(false); +} + +void +Diagonal_storage::resize(int,int) +{ +} + +void +Diagonal_storage::resize(int) +{ +} + +void +Diagonal_storage::delete_column(int ) +{ + assert(false); +} + +Diagonal_storage::~Diagonal_storage() +{ +} + + +bool +Diagonal_storage::band_elt_b(int i,int j)const +{ + return abs(i-j) <= band_size_i(); +} + +void +Diagonal_storage::assert_valid(int i,int j )const +{ + assert( band_elt_b(i,j) ); + assert( i >=0 && j >=0 && i < dim() && j < dim()); +} + + +void +Diagonal_storage::resize_dim(int d) +{ + Full_storage f(d, 2*band_size_i()+1); + for (int i=0; i < d&& i < dim(); i++) { + for ( int k=0; k < 2*band_size_i(); k++) + f.elem(i,k) = elem(i,k); + } + + band_ = f; +} + + + +bool +Diagonal_storage::mult_ok(int i,int )const +{ + return i < dim(); +} + +void +Diagonal_storage::mult_next(int &i, int &j)const +{ + j++; + if ( j < i - band_size_i() ) + j = i- band_size_i(); + if ( j > i + band_size_i() || j >= dim() ) { + i++; + j = i - band_size_i(); + if (j < 0) + j=0; + } +} + +bool +Diagonal_storage::trans_ok(int ,int j)const +{ + return j < dim(); +} + +void +Diagonal_storage::trans_next(int &i, int& j)const +{ + i++; + if ( i < j - band_size_i()) + i = j-band_size_i(); + + if ( i >= dim() || i > j + band_size_i() ) { + j++; + i = j - band_size_i(); + if (i < 0) + i=0; + } +} + +static Real nul_entry=0.0; + +Real +Diagonal_storage::elem(int i, int j)const +{ + if (abs ( i-j ) > band_size_i()) + return 0; + else + return band_.elem(i, j - i +band_size_i()); +} + +Real & +Diagonal_storage::elem(int i, int j) +{ + /* + if this fails, the previous call fucked up + */ + assert(nul_entry); + if (abs ( i-j ) > band_size_i()) + return nul_entry; + else + return band_.elem(i, j - i + band_size_i()); +} + +/* + Hairy routine to try to save some fp-ops + */ + +bool +Diagonal_storage::try_right_multiply(Matrix_storage*dest, + const Matrix_storage*right)const +{ + if ( right->name() != Diagonal_storage::static_name() ) + return false; + + const Diagonal_storage* diag = (Diagonal_storage const*)right; + int band2 = diag->band_size_i(); + int n = dim(); + /* + should check if dest is a Diagonal_storage of sufficient size too. + */ + for (int i=0; i < n; i++) { + for (int j = 0; j < n; j++) { + int startk = i - band_size_i() >? 0 >? j - band2; + int stopk = i + band_size_i() elem(relk, j); + dest->elem(i, j) = sum; + + } + } + return true; +} + +IMPLEMENT_IS_TYPE_B1(Diagonal_storage, Matrix_storage); + + +Diagonal_storage::Diagonal_storage(Matrix_storage*stor_l, int band_i) +{ + set_band_size(band_i); + resize_dim(stor_l->dim()); + + for ( int i=0,j=0; mult_ok(i,j); mult_next(i,j)) + band_.elem(i, j + band_i -i ) = stor_l->elem(i,j); +} + +void +Diagonal_storage::OK() const +{ + band_.OK(); +} diff --git a/flower/full-storage.cc b/flower/full-storage.cc index 1b5c05a392..223796ba35 100644 --- a/flower/full-storage.cc +++ b/flower/full-storage.cc @@ -3,7 +3,7 @@ source file of the Flower Library - (c) 1997 Han-Wen Nienhuys + (c) 1996,1997 Han-Wen Nienhuys */ #include "full-storage.hh" @@ -23,12 +23,13 @@ void Full_storage::OK() const { #ifndef NDEBUG - // static Real dummy; + 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 } + void Full_storage::resize_cols(int newh) { @@ -49,6 +50,18 @@ Full_storage::resize_cols(int newh) height_i_ = max_height_i_ = newh; } + +Full_storage::Full_storage(Matrix_storage*m) +{ + set_size(m->rows(), m->cols()); + if ( !m->is_type_b ( Full_storage::static_name())) + for (int i=0; imult_ok(i,j); m->mult_next(i,j)) + els_p_p_[i][j] = m->elem(i,j); +} + void Full_storage::resize_rows(int neww) { @@ -79,20 +92,19 @@ Full_storage::resize(int rows, int cols) OK(); resize_cols(rows); resize_rows(cols); - } bool -Full_storage::mult_ok(int i, int j) const +Full_storage::mult_ok(int i, int ) const { - return valid(i,j); + return i < height_i_; } bool -Full_storage::trans_ok(int i, int j) const +Full_storage::trans_ok(int , int j) const { - return valid(i,j); + return j < width_i_; } @@ -149,47 +161,21 @@ Full_storage::insert_row(int k) } - -Array -Full_storage::row(int n) const +int +Full_storage::dim()const { - Array r; - for (int j = 0; j < width_i_; j++) - r.push(els_p_p_[n][j]); - return r; + assert (rows()==cols()); + return rows(); } -Array -Full_storage::column(int n) const -{ - - Array r; - for (int i = 0; iname() != Full_storage::static_name() || right->name() != Full_storage::static_name()) @@ -211,5 +197,4 @@ Full_storage::try_right_multiply(Matrix_storage * dest, Matrix_storage const * r } -IMPLEMENT_IS_TYPE_B(Matrix_storage); IMPLEMENT_IS_TYPE_B1(Full_storage,Matrix_storage); diff --git a/flower/include/Makefile b/flower/include/Makefile index e783a73603..1ad45cb463 100644 --- a/flower/include/Makefile +++ b/flower/include/Makefile @@ -8,7 +8,7 @@ depth = ../.. # generic stuff/Makefile # include ./$(depth)/make/Include.make -include ./$(depth)/flower/.version +include ./$(depth)/flower/VERSION # identify module: # diff --git a/flower/include/choleski.hh b/flower/include/choleski.hh index f5e9fb4f5a..a3a02a11e0 100644 --- a/flower/include/choleski.hh +++ b/flower/include/choleski.hh @@ -24,7 +24,7 @@ struct Choleski_decomposition { P needs to be symmetric positive definite */ - Choleski_decomposition(Matrix P); + Choleski_decomposition(Matrix const &P); /** solve Px = rhs @@ -40,7 +40,9 @@ struct Choleski_decomposition { return P, calc'ed from L and D */ Matrix original() const; - +private: + void full_matrix_decompose(Matrix const & P); + void band_matrix_decompose(Matrix const &P); }; #endif diff --git a/flower/include/diagonal-storage.hh b/flower/include/diagonal-storage.hh new file mode 100644 index 0000000000..517c5cd814 --- /dev/null +++ b/flower/include/diagonal-storage.hh @@ -0,0 +1,65 @@ +/* + diagonal-storage.hh -- declare Diagonal_storage + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef DIAGONAL_STORAGE_HH +#define DIAGONAL_STORAGE_HH +#include "full-storage.hh" + +/** + Store a single-band matrix; + + INVARIANT + + Diagonal_storage(i,j) == band_(i, j-i + band_size_i()) + + band_.cols() == 2 * band_size_i() + 1 + + */ +class Diagonal_storage : public Matrix_storage { + Full_storage band_; + +public: + void set_band_size(int b); + int band_size_i()const; + + void assert_valid(int i, int j) const; + bool band_elt_b(int,int )const; + void resize_dim(int); + + virtual void resize_rows(int d) { resize_dim (d); } + virtual void resize_cols(int d) { resize_dim(d); } + virtual int dim() const; + + virtual int rows() const ; + virtual int cols() const ; + + + virtual void resize(int i, int j); + virtual void resize(int i); + + virtual Real& elem(int i,int j); + virtual Real elem(int i, int j) const; + Diagonal_storage(Matrix_storage* , int band_i); + Diagonal_storage(); + void OK() const; + + virtual void insert_row(int k); + virtual void delete_row(int k); + virtual void delete_column(int k); + + ~Diagonal_storage(); + virtual bool mult_ok(int i, int j)const; + virtual void mult_next(int &i, int &j) const ; + virtual bool trans_ok(int i, int j) const; + virtual void trans_next(int &i, int &j) const; + VIRTUAL_COPY_CONS(Diagonal_storage, Matrix_storage); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const *)const; +}; +#endif // DIAGONAL_STORAGE_HH diff --git a/flower/include/flower-debug.hh b/flower/include/flower-debug.hh index 1fe12e09e1..a617c6f379 100644 --- a/flower/include/flower-debug.hh +++ b/flower/include/flower-debug.hh @@ -1,5 +1,5 @@ /* - flower-debug.hh -- declare + flower-debug.hh -- declare global constants relating to debug dumps source file of the Flower Library diff --git a/flower/include/full-storage.hh b/flower/include/full-storage.hh index bcd778a994..78bafab43d 100644 --- a/flower/include/full-storage.hh +++ b/flower/include/full-storage.hh @@ -13,6 +13,7 @@ #include "varray.hh" #include "matrix-storage.hh" #include "real.hh" + /// simplest matrix storage. refer to its baseclass for the doco. class Full_storage : public Matrix_storage { @@ -49,14 +50,6 @@ public: } - virtual void set_size(int i, int j) - { - resize(i,j); //this could be more efficient. - } - - virtual void set_size(int i) { - set_size(i,i); - } virtual void resize(int i, int j); virtual void resize(int i) { resize(i,i); @@ -66,13 +59,12 @@ public: assert(valid(i,j)); return els_p_p_[i][j]; } - virtual Real const & elem(int i, int j) const { + virtual Real elem(int i, int j) const { assert(valid(i,j)); return els_p_p_[i][j]; } - virtual Array row(int i) const; - virtual Array column(int j) const; - + int dim()const; + Full_storage(Matrix_storage*); Full_storage() { init(); } @@ -80,7 +72,7 @@ public: init(); set_size(i,j); } - Full_storage(Full_storage&); + Full_storage(Full_storage const&); Full_storage(int i) { init(); set_size(i); @@ -91,16 +83,15 @@ public: virtual void insert_row(int k); virtual void delete_row(int k); virtual void delete_column(int k); - ~Full_storage(); virtual bool mult_ok(int i, int j)const; virtual void mult_next(int &i, int &j) const ; virtual bool trans_ok(int i, int j) const; virtual void trans_next(int &i, int &j) const; - virtual Matrix_storage * clone(); - NAME_MEMBERS(); - virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const * ); + VIRTUAL_COPY_CONS(Full_storage,Matrix_storage); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual bool try_right_multiply(Matrix_storage * dest, Matrix_storage const * )const; }; #endif // FULL_STORAGE_HH diff --git a/flower/include/matrix-storage.hh b/flower/include/matrix-storage.hh index d7e9310acf..a5971b2688 100644 --- a/flower/include/matrix-storage.hh +++ b/flower/include/matrix-storage.hh @@ -39,19 +39,22 @@ public: /// width of matrix virtual int cols() const = 0; - + + /// size if square + virtual int dim() const =0; /** set the size. contents lost. PRE i >=0, j>=0 */ - virtual void set_size(int rows, int cols) = 0; + virtual void set_size(int rows, int cols) ; + /**set the size to square dimen. contents lost PRE i>=0 */ - virtual void set_size(int i) = 0; + virtual void set_size(int i) ; /**set the size to i. keep contents. If enlarged contents unspecified @@ -72,7 +75,7 @@ public: virtual void resize(int i) = 0; - /** + /** access an element. Generate an errormessage, if this happens @@ -82,10 +85,10 @@ public: virtual Real& elem(int i,int j) = 0; /// access a element, no modify - virtual Real const & elem(int i, int j) const = 0; + virtual Real elem(int i, int j) const = 0; - virtual Array row(int i) const = 0; - virtual Array column(int j) const = 0; + virtual Array row(int i) const ; + virtual Array column(int j) const; /** @@ -106,7 +109,7 @@ public: virtual void delete_row(int k)=0; virtual void delete_column(int k)=0; virtual ~Matrix_storage() { } - virtual Matrix_storage *clone()=0; + virtual Matrix_storage *clone()const=0; @@ -130,7 +133,7 @@ public: */ virtual void mult_next(int &i, int &j) const = 0; -/** + /** valid matrix entry. return false if at end of row */ virtual bool trans_ok(int i, int j) const=0; @@ -144,25 +147,28 @@ public: */ virtual void trans_next(int &i, int &j) const = 0; + /// generate a "Full_storage" matrix static Matrix_storage *get_full(int n, int m); - - + static void set_band(Matrix_storage*&, int band); + static void set_full(Matrix_storage*&); virtual bool try_right_multiply(Matrix_storage *dest, - const Matrix_storage *fact) ; + const Matrix_storage *fact)const ; /** RTTI. */ - NAME_MEMBERS(); -}; - + DECLARE_MY_RUNTIME_TYPEINFO; + + static Matrix_storage* get_product_result(Matrix_storage *left, + Matrix_storage *right); + + + static void set_addition_result( + Matrix_storage *&dat, Matrix_storage *right); + static void set_product_result( + Matrix_storage*&dest, Matrix_storage*left, Matrix_storage*right); +}; -inline bool -Matrix_storage::try_right_multiply(Matrix_storage *, - const Matrix_storage *) -{ - return false; -} #endif // MATRIX_STORAGE_HH diff --git a/flower/include/matrix.hh b/flower/include/matrix.hh index df013e0849..b6e084efda 100644 --- a/flower/include/matrix.hh +++ b/flower/include/matrix.hh @@ -24,8 +24,12 @@ class Matrix { + friend Matrix operator *(Matrix const &m1, Matrix const &m2); + +protected: Matrix_storage *dat; - + void set(Matrix_storage*); + Matrix(Matrix_storage*); public: void OK() const { dat->OK(); } int cols() const { return dat->cols(); } @@ -37,7 +41,16 @@ public: */ int dim() const; - // Matrix() { dat = 0; } + /** + the band size of the matrix. + @ret + + 0 <= band_i() <= dim + */ + int band_i() const; + bool band_b()const; + void set_full()const; + void try_set_band()const; ~Matrix() { delete dat; } /// set entries to r @@ -76,7 +89,7 @@ public: square n matrix, initialised to null */ Matrix(int n); - + /** n x m matrix, init to 0 */ @@ -140,4 +153,9 @@ inline Matrix operator -(Matrix m1,const Matrix m2) m1 -= m2; return m1; } +inline Matrix operator +(Matrix m1,const Matrix m2) +{ + m1 += m2; + return m1; +} #endif diff --git a/flower/include/virtual-methods.hh b/flower/include/virtual-methods.hh index b8933baa0e..88dad44aeb 100644 --- a/flower/include/virtual-methods.hh +++ b/flower/include/virtual-methods.hh @@ -14,7 +14,7 @@ The static_name() can *not* be inlined (this might have the effect that s->name() != S::static_name(). Overlapping strings need not be merged in C++ */ -#define NAME_MEMBERS() \ +#define DECLARE_MY_RUNTIME_TYPEINFO \ static char const *static_name();\ static bool static_is_type_b(const char*s);\ virtual bool is_type_b(const char *s)const { return static_is_type_b(s); } \ diff --git a/flower/matrix-debug.cc b/flower/matrix-debug.cc index 47a66896a5..099a05beb9 100644 --- a/flower/matrix-debug.cc +++ b/flower/matrix-debug.cc @@ -1,15 +1,26 @@ +/* + matrix-debug.cc -- implement Matrix print routines + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + + #include "flower-debug.hh" #include "matrix.hh" +#include "matrix-storage.hh" Matrix::operator String() const { String s; #ifndef NPRINT - s="matrix {\n"; + Matrix_storage const * stor_c_l = dat; + s=String("matrix { (") + dat->name() + ")\n"; for (int i=0; i< rows(); i++){ for (int j = 0; j < cols(); j++) { - s+= String(dat->elem(i,j), "%6f "); + s+= String(stor_c_l->elem(i,j), "%6f "); } s+="\n"; } diff --git a/flower/matrix-storage.cc b/flower/matrix-storage.cc new file mode 100644 index 0000000000..76b89f7f36 --- /dev/null +++ b/flower/matrix-storage.cc @@ -0,0 +1,139 @@ +/* + matrix-storage.cc -- implement Matrix_storage + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "full-storage.hh" +#include "diagonal-storage.hh" + +void +Matrix_storage::set_addition_result(Matrix_storage *&dat, Matrix_storage *right) +{ + if (dat && dat->name() == Diagonal_storage::static_name() + && right->name() == Diagonal_storage::static_name()) { + Diagonal_storage *L = (Diagonal_storage*)dat; + Diagonal_storage* R = (Diagonal_storage*) right; + + if ( R->band_size_i() > L->band_size_i()) { + L->set_band_size(R->band_size_i()); + return ; + } + } + if (!dat || !dat->is_type_b(Full_storage::static_name() )) { + + Matrix_storage *new_stor = (dat)? new Full_storage(dat) : + new Full_storage( right->rows(), right->cols()); + delete dat; + dat = new_stor; + } +} + +Matrix_storage* +Matrix_storage::get_product_result(Matrix_storage*left, Matrix_storage*right) +{ + Matrix_storage* dest =0; + set_product_result(dest, left,right); + return dest; +} + + +/* + hairy + */ +void +Matrix_storage::set_product_result(Matrix_storage*&dest, + Matrix_storage*left, Matrix_storage*right) +{ + if ( left->name() == Diagonal_storage::static_name() + && right->name() == Diagonal_storage::static_name()) { + Diagonal_storage *L = (Diagonal_storage*)left; + Diagonal_storage* R = (Diagonal_storage*) right; + + if (L->band_size_i() + R->band_size_i() < L->dim()/2 ) { + if (dest ->name() != Diagonal_storage::static_name()){ + delete dest; + dest = new Diagonal_storage; + } + + dest->set_size(L->dim()); + return; + } + } + + if ( dest && dest->name() == Full_storage::static_name()) { + dest->set_size(left->rows(), right->cols()); + } else { + delete dest; + dest = new Full_storage( left->rows(), right->cols()); + } +} + +IMPLEMENT_IS_TYPE_B(Matrix_storage); + +Matrix_storage * +Matrix_storage::get_full(int n, int m) +{ + return new Full_storage(n,m); +} + + + + bool +Matrix_storage::try_right_multiply(Matrix_storage *, + const Matrix_storage *)const +{ + return false; +} + +Array +Matrix_storage::row(int n) const +{ + Array r; + for (int j = 0; j < cols(); j++) + r.push(elem(n,j)); + return r; +} + +Array +Matrix_storage::column(int n) const +{ + Array r; + for (int i = 0; i < rows(); i++) + r.push(elem(i,n)); + return r; +} + +void +Matrix_storage::set_size(int rows, int cols) +{ + + resize(rows,cols); +} + +void +Matrix_storage::set_size(int rows) +{ + + resize(rows); +} + + +void +Matrix_storage::set_band(Matrix_storage *&mat, int b) +{ + Matrix_storage* ns = new Diagonal_storage(mat, b); + delete mat; + mat=ns; +} + + +void +Matrix_storage::set_full(Matrix_storage *&mat) +{ + Matrix_storage* ns = new Full_storage(mat); + delete mat; + mat=ns; +} diff --git a/flower/matrix.cc b/flower/matrix.cc index b096601c86..78e3d777b0 100644 --- a/flower/matrix.cc +++ b/flower/matrix.cc @@ -1,4 +1,42 @@ +/* + matrix.cc -- implement Matrix + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + #include "matrix.hh" +#include "full-storage.hh" +#include "diagonal-storage.hh" + +bool +Matrix::band_b()const +{ + return dat->is_type_b( Diagonal_storage::static_name()); +} + +void +Matrix::set_full() const +{ + if ( dat->name() != Full_storage::static_name()) { + Matrix_storage::set_full( ((Matrix*)this)->dat ); + } +} + +void +Matrix::try_set_band()const +{ + if (band_b()) + return; + + int b = band_i(); + if ( b > dim()/2) + return; + // it only looks constant + Matrix*self = (Matrix*)this; + Matrix_storage::set_band(self->dat,b); +} Real Matrix::norm() const @@ -33,6 +71,7 @@ Matrix::set_diag(Vector d) void Matrix::operator+=(Matrix const &m) { + Matrix_storage::set_addition_result(dat, m.dat); assert(m.cols() == cols()); assert(m.rows() == rows()); for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j)) @@ -42,6 +81,7 @@ Matrix::operator+=(Matrix const &m) void Matrix::operator-=(Matrix const &m) { + Matrix_storage::set_addition_result(dat, m.dat); assert(m.cols() == cols()); assert(m.rows() == rows()); for (int i=0, j=0; dat->mult_ok(i,j); dat->mult_next(i,j)) @@ -64,6 +104,23 @@ Matrix::operator=(Matrix const &m) delete dat; dat = m.dat->clone(); } + +int +Matrix::band_i()const +{ + int starty = dim(); + while (starty >= 0 ) { + for ( int i = starty, j = 0; i < dim(); i++, j++ ) + if (dat->elem( i,j )) + goto gotcha; + for ( int i=0, j = starty; j < dim(); i++,j++) + if (dat->elem(i,j)) + goto gotcha; + starty --; + } +gotcha: + return starty; +} Matrix::Matrix(Matrix const &m) { @@ -79,6 +136,11 @@ Matrix::Matrix(int n, int m) fill(0); } +Matrix::Matrix(Matrix_storage*stor_p) +{ + dat = stor_p; +} + Matrix::Matrix(int n) { dat = Matrix_storage::get_full(n,n); @@ -173,12 +235,11 @@ Matrix::transposed() const return m; } - -/* should do something smarter: bandmatrix * bandmatrix is also banded matrix. */ Matrix operator *(Matrix const &m1, Matrix const &m2) { - Matrix result(m1.rows(), m2.cols()); + Matrix result(Matrix_storage::get_product_result(m1.dat, m2.dat)); + result.set_product(m1,m2); return result; } @@ -188,7 +249,7 @@ Matrix::set_product(Matrix const &m1, Matrix const &m2) { assert(m1.cols()==m2.rows()); assert(cols()==m2.cols() && rows()==m1.rows()); - + if (m1.dat->try_right_multiply(dat, m2.dat)) return; for (int i=0, j=0; dat->mult_ok(i,j); @@ -243,3 +304,5 @@ Matrix::dim() const return rows(); } + + diff --git a/flower/string-convert.cc b/flower/string-convert.cc index f791e1f6c2..d1a9fe0575 100644 --- a/flower/string-convert.cc +++ b/flower/string-convert.cc @@ -204,10 +204,10 @@ String_convert::int_str(int i, char const* fmt) String String_convert::double_str(double f, char const* fmt) { - static char buf[STRING_BUFFER_LEN]; + char buf[STRING_BUFFER_LEN]; snprintf(buf, STRING_BUFFER_LEN, fmt ? fmt : "%f", f); - return buf; + return String(buf); } /** diff --git a/flower/test/Makefile b/flower/test/Makefile index ec93a1e545..207bcd10ce 100644 --- a/flower/test/Makefile +++ b/flower/test/Makefile @@ -16,9 +16,9 @@ depth = ../.. # identify module: # NAME =flower-test -# include ./$(depth)/$(NAME)/.version +# include ./$(depth)/$(NAME)/VERSION MODULE_NAME = flower -include ./$(depth)/flower/.version +include ./$(depth)/flower/VERSION # @@ -48,8 +48,7 @@ EXECSTRINGTEST=$(EXECUTABLE) # don't do the exec, as this might fail if flowerlib isn't installed yet. default: $(BUILDSTRINGTEST) - -do-stringtest: +test: $(EXECUTABLE) $(EXECSTRINGTEST) > $(outdir)/result cmp $(outdir)/result result diff --git a/flower/test/mat-test.cc b/flower/test/mat-test.cc new file mode 100644 index 0000000000..f7ce01bfc5 --- /dev/null +++ b/flower/test/mat-test.cc @@ -0,0 +1,60 @@ +/* + mat-test.cc -- test Matrix + + source file of the Flower Library + + (c) 1997 Han-Wen Nienhuys +*/ + +#include +#include "matrix.hh" +#include "string.hh" +#include "flower-test.hh" +#include "choleski.hh" + +void +matrix() +{ + int N=10; + Matrix m(N,N), q(N,N); + Vector v(N); + + for (int i=0; i < N; i++) { + v(i) =i; + for (int j=0; j < N; j++) { + m(i,j) = i+j; + q(i,j) = (abs(i-j) > 3) ?0 :i-j; + } + } + + cout << "v: " << String(v); + cout << "m: " << String(m ); + cout << "q: " << String(q); + cout << "m*q; " << String(m*q); + cout << "m*m: " << String(m*m); + m.OK(); + cout << "m: " << String(m); + cout << "q.band " << q.band_i() << endl; + q.try_set_band(); + cout << "q(B): " << q; + q.OK(); + Matrix sum(q+q); + cout << "q + q " << sum; + q.OK(); + cout << "q*q: " << q*q; + q.OK(); + + Matrix hilbert(N,N), h2(hilbert); + for (int i=0; i < N; i++) { + for (int j=0; j < N; j++) { + hilbert(i,j) = 1/(i+j+1); + h2 (i,j) = (abs(i-j) > 3) ?0 : hilbert(i,j); + } + } + h2.try_set_band(); + Choleski_decomposition ch(h2); + cout << "red Hilbert " << h2; + cout << "choleski " << ch.L; +} + +ADD_TEST(matrix); diff --git a/init/Makefile b/init/Makefile index 32318e47c3..fdab67ea61 100644 --- a/init/Makefile +++ b/init/Makefile @@ -11,17 +11,16 @@ build = ./$(depth)/lily/$(outdir)/.build # generic stuff/Makefile # include ./$(depth)/make/Include.make -# # list of distribution files: # -INITFILES = $(wildcard *.ly) -DISTFILES = Makefile $(INITFILES) -# +INIFILES = $(wildcard *.ly) +DISTFILES = Makefile $(INIFILES) + localinstall: $(INSTALL) -d $(datadir)/lilypond/init - $(INSTALL) -m 644 $(INITFILES) $(datadir)/lilypond/init + $(INSTALL) -m 644 $(INIFILES) $(datadir)/lilypond/init localuninstall: for i in $(INIFILES) ; do rm -f $(datadir)/lilypond/init/$$i; done diff --git a/init/bare.ly b/init/bare.ly deleted file mode 100644 index 67963e1051..0000000000 --- a/init/bare.ly +++ /dev/null @@ -1,5 +0,0 @@ - -% enough for the parsing step - -include "init/dutch.ly" -include "init/table_sixteen.ly" diff --git a/init/engraver.ly b/init/engraver.ly index 4d73ecf419..5fe3255194 100644 --- a/init/engraver.ly +++ b/init/engraver.ly @@ -61,6 +61,7 @@ lyric_engraver = \requesttranslator { \consists "Swallow_engraver"; } \consists "Vertical_align_engraver"; + \consists "Line_group_engraver"; } orchestral_score_translator = \requesttranslator { diff --git a/init/midi.ly b/init/midi.ly index f10856a128..0ee376eac4 100644 --- a/init/midi.ly +++ b/init/midi.ly @@ -1,5 +1,6 @@ +\include "performer.ly" default_midi = \midi { \tempo 4:60; - \include "performer.ly" + \requesttranslator{ \default_midi_perf } } diff --git a/init/paper16.ly b/init/paper16.ly index fd19f6e03e..04e0bb2855 100644 --- a/init/paper16.ly +++ b/init/paper16.ly @@ -9,8 +9,8 @@ default_paper = \paper { interline = 4.\pt; notewidth = 5.0\pt; wholewidth = 4.8\pt; - unitspace = 30.\pt; - basicspace = 5.0\pt; + unitspace = 22.\pt; + basicspace = 4.\pt; % interbeam = 2.667\pt; diff --git a/init/performer.ly b/init/performer.ly index fa184d11e7..27fbcea67e 100644 --- a/init/performer.ly +++ b/init/performer.ly @@ -1,30 +1,46 @@ % % setup for Request->Element conversion. Guru-only % +staff_perf = \requesttranslator { + Performer "Staff_performer" + \alias "Staff"; -\requesttranslator { + \contains\requesttranslator{ + Performer "Performer_group_performer" + \alias "Voice_group"; + \contains\requesttranslator{ + Performer "Performer_group_performer" + \consists "Note_performer"; + } + } + \consists "Key_performer"; + \consists "Meter_performer"; + } + +default_midi_perf = \requesttranslator { Performer "Score_performer" \alias "Score"; -% \consists "Clef_performer"; -% \consists "Key_performer"; -% \consists "Meter_performer"; + % \consists "Tempo_performer"; - \contains\requesttranslator { + \contains \requesttranslator{ \staff_perf } + \contains\requesttranslator{ + Performer "Performer_group_performer" + \alias "Piano"; + \contains\requesttranslator{\staff_perf} + } + \contains\requesttranslator{ Performer "Staff_performer" - \alias "Midi"; - \contains\requesttranslator{ - Performer "Voice_group_performer" - \alias "Voice_group"; + \alias "Lyric"; + \contains\requesttranslator { + Performer "Performer_group_performer" \contains\requesttranslator{ Performer "Performer_group_performer" \consists "Lyric_performer"; - \consists "Note_performer"; - } } - \consists "Key_performer"; \consists "Meter_performer"; - \consists "Swallow_performer"; } + \consists "Swallow_performer"; } + diff --git a/init/table16.ly b/init/table16.ly index c64b5fc399..ebc9c375a4 100644 --- a/init/table16.ly +++ b/init/table16.ly @@ -101,6 +101,7 @@ table_sixteen= "|" "\maatstreep{%}" 0.0\pt 0.64\pt 0.0\pt 16.0\pt "||" "\doublebar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt "|." "\finishbar{%}" -4.0\pt 0.0\pt 0.0\pt 16.0\pt + ".|" "\startbar{%}" 0.0\pt 4.0\pt 0.0\pt 16.0\pt ":|" "\repeatbar" -8.0\pt 0.0\pt 0.0\pt 16.0\pt "|:" "\startrepeat" 0.0\pt 8.0\pt 0.0\pt 16.0\pt ":|:" "\repeatbarstartrepeat" 0.0\pt 16.0\pt 0.0\pt 16.0\pt diff --git a/input/beams.ly b/input/beams.ly index 24753a131d..ff17863b40 100644 --- a/input/beams.ly +++ b/input/beams.ly @@ -12,58 +12,57 @@ EndMudelaHeader %} \score{ - \staff{ \inputregister{melodicregs} - \melodic{ \octave c'; + \melodic <\multi 3; + { \octave c'; \meter 8/4; \duration8; - \stem 1; [c c'' a' f'] + \stem \up; [c c'' a' f'] \duration16; - \stem 1; [c c'' a' f'] + \stem \up; [c c'' a' f'] \duration32; - \stem 1; [c c'' a' f'] + \stem \up; [c c'' a' f'] \duration64; - \stem 1; [c c'' a' f'] + \stem \up; [c c'' a' f'] \duration128; - \stem 1; [c c'' a' f'] + \stem \up; [c c'' a' f'] \duration 8; - \stem 1; ['g 'g 'g 'g] + \stem \up; ['g 'g 'g 'g] \duration 16; - \stem 1; ['g 'g 'g 'g] + \stem \up; ['g 'g 'g 'g] \duration 32; - \stem 1; ['g 'g 'g 'g] + \stem \up; ['g 'g 'g 'g] \duration 64; - \stem 1; ['g 'g 'g 'g] + \stem \up; ['g 'g 'g 'g] \duration 128; - \stem 1; ['g 'g 'g 'g] + \stem \up; ['g 'g 'g 'g] } - } - \staff{ \inputregister{melodicregs} - \melodic{ \octave c'; + + { \octave c'; \meter 8/4; \duration8; - \stem -1; [a' 'a c e] + \stem \down; [a' 'a c e] \duration16; - \stem -1; [a' 'a c e] + \stem \down; [a' 'a c e] \duration32; - \stem -1; [a' 'a c e] + \stem \down; [a' 'a c e] \duration64; - \stem -1; [a' 'a c e] + \stem \down; [a' 'a c e] \duration128; - \stem -1; [a' 'a c e] + \stem \down; [a' 'a c e] \octave c; \duration 8; - \stem -1; [d'' d'' d'' d''] + \stem \down; [d'' d'' d'' d''] \duration 16; - \stem -1; [d'' d'' d'' d''] + \stem \down; [d'' d'' d'' d''] \duration 32; - \stem -1; [d'' d'' d'' d''] + \stem \down; [d'' d'' d'' d''] \duration 64; - \stem -1; [d'' d'' d'' d''] + \stem \down; [d'' d'' d'' d''] \duration 128; - \stem -1; [d'' d'' d'' d''] + \stem \down; [d'' d'' d'' d''] } - } - \paper{} -} + >} + + diff --git a/input/cadenza.ly b/input/cadenza.ly index a2110f3462..23b94fce90 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -13,7 +13,8 @@ EndMudelaHeader \version "0.1.0"; -cad = \melodic { +\score { + \melodic {\id "Staff" "french horn"; \cadenza 1; \grouping 1*4;\duration 8;\octave c'; @@ -55,12 +56,10 @@ cad = \melodic { c4 } -\score { - \melodic{ \cad } \paper { unitspace= 14.0\mm; geometric= 1.4; } -% \midi { \tempo 4:90 } + \midi { \tempo 4:90; } } diff --git a/input/collisions.ly b/input/collisions.ly index 9bde8122fb..d281dc0e74 100644 --- a/input/collisions.ly +++ b/input/collisions.ly @@ -16,41 +16,41 @@ EndMudelaHeader two_voice = \melodic < \multi 2; - { \octave c'; \stem -1; + { \octave c'; \stem \down; c4 d e f g2~ g4 a [c8 d e f] c2| } - { \stem 1; + { \stem \up; g4 f e g ~ g2 g2 c4 g4 g2 } > two_voice_steminvert = \melodic < \multi 2; - { \octave c'; \stem 1; + { \octave c'; \stem \up; % the f and g on 4th beat are exceptionally ugh. c4 d e f g2 g4 a | } - { \stem -1; + { \stem \down; g4 f e g g2 g2 } > three_voice = \melodic < \multi 2; - { \stem 1; + { \stem \up; g4 f e f g a g2 } - { \hshift 1; \stem 1; + { \hshift 1; \stem \up; e2 e2 e2 e2 } - { \stem -1; + { \stem \down; c4 d e d c d es } > rests = \melodic < \multi 2; - { \stem 1; + { \stem \up; | r8 r r r r r r r [c' b a g] [f e d c] } - { \stem -1; + { \stem \down; [c8 d e f] [g a b c'] r r r r r r r r } @@ -59,12 +59,12 @@ rests = \melodic restsII = \melodic { \octave c'; < \multi2; - { \stem 1; g' f' e' d' c' b a g f e d c } - { \stem -1; r r r r r r r r r r r r } + { \stem \up; g' f' e' d' c' b a g f e d c } + { \stem \down; r r r r r r r r r r r r } > < \multi2; - { \stem 1; r r r r r r r r r r r r } - { \stem -1; c d e f g a b c' d' e' f' g' } + { \stem \up; r r r r r r r r r r r r } + { \stem \down; c d e f g a b c' d' e' f' g' } > r8 r4 < \multi2; r8 r8 > @@ -72,10 +72,10 @@ restsII = \melodic { < \multi2; r8 r8 r8 r8 > < \multi2; r r > < \multi2; r r r > - \stem 1; + \stem \up; [c''8 r8 c''8 c''8] [c8 r8 c8 c8] - \stem -1; + \stem \down; [c8 r8 c8 c8] [c''8 r8 c''8 c''8] } diff --git a/input/coriolan-alto.ly b/input/coriolan-alto.ly index 439ccfb0f6..ac772fdf9f 100644 --- a/input/coriolan-alto.ly +++ b/input/coriolan-alto.ly @@ -1,3 +1,4 @@ +% remark: still temporarily broken. %{MudelaHeader filename: coriolan-alto.ly diff --git a/input/error.ly b/input/error.ly deleted file mode 100644 index 118dba144d..0000000000 --- a/input/error.ly +++ /dev/null @@ -1,39 +0,0 @@ -\version "0.0.58"; - -\include "this-is-hopefully-a-nonexisting-file" - - - -mwa = \melodic{ - \meter 3/4; - [ a8 a8 a8 a8 a8 ] % - [ a8 ] % -% segfault - < { [ bes^"1"~ a bes-. g-. ] a4-.^"4" } { [ e ] } { [ c ] } > | - a ) b ] c % warning - & % ok; error - a b ) ] % ok; error -% a......... % fatal error -- assert - a b c - |.| % - abc % ok; print error, no \output - \bla % STRING, reduced to lyric_elt. - a [ b % warning, still \output - < a( b > % warning, still \output - a b ,c - a b c-* - a b c& - < a-. b-. > - -} - -bla = \lyric{ - These Gates will open just like windows. % ok; warning -} - - -\include "this-is-hopefully-a-nonexisting-file" -\score{ - \staff{ bla } - \staff{ mwa } -} diff --git a/input/multi.ly b/input/multi.ly index 7113cfb4a0..141d191a9e 100644 --- a/input/multi.ly +++ b/input/multi.ly @@ -18,7 +18,7 @@ EndMudelaHeader \melodic { \octave c'; c4 c4 < \multi 1; { c2 c2 } { c'2 c'2 } > - < \multi 2; { \stem -1; c2 c2 } { \stem 1; c'2 c'2 } > + < \multi 2; { \stem \down; c2 c2 } { \stem \up; c'2 c'2 } > < \multi 3; { \clef "bass"; c2 c2 } { \meter 2/4;\bar "||"; \key fis cis gis; c'2 c'2 } > c2 c1 c1 c1 diff --git a/input/scsii-menuetto.ly b/input/scsii-menuetto.ly index 64e7a17ae0..1c69f21f99 100644 --- a/input/scsii-menuetto.ly +++ b/input/scsii-menuetto.ly @@ -60,15 +60,15 @@ IImenuetto = \melodic{ < [ e'8 g > d' cis'_"2" e' a~ g ] | %%11 < \multi 2; - {\stem 1; a4~ d'4 cis'4-. } - { \stem -1; f2 e4 } > | + {\stem \up; a4~ d'4 cis'4-. } + { \stem \down; f2 e4 } > | %%12 < [ g'8^"4" d > f' e' f' d'^"3"~ c' ] | %%13 \clef "alto"; < \multi 2; - { \stem 1; bes2 c'4 } - { \stem -1; g4~ f4 e4 }% ugh + { \stem \up; bes2 c'4 } + { \stem \down; g4~ f4 e4 }% ugh > | %%14 < [ a8 f > g a f ] < d'4-\upbow e4 'bes4 > | @@ -86,8 +86,8 @@ IImenuetto = \melodic{ < { [ c'8 ( bes a )bes g~ bes ] } { [ d ] } { [ g ] } > | %%21 < \multi 2; - {\stem 1; d'4 (\stem 1; ) cis'4 d'4 } - { \stem -1; g2 f4 } + {\stem \up; d'4 (\stem \up; ) cis'4 d'4 } + { \stem \down; g2 f4 } > | %%22 < { [ g8 ~ f g e ] } { [ cis ] } > < f4 d4 > | diff --git a/input/slurs.ly b/input/slurs.ly index 107809130c..87223a1b04 100644 --- a/input/slurs.ly +++ b/input/slurs.ly @@ -29,8 +29,8 @@ EndMudelaHeader { e ~ f } > < \multi 2; - { \stem 1; c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c } - { \stem -1; c (e g )c'~( [b a g )d] r2 } + { \stem \up; c'8 ~g ~e( ~c~ [c'~ g' e' )c'] c'' ~ c'' c~c } + { \stem \down; c (e g )c'~( [b a g )d] r2 } > } diff --git a/input/standchen.ly b/input/standchen.ly index 34faff618c..1769e18564 100644 --- a/input/standchen.ly +++ b/input/standchen.ly @@ -152,8 +152,8 @@ melodie = \melodic{ %%48 \textstyle "italic"; < - { fis2.~ \group "+1"; \stem -1; f2. } - { d'2. ~ \stem 1; d'4 r4_"decresc." d'4 } + { fis2.~ \group "+1"; \stem \down; f2. } + { d'2. ~ \stem \up; d'4 r4_"decresc." d'4 } > \textstyle "roman"; | %%50 @@ -199,13 +199,13 @@ begeleiding = \melodic{ ''a r4 | %%5 \duration 8; - < \multi 2; { \stem 1; + < \multi 2; { \stem \up; [ 'f 'a d 'a d 'a ] [ 'd 'e 'g 'e 'g 'e ] [ 'cis 'e 'g 'e 'g e ] [ 'd 'a d 'a d 'a ] } - { \stem -1; + { \stem \down; 'd2 r4 ''bes2 r4 ''a2 r4 @@ -217,12 +217,12 @@ begeleiding = \melodic{ [ 'd 'a d 'a d 'a ] | %%11 < \multi 2; - { \stem 1; + { \stem \up; [ 'f 'a d 'a d 'a ] [ 'd 'e 'g 'e 'g 'e ] [ 'e 'g 'bes 'g 'bes 'g ] [ 'a c f c f c ] - } { \stem -1; + } { \stem \down; 'd2 r4 ''bes2 r4 'c2 r4 @@ -233,10 +233,10 @@ begeleiding = \melodic{ %%16 [ ''f 'c 'f 'c 'f 'c ] | < \multi 2; - { \stem 1; + { \stem \up; [ ''a 'e 'g 'e 'g 'e ][ 'd 'a d 'a d 'a ] [ ''bes 'f 'bes 'f 'bes 'f ][ ''f 'c 'f 'c 'f 'c ] } - { \stem -1; + { \stem \down; ''a2 r4 'd2 r4 ''bes2 r4 @@ -247,13 +247,13 @@ begeleiding = \melodic{ %%22 [ 'f 'a c 'a 'f 'c ] | < \multi 2; { - \stem 1; + \stem \up; [ ''a 'e 'g 'e 'g 'e ] [ 'd 'fis 'a 'fis 'a 'fis ] [ ''g 'd 'b 'd 'b 'd ] [ 'd 'a d 'a d 'a ] } - {\stem -1; + {\stem \down; ''a2 r4 'd2 r4 ''g2 r4 @@ -298,11 +298,11 @@ begeleiding = \melodic{ %%44 < [ 'd ''b > 'fis 'b 'fis 'b 'fis ] | %%45 - < \multi 2; { \stem 1; + < \multi 2; { \stem \up; [ ''g 'd 'b 'd 'b 'd ] [ 'd 'a d 'a d 'a ] } { - \stem -1; + \stem \down; ''g2 r4 'd2 r4 } > diff --git a/input/toccata-fuga-E.ly b/input/toccata-fuga-E.ly index 6e5746e725..a1d59b84c9 100644 --- a/input/toccata-fuga-E.ly +++ b/input/toccata-fuga-E.ly @@ -32,9 +32,9 @@ toccata_right = \melodic{ % 13 -- how to type -- where to split -- this more neatly ? \octave c'; <\multi 2; - { \stem 1; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 } - { \stem 1; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 } - { \stem -1; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 } + { \stem \up; r4 dis'4 e'4.-. e'8( | \hshift 1; )e'4 [d'8 fis'8] \hshift 0; gis'4 [gis'8 fis'16 e'16] | fis'4~ [fis'8 e'16 dis'16] e'4 r8 e'8 } + { \stem \up; \hshift 1; r4 bis4 cis'4-. cis'4 | \hshift 0; a'4~ [a'16 gis'16 a'16 b'16] \hshift 1; dis'4 cis'4~ [cis'8 dis'16 a16] bis4 cis'4 r8 b8 } + { \stem \down; r4 < gis4 fis4 dis4 > gis4-. gis4 | a4. cis'8 gis2 | fis4 gis4 gis4 r8 e8 } > | % 16 } @@ -45,9 +45,9 @@ toccata_left = \melodic{ \clef bass; % 13 <\multi 2; - { \stem 1; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 } - { \stem 1; \hshift 1; r4 gis4. gis8~ gis4 | \stem -1; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 } - { \stem -1; r4 < dis4 fis4 > < cis4 e4 > } + { \stem \up; bis2 cis'4-. cis'4~ [cis'8 a8 d'8 cis'8] [bis8 gis8] cis'4 | dis'2 cis'4 r8 cis'8 } + { \stem \up; \hshift 1; r4 gis4. gis8~ gis4 | \stem \down; \hshift 0; a4. fis8 gis4. a8~ a4 gis4-. gis4 r8 gis8 } + { \stem \down; r4 < dis4 fis4 > < cis4 e4 > } > | % 16 } @@ -75,8 +75,8 @@ fuga2_right = \melodic{ % 15 \octave c'; <\multi 2; - { \stem 1; [b8 fis8] b4 } - { \stem -1; fis2 } + { \stem \up; [b8 fis8] b4 } + { \stem \down; fis2 } > %{ this chord is usually set like this: | @@ -87,16 +87,16 @@ fuga2_right = \melodic{ | %} < \multi 2; - { \stem 1; \hshift 0; e'4 } - { \stem 1; \hshift 1; cis'4 } - { \stem 1; \hshift 2; ais4 } - { \stem -1; fis4 } + { \stem \up; \hshift 0; e'4 } + { \stem \up; \hshift 1; cis'4 } + { \stem \up; \hshift 2; ais4 } + { \stem \down; fis4 } > | % 16 <\multi 2; - { \stem 1; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] } - { \stem 1; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 } - { \stem -1; fis2.~ fis2.~ fis4 e2 } + { \stem \up; dis'2 dis'4 | cis'2 cis'4 | b4~ [b8 cis'8 dis'8 e'8] } + { \stem \up; \hshift 1; [b8 fis8] b2~ [b8 a16 g16] a2 | a4 gis2 } + { \stem \down; fis2.~ fis2.~ fis4 e2 } > | % 19 } @@ -108,8 +108,8 @@ fuga2_left = \melodic{ % 15 b2 <\multi 2; - { \stem 1; ais4 | bes2. } - { \stem -1; e4 | fis2 fis4 } + { \stem \up; ais4 | bes2. } + { \stem \down; e4 | fis2 fis4 } > % 17 cis'2 e'4 | diff --git a/input/wohltemperirt.ly b/input/wohltemperirt.ly index 5fa5b63007..49d0062a91 100644 --- a/input/wohltemperirt.ly +++ b/input/wohltemperirt.ly @@ -25,7 +25,7 @@ dux = \clef "violin"; \octave c'; - \stem -1; + \stem \down; r8 [c'16 b] [c'8 g] [as c'16 b] [c'8 d'] | [g c'16 b] [c'8 d'] [f16 g] as4 [g16 f] | [es c' b a] [g f! es d] [c8 es' d' c'] | @@ -71,7 +71,7 @@ dux = comes = \melodic { \octave c''; - \stem 1; + \stem \up; r1 | r1 | r8 [g16 fis] [g8 c] [es g16 fis] [g8 a] | @@ -153,8 +153,8 @@ bassdux = [d c g G] %% 30 < \multi 2; - { \stem 1; c2~ | c1~ | c1 } - { \stem -1; C2~ | C1~ | C1 } + { \stem \up; c2~ | c1~ | c1 } + { \stem \down; C2~ | C1~ | C1 } > } diff --git a/lily/Makefile b/lily/Makefile index 23145c0b40..65065454be 100644 --- a/lily/Makefile +++ b/lily/Makefile @@ -16,7 +16,7 @@ depth = .. # include Stable.make include ./$(depth)/make/Variables.make -include .version +include VERSION # # identify module: @@ -33,7 +33,7 @@ SUBDIRS = include # list of distribution files: # -EXTRA_DISTFILES = .version +EXTRA_DISTFILES = VERSION # # list of custom libraries: diff --git a/lily/.version b/lily/VERSION similarity index 90% rename from lily/.version rename to lily/VERSION index 98ec990eb1..21c1e02238 100644 --- a/lily/.version +++ b/lily/VERSION @@ -1,6 +1,6 @@ MAJOR_VERSION = 0 MINOR_VERSION = 0 -PATCH_LEVEL = 77 +PATCH_LEVEL = 78 # use to send patches, always empty for released version: # include separator: ".postfix", "-pl" makes rpm barf diff --git a/lily/crescendo.cc b/lily/crescendo.cc index 8de7d68759..df349421bb 100644 --- a/lily/crescendo.cc +++ b/lily/crescendo.cc @@ -44,7 +44,6 @@ Crescendo::get_symbol()const warning("Crescendo too small"); w_dim = 0; } -// Real lookup_wid = w_dim * 0.9; // make it slightly smaller. return Symbol( paper()->lookup_l()->hairpin( w_dim, grow_dir_i_ < 0) ); } diff --git a/lily/debug.cc b/lily/debug.cc index 4b95a38519..3d046bd414 100644 --- a/lily/debug.cc +++ b/lily/debug.cc @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "debug.hh" #include "dstream.hh" diff --git a/lily/engraver-group.cc b/lily/engraver-group.cc index 50a3c60568..a1a77d7da1 100644 --- a/lily/engraver-group.cc +++ b/lily/engraver-group.cc @@ -14,6 +14,7 @@ #include "p-score.hh" #include "score-elem.hh" #include "input-translator.hh" + Engraver* get_engraver_p(String); Engraver_group_engraver::~Engraver_group_engraver() @@ -31,7 +32,6 @@ Engraver_group_engraver::check_removal() else i++; } - } bool @@ -42,7 +42,7 @@ Engraver_group_engraver::removable_b()const Engraver_group_engraver::Engraver_group_engraver() { - itrans_l_ =0; + itrans_l_ = 0; } void diff --git a/lily/include/bar-grav.hh b/lily/include/bar-grav.hh index d65c26930b..f159d2973a 100644 --- a/lily/include/bar-grav.hh +++ b/lily/include/bar-grav.hh @@ -19,7 +19,7 @@ class Bar_engraver : public Engraver { Bar * bar_p_; public: Bar_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: diff --git a/lily/include/bar.hh b/lily/include/bar.hh index ccef49e2bf..9a7a8b92b6 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -15,7 +15,7 @@ public: String type_str_; int spanned_i_; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Bar); Bar(); private: diff --git a/lily/include/beam.hh b/lily/include/beam.hh index bd0c2550a9..1e6a36fe15 100644 --- a/lily/include/beam.hh +++ b/lily/include/beam.hh @@ -24,7 +24,7 @@ public: /* *************** */ - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Beam(); void add(Stem*); diff --git a/lily/include/bow.hh b/lily/include/bow.hh index c69214a542..e483c36ac2 100644 --- a/lily/include/bow.hh +++ b/lily/include/bow.hh @@ -25,7 +25,7 @@ protected: Molecule*brew_molecule_p()const; public: Bow(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Offset center() const; }; #endif // BOW_HH diff --git a/lily/include/break-align-item.hh b/lily/include/break-align-item.hh index 7e0e632b01..6ef6818b3d 100644 --- a/lily/include/break-align-item.hh +++ b/lily/include/break-align-item.hh @@ -18,7 +18,7 @@ class Break_align_item : public Horizontal_align_item { protected: virtual void do_pre_processing(); public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Break_align_item); }; diff --git a/lily/include/clef-grav.hh b/lily/include/clef-grav.hh index ec35bf0b5a..2f974eeadb 100644 --- a/lily/include/clef-grav.hh +++ b/lily/include/clef-grav.hh @@ -34,7 +34,7 @@ public: /* ************** */ Clef_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // CLEF_HH diff --git a/lily/include/clef-item.hh b/lily/include/clef-item.hh index 162cf813eb..face7e818d 100644 --- a/lily/include/clef-item.hh +++ b/lily/include/clef-item.hh @@ -27,7 +27,7 @@ public: bool default_b_; /* *************** */ - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Clef_item); Clef_item(); void read(Clef_engraver const&); diff --git a/lily/include/collision-grav.hh b/lily/include/collision-grav.hh index 4500a72617..be3880de62 100644 --- a/lily/include/collision-grav.hh +++ b/lily/include/collision-grav.hh @@ -20,6 +20,6 @@ protected: virtual void do_pre_move_processing(); public: Collision_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // COLLISION_GRAV_HH diff --git a/lily/include/collision.hh b/lily/include/collision.hh index 62cee06041..3891a5a0c1 100644 --- a/lily/include/collision.hh +++ b/lily/include/collision.hh @@ -23,7 +23,7 @@ protected: virtual void do_pre_processing(); public: Link_array clash_l_arr_; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; void add (Note_column*ncol_l); Collision(); diff --git a/lily/include/const.hh b/lily/include/const.hh index 9c2f3f9ccc..80342a4450 100644 --- a/lily/include/const.hh +++ b/lily/include/const.hh @@ -6,7 +6,5 @@ #include #include "real.hh" -const Real EPS=1e-7; // qlpsolve.hh -const int MAXITER=100; // qlpsolve.hh const Real INFTY=HUGE_VAL; #endif diff --git a/lily/include/crescendo.hh b/lily/include/crescendo.hh index 0ebf499cdf..4539ac209c 100644 --- a/lily/include/crescendo.hh +++ b/lily/include/crescendo.hh @@ -29,7 +29,7 @@ protected: SCORE_ELEM_CLONE(Crescendo); virtual Molecule*brew_molecule_p()const; virtual Interval symbol_height()const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; private: Symbol get_symbol()const; diff --git a/lily/include/dynamic-grav.hh b/lily/include/dynamic-grav.hh index 5c1a585ca5..389a468466 100644 --- a/lily/include/dynamic-grav.hh +++ b/lily/include/dynamic-grav.hh @@ -23,7 +23,7 @@ class Dynamic_engraver : public Engraver { public: Dynamic_engraver(); ~Dynamic_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void acknowledge_element(Score_elem_info); virtual bool do_try_request(Request *req_l); diff --git a/lily/include/elem-group-item.hh b/lily/include/elem-group-item.hh index ce7b75e41a..a3e1ea6d16 100644 --- a/lily/include/elem-group-item.hh +++ b/lily/include/elem-group-item.hh @@ -15,14 +15,14 @@ class Horizontal_vertical_group_item : public Item, public Horizontal_vertical_group { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Horizontal_vertical_group_item); protected: virtual void do_print() const; }; class Horizontal_group_item : public Item, public Horizontal_group { - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Horizontal_group_item); protected: virtual void do_print() const { Elbement_group::do_print(); } diff --git a/lily/include/elem-group.hh b/lily/include/elem-group.hh index 245b2dfcf1..650dc613ce 100644 --- a/lily/include/elem-group.hh +++ b/lily/include/elem-group.hh @@ -20,13 +20,13 @@ public: Elbement_group(); bool contains_b(Score_elem const *)const; void add_element(Score_elem*); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; class Horizontal_group : public Elbement_group { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Horizontal_group(Horizontal_group const&); Horizontal_group(){} void add_element(Score_elem*); @@ -47,7 +47,7 @@ protected: public: Vertical_group(Vertical_group const &); Vertical_group(){} - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; /** A class to treat a group of elements as a single entity. The @@ -62,7 +62,7 @@ protected: public: Horizontal_vertical_group(); bool contains_b(Score_elem const *)const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual void do_substitute_dependency(Score_elem*,Score_elem*); virtual void do_print() const; void add_element(Score_elem*); diff --git a/lily/include/engraver-group.hh b/lily/include/engraver-group.hh index 7e2b9b21b5..96e67feaa8 100644 --- a/lily/include/engraver-group.hh +++ b/lily/include/engraver-group.hh @@ -53,7 +53,7 @@ public: */ virtual void terminate_engraver(Engraver * grav_l); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; /** Remove #grav_l# from the list, and return it. diff --git a/lily/include/engraver.hh b/lily/include/engraver.hh index 5047877145..52cd3bd7ea 100644 --- a/lily/include/engraver.hh +++ b/lily/include/engraver.hh @@ -134,7 +134,7 @@ public: Engraver(); virtual ~Engraver(){} - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; void print() const; }; diff --git a/lily/include/general-script-def.hh b/lily/include/general-script-def.hh index 5c9dac12bc..acaa554019 100644 --- a/lily/include/general-script-def.hh +++ b/lily/include/general-script-def.hh @@ -19,7 +19,7 @@ class General_script_def : public Input { public: VIRTUAL_COPY_CONS(General_script_def,General_script_def); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual int staff_dir_i()const; void print() const; virtual int rel_stem_dir_i()const; diff --git a/lily/include/global-translator.hh b/lily/include/global-translator.hh index 3faa9e4eea..112392a670 100644 --- a/lily/include/global-translator.hh +++ b/lily/include/global-translator.hh @@ -30,7 +30,7 @@ public: virtual void finish() {} virtual void start() {} - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual Global_translator *global_l() { return this; } diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh index ea5e9a7531..77065d84cb 100644 --- a/lily/include/head-column.hh +++ b/lily/include/head-column.hh @@ -30,7 +30,7 @@ public: void add(Script*s) { Script_column::add(s) ; } virtual void set(Stem*); Head_column(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: diff --git a/lily/include/head-grav.hh b/lily/include/head-grav.hh index c7522c5005..2a5b2be280 100644 --- a/lily/include/head-grav.hh +++ b/lily/include/head-grav.hh @@ -19,7 +19,7 @@ struct Note_head_engraver : Engraver { virtual void do_process_requests(); virtual void do_pre_move_processing(); virtual void do_post_move_processing(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; diff --git a/lily/include/horizontal-align-item.hh b/lily/include/horizontal-align-item.hh index e12eae39bc..639ce1b22e 100644 --- a/lily/include/horizontal-align-item.hh +++ b/lily/include/horizontal-align-item.hh @@ -32,7 +32,7 @@ public: */ int align_i_; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Horizontal_align_item); void add(Item*, int p); Horizontal_align_item(); diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index c2c5eebe7a..2088c841f7 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -28,7 +28,7 @@ struct Identifier : public Input { virtual ~Identifier() ; void print()const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; void error(String); IDACCESSOR(Input_translator, input_translator) IDACCESSOR(Music, music) @@ -50,7 +50,7 @@ private: #define declare_id_class(Idclass, Class, accessor) \ struct Idclass : Identifier {\ - NAME_MEMBERS(); \ + DECLARE_MY_RUNTIME_TYPEINFO; \ Idclass(String s, Class*st, int code);\ virtual Class* accessor(bool copy);\ ~Idclass();\ diff --git a/lily/include/ineq-constrained-qp.hh b/lily/include/ineq-constrained-qp.hh new file mode 100644 index 0000000000..161bc51f46 --- /dev/null +++ b/lily/include/ineq-constrained-qp.hh @@ -0,0 +1,72 @@ +/* + ineq-constrained-qp.hh -- declare Ineq_constrained_qp + + source file of the GNU LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef INEQ_CONSTRAINED_QP_HH +#define INEQ_CONSTRAINED_QP_HH + + + +#include "matrix.hh" + +/// inequality constrained quadratic program +class Ineq_constrained_qp { + friend class Active_constraints; + + Array cons; + Array consrhs; +public: + Matrix quad; + Vector lin; + Real const_term; + + + /** + use a KKT method to assert optimality of sol + */ + void assert_solution(Vector sol) const; + /// solve the problem using a projected gradient method + Vector solve(Vector start) const; + + /** + @return the number of variables in the problem + */ + int dim() const{ + return lin.dim(); + } + + /** + add a constraint + + + c*vars >= r + + PRE + c.dim() == dim(); + + */ + void add_inequality_cons(Vector c, double r); + + /** set up matrices to go with the problem. */ + Ineq_constrained_qp(int novars); + + /** + evaluate the quadratic function for input #v# + */ + Real eval(Vector v); + + void eliminate_var(int idx, Real value); + void OK()const; + void print() const; + +}; + +// ugh +const Real EPS=1e-7; + +#endif // INEQ_CONSTRAINED_QP_HH diff --git a/lily/include/item.hh b/lily/include/item.hh index 109a9c8191..6f3eb6a7cb 100644 --- a/lily/include/item.hh +++ b/lily/include/item.hh @@ -38,7 +38,7 @@ public: virtual Item *item() { return this; } Item(); Real hpos_f() const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual Line_of_score * line_l() const; protected: virtual void do_breakable_col_processing(); diff --git a/lily/include/key-grav.hh b/lily/include/key-grav.hh index d62345ab1b..7b54214892 100644 --- a/lily/include/key-grav.hh +++ b/lily/include/key-grav.hh @@ -27,7 +27,7 @@ struct Key_engraver : Engraver { virtual void do_post_move_processing(); virtual void acknowledge_element(Score_elem_info); Key_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; private: void create_key(); diff --git a/lily/include/key-item.hh b/lily/include/key-item.hh index 759e6d1123..a1ab3dc6d4 100644 --- a/lily/include/key-item.hh +++ b/lily/include/key-item.hh @@ -20,7 +20,7 @@ struct Key_item : Item { /* *************** */ - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Key_item); Key_item(int cposition); diff --git a/lily/include/key-performer.hh b/lily/include/key-performer.hh index a14c19cc56..6b1cba48f8 100644 --- a/lily/include/key-performer.hh +++ b/lily/include/key-performer.hh @@ -14,7 +14,7 @@ class Key_performer : public Performer { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Key_performer(); ~Key_performer(); diff --git a/lily/include/line-group-grav.hh b/lily/include/line-group-grav.hh index bb43f6d2d9..e7153be0f5 100644 --- a/lily/include/line-group-grav.hh +++ b/lily/include/line-group-grav.hh @@ -1,5 +1,5 @@ /* - line-group-grav.hh -- declare + line-group-grav.hh -- declare Line_group_engraver source file of the GNU LilyPond music typesetter @@ -24,7 +24,7 @@ protected: virtual void acknowledge_element(Score_elem_info); public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Line_group_engraver(); }; diff --git a/lily/include/local-key-grav.hh b/lily/include/local-key-grav.hh index cc52ed5f8f..0530099634 100644 --- a/lily/include/local-key-grav.hh +++ b/lily/include/local-key-grav.hh @@ -24,7 +24,7 @@ struct Local_key_engraver : Engraver { virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); Local_key_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // LOCALKEYGRAV_HH diff --git a/lily/include/local-key-item.hh b/lily/include/local-key-item.hh index a80e44196e..2d4ed66e8f 100644 --- a/lily/include/local-key-item.hh +++ b/lily/include/local-key-item.hh @@ -23,7 +23,7 @@ struct Local_acc { update item if Items are removed */ struct Local_key_item : Item { - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Array accs; Link_array support_items_; int c0_position; diff --git a/lily/include/lyric-engraver.hh b/lily/include/lyric-engraver.hh index 9c1aefadac..8e18c8ed6a 100644 --- a/lily/include/lyric-engraver.hh +++ b/lily/include/lyric-engraver.hh @@ -23,7 +23,7 @@ protected: virtual void do_process_requests(); virtual void do_post_move_processing(); public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Lyric_engraver(); }; #endif // LYRIC_ENGRAVER_HH diff --git a/lily/include/lyric-performer.hh b/lily/include/lyric-performer.hh index cd07a96fde..c0321c2839 100644 --- a/lily/include/lyric-performer.hh +++ b/lily/include/lyric-performer.hh @@ -16,7 +16,7 @@ class Lyric_performer : public Performer { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Lyric_performer(); ~Lyric_performer(); diff --git a/lily/include/meter-grav.hh b/lily/include/meter-grav.hh index d2f25ec2cd..d1085f63fe 100644 --- a/lily/include/meter-grav.hh +++ b/lily/include/meter-grav.hh @@ -31,6 +31,6 @@ public: virtual void do_creation_processing(); virtual void do_post_move_processing(); Meter_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // METERGRAV_HH diff --git a/lily/include/meter-performer.hh b/lily/include/meter-performer.hh index e72451d5b8..3d972c10e8 100644 --- a/lily/include/meter-performer.hh +++ b/lily/include/meter-performer.hh @@ -14,7 +14,7 @@ class Meter_performer : public Performer { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Meter_performer(); ~Meter_performer(); diff --git a/lily/include/meter.hh b/lily/include/meter.hh index 176ce6085c..eb5f2b128e 100644 --- a/lily/include/meter.hh +++ b/lily/include/meter.hh @@ -23,7 +23,7 @@ protected: Molecule*brew_molecule_p() const; public: Meter(Array args) ; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; SCORE_ELEM_CLONE(Meter); }; #endif // METER_HH diff --git a/lily/include/midi-item.hh b/lily/include/midi-item.hh index b8e1a6b8b4..ed5cf51a59 100644 --- a/lily/include/midi-item.hh +++ b/lily/include/midi-item.hh @@ -5,34 +5,59 @@ #ifndef MIDI_ITEM_HH #define MIDI_ITEM_HH + #include "string.hh" #include "lily-proto.hh" +#include "virtual-methods.hh" + +/** + Any piece of midi information. + Maybe use base classes for RIFF files? + */ struct Midi_item { + Midi_item() { } + DECLARE_MY_RUNTIME_TYPEINFO; static String i2varint_str( int i ); virtual void output_midi( Midi_stream& midi_stream_r ) const; virtual String str() const = 0; - NAME_MEMBERS(); +private: + Midi_item(Midi_item const&){} + void operator=(Midi_item const&){} }; struct Midi_key : public Midi_item { Midi_key( int accidentals_i, int minor_i ); + DECLARE_MY_RUNTIME_TYPEINFO; virtual String str() const; - NAME_MEMBERS(); /* *************** */ int accidentals_i_; int minor_i_; }; +/** + Change instrument event + */ +struct Midi_instrument : public Midi_item { + Midi_instrument( int channel_i, String instrument_str ); + DECLARE_MY_RUNTIME_TYPEINFO; + + virtual String str() const; + + int channel_i_; + Byte program_byte_; +}; + struct Midi_note : public Midi_item { /** - Generate a note-event on a channel pitch. + Generate a note-event on a channel. @param #melreq_l# is the pitch. */ Midi_note( Melodic_req* melreq_l, int channel_i, bool on_b ); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual String str() const; /* *************** */ @@ -46,20 +71,20 @@ struct Midi_note : public Midi_item { struct Midi_duration : public Midi_item { Midi_duration( Real seconds_f ); + DECLARE_MY_RUNTIME_TYPEINFO; virtual String str() const; - NAME_MEMBERS(); /* *************** */ Real seconds_f_; }; struct Midi_chunk : Midi_item { Midi_chunk(); + DECLARE_MY_RUNTIME_TYPEINFO; void add( String str ); void set( String header_str, String data_str, String footer_str ); virtual String str() const; - NAME_MEMBERS(); private: String data_str_; String footer_str_; @@ -69,7 +94,7 @@ private: struct Midi_header : Midi_chunk { /* *************** */ Midi_header( int format_i, int tracks_i, int clocks_per_4_i ); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; struct Midi_text : Midi_item { @@ -79,7 +104,8 @@ struct Midi_text : Midi_item { MARKER, CUE_POINT }; Midi_text( Midi_text::Type type, String text_str ); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; + virtual String str() const; /* *************** */ Type type_; @@ -89,7 +115,7 @@ struct Midi_text : Midi_item { struct Midi_tempo : Midi_item { Midi_tempo( int per_minute_4_i ); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual String str() const; /* *************** */ @@ -100,7 +126,7 @@ struct Midi_tempo : Midi_item { struct Midi_time : Midi_item { Midi_time( int num_i, int den_i, int clocks_per_1_i ); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual String str() const; @@ -113,11 +139,10 @@ struct Midi_time : Midi_item { struct Midi_track : Midi_chunk { int number_i_; /* *************** */ - Midi_track( ); - NAME_MEMBERS(); + Midi_track(); + DECLARE_MY_RUNTIME_TYPEINFO; void add( int delta_time_i, String event ); -// void add( Moment delta_time_moment, Midi_item& mitem_r ); void add( Moment delta_time_moment, Midi_item* mitem_l ); }; diff --git a/lily/include/music-iterator.hh b/lily/include/music-iterator.hh index 93d21e5c2a..42ad968c42 100644 --- a/lily/include/music-iterator.hh +++ b/lily/include/music-iterator.hh @@ -22,7 +22,7 @@ protected: public: Music_iterator *daddy_iter_l_; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Arrayreport_to_l_arr_; Translator *report_to_l()const; @@ -48,7 +48,7 @@ public: class Change_iterator : public Music_iterator { Change_reg * change_l_; public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; virtual void process_and_next(Moment); Change_iterator(Change_reg*); }; @@ -60,7 +60,7 @@ class Chord_iterator : public Music_iterator public: ~Chord_iterator(); Chord_iterator(Chord const*); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void do_print()const; virtual void construct_children(); @@ -75,7 +75,7 @@ class Request_chord_iterator : public Music_iterator { bool last_b_; public: Request_chord_iterator(Request_chord*); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void process_and_next(Moment); @@ -94,7 +94,7 @@ class Voice_iterator : private PCursor, public Music_iterator void next_element(); public: Voice_iterator(Voice const*); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void do_print()const; virtual void construct_children(); diff --git a/lily/include/music-list.hh b/lily/include/music-list.hh index ad745eff28..dda2f568ad 100644 --- a/lily/include/music-list.hh +++ b/lily/include/music-list.hh @@ -29,7 +29,7 @@ public: String id_str_; Music_list(Music_list const&); Music_list(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Music_list,Music); virtual void add(Music*); virtual void transpose(Melodic_req const *); @@ -47,7 +47,7 @@ protected: class Chord : public Music_list { public: Chord(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Chord,Music); virtual void translate(Moment dt); virtual MInterval time_int()const; @@ -55,7 +55,7 @@ public: class Request_chord : public Chord { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Request_chord(); VIRTUAL_COPY_CONS(Request_chord,Music); }; @@ -69,7 +69,7 @@ public: Moment offset_mom_; Voice(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Voice, Music); virtual void translate(Moment dt); virtual MInterval time_int()const; @@ -86,7 +86,7 @@ public: /// what name (or look for this name) String id_str_; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Change_reg, Music); }; #endif // MUSIC_LIST_HH diff --git a/lily/include/music.hh b/lily/include/music.hh index e90ea58a6b..196f461eeb 100644 --- a/lily/include/music.hh +++ b/lily/include/music.hh @@ -34,7 +34,7 @@ public: virtual void transpose(Melodic_req const *); virtual void translate(Moment dt); VIRTUAL_COPY_CONS(Music,Music); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Music(); protected: virtual void do_print() const; diff --git a/lily/include/note-column-grav.hh b/lily/include/note-column-grav.hh index 800550bd59..561944f00f 100644 --- a/lily/include/note-column-grav.hh +++ b/lily/include/note-column-grav.hh @@ -32,6 +32,6 @@ protected: virtual void do_post_move_processing(); public: Note_column_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // NOTE_COLUMN_GRAV_HH diff --git a/lily/include/note-column.hh b/lily/include/note-column.hh index 3065642be6..2e297e88a4 100644 --- a/lily/include/note-column.hh +++ b/lily/include/note-column.hh @@ -24,7 +24,7 @@ public: Interval_t head_positions_interval()const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Note_column(); virtual void set(Stem *); void sort(); diff --git a/lily/include/note-head.hh b/lily/include/note-head.hh index 450281825d..14cd2491a8 100644 --- a/lily/include/note-head.hh +++ b/lily/include/note-head.hh @@ -20,7 +20,7 @@ class Note_head : public Item { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; bool rest_b_; int position_i_; diff --git a/lily/include/note-performer.hh b/lily/include/note-performer.hh index cae7505685..b925617e42 100644 --- a/lily/include/note-performer.hh +++ b/lily/include/note-performer.hh @@ -15,7 +15,7 @@ class Note_performer : public Performer { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Note_performer(); ~Note_performer(); diff --git a/lily/include/performer-group-performer.hh b/lily/include/performer-group-performer.hh index b3a1239d5a..ae87b68b19 100644 --- a/lily/include/performer-group-performer.hh +++ b/lily/include/performer-group-performer.hh @@ -20,7 +20,7 @@ class Performer_group_performer : public Performer, public virtual Translator { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Input_translator* itrans_l_; Performer_group_performer(); diff --git a/lily/include/performer.hh b/lily/include/performer.hh index 55a2660c43..f9b47a6f84 100644 --- a/lily/include/performer.hh +++ b/lily/include/performer.hh @@ -17,7 +17,7 @@ class Performer { bool init_b_; public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Performer_group_performer* daddy_perf_l_; Performer(); diff --git a/lily/include/qlp.hh b/lily/include/qlp.hh index 3c026581eb..defcd3ee63 100644 --- a/lily/include/qlp.hh +++ b/lily/include/qlp.hh @@ -9,60 +9,7 @@ #ifndef QLP_HH #define QLP_HH -#include "matrix.hh" - -/// inequality constrained quadratic program -class Ineq_constrained_qp { - friend class Active_constraints; - - Array cons; - Array consrhs; -public: - Matrix quad; - Vector lin; - Real const_term; - - - /** - use a KKT method to assert optimality of sol - */ - void assert_solution(Vector sol) const; - /// solve the problem using a projected gradient method - Vector solve(Vector start) const; - - /** - @return the number of variables in the problem - */ - int dim() const{ - return lin.dim(); - } - - /** - add a constraint - - - c*vars >= r - - PRE - c.dim() == dim(); - - */ - void add_inequality_cons(Vector c, double r); - - /** set up matrices to go with the problem. */ - Ineq_constrained_qp(int novars); - - /** - evaluate the quadratic function for input #v# - */ - Real eval(Vector v); - - void eliminate_var(int idx, Real value); - void OK()const; - void print() const; - -}; - +#include "ineq-constrained-qp.hh" /** Quadratic programming with mixed linear constraints. diff --git a/lily/include/qlpsolve.hh b/lily/include/qlpsolve.hh index c7a54b1eca..56b84e2e16 100644 --- a/lily/include/qlpsolve.hh +++ b/lily/include/qlpsolve.hh @@ -9,7 +9,7 @@ #ifndef QLPSOLVE_HH #define QLPSOLVE_HH -#include "qlp.hh" + #include "matrix.hh" diff --git a/lily/include/request.hh b/lily/include/request.hh index f130120cf6..9a7055bf8f 100644 --- a/lily/include/request.hh +++ b/lily/include/request.hh @@ -29,7 +29,7 @@ public: virtual ~Request(){} - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; VIRTUAL_COPY_CONS(Request,Music); virtual MInterval time_int() const; @@ -52,7 +52,7 @@ protected: #define REQUESTMETHODS(T,accessor) \ virtual T * accessor() { return this;}\ -NAME_MEMBERS();\ +DECLARE_MY_RUNTIME_TYPEINFO;\ VIRTUAL_COPY_CONS(T, Request);\ virtual void do_print() const diff --git a/lily/include/rest-collision-grav.hh b/lily/include/rest-collision-grav.hh index 8685aa5d7d..7a9eea4042 100644 --- a/lily/include/rest-collision-grav.hh +++ b/lily/include/rest-collision-grav.hh @@ -22,6 +22,6 @@ protected: virtual void do_pre_move_processing(); public: Rest_collision_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; }; #endif // REST_COLLISION_GRAV_HH diff --git a/lily/include/rest-collision.hh b/lily/include/rest-collision.hh index a2a39754be..56589fe14f 100644 --- a/lily/include/rest-collision.hh +++ b/lily/include/rest-collision.hh @@ -20,7 +20,7 @@ public: void add(Note_column*); void add(Rest_column*); void add(Collision*); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Rest_collision(); protected: virtual void do_post_processing(); diff --git a/lily/include/rest-column.hh b/lily/include/rest-column.hh index 86aa7f96e0..7e2db4272c 100644 --- a/lily/include/rest-column.hh +++ b/lily/include/rest-column.hh @@ -19,7 +19,7 @@ */ class Rest_column : public Head_column { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; void translate_heads(int dy); }; diff --git a/lily/include/score-align-grav.hh b/lily/include/score-align-grav.hh index fb40310ccb..4dcee6837e 100644 --- a/lily/include/score-align-grav.hh +++ b/lily/include/score-align-grav.hh @@ -20,7 +20,7 @@ public: const char* type_ch_C_; int priority_i_; Score_align_engraver(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; protected: virtual void acknowledge_element(Score_elem_info); virtual void do_pre_move_processing(); diff --git a/lily/include/score-elem.hh b/lily/include/score-elem.hh index 4bf3efd006..2adf9a8911 100644 --- a/lily/include/score-elem.hh +++ b/lily/include/score-elem.hh @@ -68,7 +68,7 @@ public: virtual ~Score_elem(); Score_elem(); - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Interval width() const; Interval height() const; diff --git a/lily/include/score-grav.hh b/lily/include/score-grav.hh index c559d25548..7a722edc2e 100644 --- a/lily/include/score-grav.hh +++ b/lily/include/score-grav.hh @@ -32,7 +32,7 @@ class Score_engraver : void typeset_all(); public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Score_engraver(); diff --git a/lily/include/score-halign-grav.hh b/lily/include/score-halign-grav.hh index 6cab304fe3..bfbc22f140 100644 --- a/lily/include/score-halign-grav.hh +++ b/lily/include/score-halign-grav.hh @@ -13,7 +13,7 @@ class Score_horizontal_align_engraver : public Engraver { Break_align_item * halign_p_; public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Score_horizontal_align_engraver(); protected: virtual void acknowledge_element(Score_elem_info); diff --git a/lily/include/score-performer.hh b/lily/include/score-performer.hh index 769edecec7..4a79cb1fb4 100644 --- a/lily/include/score-performer.hh +++ b/lily/include/score-performer.hh @@ -15,7 +15,7 @@ class Score_performer: public Performer_group_performer, public Global_translator { public: - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Score_performer(); ~Score_performer(); diff --git a/lily/include/scoreline.hh b/lily/include/scoreline.hh index 2f44031851..ef95d6d078 100644 --- a/lily/include/scoreline.hh +++ b/lily/include/scoreline.hh @@ -18,7 +18,7 @@ public: virtual String TeX_string() const; - NAME_MEMBERS(); + DECLARE_MY_RUNTIME_TYPEINFO; Line_of_score(); void add(Score_elem *); diff --git a/lily/include/script-column.hh b/lily/include/script-column.hh index 242acd4bdb..aeb9d11277 100644 --- a/lily/include/script-column.hh +++ b/lily/include/script-column.hh @@ -23,7 +23,7 @@ protected: public: Link_array