O'Reilly logo

The C++ Programming Language, Fourth Edition by Bjarne Stroustrup

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

29. A Matrix Design

Never express yourself more clearly than you are able to think.

– Niels Bohr

Introduction

Basic Matrix Uses; Matrix Requirements

A Matrix Template

Construction and Assignment; Subscripting and Slicing

Matrix Arithmetic Operations

Scalar Operations; Addition; Multiplication

Matrix Implementation

slice; Matrix Slices; Matrix_ref; Matrix List Initialization; Matrix Access; Zero-Dimensional Matrix

Solving Linear Equations

Classical Gaussian Elimination; Pivoting; Testing; Advice

29.1. Introduction

A language feature in isolation is boring and useless. This chapter demonstrates how features can be used in combination to address a challenging design task: a general N-dimensional matrix.

I have never seen a perfect matrix ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required