• Complain

Peter Gottschling - Discovering Modern C++ (C++ In-Depth Series)

Here you can read online Peter Gottschling - Discovering Modern C++ (C++ In-Depth Series) full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, publisher: Addison-Wesley Professional, genre: Home and family. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Discovering Modern C++ (C++ In-Depth Series)
  • Author:
  • Publisher:
    Addison-Wesley Professional
  • Genre:
  • Year:
    2021
  • Rating:
    4 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 80
    • 1
    • 2
    • 3
    • 4
    • 5

Discovering Modern C++ (C++ In-Depth Series): summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Discovering Modern C++ (C++ In-Depth Series)" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Write Powerful, Modern C++ Code for Scientific, Engineering, and Embedded ApplicationsDiscovering Modern C++, Second Edition, will help you master valuable skills for programming with C++ at nearly every level, from close to the hardware to high-level abstractions. Updated for C++17 and C++ 20, this intensive introduction teaches C++ using realistic examples from diverse technical problem domains. Drawing on extensive experience teaching C++ to physicists, mathematicians, engineers, and students, Peter Gottschling guides you smoothly to sophisticated approaches based on advanced features. Whatever your programming experience, youll rapidly master increasingly powerful features, from lambdas to expression and variadic templates. Gottschling also shows you how to apply C++s libraries: both the Standard Template Library (STL) and scientific libraries for arithmetic, linear algebra, differential equations, and graphs. Step by step, youll learn to write clear and expressive code using object orientation, generics, metaprogramming, and procedural techniques, and master all the abstractions you need to write high-quality, well-performing software.
  • Quickly master core features: variables, operators, expressions, statements, functions, error handling, I/O, arrays, pointers, references, and more
  • Make the most of classes and object-oriented programming, from constructors/destructors to operator overloading and multiple inheritance
  • Apply advanced generic programming and template-based techniques
  • Use C++s libraries to write more robust and powerful code more quickly
  • Explore metaprogramming in depth, and master cutting-edge optimization techniques
  • Walk through representative scientific projects, and create your own
Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Peter Gottschling: author's other books


Who wrote Discovering Modern C++ (C++ In-Depth Series)? Find out the surname, the name of the author of the book and a list of all author's works by series.

Discovering Modern C++ (C++ In-Depth Series) — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Discovering Modern C++ (C++ In-Depth Series)" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Discovering Modern C C In-Depth Series - image 1
Discovering Modern C++

Peter Gottschling

Discovering Modern C C In-Depth Series - image 2

Table of Contents
Preface

The world is built on C++ (and its C subset).

Herb Sutter

The infrastructures at Google, Amazon, and Facebook are built using components and services designed and implemented in the C++ programming language. A considerable portion of the technology stack of operating systems, networking equipment, and storage systems is implemented in C++. In telecommunication systems, almost all landline and cellular phone connections are orchestrated by C++ software. And key components in industrial and transportation systems, including automated toll collection systems, and autonomous cars, trucks, and autobuses depend on C++.

In science and engineering, most high-quality software packages today are implemented in C++. The strength of the language is evidenced when projects exceed a certain size and data structures and algorithms become non-trivial. It is no wonder that manyif not mostsimulation software programs in computational science are realized today in C++; these include FLUENT, Abaqus, deal.II, FEniCS, OpenFOAM, and G+Smo. Even embedded systems are increasingly realized in C++ thanks to more powerful embedded processors and improved compilers. And the new application domains of the Internet of Things (IoT) and embedded edge intelligence are all driven by C++ platforms such as TensorFlow, Caffe2, and CNTK.

Core services you use every day are based on C++: your cell phone, your car, communication and industrial infrastructure, and key elements in media and entertainment services all contain C++ components. C++ services and applications are omnipresent in modern society. The reason is simple. The C++ language has progressed with its demands, and in many ways leads the innovations in programming productivity and execution efficiency. Both attributes make it the language of choice for applications that need to run at scale.

Reasons to Learn C++

