39,59 €
Learn to solve scientific computing problems using Scala and its numerical computing, data processing, concurrency, and plotting libraries
Scientists and engineers who would like to use Scala for their scientific and numerical computing needs. A basic familiarity with undergraduate level mathematics and statistics is expected but not strictly required. A basic knowledge of Scala is required as well as the ability to write simple Scala programs. However, complicated programming concepts are not used in the book. Anyone who wants to explore using Scala for writing scientific or engineering software will benefit from the book.
Scala is a statically typed, Java Virtual Machine (JVM)-based language with strong support for functional programming. There exist libraries for Scala that cover a range of common scientific computing tasks – from linear algebra and numerical algorithms to convenient and safe parallelization to powerful plotting facilities. Learning to use these to perform common scientific tasks will allow you to write programs that are both fast and easy to write and maintain.
We will start by discussing the advantages of using Scala over other scientific computing platforms. You will discover Scala packages that provide the functionality you have come to expect when writing scientific software. We will explore using Scala's Breeze library for linear algebra, optimization, and signal processing. We will then proceed to the Saddle library for data analysis. If you have experience in R or with Python's popular pandas library you will learn how to translate those skills to Saddle. If you are new to data analysis, you will learn basic concepts of Saddle as well. Well will explore the numerical computing environment called ScalaLab. It comes bundled with a lot of scientific software readily available. We will use it for interactive computing, data analysis, and visualization. In the following chapters, we will explore using Scala's powerful parallel collections for safe and convenient parallel programming. Topics such as the Akka concurrency framework will be covered. Finally, you will learn about multivariate data visualization and how to produce professional-looking plots in Scala easily. After reading the book, you should have more than enough information on how to start using Scala as your scientific computing platform
Examples are provided on how to use Scala to do basic numerical and scientific computing tasks. All the concepts are illustrated with more involved examples in each chapter. The goal of the book is to allow you to translate existing experience in scientific computing to Scala.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 277
Veröffentlichungsjahr: 2016
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2016
Production reference: 1220416
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78588-694-2
www.packtpub.com
Author
Vytautas Jančauskas
Reviewer
Chetan Khatri
Commissioning Editor
Amarabha Banerjee
Acquisition Editors
Ruchita Bhansali
Sonali Vernekar
Content Development Editor
Kajal Thapar
Technical Editor
Prajakta Mhatre
Copy Editor
Charlotte Carneiro
Project Coordinator
Shweta H Birwatkar
Proofreader
Safis Editing
Indexer
Rekha Nair
Graphics
Kirk D'Penha
Production Coordinator
Manu Joseph
Cover Work
Manu Joseph
Vytautas Jančauskas is a computer science PhD student and lecturer at Vilnius University. At the time of writing, he was about to get a PhD in computer science. The thesis concerns multiobjective optimization using nature-inspired optimization methods. Throughout the years, he has worked on a number of open source projects that have to do with scientific computing. These include Octave, pandas, and others. Currently, he is working with numerical codes with astrophysical applications.
He has experience writing code to be run on supercomputers, optimizing code for performance, and interfacing C code to higher-level languages. He has been teaching computer networks, operating systems design, C programming, and computer architecture to computer science and software engineering undergraduates at Vilnius University for 4 years now.
His primary research interests include optimization, numerical algorithms, programming language design, and software engineering. Vytautas has significant experience with various different programming languages. He has written simple programs and has participated in projects using Scheme, Common Lisp, Python, C/C++, and Scala. He has experience working as a Unix systems administrator. He also has significant experience working with numerical computing platforms such as NumPy/MATLAB and data analysis frameworks such pandas and R.
I would like to thank my wife for being patient and giving me time to write this book.
Chetan Khatri is data science researcher with over four and a half years of experience in research and development. He works as a principal engineer in data and machine learning at Nazara Technologies Pvt. Ltd. Previously, he worked with R&D Lab, Eccella Corporation. He completed his masters in computer science and minor in data science from KSKV Kachchh University and was a gold medalist.
He contributes to society in various ways, including giving talks to sophomore students at University. He also gives talks on various fields of data science at academia and conferences. He helps the community by providing a data science platform, and loves to participate in data science hackathons. He is one of the founding member of PyKutch—a Python community. Currently, he is exploring deep neural networks and reinforcement learning for government data.
I would like to thank Prof. Devji Chhanga, Head of the Computer Science department, University of Kachchh, for showing me the correct path and for valuable guidance in the field of data science research.
I would like to thank my beloved family.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at <[email protected]> for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and readPackt's entire library of books.
In this book, we will look into using Scala as a scientific computing platform. It is intended for people who already have experience with scientific computing and Scala. We will see how to do things that are possible in other numerical/scientific computing platforms in Scala. We will cover numerical computation, data storage and retrieval, structured data analysis, interactive computing, visualization, and other important topics.
Chapter 1, Introducing Scientific Computing with Scala, looks into the feasibility of using Scala for scientific computing. An overview of the state-of-the-art libraries and tools in Scala scientific computing is given here.
Chapter 2, Storing and Retrieving Data, provides various options for storing and retrieving data in Scala. Popular data storage and retrieval formats that you may encounter in scientific computing are explored.
Chapter 3, Numerical Computing with Breeze, is about using the Breeze library for numerical computing.
Chapter 4, Using Saddle for Data Analysis, explores the functionality of the Saddle library for structured data analysis and manipulation.
Chapter 5, Interactive Computing with ScalaLab, explores the possibilities offered by the ScalaLab environment for interactive computing.
Chapter 6, Parallel Programming in Scala, is about parallel programming in Scala. Various techniques, including JVM threads, parallel collections, and actor-based concurrency with Akka, are covered.
Chapter 7, Cluster Computing Using Scala, teaches how to use Scala programs in distributed computing environments and shows how to use MPI from Scala, and more.
Chapter 8, Scientific Plotting with Scala, gives various options for carrying out plots in Scala.
Chapter 9, Visualizing Multi-Dimensional Data in Scala, elaborates on advanced plotting and visualization.
You will need Scala and SBT installed on your system. Technically, you only need SBT, since SBT will install the required version of Scala for you. You can get Scala and SBT from the following websites:
It is advisable that you use a UNIX-like operating system for this book. However, this is not strictly necessary for most chapters. You will also need a Scala IDE or a text editor. Setting up Emacs to work with Scala and SBT is covered in the book. Alternatively, you can use any editor you are comfortable with.
This book is for scientists and engineers who would like to use Scala for their scientific and numerical computing needs. Basic familiarity with undergraduate-level mathematics and statistics is expected but not strictly required. Basic knowledge of Scala is required as well as the ability to write simple Scala programs. Complicated programming concepts are not used in the book. Anyone who wants to explore using Scala for writing scientific or engineering software will benefit from the book.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
You can also download the code files by clicking on the Code Files button on the book's webpage at the Packt Publishing website. This page can be accessed by entering the book's name in the Search box. Please note that you need to be logged in to your Packt account.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/ScientificComputingwithScala_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
