Skip to content

Commit 87d53f4

Browse files
New pass to remove missing Java
1 parent 4f9bb43 commit 87d53f4

File tree

2 files changed

+43
-54
lines changed

2 files changed

+43
-54
lines changed

Integration.tex

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -546,9 +546,8 @@ \section{Evaluation of open integrals}
546546

547547
\section{Which method to chose?}
548548
\label{sec:intwhich} An example comparing the results of the three
549-
algorithms is given in section \ref{sec:sintcompar} for Smalltalk
550-
and section \ref{sec:jintcompar} for Java. The function to
551-
integrate is the inverse function in both cases. The integration
549+
algorithms is given in section \ref{sec:sintcompar} for Smalltalk.
550+
The function to integrate is the inverse function in both cases. The integration
552551
interval is from 1 to 2 so that the value of the result is known,
553552
namely $\ln 2$. Integration is carried for various values of the
554553
desired precision. The reader can then compare the attained

Introduction.tex

Lines changed: 41 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -177,17 +177,17 @@ \section{Object-oriented concepts in a nutshell}
177177
requirements.
178178
\par
179179
The code implementation of the algorithms presented in this book
180-
is given in two languages: Smalltalk and Java. Both languages are
181-
excellent object-oriented languages. I would strongly recommend
182-
people reading this book to consult the implementation sections of
183-
both languages regardless of their personal taste of language.
184-
First, I have made some effort to use of the best feature of each
185-
language. Second, each implementation has been made independently.
186-
The fact that the code of each implementation is different shows
187-
that there is indeed many ways to skin a cat, even when written by
188-
the same person. Thus, looking seriously at both implementations
189-
can be quite instructive for someone who wants to progress with
190-
the object-oriented paradigm.
180+
is given in Smalltalk, one of the best object-oriented programming language.
181+
For this book, we are using Pharo\footnote{http://www.pharo.org/}, a modern
182+
open-source implementation of Smalltalk.
183+
184+
%Both languages are excellent object-oriented languages. I would strongly
185+
%recommend people reading this book to consult the implementation sections of both languages regardless of their personal taste of language. First, I have
186+
%made some effort to use of the best feature of each language. Second, each
187+
%implementation has been made independently. The fact that the code of each
188+
%implementation is different shows that there is indeed many ways to skin a cat,
189+
%even when written by the same person. Thus, looking seriously at both
190+
%implementations can be quite instructive for someone who wants to progress with the object-oriented paradigm.
191191

192192
\section{Dealing with numerical data}
193193
The numerical methods exposed in this book are all applicable to
@@ -597,7 +597,7 @@ \section{Finding the numerical precision of a computer}
597597
the small number has been defined as the square root of the
598598
smallest number that can be represented on the machine.
599599

600-
\subsection{Computer numerical precision --- General implementation}
600+
\subsection{Computer numerical precision}
601601
The computation of the parameters only needs to be executed once.
602602
We have introduced a specific class to hold the variables
603603
described earlier and made them available to any object.
@@ -608,7 +608,6 @@ \subsection{Computer numerical precision --- General implementation}
608608
Methods in charge of computing the parameters are all prefixed
609609
with the word compute.
610610

611-
\subsection{Computer numerical precision --- Smalltalk implementation}
612611
Listing \ref{ls:floatmachine} shows the class {\tt
613612
DhbFloatingPointMachine} responsible of computing the parameters
614613
of the floating-point representation. This class is implemented as
@@ -617,8 +616,7 @@ \subsection{Computer numerical precision --- Smalltalk implementation}
617616
is given to readability.
618617

619618
\noindent The computation of the smallest and largest numbers uses
620-
exceptions\footnote{The code is using the implementation of Visual
621-
Age For Smalltalk\tm.} to detect the underflow and the overflow.
619+
exceptions to detect the underflow and the overflow.
622620

623621
\noindent The method {\tt showParameters} can be used to print the
624622
values of the parameters onto the Transcript window.
@@ -632,7 +630,7 @@ \subsection{Computer numerical precision --- Smalltalk implementation}
632630
\section{Comparing floating point numbers}
633631
It is very surprising to see how frequently questions about the
634632
lack of equality between two floating-point numbers are posted on
635-
the Smalltalk and Java electronic discussion groups. As we have
633+
the Smalltalk electronic discussion groups. As we have
636634
seen in section \ref{sec-rounding} one should always expect the
637635
result of two different computations that should have yielded the
638636
same number from a mathematical standpoint to be different using a
@@ -668,7 +666,6 @@ \section{Comparing floating point numbers}
668666
one can determine the precision of each number, then the method
669667
{\tt relativelyEqual} can be used.
670668

671-
\subsection{Comparing floating point numbers --- Smalltalk code}
672669
In Smalltalk this means adding a new method to the class Number as
673670
shown in Listing \ref{ls:fltcompare}.
674671

@@ -678,25 +675,18 @@ \subsection{Comparing floating point numbers --- Smalltalk code}
678675
\input{Smalltalk/NumericalPrecision/Number(DhbNumericalPrecision)}
679676
\end{listing}
680677

681-
\subsection{Comparing floating point numbers --- Java code}
682-
\label{sec:eqfltjava} In Java the methods have been added to the
683-
class {\tt DhbMath}. The code of that class is shown in listing
684-
\ref{lj:floatmachine}.
685-
686678
\section{Speed consideration (to be revisited)}
687679
\label{sec:speed} Some people may think that implementing
688-
numerical methods for object-oriented languages such as Smalltalk
689-
or Java is just a waste of time. Those languages are notoriously
690-
slow or so they think.
680+
numerical methods for object-oriented languages such as Smalltalk just a waste
681+
of time. Those languages are notoriously slow or so they think.
691682

692683
First of all, things should be put in perspective with other
693684
actions performed by the computer. If a computation does not take
694685
longer than the time needed to refresh a screen, it does not
695686
really matter if the application is interactive. For example,
696-
performing a least square fit to a histogram in Smalltalk and Java
697-
and drawing the resulting fitted function is usually hardly
698-
perceptible to the eye on a personal computer using a 200MHz
699-
Pentium. Thus, even though a C version runs 10 times faster, it
687+
performing a least square fit to a histogram in Smalltalk and drawing the
688+
resulting fitted function is usually hardly perceptible to the eye on a personal
689+
computer. Thus, even though a C version runs 10 times faster, it
700690
does not make any difference for the end user. The main difference
701691
comes, however, when you need to modify the code. Object-oriented
702692
software is well known for its maintainability. As $80\%$ of the
@@ -713,39 +703,39 @@ \section{Speed consideration (to be revisited)}
713703
code, otherwise the comparison with object-oriented code would not
714704
be fair. The Smalltalk code was run under version 4.0 of Visual
715705
Age\tm for Smalltalk from IBM Corporation using the ENVY benchmark
716-
tool provided. The Java code was run under version 2.0 of Visual
717-
Age\tm for Java from IBM Corporation. Elapsed time were measured
706+
tool provided.
707+
Elapsed time were measured
718708
by repeating the measured evaluation a sufficient number of time
719709
so that the error caused by the CPU clock is less that the last
720710
digit shown in the final result.
721711
\begin{table}[h]
722-
\caption{Compared execution speed between C, Smalltalk and Java}
712+
\caption{Compared execution speed between C and Smalltalk}
723713
\label{tb:speed} \vspace{1 ex}
724-
\begin{tabular}{|l | c r r r|} \hline
725-
\hfil {\bf Operation} & {\bf Units} & {\bf C}\hfil & {\bf Smalltalk}\hfil & {\bf Java}\hfil \\ \hline
726-
Polynomial $10\th$ degree & msec. & 1.1 & 27.7 & 9.0 \\
727-
Neville interpolation (20 points) & msec. & 0.9 & 11.0 & 0.8 \\
728-
LUP matrix inversion ($100\times 100$)& sec. & 3.9 & 22.9 & 1.0 \\ \hline
714+
\begin{tabular}{|l | c r r |} \hline
715+
\hfil {\bf Operation} & {\bf Units} & {\bf C}\hfil & {\bf Smalltalk}\hfil \\ \hline
716+
Polynomial $10\th$ degree & msec. & 1.1 & 27.7 \\
717+
Neville interpolation (20 points) & msec. & 0.9 & 11.0 \\
718+
LUP matrix inversion ($100\times 100$)& sec. & 3.9 & 22.9 \\ \hline
729719
\end{tabular}
730720
\end{table}
731721

732722
One can see that object-oriented code is quite efficient,
733723
especially when it comes to complex algorithms: good
734724
object-oriented code can actually beat up C code.
735725

736-
My early tests with Java, a couple of years ago, were showing that
737-
Java was 5-10 times slower than C. One can see that vendors did a
738-
great job in optimizing the generated code and in accelerating the
739-
virtual machine. I would like to see the same efforts going in
740-
optimizing Smalltalk. The spectacular improvement of Java shows
741-
that it is possible. Actually, my early tests made with Visual
742-
Smalltalk\tm from Digitalk Inc.\footnote{Unfortunately, the future
743-
of Visual Smalltalk now owned by Cincom Inc. is quite uncertain at
744-
this time of writing.} were 5 times better.
745-
746-
Today admittedly, I would not use Smalltalk to build a structural
747-
analysis program, but Java would certainly be a contender.
748-
Nevertheless, I have successfully build data mining Smalltalk
726+
%My early tests with Java, a couple of years ago, were showing that
727+
%Java was 5-10 times slower than C. One can see that vendors did a
728+
%great job in optimizing the generated code and in accelerating the
729+
%virtual machine. I would like to see the same efforts going in
730+
%optimizing Smalltalk. The spectacular improvement of Java shows
731+
%that it is possible. Actually, my early tests made with Visual
732+
%Smalltalk\tm from Digitalk Inc.\footnote{Unfortunately, the future
733+
%of Visual Smalltalk now owned by Cincom Inc. is quite uncertain at
734+
%this time of writing.} were 5 times better.
735+
736+
%Today admittedly, I would not use Smalltalk to build a structural
737+
%analysis program, but Java would certainly be a contender.
738+
I have successfully build data mining Smalltalk
749739
applications using {\bf all the code}\footnote{I want to emphasize
750740
here that all the code of this book is real code, which I have
751741
used personally in real applications.} presented in this book.
@@ -842,7 +832,7 @@ \subsection{Class diagrams}
842832
already discussed in an earlier chapter; the reference to the
843833
chapter is written below the class name. Class {\tt
844834
ClassInOtherChapter} in figure \ref{fig:classDiagram} is such a
845-
class. To save space, we have used the Java class names and the
835+
class. To save space, we have used the
846836
Smalltalk method names. It is quite easy to identify methods
847837
needing parameters when one uses Smalltalk method names: a
848838
colon in the middle or at the end of the method name indicates

0 commit comments

Comments
 (0)