Like no other language, C++ masters the full spectrum from programming sufficiently close to the hardware on one end to abstract high-level programming on the other. The lower-level programminglike user-definable memory managementempowers you as a programmer to understand what really happens during execution, which in turn helps you understand the behavior of programs in other languages. In C++ you can write extremely efficient programs that can only be slightly outperformed by code written in machine language with ridiculous effort. However, you should wait a little with the hardcore performance tuning and focus first on clear and expressive software.

This is where the high-level features of C++ come into play. The language supports a wide variety of programming paradigms directly: object-oriented programming (), among others.

Several programming techniqueslike RAII () were invented in and for C++. As the language is so expressive, it was often possible to establish these new techniques without changing the language. And who knows, maybe one day you will invent a new technique.

Reasons to Read This Book

The material in the book has been tested on real humans. The author taught his class, C++ for Scientists, over three years (i.e., three times two semesters). The students, mostly from the mathematics department, plus some from the physics and engineering departments, often did not know C++ before the class and were able to implement advanced techniques like expression templates (.

The Beauty and the Beast

C++ programs can be written in so many ways. In this book, we will lead you smoothly to the more sophisticated styles. This requires the use of advanced features that might be intimidating at first but will become less so once you get used to them. Actually, high-level programming is not only more widely applicable but is usually equally or more efficient and readable.

We will give you a first impression with a simple example: gradient descent with constant step size. The principle is extremely simple: we compute the steepest descent of f(x) with its gradient, say g(x), and follow this direction with fixed-size steps to the next local minimum. Even the algorithmic pseudo-code is as simple as this description:

Algorithm 1: Gradient descent algorithm

Input: Start value x, step size s, termination criterion , function f, gradient g

Output: Local minimum x

do

| x = xsg(x)

while |f(x)| > ;

For this simple algorithm, we wrote two quite different implementations. Please have a look and let it sink in without trying to understand the technical details.

void gradient_descent(double* x,double* y, double s, double eps,double(*f)(double, double),double(*gx)(double, double),double(*gy)(double, double)){ double val= f(*x, *y), delta; do { *x-= s * gx(*x, *y); *y-= s * gy(*x, *y); double new_val= f(*x, *y); delta= abs(new_val - val); val= new_val; } while (delta > eps);}template <typename Value, typename P1,typename P2, typename F,typename G>Value gradient_descent(Value x, P1 s,P2 eps, F f, G g){ auto val= f(x), delta= val; do { x-= s * g(x); auto new_val= f(x); delta= abs(new_val - val); val= new_val; } while (delta > eps); return x;}

At first glance, they look pretty similar, and we will tell you soon which one we like more. The first version is in principle pure C, i.e., compilable with a C compiler too. The benefit is that what is optimized is directly visible: a 2D function with double values (indicated by the highlighted function parameters). We prefer the second version as it is more widely usable: two functions of arbitrary dimension with arbitrary value types (visible by the marked type and function parameters). Surprisingly, the versatile implementation is not less efficient. To the contrary, the functions given for F and G may be inlined (see ) so that the function call overhead is saved, whereas the explicit use of (ugly) function pointers in the first version makes this code acceleration difficult for the compiler.

A longer example comparing old and new styles is found in ) for the really patient reader. There, the benefit of modern programming is much more evident than in the toy example here. But we do not want to hold you back too long with preliminary skirmishing.

Languages in Science and Engineering

It would be nice if every kind of numeric software could be written in C++ without loss of efficiency, but unless something can be found that achieves this without compromising the C++-type system it may be preferable to rely on Fortran, assembler or architecture-specific extensions.

Bjarne Stroustrup

Scientific and engineering software is written in different languages, and which one is the most appropriate depends on the goals and available resources:

Math tools like MATLAB, Mathematica, or R are excellent when we can use their existing algorithms. When we implement our own algorithms with fine-grained (e.g., scalar) operations, we will experience a significant decrease in performance. This might not be an issue when the problems are small or the user is infinitely patient; otherwise we should consider alternative languages.

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Discovering Modern C++ (C++ In-Depth Series)»

Look at similar books to Discovering Modern C++ (C++ In-Depth Series). We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Discovering Modern C++ (C++ In-Depth Series)»

Discussion, reviews of the book Discovering Modern C++ (C++ In-Depth Series) and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.