Title: Development of numerical library software in Java
1Development of numerical library software in Java
- Feb 8 , 2000
- H.Okazawa, Shizuoka Seika College, Japan
- and
- T.Sasaki, KEK,Japan
2Contents
- Introduction
- Object Oriented Programming
- Analysis and Design of Numerical library
- Fitting program in OOA/OOD
- Summary
3Introduction(1)
- We present
- Our attempt on OO analysis and OO development to
the general numerical library in Java - The development of data fitting program with
OOA/OOD - The detail of the design as a first step of
development of numerical analysis libraries in
Java
4Introduction(2)
- HEP Analysis
- Software components tend to be large
- Software will be used for more than 10 yeas or
so.
Object Oriented technique -Reuse software
component -Change the specification of the
software -Understand an overall of the system.
5Introduction(3)
- The need of Common Interface for numerical
library - Different products have different interfaces
- Make difficult to
- Try another algorithm
- Implement a new functionary
- The need of well designed software
- Minimum effort in changing users code
- Increases reliability and production capability
of software
6 Object Oriented Programming(1)
- Why we use Java?
- C
- Illustrates high-level performance
- Has various runtime libraries used in C language
- Takes long time in understanding or developing
software for no expert of C programming - Java, simple OO language
- Easy to understand and integrate the software
- Easily moved among computing platforms
- Very safe and reliable under networking condition
- Easy to import visualization program to many
platforms
7Object Oriented Programming(2)
Ref JAVA World 12, 1999
A Excellent B Good C Available D Not supported
8Analysis and Design of Numerical library(1)
- It is difficult to develop numerical library in
Java because. - C
- Functions in numerical library are implemented as
Template functions. - Java
- No template functionary
- Everything must be in class
9Analysis and Design of Numerical library(2)
- We investigated 2 scenario for the development of
numerical library in Java. - Scenario 1
- The object is identified to manage the numerical
library. - The super class are prepared and all of other
functionary is realized to inherit it. - Only interfaces are defined in the super class.
- Scenario 2
- Objects are identified as variables or arrays to
be used for mathematical manipulations. - lt Need to define so many classes according to
basic data types in Java.
10Analysis and Design of Numerical library(3)
- However Scenario 1 looks a bit far from native OO
concepts, it has advantage in simplicity of
implementation and also maintainability. - Usecase diagram from Scenario 1
11Development of fitting program in OOA/OOD(1)
- We plan to develop several numerics classes.
- As an example of implementation of a functionary
of - numerical library, a fitting program was
developed.
Numerics
Evaluator
Integrator
Equator
Sorter
Fitter
12Development of fitting program in OOA/OOD(2)
- Class diagram for fitting program
Matrix
Numerics
Fitter
add()
inputData()
leastSquare()
transpose()
action()
Marquardt()
divide()
result()
chisq()
subtract()
UserDefinedFitter
PolynomialFitter
GaussianFitter
13Development of fitting program in OOA/OOD(3)
A Sample result from polynomial fitter
14Development of fitting program in OOA/OOD(4)
If you want to add your own function, you just
extend new function class you need. Or you can
easily find out where to change the code from
class diagram. Although this class library is
very simple now, further iteration of analysis,
design and implementation makes more elegant,
widely usable software package.
package Numerical public class MyOwnFitter
extends Fitter public void myfunc()
double x double y double a
for(int i0 iltnarray i) y
ai0Math.pow() ai1x...
return
15Summary
- Attempt OOA/OOD on the numerical library in Java
- A simple Java fitting software by OOA/OOD was
developed on it - prepared reusable package
-