MathMore Lorenzo Moneta, Andràs Zsenei ROOT Meeting 19/8/2005.

Slides:



Advertisements
Similar presentations
Intro into real world numerical libraries/packages.
Advertisements

The C ++ Language BY Shery khan. The C++ Language Bjarne Stroupstrup, the language’s creator C++ was designed to provide Simula’s facilities for program.
Contents o Introduction o Characteristics of Constructor. o Types of constructor. - Default Constructor - Parameterized Constructor - Copy Constructor.
Optimization.
1 Chapter Overview Understanding and Applying NTFS Permissions Assigning NTFS Permissions and Special Permissions Solving Permissions Problems.
1 Classes Object-oriented programming: Model the problem as a collection of objects that have certain attributes and interact with one another and/or the.
Object Oriented Programming.  OOP Basic Principles  C++ Classes  September 2004  John Edgar 22.
 2006 Pearson Education, Inc. All rights reserved Introduction to Classes and Objects.
C++ Programming: Program Design Including Data Structures, Fifth Edition Chapter 17: Linked Lists.
Microsoft Visual Source Safe 6.01 Microsoft Visual Source Safe (MVSS) Presented By: Rachel Espinoza.
Inheritance and Polymorphism CS351 – Programming Paradigms.
MathMore Lorenzo Moneta, Andràs Zsenei ROOT Workshop 30/9/2005.
From C++ to C#. Web programming The course is on web programming using ASP.Net and C# The course is on web programming using ASP.Net and C# ASP.Net is.
IT PUTS THE ++ IN C++ Object Oriented Programming.
Ranga Rodrigo. Class is central to object oriented programming.
The Pseudocode Programming Process Chapter 9. Summary of Steps in Building Classes and Routines.
Math LHCb Ivan Belyaev LHCb, CERN & ITEP/Moscow.
New ROOT Math Libraries W. Brown 1), M. Fischler 1), L. Moneta 2), A. Zsenei 2) 1) Fermi National Accelerator Laboratory, Batavia, Illinois, USA 2) CERN.
Introduction to Object-oriented programming and software development Lecture 1.
Lecture 8 Inheritance Richard Gesick. 2 OBJECTIVES How inheritance promotes software reusability. The concepts of base classes and derived classes. To.
Inheritance. Recall the plant that we defined earlier… class Plant { public: Plant( double theHeight ) : hasLeaves( true ), height (theHeight) { } Plant(
Development of numerical library software in Java Feb 8, 2000 H.Okazawa, Shizuoka Seika College, Japan and T.Sasaki, KEK,Japan.
Introduction to GSL CS 3414 From GNU Scientific Library Reference Manual at
Object Oriented Programming with C++/ Session 6 / 1 of 44 Multiple Inheritance and Polymorphism Session 6.
Chapter 4 Interpolation and Approximation. 4.1 Lagrange Interpolation The basic interpolation problem can be posed in one of two ways: The basic interpolation.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
1 Administering Shared Folders Understanding Shared Folders Planning Shared Folders Sharing Folders Combining Shared Folder Permissions and NTFS Permissions.
Copyright © Curt Hill Generic Classes Template Classes or Container Classes.
New ROOT Mathematical Libraries SMatrix Package with matrix and vector classes of arbitrary type (initially developed by T. Glebe for HeraB software) complementary.
Object Oriented Software Development
Quadrature rules 1Michael Sokolov / Numerical Methods for Chemical Engineers / Numerical Quadrature Michael Sokolov ETH Zurich, Institut für Chemie- und.
Objects & Classes Weiss ch. 3. So far: –Point (see java.awt.Point) –String –Arrays of various kinds –IPAddress (see java.net.InetAddress) The Java API.
SEAL-ROOT Math Plans for 2005 Math work package Andras Zsenei, Anna Kreshuk, Lorenzo Moneta, Eddy Offermann LCG Application Area Internal Review, 30 March,
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Lorenzo Moneta,LHCb Software week, 26 May Proposal for ROOT Math Libraries MathLib work package from ROOT SEAL merge new proposed structure for.
Chapter 10: Classes and Data Abstraction. Objectives In this chapter, you will: Learn about classes Learn about private, protected, and public members.
EGR 2261 Unit 11 Classes and Data Abstraction  Read Malik, Chapter 10.  Homework #11 and Lab #11 due next week.  Quiz next week.
Copyright © 2008 Pearson Addison-Wesley. All rights reserved. Chapter 15 Inheritance.
CMSC 345 Fall 2000 OO Design. Characteristics of OOD Objects are abstractions of real-world or system entities and manage themselves Objects are independent.
Copyright © 2009 – Curt Hill Standard Template Library An Introduction.
Chapter 10: Classes and Data Abstraction. Classes Object-oriented design (OOD): a problem solving methodology Objects: components of a solution Class:
1 C# - Inheritance and Polymorphism. 2 1.Inheritance 2.Implementing Inheritance in C# 3.Constructor calls in Inheritance 4.Protected Access Modifier 5.The.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
Lorenzo Moneta,LHCb Software week, 26 May New ROOT Math Libraries Activities MathLib work package from ROOT SEAL merge new proposed structure for.
9 Associators How to relate objects to each other Create relations Save relations Use relations: Associators.
CPS120: Introduction to Computer Science Lecture 16A Object-Oriented Concepts.
Value Types. 2 Objectives Discuss concept of value types –efficiency –memory management –value semantics –boxing –unboxing –simple types Introduce struct.
Classes C++ representation of an object
APPENDIX a WRITING SUBROUTINES IN C
Object-Oriented Programming: Inheritance
Distributed Shared Memory
Introduction to C++ Systems Programming.
Object-Oriented Programming & Design Lecture 18 Martin van Bommel
Chapter 5 Classes.
Introduction to GSL CS 3414 From GNU Scientific Library Reference Manual at
OOP Paradigms There are four main aspects of Object-Orientated Programming Inheritance Polymorphism Abstraction Encapsulation We’ve seen Encapsulation.
The Object-Oriented Thought Process Chapter 05
Lecture 22 Inheritance Richard Gesick.
CIS16 Application Development Programming with Visual Basic
Miscellaneous C++ Topics
Polymorphism Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2nd edition, by Kernighan.
COP 3330 Object-oriented Programming in C++
Object-Oriented Programming
Lecture 11 Graphics ChE 310.
Classes C++ representation of an object
CPS120: Introduction to Computer Science
Lecture 8 Object Oriented Programming (OOP)
Classes and Objects Systems Programming.
Introduction to Classes and Objects
Presentation transcript:

MathMore Lorenzo Moneta, Andràs Zsenei ROOT Meeting 19/8/2005

19/8/2005ROOT meeting, Andràs Zsenei2 MathMore components  Special functions (extension of MathCore)  Statistical functions (extension of MathCore)  Derivation  Integration  Interpolation  Root finding  1 dimensional minimization

19/8/2005ROOT meeting, Andràs Zsenei3 The Current Implementation  The relevant GSL code extracted into mathmore/src/gsl-xxx and compiled automatically (mathmore/Module.mk)  Easily maintainable and updateable compared to direct copy of the algorithms into ROOT classes

19/8/2005ROOT meeting, Andràs Zsenei4 Special Functions  Those functions from the N1687 Technical Report on Standard Library Extensions that use GSL implementa- tion ( )  For example:  Bessel Functions  Elliptic Integrals  Legendre Polynomials, etc

19/8/2005ROOT meeting, Andràs Zsenei5 Special Functions cont’d  Free functions following the C++ standard’s naming convention (N1687)  Trivial use: root [0] gSystem->Load("libMathMore.so"); root [1] ROOT::Math::cyl_bessel_i(1.2, 2.4) (double) e+00

19/8/2005ROOT meeting, Andràs Zsenei6 Statistical Functions  Cumulative Distribution Functions (CDF) of those distributions from MathCore which were missing:  Chi-square, T-distribution, etc  The inverses of the CDF-s  Free functions callable in a trivial way  Naming convention in N1668, but might change (following up…) 

19/8/2005ROOT meeting, Andràs Zsenei7 Function Interface  Minimal interface for functions used by all the nu- merical algorithms: IGenFunction, ParamFunction, Polynomial (see previous presentations)  It would be nice but not necessary if TF1 would implement this interface  class WrappedFunction which wraps any C++ callable object (C free functions, functors, etc...)  Reviewed by CMS — several of the recommendations implemented  Still a few questions:  Gradients: interface or feature testing  NVI (Non-Virtual Interface)

19/8/2005ROOT meeting, Andràs Zsenei8 Derivation — an example of the overall design  Class Derivator which defines the user interface (constructors, member functions) and has an instance of GSLDerivator  Class GSLDerivator which calls the appropri- ate GSL functions  Both GSLDerivator.h and GSLDerivator.cxx are in mathmore/src so that implementa- tion details do not pollute ROOT header files

19/8/2005ROOT meeting, Andràs Zsenei9 Derivation — an example of the overall design, cont’d  Usage with function inheriting from IGenFunction: ROOT::Math::Polynomial *f1 = new ROOT::Math::Polynomial(2); … ROOT::Math::Derivator *der = new ROOT::Math::Derivator(*f1); double step = 1E-8; double x0 = 2; double result = der->EvalCentral(x0, step); double error = der->Error();

19/8/2005ROOT meeting, Andràs Zsenei10 Derivation — an example of the overall design, cont’d  Usage with a function pointer: double myfunc ( double x, void * ) { return std::pow( x, 1.5); } ROOT::Math::Derivator *der = new ROOT::Math::Derivator(myfunc); double step = 1E-8; double x0 = 2; double result = der->EvalCentral(x0, step);

19/8/2005ROOT meeting, Andràs Zsenei11 Derivation — an example of the overall design, cont’d  Usage with modified TF1 (or any other callable implementing operator() ): TF1 *fun1 = new TF1("fun1","x*x+3*x",0,10); ROOT::Math::Derivator *der = new ROOT::Math::Derivator(ROOT::Math::WrappedFunction (*fun1)); double step = 1E-8; double x0 = 2; double result = der->EvalCentral( x0, step);

19/8/2005ROOT meeting, Andràs Zsenei12 Derivation — an example of the overall design, cont’d  Straightforward to add the functionality into TF1’s Derivative() so that it is trans-parent to the old user (disadvantage: cre-ates a Derivator object for each call)  If performance is a major issue there is always the possibility to create the object oriented way as shown previously + use function pointers

19/8/2005ROOT meeting, Andràs Zsenei13 Integration  Non-adaptive, adaptive and adaptive singular (i.e. taking into account singularities) integration  Different Gauss-Konrod rules can be selected  Possibility to use infinite and semi- infinite ranges

19/8/2005ROOT meeting, Andràs Zsenei14 Interpolation  Linear, polynomial, Akima and Akima periodic interpola- tions

19/8/2005ROOT meeting, Andràs Zsenei15 Root Finding  Root finding of one dimensional functions  Bracketing algorithms: bisection, false position, Brent-Dekker  Polishing algorithms (derivatives): Newton, secant, Steffenson

19/8/2005ROOT meeting, Andràs Zsenei16 Minimization in 1 D  1 dimensional minimization for cases where Minuit or Fumili would be too much overhead  Golden section algorithm  Brent algorithm

19/8/2005ROOT meeting, Andràs Zsenei17 In progress — Implementation type  How can we select the various implementations (GSL, original ROOT, Cernlib, etc..)?  An additional constructor for class Derivator which takes implementation type so that Derivator constructs an instance of worker class according to implementation chosen (i.e. GSL)  Have also a default implementation (for example used by TF1) which would allow to move Derivator.h into MathCore  Introduce a class MathSelector which manages centrally all the default implementations for the numerical algorithms; PluginManager would be convenient but not standalone