using nag numerical software via c c excel fortran matlab
play

Using NAG Numerical Software via C, C++, Excel, Fortran, MATLAB - PowerPoint PPT Presentation

Numerical Algorithms Group Mathematics and technology for optimized performance Using NAG Numerical Software via C, C++, Excel, Fortran, MATLAB & other environments LTCC John Holden, David Sayers, Louise Mitchell Results Matter. Trust


  1. Numerical Algorithms Group Mathematics and technology for optimized performance Using NAG Numerical Software via C, C++, Excel, Fortran, MATLAB & other environments LTCC John Holden, David Sayers, Louise Mitchell Results Matter. Trust NAG.

  2. Agenda… � Introduction to NAG � Technical overview � A few examples.. � NAG Fortran / C Library for Windows � NAG and Excel � NAG Toolbox for MATLAB � Fortran Builder (NAG’s New Windows Fortran Compiler) London Universities - 1 st December 2008 www.nag.co.uk 2

  3. Numerical Algorithms Group - What We Do � NAG provides mathematical and statistical algorithm libraries widely used in industry and academia � Established in 1970 with offices in Oxford, Manchester, Chicago and Tokyo � Not-for-profit organisation committed to research & development � Library code written and contributed by some of the world’s most renowned mathematicians and computer scientists � NAG’s numerical code is embedded within many vendor libraries such as AMD and Intel � Many collaborative projects – e.g. CSE Support to the UK’s largest supercomputer, HECToR London Universities - 1 st December 2008 www.nag.co.uk 3

  4. Partnerships with leading academics � University of Aachen � Uwe Naumann � K.U. Leuven � Wim Schoutens � University of Manchester � Peter Duck, Nick Higham, Ser Huang Poon, .. � University of Oxford � Mike Giles, � University of Vienna � Stanford University London Universities - 1 st December 2008 www.nag.co.uk 4

  5. Portfolio � Numerical Libraries � Highly flexible for use in many computing languages, programming environments, hardware platforms and for high performance computing methods � Connector Products for MATLAB and Maple � Giving users of the mathematical software packages MATLAB and Maple access to NAG’s library of highly optimized and often superior numerical routines � Visualization and graphics software � Build data visualization applications with NAG’s IRIS Explorer � NAG Fortran Compiler and GUI based Compiler: Fortran Builder � Consultancy services London Universities - 1 st December 2008 www.nag.co.uk 5

  6. Why Use NAG Maths Libraries? � Global reputation for quality – accuracy, reliability and robustness… � Extensively tested, supported and maintained code � Reduce development time � Concentrate on your key areas � Components � Fit into your environment � Simple interfaces to your favourite packages � Regular performance improvements! London Universities - 1 st December 2008 www.nag.co.uk 6

  7. What does the NAG / LTCC licence cover? � See LTCC website for “up to date” information / product listing. [or contact NAG via operations@nag.co.uk quoting ref: NAG/LTCC/JCH � Unlimited use for the licensed implementations � As long as for academic or research purposes � Installation may be on any university, staff or student machine as long as they are from the dept or site � Full access to NAG Support support@nag.co.uk � Our software: � Includes online documentation - also www.nag.co.uk � Supplied with extensive example programs � data and results London Universities - 1 st December 2008 www.nag.co.uk 7

  8. Technical Agenda � The NAG Engine � Algorithmic contents � Ease of Integration � NAG and Excel examples � Navigating around the NAG toolbox in MATLAB � NAG Optimisation Chapters � Next release � Option Pricing Functions London Universities - 1 st December 2008 www.nag.co.uk 8

  9. The NAG Engine NAG software is based on NAG Engine technology NAG C NAG Fortran Library Library NAG User-callable Engine library routines are thin wrappers (algorithmic repository) NAG NAG SMP Library Toolbox for Other NAG MATLAB Software London Universities - 1 st December 2008 www.nag.co.uk 9

  10. NAG Library Contents � Root Finding � Dense Linear Algebra � Summation of Series � Sparse Linear Algebra � Quadrature � Correlation and Regression Analysis � Ordinary Differential Equations � Multivariate Analysis of � Partial Differential Equations Variance � Numerical Differentiation � Random Number Generators � Integral Equations � Univariate Estimation � Mesh Generation � Nonparametric Statistics � Interpolation � Smoothing in Statistics � Curve and Surface Fitting � Contingency Table Analysis � Optimization � Survival Analysis � Approximations of Special � Time Series Analysis Functions � Operations Research London Universities - 1 st December 2008 www.nag.co.uk 10

  11. NAG Data Mining Components � Regression � Data Cleaning � Regression Trees � Data Imputation � Outlier Detection � Linear Regression � Multi-layer Perceptron Neural � Data Transformations Networks � Scaling Data � Nearest Neighbours � Principal Component Analysis � Radial Basis Function Models � Association Rules � Cluster Analysis � Utility Functions � k-means Clustering � Hierarchical Clustering � To support the main functions and help with prototyping � Classification � Classification Trees � Generalised Linear Models � Nearest Neighbours London Universities - 1 st December 2008 www.nag.co.uk 11

  12. NAG Libraries – a quick introduction � NAG Fortran Library � C:\Program Files\NAG\FL21 � Manual – html – Mk21 � Samples – surface fit � Optimisation E04 chapter introduction � NAG C Library � C:\Program Files\NAG\CL08\cldll084zl\projects N.B. Manual needs to be installed separately London Universities - 1 st December 2008 www.nag.co.uk 12

  13. NAG Libraries Ease of Integration � C++ (various) � Excel � C# / .NET � MATLAB � Visual Basic � Maple � Java � LabVIEW � Borland Delphi � R and S-Plus � F# � SAS � Python � Simfit � … � … � … � and more � and more �������������������������������������������������������������� London Universities - 1 st December 2008 www.nag.co.uk 13

  14. NAG and Excel.. www.nag.co.uk/numeric/callingDLLsfromotherlang.asp ������� !����"���� London Universities - 1 st December 2008 www.nag.co.uk 14

  15. NAG and Excel.. � Our libraries are easily accessible from Excel � Calling DLLs using VBA � NAG provide VB Declaration Statements and Examples � Excel Add-ins � NAG’s Statistical Add-in for Excel � Sophisticated Add-in offering 76 statistical functions � Function/ array “driven” � NAG Schools Excel Add-in (N-SEA) � Basic statistical functions including graphs � Menu Drive ������� !����"���� London Universities - 1 st December 2008 www.nag.co.uk 15

  16. Maple-NAG Connector � Works with “latest” versions of: � Maple 10, 11 & 12 � NAG C Library 7 & 8 � The connector supports Mark 7 functionality � Runs under � Mac (PowerPC, Intel Mac - 32-bit) � Linux (32-bit) � Windows (32-bit) �������#�$���"���� London Universities - 1 st December 2008 www.nag.co.uk 16

  17. NAG Toolbox for MATLAB http://www.nag.co.uk/numeric/MB/start.asp �������#�%��&�"���� ����'��(���))'�*(��+� London Universities - 1 st December 2008 www.nag.co.uk 17

  18. NAG Toolbox for MATLAB � Built as MATLAB mex files � Auto-generated from XML documentation � Contains essentially all NAG functionality � not a subset � Currently runs under Windows (32/64bit) or Linux (32/64-bit). � Installed under the usual MATLAB toolbox directory � Makes use of a DLL or shared version of the NAG Library � Can be used with MATLAB compiler �������#�%��&�"���� ����'��(���))'�*(��+� London Universities - 1 st December 2008 www.nag.co.uk 18

  19. Chapter e04 – Minimization / Maximization Problem: minimize F(x 1 , x 2 , …, x n ) possibly subject to constraints The function F(x) is called the objective function . We wish to determine x, the n-vector of variables. May have: � No constraints � Bound constraints: l i <= x i <= u i � Linear or nonlinear constraints: l <= G(x) <= u London Universities - 1 st December 2008 www.nag.co.uk 19

  20. Unconstrained optimization London Universities - 1 st December 2008 www.nag.co.uk 20

  21. Linearly constrained optimization London Universities - 1 st December 2008 www.nag.co.uk 21

  22. Nonlinear constraints London Universities - 1 st December 2008 www.nag.co.uk 22

  23. Chapter e04 Problems categorized according to properties of objective function: � nonlinear � sum of squares of nonlinear functions � quadratic � linear Example – nonlinear objective and constraints: Minimize f ( x , y ) = (1 − x ) 2 + 100( y − x 2 ) 2 x 2 + y 2 <= 2 subject to -2 <= x <= 2 London Universities - 1 st December 2008 www.nag.co.uk 23

  24. E04WD � Sequential quadratic programming ( SQP ) algorithm � obtains search directions from a sequence of QP subproblems. � designed for problems with many variables and constraints � P. Gill (San Diego), W. Murray (Stanford) and M. Saunders (Stanford) London Universities - 1 st December 2008 www.nag.co.uk 24

Recommend


More recommend