C++Now 2019: Bob Steagall “Linear Algebra for the Standard C++ Library”

preview_player
Показать описание


Linear algebra is a mathematical discipline of ever-increasing importance in today's world, with direct application to a wide variety of problem domains, such as signal processing, computer graphics, medical imaging, machine learning, data science, financial modeling, and scientific simulations. And yet, despite the relevance of linear algebra to so many aspects of modern computing, the C++ standard library does not include a set of linear algebra facilities.

This talk will describe a proposal before the C++ standardization committee (P1385) to add linear algebra to the standard library. We'll begin with a quick refresher on what linear algebra is and why it's so important. Next, we'll cover the features and high-level requirements for the proposed components, including a review of related mathematical objects deliberately excluded. We'll then discuss in detail the design of the proposed components, the evolution of that design, and its rationale. In particular, we'll discuss in depth how the requirements we set out to fulfill led directly to the design, and how modern C++ allows us to specify an extensible interface that is expressive, customizable, and supports high performance. Along the way, the talk will also provide some color commentary regarding the process of composing, submitting, and advocating a proposal for a significant new library feature.

Bob Steagall
KEWB Computing
Chief Cook and Bottle Washer
Maryland

I've been working in C++ since discovering the second edition of The C++ Programming Language in a college bookstore in 1992. The majority of my career has been spent in medical imaging, where I led teams building applications for functional MRI and CT-based cardiac visualization. After a brief detour through the worlds of DNS and analytics, I'm now working in the area of distributed stream processing. I'm a voting member of the C++ Standardization Committee, and have a blog where I occasionally write about C++ and related topics. I hold BS and MS degrees in Physics, I'm an avid cyclist when weather permits, and I live in fear of my wife's cats.

---

*--*

---
Рекомендации по теме
Комментарии
Автор

IMO the lack of distinction between row vectors and column vectors is a total deal breaker. Once something makes it into the standard, it is there for good, so we can't allow this kind of conceptual sloppiness be locked in. This is not pedantry -- a row vector and a column vector truly are different things and truly should be treated differently. The "inner product" vs "outer product" distinction is only one aspect of this.

For example, say you have a n x n matrix A and an n-component column vector x. The product Ax is well-defined and can be used in an expression, for example, y = Ax. The expression xA, on the other hand, is pure nonsense and should give an error (at compile time if possible). If x is just a "vector" and who-cares- of-what-vector-space, x would be silently interpreted as a row vector, and the product xA would get calculated. If what you wanted was Ax, welp, in general xA != Ax so a detectable error was traded for a wrong result. It is fundamentally impossible for the compiler to help here precisely because both expressions are legal. This is really bad.

It honestly makes no sense to me why someone would even bother implementing a linear algebra library if the implementation won't follow linear algebra but just some "close enough" facsimile of it. Just... do it right. Please.

isodoublet