From 8de87b6ae5562b32e40154516d99ac1185f7ddc3 Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 24 Mar 2002 20:02:06 +0000 Subject: [PATCH] lilypond-0.1.41 --- flower/include/fproto.hh | 1 + flower/test/Makefile | 2 +- flower/test/main.cc | 14 ++-- flower/test/mat-test.cc | 78 +++++++++---------- flower/test/pqtest.cc | 22 +++--- flower/test/stringtest.cc | 156 ++++++++++++++++++++------------------ lily/include/axes.hh | 2 +- 7 files changed, 141 insertions(+), 134 deletions(-) diff --git a/flower/include/fproto.hh b/flower/include/fproto.hh index e09f03e3c1..694f63fed6 100644 --- a/flower/include/fproto.hh +++ b/flower/include/fproto.hh @@ -44,6 +44,7 @@ struct Directed_graph_node; struct Getopt_long; struct Matrix; struct String_data; +struct FlowerString; struct String_handle; struct String_convert; struct String; diff --git a/flower/test/Makefile b/flower/test/Makefile index 207bcd10ce..eccb972ad3 100644 --- a/flower/test/Makefile +++ b/flower/test/Makefile @@ -36,7 +36,7 @@ EXTRA_DISTFILES = result # MODULE_LIBDEPS=check-flower-deps -MODULE_LIBES = -lflower +MODULE_LIBES = -lflower # diff --git a/flower/test/main.cc b/flower/test/main.cc index 85c4cbce27..5d2e6db18f 100644 --- a/flower/test/main.cc +++ b/flower/test/main.cc @@ -5,16 +5,16 @@ Array< fptr > *test_arr_p; void reg_test (fptr f) { - if (!test_arr_p) - test_arr_p = new Array; - test_arr_p->push(f); + if (!test_arr_p) + test_arr_p = new Array; + test_arr_p->push(f); } int main() { - if (test_arr_p) { - for (int i=0; i < test_arr_p->size(); i++) - (*test_arr_p)[i] (); - } + if (test_arr_p) { + for (int i=0; i < test_arr_p->size(); i++) + (*test_arr_p)[i] (); + } } diff --git a/flower/test/mat-test.cc b/flower/test/mat-test.cc index 8fdc7d794e..1ad7af49ce 100644 --- a/flower/test/mat-test.cc +++ b/flower/test/mat-test.cc @@ -15,50 +15,50 @@ void matrix() { - int N=10; - Matrix m(N,N), q(N,N); - Vector v(N); + 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; - } + 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(); + 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/Real(i+j+1); - h2 (i,j) = (abs(i-j) > 3) ?0 : hilbert(i,j); - } + Matrix hilbert(N,N), h2(hilbert); + for (int i=0; i < N; i++) { + for (int j=0; j < N; j++) { + hilbert(i,j) = 1/Real(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; - Matrix T =ch.L.transposed(); - cout << "L^T " << T; - cout << "L * L^T" << ch.L * T; - cout << "H2^{-1} * H2" << h2 * ch.inverse(); + } + h2.try_set_band(); + Choleski_decomposition ch(h2); + cout << "red Hilbert " << h2; + cout << "choleski " << ch.L; + Matrix T =ch.L.transposed(); + cout << "L^T " << T; + cout << "L * L^T" << ch.L * T; + cout << "H2^{-1} * H2" << h2 * ch.inverse(); } ADD_TEST(matrix); diff --git a/flower/test/pqtest.cc b/flower/test/pqtest.cc index 0e086ab0ef..66838d4180 100644 --- a/flower/test/pqtest.cc +++ b/flower/test/pqtest.cc @@ -4,23 +4,23 @@ int compare(int i, int j) { - return i-j; + return i-j; } void pqtest() { - PQueue pq; + PQueue pq; - for (int i=0; i < 10; i++) { - int r = rand()/10000; - pq.insert(r); - cout << "adding: " << r<< endl; - } - while (pq.size()) { - cout << "getting : "<< flush; - cout << pq.get() << "\n"; - } + for (int i=0; i < 10; i++) { + int r = rand()/10000; + pq.insert(r); + cout << "adding: " << r<< endl; + } + while (pq.size()) { + cout << "getting : "<< flush; + cout << pq.get() << "\n"; + } } ADD_TEST(pqtest); diff --git a/flower/test/stringtest.cc b/flower/test/stringtest.cc index 163b3bbb9c..79ec1e443a 100644 --- a/flower/test/stringtest.cc +++ b/flower/test/stringtest.cc @@ -10,51 +10,57 @@ void ctors() { - cout << "constructors"< a; - a.push("abcd"); - a.push("zxy"); - a.push("abc"); - a.push(""); - a.sort(String::compare_i); - cout << "compares: "< a; + a.push("abcd"); + a.push("zxy"); + a.push("abc"); + a.push(""); + a.sort(String::compare_i); + cout << "compares: "<