Top Banner
Elemental Manual Release 0.86-dev Jack Poulson November 01, 2015
606

Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Feb 07, 2018

Download

Documents

trancong
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental ManualRelease 0.86-dev

Jack Poulson

November 01, 2015

Page 2: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,
Page 3: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CONTENTS

1 Introduction 11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2 Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.3 License and copyright . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.4 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2 Build system 52.1 Handling mandatory external dependencies . . . . . . . . . . . . . . . . . . . . . 52.2 Soft dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.3 Getting Elemental’s source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.4 Building Elemental . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5 Build modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.6 Testing the C++11 installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.7 Testing the Python installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.8 Elemental as a CMake subproject . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.9 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.10 References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3 Core functionality 173.1 Imported library routines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173.2 Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.3 Element manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.4 Matrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.5 Grid . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 563.6 DistMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603.7 Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903.8 SparseMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923.9 DistGraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 953.10 DistSparseMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973.11 DistMultiVec . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 993.12 Viewing submatrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1013.13 Read/write proxies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063.14 FLAME-like partition tracking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108

4 BLAS-like linear algebra 1614.1 Level 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1614.2 Level 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2114.3 Level 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2214.4 Tuning parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241

i

Page 4: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

5 LAPACK-like linear algebra 2435.1 Reduction to condensed form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2435.2 Factorizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2545.3 Spectral analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2925.4 Matrix functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3295.5 Matrix properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3405.6 Linear solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3665.7 Euclidean minimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3765.8 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3915.9 Reflectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3955.10 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397

6 Optimization 3996.1 Solvers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3996.2 Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4156.3 Proximal maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4386.4 Utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443

7 Control theory 4657.1 Algebraic Ricatti . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4657.2 Lyapunov . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4677.3 Sylvester . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468

8 Special matrices 4718.1 Deterministic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4718.2 Random . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510

9 Input/output 5199.1 Display . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5199.2 Print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5209.3 Spy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5219.4 Read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5229.5 Write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524

10 Indices 527

Bibliography 529

Index 533

ii

Page 5: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

ONE

INTRODUCTION

1.1 Overview

Elemental is a library for distributed-memory “direct” linear algebra and optimization, withthe term “direct” being the best single descriptor for the class of algorithms containing denselinear algebra, sparse-direct linear algebra, and Interior Point Methods for convex optimiza-tion. Elemental originally began as an object-oriented analogue and extension of the paralleldense linear algebra library [PLAPACK], which was designed around the idea of building agraph of different matrix distributions and providing simple API for moving a matrix fromone such distribution to another throughout the course of a computation. Over time, the func-tionality of Elemental steadily expanded beyond its beginnings; at one point, Elemental wasquite similar in scope to [ScaLAPACK], the most widely-used library for extending [LAPACK]to distributed-memory architectures, but Elemental now also implements distributed-memorysparse-direct solvers and Interior Point Methods, and so there is no longer another library withcomparable depth and scope.

Elemental’s name is derived from the fact that, unlike PLAPACK and ScaLAPACK, its primarydense matrix distributions are designed to spread matrix entries in element-wise, as opposedto block-wise, fashions [PEtAl2013]. Some of the unique features of Elemental include dis-tributed implementations of:

• Dense and sparse Interior Point Methods for Linear, Quadratic, and Second-Order Coneprograms

• Support for dense and sparse basis pursuit, Lasso, SVM, etc.

• Distributed Jordan algebras over products of Second-order Cones

• High-performance pseudospectral computation and visualization

• Quadratic-time low-rank Cholesky and LU modifications

• Bunch-Kaufman and Bunch-Parlett for accurate symmetric factorization

• LU and Cholesky with full pivoting

• Column-pivoted QR and interpolative/skeleton decompositions

• Quadratically Weighted Dynamic Halley iteration for the polar decomposition

• Spectral Divide and Conquer Schur decomposition and Hermitian EVD

• Many algorithms for Singular-Value soft-Thresholding (SVT)

• Tall-skinny QR decompositions

• Hermitian matrix functions

1

Page 6: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Elemental currently supports C++11, C, and Python interfaces, while an R interface is beingmaintained by Rodrigo Canales and a Julia interface is under development. Interfaces to otherlanguages, such as Fortran 90, can be built on top of the C interface in a straightforward, ifnot tedious, manner. Ideally Elemental will eventually be hooked into LLVM in order to helpautomate the creation of external interfaces.

1.2 Dependencies

• Functioning C++11 and ANSI C compilers.

• A working MPI2 implementation

• BLAS and LAPACK (ideally version 3.3 or greater) implementations.

• CMake (version 2.8.8 or later).

If a sufficiently up-to-date C++11 compiler is used (e.g., recent versions of g++ or clang++),Elemental should be straightforward to build on Unix-like platforms. Building on MicrosoftWindows platforms should also be possible with modest effort.

1.3 License and copyright

All files distributed with Elemental, with the exception of Elemental’s custom ParMETIS exten-sions (which can easily be disabled), are distributed under the terms of the New BSD license,which states:

Redistribution and use in source and binary forms, with or without

modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice,

this list of conditions and the following disclaimer.

- Redistributions in binary form must reproduce the above copyright notice,

this list of conditions and the following disclaimer in the documentation

and/or other materials provided with the distribution.

- Neither the name of the owner nor the names of its contributors

may be used to endorse or promote products derived from this software

without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"

AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE

IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE

ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE

LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR

CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF

SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS

INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN

CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)

ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE

POSSIBILITY OF SUCH DAMAGE.

But note that Elemental optionally downloads and installs a number of libraries, such as:

2 Chapter 1. Introduction

Page 7: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1. METIS, which is made available under the (equally permissive) Apache License, Version2.0.

2. ParMETIS, which can not be used for commercial purposes (it can be disabled with theCMake option -D EL DISABLE PARMETIS=TRUE),

3. libquadmath, which is available under the terms of the GNU GPL (it can be disabledwith the CMake option -D EL DISABLE QUAD=TRUE),

4. OpenBLAS, which is available under the New BSD License (it can be disabled with -D

EL DISABLE OPENBLAS=TRUE),

5. BLIS, which is available under the New BSD License (it can be disabled with -D

EL DISABLE BLIS=TRUE), and

6. ScaLAPACK, which is also available under the New BSD License (and can be disabledwith -D EL DISABLE SCALAPACK=TRUE).

Most source files contain the copyright notice:

Copyright (c) 2009-2015, Jack Poulson

All rights reserved.

For an up-to-date list of contributing authors, please see the AUTHORS file.

1.4 References

1.4. References 3

Page 8: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4 Chapter 1. Introduction

Page 9: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

TWO

BUILD SYSTEM

Elemental’s build system relies on CMake in order to manage a large number of configurationoptions in a platform-independent manner; it can be easily configured to build on Linux andUnix environments (including Darwin), as well as via Cygwin in a Windows environment (Vi-sual Studio’s is expected to begin supporting constexpr, which is heavily used by Elemental,with the official VS 2015 release in July 2015). A relatively recent C++11 compiler (e.g., gcc >=4.7) is required in all cases.

Elemental’s main external dependencies are

1. CMake ,

2. MPI ,

3. BLAS ,

4. LAPACK,

5. METIS, and

6. PMRRR,

and the dependencies which can not currently be automatically handled by Elemental’s buildsystem are

1. CMake, and

2. MPI.

2.1 Handling mandatory external dependencies

2.1.1 Installing CMake

Elemental uses several relatively new CMake modules, so it is important to ensure that CMakeversion 2.8.12 or later is available. Thankfully, the installation process is extremely straightfor-ward: either download a platform-specific binary from the downloads page, or instead grabthe most recent stable tarball and have CMake bootstrap itself. In the simplest case, the boot-strap process is as simple as running the following commands:

./bootstrap

make

sudo make install

Note that recent versions of Ubuntu (e.g., version 13.10) have sufficiently up-to-date versionsof CMake, and so the following command is sufficient for installation:

5

Page 10: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

sudo apt-get install cmake

If you do install from source, there are two important issues to consider

1. By default, make install attempts a system-wide installation (e.g., into /usr/bin) andwill likely require administrative privileges. A different installation folder may be speci-fied with the --prefix option to the bootstrap script, e.g.,:

./bootstrap --prefix=/home/your_username

make

make install

Afterwards, it is a good idea to make sure that the environment variable PATH includesthe bin subdirectory of the installation folder, e.g., /home/your username/bin.

2. Some highly optimizing compilers will not correctly build CMake, but the GNU compil-ers nearly always work. You can specify which compilers to use by setting the environ-ment variables CC and CXX to the full paths to your preferred C and C++ compilers beforerunning the bootstrap script.

Basic usage

Though many configuration utilities, like autoconf, are designed such that the user needonly invoke ./configure && make && sudo make install from the top-level source direc-tory, CMake targets out-of-source builds, which is to say that the build process occurs awayfrom the source code. The out-of-source build approach is ideal for projects that offer severaldifferent build modes, as each version of the project can be built in a separate folder.

A common approach is to create a folder named build in the top-level of the source directoryand to invoke CMake from within it:

mkdir build

cd build

cmake ..

The last line calls the command line version of CMake, cmake, and tells it that it should lookin the parent directory for the configuration instructions, which should be in a file namedCMakeLists.txt. Users that would prefer a graphical interface from the terminal (throughcurses) should instead use ccmake (on Unix platforms) or CMakeSetup (on Windows plat-forms). In addition, a GUI version is available through cmake-gui.

Though running make clean will remove all files generated from running make, it will not re-move configuration files. Thus, the best approach for completely cleaning a build is to removethe entire build folder. On *nix machines, this is most easily accomplished with:

cd ..

rm -rf build/

This is perhaps a safer habit than simply running rm -rf * since, if accidentally run from thewrong directory, deleting build/ would be unlikely to have any effect.

2.1.2 Installing MPI

An implementation of the Message Passing Interface (MPI) is required for building Elemental.The two most commonly used implementations are

6 Chapter 2. Build system

Page 11: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1. MPICH,

2. OpenMPI, and

3. MVAPICH,

where MVAPICH is primarily focused on systems with InfiniBand and/or GPUs.

Each of the respective websites contains installation instructions, but, on recent versions ofUbuntu, MPICH2 can be installed with

sudo apt-get install libmpich2-dev

and OpenMPI can be installed with

sudo apt-get install libopenmpi-dev

Alternatively, one could manually download and install a recent stable release of MPICH,typically available from http://www.mpich.org/downloads/. For example, to download andinstall mpich-3.1.4, one might run:

wget http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz

tar -xzf mpich-3.1.4.tar.gz

cd mpich-3.1.4/

./configure --prefix=/where/to/install/mpich --CC=YourCCompiler --CXX=YourC++Compiler --FC=YourFortranCompiler

make

sudo make install

where the sudo is obviously not needed if you have permission to install files into the directoryspecified with --prefix. Lastly, these instructions assumed the existence of a Fortran compiler,and so, if one is not available, you should instead run the commands:

wget http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz

tar -xzf mpich-3.1.4.tar.gz

cd mpich-3.1.4/

./configure --prefix=/where/to/install/mpich --CC=YourCCompiler --CXX=YourC++Compiler --disable-fortran

make

sudo make install

2.2 Soft dependencies

As was already mentioned, Elemental has several external dependencies which can be op-tionally be handled by the build process, and one (PMRRR), which is always built by Ele-mental. For the optionally-specified dependencies (i.e., BLAS, LAPACK, METIS, ParMETIS,and ScaLAPACK), if custom implementations were not specified during the CMake configu-ration phase, then appropriate libraries will be automatically downloaded/built/installed viaCMake’s ExternalProject functionality. In particular, Elemental can automatically fulfill depen-dencies using:

1. OpenBLAS or BLIS (to provide BLAS+LAPACK)

2. METIS and/or ParMETIS (for computing a vertex separator of a graph), and

3. ScaLAPACK (for implementations of distributed Hessenberg QR algorithms).

Furthermore, there are several further (optional) external dependencies:

2.2. Soft dependencies 7

Page 12: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1. libFLAME is recommended for faster SVD’s due to its high-performance bidiagonal QRalgorithm implementation,

2. libquadmath for quad-precision support (and more robust sparse-direct solvers),

3. Qt5 for C++11 matrix visualization,

4. matplotlib for Python matrix visualization,

5. NetworkX for Python graph visualization, and

6. NumPy for supporting the Python interface in general.

Support is not required for any of these libraries, but each is helpful for particular componentsof Elemental’s functionality.

2.2.1 Installing BLAS and LAPACK

The Basic Linear Algebra Subprograms (BLAS) and Linear Algebra PACKage (LAPACK) areboth used heavily within Elemental. On most installations of Ubuntu, either of the followingcommand should suffice for their installation:

sudo apt-get install libopenblas-dev

sudo apt-get install libatlas-dev liblapack-dev

The reference implementation of LAPACK can be found at

http://www.netlib.org/lapack/

and the reference implementation of BLAS can be found at

http://www.netlib.org/blas/

However, it is better to install an optimized version of these libraries, especialy for the BLAS.The most commonly used open-source versions the BLAS are ATLAS, OpenBLAS, and BLIS. Ifno version of BLAS+LAPACK is detected, Elemental attempts to download and install Open-BLAS (or BLIS).

OpenBLAS

OpenBLAS is a high-performance implementation of the BLAS (and, to a somewhat lesserdegree, LAPACK) which Elemental defaults to downloading and installing if no other high-performance implementation was detected . For example, by default, on Mac OS X, eitherAccelerate or vecLib is used, but this behavior may be overridden via the CMake option -D

EL PREFER OPENBLAS=TRUE. Furthermore, Elemental may be requested not to use OpenBLASvia the option -D EL DISABLE OPENBLAS=TRUE. Lastly, while Elemental will, by default, searchfor a previous installation of OpenBLAS before attempting to download and install the library,this search can be prevented via the -D EL BUILD OPENBLAS=TRUE option.

BLIS

BLIS is “a software framework for instantiating high-performance BLAS-like dense linear al-gebra libraries” and can optionally be downloaded and installed as part of Elemental’s buildprocess. In order to do so on non-Apple architectures, the flag -D EL DISABLE OPENBLAS=TRUE

should be enabled to avoid the OpenBLAS default, and, on Apple-architectures, the flag -D

8 Chapter 2. Build system

Page 13: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

EL PREFER BLIS LAPACK=TRUE should be specified to avoid the vecLib/Accelerate frame-works.

libFLAME

libFLAME is an open source library made available as part of the FLAME project. Elemen-tal’s current implementation of parallel SVD is dependent upon a serial kernel for the bidi-agonal SVD. A high-performance implementation of this kernel was recently introduced in[vZvdGQ2014].

Installation of libFLAME is fairly straightforward. It is recommended that you download thelatest nightly snapshot from

http://www.cs.utexas.edu/users/flame/snapshots/

and then installation should simply be a matter of running:

./configure

make

sudo make install

Automatic installation of libflame will hopefully be added into Elemental’s build system soon(pending the resolution of issues in the current libflame build system). Until that time, itis necessary to manually specify libflame as part of the MATH LIBS variable. For example, iflibflame is available at /path/to/libflame.a, then this library needs to be prepended to thelist of BLAS and LAPACK libraries, e.g., via:

-D MATH_LIBS="/path/to/libflame.a;-L/usr/lib -llapack -lblas -lm"

or:

-D MATH_LIBS="/path/to/libflame.a;-mkl"

2.2.2 PMRRR

PMRRR is a parallel implementation of the MRRR algorithm introduced by Inderjit Dhillonand Beresford Parlett for computing k eigenvectors of a tridiagonal matrix of size n in 𝒪(nk)time. PMRRR was written by Matthias Petschow and Paolo Bientinesi and, while it is includedwithin Elemental, it is also available at:

http://code.google.com/p/pmrrr

Note that PMRRR currently requires support for pthreads.

2.2.3 METIS

METIS is perhaps the most widely-used library for (hyper)graph partitioning and is the de-fault tool used within Elemental in order to construct vertex separators for the Nested Dissec-tion approach to sparse-direct factorization. In particular, Elemental makes use of the routineMETIS ComputeVertexSeparator, which is somewhat undocumented but used by ParMETIS.METIS, unlike ParMETIS, is released under the terms of the Apache License Version 2.0 (whichis similar in spirit to Elemental’s New BSD License).

2.2. Soft dependencies 9

Page 14: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Support for METIS can be disabled via the CMake option -D EL DISABLE METIS=TRUE, or El-emental can be requested to avoid detecting a previous installation and instead immediatelydecide to download/install the library via the -D EL BUILD METIS=TRUE option.

2.2.4 ParMETIS

ParMETIS is a parallel version of METIS that is unfortunately released under a more restric-tive license that does not allow for commercial usage, and so commercial users should addthe CMake option -D EL DISABLE PARMETIS=TRUE when configuring Elemental. Furthermore,since ParMETIS, unlike METIS, does not provide a routine for computing a vertex separator ofa graph, Elemental makes use of ParMETIS’s internal APIs in order to construct such a routine(which can be viewed as a parallel analogue of METIS ComputeVertexSeparator).

Also, Elemental can be requested to avoid detecting a previous installation (which is extremelyunlikely to be sufficient due to Elemental’s usage of ParMETIS’s internal API, which is nottypically installed) and instead immediately decide to download and install the library via the-D EL BUILD PARMETIS=TRUE option.

2.2.5 ScaLAPACK

ScaLAPACK is the most widely-used library for distributed-memory dense linear algebra andcontains a number of routines not implemented elsewhere. In particular, its distributed Hes-senberg Schur decomposition support can be optionally used within Elemental for comput-ing Schur decompositions (which is the preprocessing step for Elemental’s high-performancepseudospectral calculations). The routines resulting from the work of [HWD2002] (and thecorresponding complex implementation from [Fahey2003]), as well as the later AED versionsfrom [GKK2010], are all used in different instances.

Support for ScaLAPACK can be disabled via the CMake option -D

EL DISABLE SCALAPACK=TRUE, or Elemental can be requested to avoid detecting previousinstallations and to download/install the library via -D EL BUILD SCALAPACK=TRUE.

2.2.6 libquadmath

If a GNU compiler is being used to compile Elemental, then it is likely that support for libquad-math was detected, and, by default, this would lead to both more robust Interior Point Meth-ods and your copy of Elemental transitioning from the terms of the New BSD License to theGNU General Public License. If you prefer not to use Elemental under the terms of the GPL,then libquadmath must be disabled via the CMake option -D EL DISABLE QUAD=TRUE.

2.2.7 Qt5

Qt is an open source cross-platform library for creating Graphical User Interfaces (GUIs) inC++. Elemental currently supports using version 5.1.1 of the library to display and save imagesof matrices.

Please visit Qt Project’s download page for download and installation instructions. Note that,if Elemental is launched with the -no-gui command-line option, then Qt5 will be started with-out GUI support. This supports using Elemental on clusters whose compute nodes do not rundisplay servers, but PNG’s of matrices need to be created using Qt5’s simple interface.

10 Chapter 2. Build system

Page 15: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

2.3 Getting Elemental’s source

There are two basic approaches:

1. Download a tarball of the most recent version from libelemental.org/releases. A newversion is typically released every one to two months.

2. Install git and check out a copy of the repository by running

git clone git://github.com/elemental/Elemental.git

2.4 Building Elemental

On Unix-like machines with MPI and CMake installed in standard locations, Elemental canoften be built and installed using the commands:

git clone https://github.com/elemental/Elemental

cd Elemental

mkdir build

cd build

cmake ..

sudo make

sudo make install

Note that super-user privileges may be required for the make phase due to the installation ofexternal packages.

As with the installation of CMake, the default install location is system-wide, e.g., /usr/local.The installation directory of the main library can be changed at any time by invoking CMakewith the option:

-D CMAKE_INSTALL_PREFIX=/your/desired/install/path

and the installation of the Python interface can be switched from the default system-widelocation to the user’s home directory via the option:

-D INSTALL_PYTHON_INTO_USER_SITE=ON

or instead installed into $CMAKE INSTALL PREFIX/python/ via the option:

-D INSTALL_PYTHON_PACKAGE=OFF

Alternatively, the user can specify a particular directory for the python package via:

-D PYTHON_SITE_PACKAGES=/your/desired/python/install/path

Though the above instructions will work on many systems, it is common to need to man-ually specify several build options, especially when multiple versions of libraries or sev-eral different compilers are available on your system. For instance, any C++, C, or For-tran compiler can respectively be set with the CMAKE CXX COMPILER, CMAKE C COMPILER, andCMAKE Fortran COMPILER variables, e.g.,

-D CMAKE_CXX_COMPILER=/usr/bin/g++ \

-D CMAKE_C_COMPILER=/usr/bin/gcc \

-D CMAKE_Fortran_COMPILER=/usr/bin/gfortran

2.3. Getting Elemental’s source 11

Page 16: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

and it may be necessary to manually specify the paths to the MPI compilers as well using, forexample, the options:

-D MPI_CXX_COMPILER=/usr/bin/mpicxx \

-D MPI_C_COMPILER=/usr/bin/mpicc \

-D MPI_Fortran_COMPILER=/usr/bin/mpif90

It is also occasionally necessary to specify which libraries need to be linked in order to linkto BLAS and LAPACK (and, if SVD is important, libFLAME). The MATH LIBS variable wasintroduced for this purpose and an (unrecommended for performance reasons) example forspecifying BLAS and LAPACK libraries in /usr/lib might be

-D MATH_LIBS="-L/usr/lib -llapack -lblas -lm"

whereas specifying Intel’s MKL libraries when using the Intel compilers is often as simple as:

-D MATH_LIBS="-mkl"

It is important to ensure that if library A depends upon library B, A should be specified tothe left of B; in this case, LAPACK depends upon BLAS, so -llapack is specified to the leftof -lblas. If MATH LIBS is not specified, then Elemental will attempt to download and installeither OpenBLAS or BLIS, or, failing that, search for an installed reference implementation.

2.5 Build modes

Elemental currently has two different build modes:

• Debug - Maintains a call stack and provides significant error-checking.

• Release - An optimized build suitable for production usage (assuming high-performanceBLAS and MPI implementations were used)

The build mode can be specified with the CMAKE BUILD TYPE option, e.g., -D

CMAKE BUILD TYPE=Debug. If this option is not specified, Elemental defaults to the Re-lease build mode.

Once the build mode is selected, one might also want to manually set the optimization level ofthe compiler, e.g., via the CMake option -D CXX FLAGS="-O3".

Furthermore, there is also an option to attempt to make use of OpenMP parallelization whenpacking and unpacking MPI buffers that is enabled when the -D EL HYBRID=TRUE CMake op-tion is set. If this option is used, the user should ensure that a threaded BLAS implementationis used.

2.6 Testing the C++11 installation

Once Elemental has been installed, it is a good idea to verify that it is functioning properly.This can be accomplished by simply running:

make test

Alternatively, an example of generating a random distributed matrix, computing its Sin-gular Value Decomposition (SVD), and checking for numerical error is available in exam-ples/lapack like/SVD.cpp.

12 Chapter 2. Build system

Page 17: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

As you can see, the only required header is El.hpp, which must be in the include pathwhen compiling this simple driver, SVD.cpp. If Elemental was installed in /usr/local, then/usr/local/conf/ElVars can be used to build a simple Makefile:

include /usr/local/conf/ElVars

SVD: SVD.cpp

$CXX $EL_COMPILE_FLAGS $< -o $@ $EL_LINK_FLAGS $EL_LIBS

As long as SVD.cpp and this Makefile are in the current directory, simply typing make shouldbuild the driver.

The executable can then typically be run with a single process (generating a 300 × 300 dis-tributed matrix, using

./SVD --height 300 --width 300

and the output should be similar to

||A||_max = 0.999997

||A||_1 = 165.286

||A||_oo = 164.116

||A||_F = 173.012

||A||_2 = 19.7823

||A - U Sigma V^H||_max = 2.20202e-14

||A - U Sigma V^H||_1 = 1.187e-12

||A - U Sigma V^H||_oo = 1.17365e-12

||A - U Sigma V^H||_F = 1.10577e-12

||A - U Sigma V_H||_F / (max(m,n) eps ||A||_2) = 1.67825

The driver can be run with several processes using the MPI launcher provided by your MPIimplementation; a typical way to run the SVD driver on eight processes would be:

mpirun -np 8 ./SVD --height 300 --width 300

You can also build a wide variety of example and test drivers (unfortunately the line is a littleblurred) by using the CMake options:

-D EL_EXAMPLES=ON

and/or

-D EL_TESTS=ON

2.7 Testing the Python installation

A number of Python example scripts which, for example, solve sparse linear systems andquadratic programs, may be found at examples/interface. However, it is typically necessaryto augment the environment variable PYTHONPATH, and perhaps also LD LIBRARY PATH.

2.7.1 Linux systems

On most Linux systems, it will be necessary to append $(CMAKE INSTALL PREFIX)/lib toLD LIBRARY PATH as well as setting PYTHONPATH to a value dependent upon how Elemental

2.7. Testing the Python installation 13

Page 18: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

was instructed to install the Python interface. In the default case, where Python is installedinto the global site packages directory, PYTHONPATH should be set to the result of:

from distutils.sysconfig import get_python_lib

print get_python_lib()

which may have a value suh as $(HOME)/anaconda/lib/python2.7/site-packages.

In cases where the CMake option INSTALL PYTHON PACKAGE=OFF was specified, PYTHONPATHshould be set to $(CMAKE INSTALL PREFIX)/python, whereas, if the CMake optionINSTALL PYTHON INTO USER SITE=ON was specified, then PYTHONPATH should be set to the re-sult of:

import site

print site.USER_SITE

which is frequently $(HOME)/.local/lib/python2.7/site-packages.

2.7.2 Mac OS X

It should typically only be necessary to set PYTHONPATH in the same way as on Linux systems(there should be no need to set LD LIBRARY PATH, nor its OS X equivalent, DYLD LIBRARY PATH).

2.8 Elemental as a CMake subproject

Note: These instructions are somewhat out of date and so an email to [email protected] be more appropriate for now in order to help with using Elemental as a subproject ofanother CMake build system.

Adding Elemental as a dependency into a project which uses CMake for its build system can berelatively straightforward: simply put an entire copy of the Elemental source tree in a subdirec-tory of your main project folder, say external/elemental, and then create a CMakeLists.txt

file in your main project folder that builds off of the following snippet:

cmake_minimum_required(VERSION 2.8.8)

project(Foo)

add_subdirectory(external/elemental)

include_directories("$PROJECT_BINARY_DIR/external/El/include")

include_directories($MPI_CXX_INCLUDE_PATH)

# Build your project here

# e.g.,

# add_library(foo $LIBRARY_TYPE $FOO_SRC)

# target_link_libraries(foo El)

2.9 Troubleshooting

If you run into build problems, please email [email protected] and make sure to at-tach the file include/El/config.h, which should be generated within your build directory.

14 Chapter 2. Build system

Page 19: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Please only direct usage questions to [email protected], and development questions [email protected].

2.10 References

2.10. References 15

Page 20: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

16 Chapter 2. Build system

Page 21: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

THREE

CORE FUNCTIONALITY

3.1 Imported library routines

Since one of the goals of Elemental is to provide high-performance datatype-independent par-allel routines, yet Elemental’s dependencies are datatype-dependent, it is convenient to firstbuild a thin datatype-independent abstraction on top of the necessary routines from BLAS,LAPACK, and MPI. The “first-class” datatypes are float, double, Complex<float>, andComplex<double>, but int and byte (unsigned char) are supported for many cases, andsupport for higher precision arithmetic is in the works.

3.1.1 BLAS

The Basic Linear Algebra Subprograms (BLAS) are heavily exploited within Elemental in orderto achieve high performance whenever possible. Since the official BLAS interface uses differentroutine names for different datatypes, the following interfaces are built directly on top of thedatatype-specific versions.

The prototypes can be found in include/El/core/imports/blas.hpp, while the implementa-tions are in src/imports/blas.cpp.

Level 1

void blas::Axpy(int n, T alpha, const T *x, int incx, T *y, int incy)Performs y := αx + y for vectors x, y ∈ Tn and scalar α ∈ T. x and y must be stored suchthat xi occurs at x[i*incx] (and likewise for y).

T blas::Dot(int n, const T *x, int incx, T *y, int incy)Returns α := xHy, where x and y are stored in the same manner as in blas::Axpy.

T blas::Dotc(int n, const T *x, int incx, T *y, int incy)Equivalent to blas::Dot, but this name is kept for historical purposes (the BLAS provide?dotc and ?dotu for complex datatypes).

T blas::Dotu(int n, const T *x, int incx, T *y, int incy)Similar to blas::Dot, but this routine instead returns α := xTy (x is not conjugated).

Base<T> blas::Nrm2(int n, const T *x, int incx)Return the Euclidean two-norm of the vector x, where ||x||2 =

√∑n−1

i=0 |xi|2. Note thatif T represents a complex field, then the return type is the underlying real field (e.g.,T=Complex<double> results in a return type of double), otherwise T equals the returntype.

17

Page 22: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void blas::Rot(int n, F *x, int incx, F *y, int incy, Base<F> c, F s)Apply a Givens rotation to the length n vectors x and y.

void blas::Scal(int n, T alpha, T *x, int incx)Performs x := αx, where x ∈ Tn is stored in the manner described in blas::Axpy, andα ∈ T.

void blas::Swap(int n, T *x, int incx, T *y, int incy)Swap the length n vectors x and y.

Level 2

void blas::Gemv(char trans, int m, int n, T alpha, const T *A, int lda, const T *x, int incx, Tbeta, T *y, int incy)

Updates y := αop(A)x + βy, where A ∈ Tm×n and op(A) ∈

A, AT, AH is chosen bychoosing trans from N, T, C, respectively. Note that x is stored in the manner repeat-edly described in the Level 1 routines, e.g., blas::Axpy, but A is stored such that A(i, j)is located at A[i+j*lda].

void blas::Ger(int m, int n, T alpha, const T *x, int incx, const T *y, int incy, T *A, int lda)Updates A := αxyH + A, where A ∈ Tm×n and x, y, and A are stored in the mannerdescribed in blas::Gemv.

void blas::Gerc(int m, int n, T alpha, const T *x, int incx, const T *y, int incy, T *A, intlda)

Equivalent to blas::Ger, but the name is provided for historical reasons (the BLAS pro-vides ?gerc and ?geru for complex datatypes).

void blas::Geru(int m, int n, T alpha, const T *x, int incx, const T *y, int incy, T *A, intlda)

Same as blas::Ger, but instead perform A := αxyT + A (y is not conjugated).

void blas::Hemv(char uplo, int m, T alpha, const T *A, int lda, const T *x, int incx, T beta,T *y, int incy)

Performs y := αAx + βy, where A ∈ Tm×n is assumed to be Hermitian with the datastored in either the lower or upper triangle of A (depending upon whether uplo is equalto ‘L’ or ‘U’, respectively).

void blas::Her(char uplo, int m, T alpha, const T *x, int incx, T *A, int lda)Performs A := αxxH + A, where A ∈ Tm×m is assumed to be Hermitian, with the datastored in the triangle specified by uplo (depending upon whether uplo is equal to ‘L’ or‘U’, respectively).

void blas::Her2(char uplo, int m, T alpha, const T *x, int incx, const T *y, int incy, T *A,int lda)

Performs A := α(xyH + yxH) + A, where A ∈ Tm×m is assumed to be Hermitian, withthe data stored in the triangle specified by uplo (depending upon whether uplo is equalto ‘L’ or ‘U’, respectively).

void blas::Symv(char uplo, int m, T alpha, const T *A, int lda, const T *x, int incx, T beta,T *y, int incy)

The same as blas::Hemv, but A ∈ Tm×m is instead assumed to be symmetric, and theupdate is y := αAx + βy.

Note: The single and double precision complex interfaces, csymv and zsymv, are techni-cally a part of LAPACK and not BLAS.

18 Chapter 3. Core functionality

Page 23: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void blas::Syr(char uplo, int m, T alpha, const T *x, int incx, T *A, int lda)The same as blas::Her, but A ∈ Tm×m is instead assumed to be symmetric, and theupdate is A := αxxT + A.

Note: The single and double precision complex interfaces, csyr and zsyr, are technicallya part of LAPACK and not BLAS.

void blas::Syr2(char uplo, int m, T alpha, const T *x, int incx, const T *y, int incy, T *A,int lda)

The same as blas::Her2, but A ∈ Tm×m is instead assumed to be symmetric, and theupdate is A := α(xyT + yxT) + A.

Note: The single and double precision complex interfaces do not exist in BLAS or LA-PACK, so Elemental instead calls csyr2k or zsyr2k with k=1. This is likely far fromoptimal, though Syr2 is not used very commonly in Elemental.

void blas::Trmv(char uplo, char trans, char diag, int m, const T *A, int lda, T *x, int incx)Perform the update x := αop(A)x, where A ∈ Tm×m is assumed to be either lower orupper triangular (depending on whether uplo is ‘L’ or ‘U’), unit diagonal if diag equals‘U’, and op(A) ∈

A, AT, AH is determined by trans being chosen as ‘N’, ‘T’, or ‘C’,

respectively.

void blas::Trsv(char uplo, char trans, char diag, int m, const T *A, int lda, T *x, int incx)Perform the update x := αop(A)−1x, where A ∈ Tm×m is assumed to be either lower orupper triangular (depending on whether uplo is ‘L’ or ‘U’), unit diagonal if diag equals‘U’, and op(A) ∈

A, AT, AH is determined by trans being chosen as ‘N’, ‘T’, or ‘C’,

respectively.

Level 3

void blas::Gemm(char transA, char transB, int m, int n, int k, T alpha, const T *A, int lda,const T *B, int ldb, T beta, T *C, int ldc)

Perform the update C := αopA(A)opB(B)+ βC, where opA and opB are each determined(according to transA and transB) in the manner described for blas::Trmv; it is requiredthat C ∈ Tm×n and that the inner dimension of opA(A)opB(B) is k.

void blas::Hemm(char side, char uplo, int m, int n, T alpha, const T *A, int lda, const T *B,int ldb, T beta, T *C, int ldc)

Perform either C := αAB + βC or C := αBA + βC (depending upon whether side isrespectively ‘L’ or ‘R’) where A is assumed to be Hermitian with its data stored in eitherthe lower or upper triangle (depending upon whether uplo is set to ‘L’ or ‘U’, respectively)and C ∈ Tm×n.

void blas::Her2k(char uplo, char trans, int n, int k, T alpha, const T *A, int lda, const T *B,int ldb, T beta, T *C, int ldc)

Perform either C := α(ABH + BAH)βC or C := α(AHB + BH A)βC (depending uponwhether trans is respectively ‘N’ or ‘C’), where C ∈ Tn×n is assumed to be Hermitian,with the data stored in the triangle specified by uplo (see blas::Hemv) and the innerdimension of ABH or AHB is equal to k.

void blas::Herk(char uplo, char trans, int n, int k, T alpha, const T *A, int lda, T beta, T *C,int ldc)

3.1. Imported library routines 19

Page 24: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Perform either C := αAAH + βC or C := αAH A + βC (depending upon whether trans isrespectively ‘N’ or ‘C’), where C ∈ Tn×n is assumed to be Hermitian with the data storedin the triangle specified by uplo (see blas::Hemv) and the inner dimension of AAH orAH A equal to k.

void blas::Hetrmm(char uplo, int n, T *A, int lda)Form either A := LH L or A := UUH, depending upon the choice of uplo: if uplo equals‘L’, then L ∈ Tn×n is equal to the lower triangle of A, otherwise U is read from the uppertriangle of A. In both cases, the relevant triangle of A is overwritten in order to store theHermitian product.

Note: This routine is built on top of the LAPACK routines slauum, dlauum, clauum, andzlauum; it in the BLAS section since its functionality is extremely BLAS-like.

void blas::Symm(char side, char uplo, int m, int n, T alpha, const T *A, int lda, const T *B,int ldb, T beta, T *C, int ldc)

Perform either C := αAB + βC or C := αBA + βC (depending upon whether side isrespectively ‘L’ or ‘R’) where A is assumed to be symmetric with its data stored in eitherthe lower or upper triangle (depending upon whether uplo is set to ‘L’ or ‘U’, respectively)and C ∈ Tm×n.

void blas::Syr2k(char uplo, char trans, int n, int k, T alpha, const T *A, int lda, const T *B,int ldb, T beta, T *C, int ldc)

Perform either C := α(ABT + BAT)βC or C := α(ATB + BT A)βC (depending uponwhether trans is respectively ‘N’ or ‘T’), where C ∈ Tn×n is assumed to be symmetric,with the data stored in the triangle specified by uplo (see blas::Symv) and the inner di-mension of ABT or ATB is equal to k.

void blas::Syrk(char uplo, char trans, int n, int k, T alpha, const T *A, int lda, T beta, T *C,int ldc)

Perform either C := αAAT + βC or C := αAT A + βC (depending upon whether trans isrespectively ‘N’ or ‘T’), where C ∈ Tn×n is assumed to be symmetric with the data storedin the triangle specified by uplo (see blas::Symv) and the inner dimension of AAT orAT A equal to k.

void blas::Trmm(char side, char uplo, char trans, char unit, int m, int n, T alpha, const T*A, int lda, T *B, int ldb)

Performs C := αop(A)B or C := αBop(A), depending upon whether side was chosen as‘L’ or ‘R’, respectively. Whether A is treated as lower or upper triangular is determinedby whether uplo is ‘L’ or ‘U’ (setting unit equal to ‘U’ treats A as unit diagonal, otherwiseit should be set to ‘N’). op is determined in the same manner as in blas::Trmv.

void blas::Trsm(char side, char uplo, char trans, char unit, int m, int n, T alpha, const T*A, int lda, T *B, int ldb)

Performs C := αop(A)−1B or C := αBop(A)−1, depending upon whether side was cho-sen as ‘L’ or ‘R’, respectively. Whether A is treated as lower or upper triangular is de-termined by whether uplo is ‘L’ or ‘U’ (setting unit equal to ‘U’ treats A as unit diagonal,otherwise it should be set to ‘N’). op is determined in the same manner as in blas::Trmv.

3.1.2 LAPACK

A handful of LAPACK routines are currently used by Elemental: a few routines for queryingfloating point characteristics and a few other utilities. In addition, there are several BLAS-like

20 Chapter 3. Core functionality

Page 25: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

routines which are technically part of LAPACK (e.g., csyr) which were included in the BLASimports section.

The prototypes can be found in include/El/core/imports/lapack.hpp, while the implementa-tions are in src/imports/lapack.cpp.

Machine information

In all of the following functions, R can be equal to either float or double.

Real lapack::MachineEpsilon<Real>()Return the relative machine precision.

Real lapack::MachineSafeMin<Real>()Return the minimum number which can be inverted without underflow.

Real lapack::MachinePrecision<Real>()Return the relative machine precision multiplied by the base.

Real lapack::MachineUnderflowExponent<Real>()Return the minimum exponent before (gradual) underflow occurs.

Real lapack::MachineUnderflowThreshold<Real>()Return the underflow threshold: (base)^((underflow exponent)-1).

Real lapack::MachineOverflowExponent<Real>()Return the largest exponent before overflow.

Real lapack::MachineOverflowThreshold<Real>()Return the overflow threshold: (1-rel. prec.)) * (base)^(overflow exponent).

Safe norms

Real lapack::SafeNorm(Real alpha, Real beta)Return

√α2 + β2 in a manner which avoids under/overflow. R can be equal to either

float or double.

Real lapack::SafeNorm(Real alpha, Real beta, Real gamma)Return

√α2 + β2 + γ2 in a manner which avoids under/overflow. R can be equal to

either float or double.

Givens rotations

Given φ, γ ∈ Cn×n, carefully compute c ∈ R and s, ρ ∈ C such that[c s−s c

] [φγ

]=

[ρ0

],

where c2 + |s|2 = 1 and the mapping from (φ, γ) → (c, s, ρ) is “as continuous as possible”, inthe manner described by Kahan and Demmel’s “On computing Givens rotations reliably andefficiently”.

F lapack::Givens(F phi, F gamma, Base<F> *c, F *s)Computes a Givens rotation and returns the combined result, ρ.

3.1. Imported library routines 21

Page 26: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

MRRR-based Hermitian EVP

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, Base<F> absTol= 0)

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, F *Z, int ldz,Base<F> absTol = 0)

Compute all eigen-values/pairs of a Hermitian matrix.

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, int il, int iu,Base<F> absTol = 0)

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, F *Z, int ldz, intil, int iu, Base<F> absTol = 0)

Compute the il‘th through iu‘th eigen-values/pairs of a Hermitian matrix.

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, Base<F> vl,Base<F> vu, Base<F> absTol = 0)

void lapack::HermitianEig(char uplo, int n, F *A, int lda, Base<F> *w, F *Z, int ldz,Base<F> vl, Base<F> vu, Base<F> absTol = 0)

Compute the eigen-values/pairs of a Hermitian matrix with eigenvalues in the half-openinterval (vl , vu].

QR- and DQDS-based SVD

void lapack::QRSVD(int m, int n, F *A, int lda, Base<F> *s, F *U, int ldu, F *VAdj, int ldva)Computes the singular value decomposition of a general matrix by running the QR al-gorithm on the condensed bidiagonal matrix.

void lapack::SVD(int m, int n, F *A, int lda, Base<F> *s)Computes the singular values of a general matrix by running DQDS on the condensedbidiagonal matrix.

Divide-and-conquer SVD

void lapack::DivideAndConquerSVD(int m, int n, F *A, int lda, Base<F> *s, F *U, int ldu,F *VAdj, int ldva)

Computes the SVD of a general matrix using a divide-and-conquer algorithm on thecondensed bidiagonal matrix.

Bidiagonal QR

void lapack::BidiagQRAlg(char uplo, int n, int numColsVTrans, int numRowsU, Base<F>*d, Base<F> *e, F *VAdj, int ldva, F *U, int ldu)

Computes the SVD of a bidiagonal matrix using the QR algorithm.

Hessenberg Schur decomposition

void lapack::HessenbergSchur(int n, F *H, int ldh, Complex<Base<F>> *w, bool fullTri-angle = false)

Computes the eigenvalues (and possibly the full Schur factor) of an upper Hessenbergmatrix using the QR algorithm.

22 Chapter 3. Core functionality

Page 27: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void lapack::HessenbergSchur(int n, F *H, int ldh, Complex<Base<F>> *w, F *Q, intldq, bool fullTriangle = true, bool multiplyQ = false)

Computes the eigenvalues (and possibly the full Schur factor) as well as the Schur vectorsof of an upper Hessenberg matrix using the QR algorithm. If multiplyQ is true, then theSchur vectors are multiplied against the input matrix from the right.

Hessenberg eigenvalues/pairs

void lapack::HessenbergEig(int n, F *H, int ldh, Complex<Base<F>> *w)

Computes the eigenvalues of an upper Hessenberg matrix using the QR algorithm.

Note: There are not yet wrappers for computing Hessenberg eigenvectors.

Schur decomposition

void lapack::Schur(int n, F *A, int lda, Complex<Base<F>> *w, bool fullTriangle = false)Returns the eigenvalues (and possibly also the Schur factor) of a square matrix using theQR algorithm.

void lapack::Schur(int n, F *A, int lda, Complex<Base<F>> *w, F *Q, int ldq, bool full-Triangle = true)

Returns the Schur decomposition of a square matrix using the QR algorithm.

Eigenvalues/pairs

void lapack::Eig(int n, F *A, int lda, Complex<Base<F>> *w)

Returns the eigenvalues of a square matrix using the QR algorithm.

Note: There are not yet wrappers for computing general eigenvectors.

3.1.3 MPI

All communication within Elemental is built on top of the Message Passing Interface (MPI).Just like with BLAS and LAPACK, a minimal set of datatype independent abstractions hasbeen built directly on top of the standard MPI interface. This has the added benefit of local-izing the changes required for porting Elemental to architectures that do not have full MPIimplementations available.

The prototypes can be found in include/El/core/imports/mpi.hpp, while the implementa-tions are in src/imports/mpi.cpp.

Datatypes

class mpi::Comm

MPI Comm comm

Comm(MPI Comm mpiComm = MPI COMM NULL)

3.1. Imported library routines 23

Page 28: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool operator==(const mpi::Comm &a, const mpi::Comm &b)

bool operator!=(const mpi::Comm &a, const mpi::Comm &b)

class mpi::Group

MPI Group group

Group(MPI Group mpiGroup = MPI GROUP NULL)

bool operator==(const mpi::Group &a, const mpi::Group &b)

bool operator!=(const mpi::Group &a, const mpi::Group &b)

class mpi::Op

MPI Op op

Op(MPI Op mpiOp = MPI OP NULL)

bool operator==(const mpi::Op &a, const mpi::Op &b)

bool operator!=(const mpi::Op &a, const mpi::Op &b)

type mpi::Datatype

Equivalent to MPI Datatype.

type mpi::ErrorHandler

Equivalent to MPI Errhandler.

type mpi::Request

Equivalent to MPI Request.

type mpi::Status

Equivalent to MPI Status.

type mpi::UserFunction

Equivalent to MPI User function.

Constants

const int mpi::ANY SOURCE

Equivalent to MPI ANY SOURCE.

const int mpi::ANY TAG

Equivalent to MPI ANY TAG.

const int mpi::THREAD SINGLE

Equivalent to MPI THREAD SINGLE.

const int mpi::THREAD FUNNELED

Equivalent to MPI THREAD FUNNELED.

const int mpi::THREAD SERIALIZED

Equivalent to MPI THREAD SERIALIZED.

const int mpi::THREAD MULTIPLE

Equivalent to MPI THREAD MULTIPLE.

24 Chapter 3. Core functionality

Page 29: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

const int mpi::UNDEFINEDEquivalent to MPI UNDEFINED.

const mpi::Group mpi::GROUP NULL

Equivalent to MPI GROUP NULL.

const mpi::Comm mpi::COMM NULL

Equivalent to MPI COMM NULL.

const mpi::Comm mpi::COMM SELF

Equivalent to MPI COMM SELF.

const mpi::Comm mpi::COMM WORLD

Equivalent to MPI COMM WORLD.

const mpi::ErrorHandler mpi::ERRORS RETURN

Equivalent to MPI ERRORS RETURN.

const mpi::ErrorHandler mpi::ERRORS ARE FATAL

Equivalent to MPI ERRORS ARE FATAL.

const mpi::Group mpi::GROUP EMPTY

Equivalent to MPI GROUP EMPTY.

const mpi::Request mpi::REQUEST NULL

Equivalent to MPI REQUEST NULL.

const mpi::Op mpi::MAX

Equivalent to MPI MAX.

const mpi::Op mpi::MIN

Equivalent to MPI MIN.

const mpi::Op mpi::PROD

Equivalent to MPI PROD.

const mpi::Op mpi::SUM

Equivalent to MPI SUM.

const mpi::Op mpi::LOGICAL AND

Equivalent to MPI LAND.

const mpi::Op mpi::LOGICAL OR

Equivalent to MPI LOR.

const mpi::Op mpi::LOGICAL XOR

Equivalent to MPI LXOR.

const mpi::Op mpi::BINARY AND

Equivalent to MPI BAND.

const mpi::Op mpi::BINARY OR

Equivalent to MPI BOR.

const mpi::Op mpi::BINARY XOR

Equivalent to MPI BXOR.

const int mpi::MIN COLL MSG

The minimum message size for collective communication, e.g., the minimum number ofelements contributed by each process in an MPI Allgather. By default, it is hardcoded to

3.1. Imported library routines 25

Page 30: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1 in order to avoid problems with MPI implementations that do not support the 0 cornercase.

Routines

Environmental

void mpi::Initialize(int &argc, char **&argv)Equivalent of MPI Init (but notice the difference in the calling convention).

# include "El.hpp"

using namespace El;

int main( int argc, char* argv[] )

mpi::Initialize( argc, argv );

...

mpi::Finalize();

return 0;

int mpi::InitializeThread(int &argc, char **&argv, int required)The threaded equivalent of mpi::Initialize; the return integer indicates the level ofachieved threading support, e.g., mpi::THREAD MULTIPLE.

void mpi::Finalize()

Shut down the MPI environment, freeing all of the allocated resources.

bool mpi::Initialized()Return true if MPI has been initialized.

bool mpi::Finalized()Return true if MPI has been finalized.

double mpi::Time()

Return the current wall-time in seconds.

void mpi::Create(mpi::UserFunction *func, bool commutes, Op &op)Create a custom operation for use in reduction routines, e.g., mpi::Reduce,mpi::AllReduce, and mpi::ReduceScatter, where mpi::UserFunction could be de-fined as

namespace mpi

typedef void (UserFunction) ( void* a, void* b, int* length, mpi::Datatype* datatype );

The commutes parameter is also important, as it specifies whether or not the operationb[i] = a[i] op b[i], for i=0,...,length-1, can be performed in an arbitrary order(for example, using a minimum spanning tree).

void mpi::Free(mpi::Op &op)Free the specified MPI reduction operator.

26 Chapter 3. Core functionality

Page 31: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Communicator manipulation

int mpi::Rank(mpi::Comm comm)

Return our rank in the specified communicator.

int mpi::Size(mpi::Comm comm)

Return the number of processes in the specified communicator.

void mpi::Create(mpi::Comm parentComm, mpi::Group subsetGroup, mpi::Comm &subset-Comm)

Create a communicator (subsetComm) which is a subset of parentComm consisting of theprocesses specified by subsetGroup.

void mpi::Dup(mpi::Comm original, mpi::Comm &duplicate)Create a copy of a communicator.

void mpi::Split(mpi::Comm comm, int color, int key, mpi::Comm &newComm)

Split the communicator comm into different subcommunicators, where each process spec-ifies the color (unique integer) of the subcommunicator it will reside in, as well as its key(rank) for the new subcommunicator.

void mpi::Free(mpi::Comm &comm)

Free the specified communicator.

bool mpi::Congruent(mpi::Comm comm1, mpi::Comm comm2)Return true if the two communicators consist of the same set of processes (in the sameorder).

void mpi::ErrorHandlerSet(mpi::Comm comm, mpi::ErrorHandler errorHandler)Modify the specified communicator to use the specified error-handling approach.

Cartesian communicator manipulation

void mpi::CartCreate(mpi::Comm comm, int numDims, const int *dimensions, const int*periods, bool reorder, mpi::Comm &cartComm)

Create a Cartesian communicator (cartComm) from the specified communicator (comm),given the number of dimensions (numDims), the sizes of each dimension (dimensions),whether or not each dimension is periodic (periods), and whether or not the ordering ofthe processes may be changed (reorder).

void mpi::CartSub(mpi::Comm comm, const int *remainingDims, mpi::Comm &subComm)

Create this process’s subcommunicator of comm that results from only keeping the spec-ified dimensions (0 for ignoring and 1 for keeping).

Group manipulation

int mpi::Rank(mpi::Group group)Return our rank in the specified group.

int mpi::Size(mpi::Group group)Return the number of processes in the specified group.

void mpi::CommGroup(mpi::Comm comm, mpi::Group &group)Extract the underlying group from the specified communicator.

3.1. Imported library routines 27

Page 32: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void mpi::Dup(mpi::Group group, mpi::Group &newGroup)While MPI Group dup does not exist, we can mirror its functionality by unioning a groupwith itself.

void mpi::Union(mpi::Group groupA, mpi::Group groupB, mpi::Group &newGroup)Unions the ranks in groups A and B into a single new group.

void mpi::Incl(mpi::Group group, int n, const int *ranks, mpi::Group &subGroup)Create a subgroup of group that consists of the n processes whose ranks are specified inthe ranks array.

void mpi::Difference(mpi::Group parent, mpi::Group subset, mpi::Group &complement)Form a group (complement) out of the set of processes which are in the parent communi-cator, but not in the subset communicator.

void mpi::Free(mpI::Group &group)Free the specified group.

int mpi::Translate(mpi::Group origGroup, int origRank, mpi::Group newGroup)

int mpi::Translate(mpi::Comm origComm, int origRank, mpi::Group newGroup)

int mpi::Translate(mpi::Group origGroup, int origRank, mpi::Comm newComm)

int mpi::Translate(mpi::Comm origComm, int origRank, mpi::Comm newComm)

Return the new rank within newGroup (newComm) of the process specified by its rank inorigGroup (origComm).

void mpi::Translate(mpi::Group origGroup, int size, const int *origRanks, mpi::GroupnewGroup, int *newRanks)

void mpi::Translate(mpi::Comm origComm, int size, const int *origRanks, mpi::GroupnewGroup, int *newRanks)

void mpi::Translate(mpi::Group origGroup, int size, const int *origRanks, mpi::CommnewComm, int *newRanks)

void mpi::Translate(mpi::Comm origComm, int size, const int *origRanks, mpi::CommnewComm, int *newRanks)

Return the ranks within newGroup (newComm) of the size processes specified by theirranks in origGroup (origComm) using the origRanks array. The result will be in thenewRanks array, which must have been preallocated to a length at least as large as size.

Utilities

void mpi::Barrier(mpi::Comm comm)

Pause until all processes within the comm communicator have called this routine.

void mpi::Wait(mpi::Request &request)Pause until the specified request has completed.

bool mpi::Test(mpi::Request &request)Return true if the specified request has completed.

bool mpi::IProbe(int source, int tag, mpi::Comm comm, mpi::Status &status)Return true if there is a message ready which

•is from the process with rank source in the communicator comm (note thatmpi::ANY SOURCE is allowed)

28 Chapter 3. Core functionality

Page 33: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

•had the integer tag tag

If true was returned, then status will have been filled with the relevant information, e.g.,the source’s rank.

int mpi::GetCount<T>(mpi::Status &status)Return the number of entries of the specified datatype which are ready to be received.

Point-to-point communication

void mpi::Send(const T *buf, int count, int to, int tag, mpi::Comm comm)

Send count entries of type T to the process with rank to in the communicator comm, andtag the message with the integer tag.

void mpi::ISend(const T *buf, int count, int to, int tag, mpi::Comm comm, mpi::Request&request)

Same as mpi::Send, but the call is non-blocking.

void mpi::ISSend(const T *buf, int count, int to, int tag, mpi::Comm comm, mpi::Request&request)

Same as mpi::ISend, but the call is in synchronous mode.

void mpi::Recv(T *buf, int count, int from, int tag, mpi::Comm comm)

Receive count entries of type T from the process with rank from in the communicatorcomm, where the message must have been tagged with the integer tag.

void mpi::IRecv(T *buf, int count, int from, int tag, mpi::Comm comm, mpi::Request &re-quest)

Same as mpi::Recv, but the call is non-blocking.

void mpi::SendRecv(const T *sendBuf, int sendCount, int to, int sendTag, T *recvBuf, intrecvCount, int from, int recvTag, mpi::Comm comm)

Send sendCount entries of type T to process to, and simultaneously receive recvCountentries of type T from process from.

Collective communication

void mpi::Broadcast(T *buf, int count, int root, mpi::Comm comm)

The contents of buf (count entries of type T) on process root are duplicated in the localbuffers of every process in the communicator.

void mpi::Gather(const T *sendBuf, int sendCount, T *recvBuf, int recvCount, int root,mpi::Comm comm)

Each process sends an independent amount of data (i.e., sendCount entries of type T) tothe process with rank root; the root process must specify the maximum number of entriessent from each process, recvCount, so that the data received from process i lies within the[i*recvCount,(i+1)*recvCount) range of the receive buffer.

void mpi::AllGather(const T *sendBuf, int sendCount, T *recvBuf, int recvCount,mpi::Comm comm)

Same as mpi::Gather, but every process receives the result.

void mpi::Scatter(const T *sendBuf, int sendCount, T *recvBuf, int recvCount, int root,mpi::Comm comm)

The same as mpi::Gather, but in reverse: the root process starts with an array of dataand sends the [i*sendCount,(i+1)*sendCount) entries to process i.

3.1. Imported library routines 29

Page 34: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void mpi::AllToAll(const T *sendBuf, int sendCount, T *recvBuf, int recvCount,mpi::Comm comm)

This can be thought of as every process simultaneously scattering data: after completion,the [i*recvCount,(i+1)*recvCount) portion of the receive buffer on process j will con-tain the [j*sendCount,(j+1)*sendCount) portion of the send buffer on process i, wheresendCount refers to the value specified on process i, and recvCount refers to the valuespecified on process j.

void mpi::AllToAll(const T *sendBuf, const int *sendCounts, const int *sendDispls, T*recvBuf, const int *recvCounts, const int *recvDispls, mpi::Commcomm)

Same as previous mpi::AllToAll, but the amount of data sent to andreceived from each process is allowed to vary; after completion, the[recvDispls[i],recvDispls[i]+recvCounts[i]) portion of the receive buffer onprocess j will contain the [sendDispls[j],sendDispls[j]+sendCounts[j]) portion ofthe send buffer on process i.

void mpi::Reduce(const T *sendBuf, T *recvBuf, int count, mpi::Op op, int root, mpi::Commcomm)

The root process receives the result of performing

Sp−1 + (Sn−2 + · · · (S2 + (S1 + S0)) · · · ), where Si represents the send buffer of process i,and + represents the operation specified by op.

void mpi::AllReduce(const T *sendBuf, T *recvBuf, int count, mpi::Op op, mpi::Commcomm)

Same as mpi::Reduce, but every process receives the result.

void mpi::ReduceScatter(const T *sendBuf, T *recvBuf, const int *recvCounts, mpi::Opop, mpi::Comm comm)

Same as mpi::AllReduce, but process 0 only receives the [0,recvCounts[0]) portion ofthe result, process 1 only receives the [recvCounts[0],recvCounts[0]+recvCounts[1])portion of the result, etc.

3.1.4 PMRRR

Rather than directly using Petschow and Bientinesi’s parallel implementation of the MultipleRelatively Robust Representations (MRRR) algorithm, several simplified interfaces have beenexposed.

The prototypes can be found in include/El/core/imports/pmrrr.hpp, while the implementa-tions are in the folder external/pmrrr/.

Data structures

class herm tridiag eig::Estimate

For returning upper bounds on the number of local and global eigenvalues with eigen-values lying in the specified interval, (a, b].

int numLocalEigenvaluesThe upper bound on the number of eigenvalues in the specified interval that ourprocess stores locally.

int numGlobalEigenvaluesThe upper bound on the number of eigenvalues in the specified interval.

30 Chapter 3. Core functionality

Page 35: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class herm tridiag eig::Info

For returning information about the computed eigenvalues.

int numLocalEigenvaluesThe number of computed eigenvalues that our process locally stores.

int numGlobalEigenvaluesThe number of computed eigenvalues.

int firstLocalEigenvalueThe index of the first eigenvalue stored locally on our process.

Compute all eigenvalues

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,mpi::Comm comm)

Compute all of the eigenvalues of the real symmetric tridiagonal matrix with diagonald and subdiagonal e: the eigenvalues will be stored in w and the work will be dividedamong the processors in comm.

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,double *Z, int ldz, mpi::Comm comm)

Same as above, but also compute the corresponding eigenvectors.

Compute eigenvalues within interval

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,mpi::Comm comm, double a, double b)

Only compute the eigenvalues lying within the interval (a, b].

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,double *Z, int ldz, mpi::Comm comm,double a, double b)

Same as above, but also compute the corresponding eigenvectors.

herm tridiag eig::Estimate herm tridiag eig::EigEstimate(int n, double *d, double *w,mpi::Comm comm, doublea, double b)

Return upper bounds on the number of local and global eigenvalues lying within thespecified interval.

Compute eigenvalues in index range

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,mpi::Comm comm, int a, int b)

Only compute the eigenvalues with indices ranging from a to b, where 0 ≤ a ≤ b < n.

herm tridiag eig::Info herm tridiag eig::Eig(int n, double *d, double *e, double *w,double *Z, int ldz, mpi::Comm comm, inta, int b)

Same as above, but also compute the corresponding eigenvectors.

3.1. Imported library routines 31

Page 36: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.1.5 libFLAME

int FLA Bsvd v opd var1(int k, int mU, int mV, int nGH, int nIterMax, double *d, int dInc,double *e, int eInc, Complex<double> *G, int rsG, int csG, Com-plex<double> *H, int rsH, int csH, double *U, int rsU, int csU,double *V, int rsV, int csV, int nb)

int FLA Bsvd v opd var1(int k, int mU, int mV, int nGH, int nIterMax, double *d, int dInc,double *e, int eInc, Complex<double> *G, int rsG, int csG, Com-plex<double> *H, int rsH, int csH, Complex<double> *U, intrsU, int csU, Complex<double> *V, int rsV, int csV, int nb)

Optional high-performance implementations of the bidiagonal QR algorithm. This can lead tosubstantial improvements in Elemental’s distributed-memory SVD on supported architectures(as of now, modern Intel architectures).

3.1.6 ScaLAPACK

BLACS

A handful of Basic Linear Algebra Communication Subprograms (BLACS) routines are cur-rently exposed to Elemental if MATH LIBS was detected to contain a recent version of ScaLA-PACK.

int blacs::Handle(MPI Comm comm)

int blacs::GridInit(int bhandle, bool colMajor, int gridHeight, int gridWidth)

int blacs::GridHeight(int context)

int blacs::GridWidth(int context)

int blacs::GridRow(int context)

int blacs::GridCol(int context)

void blacs::FreeHandle(int bhandle)

void blacs::FreeGrid(int context)

void blacs::Exit(bool finished = true)

type blacs::Desc

Currently a typedef to std::array<int,9>.

While the following routine is not a wrapper around a BLACS routine, it is the most commonmeans of filling a blacs::Desc from a BlockMatrix:

blacs::Desc FillDesc(const BlockMatrix<F> &A, int context)Form the descriptor for the distributed matrix A using the specified context.

PBLAS

Level 2

Gemv

32 Chapter 3. Core functionality

Page 37: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void pblas::Gemv(char trans, int m, int n, F alpha, const F *A, const int *desca, const F *x,const int *descx, int incx, F beta, F *y, const int *descy, int incy)

Hemvvoid pblas::Hemv(char uplo, int n, F alpha, const F *A, const int *desca, const F *x, const

int *descx, int incx, F beta, F *y, const int *descy, int incy)

Symvvoid pblas::Symv(char uplo, int n, F alpha, const F *A, const int *desca, const F *x, const

int *descx, int incx, F beta, F *y, const int *descy, int incy)

Note: ScaLAPACK does not provide complex versions of Symv.

Trmvvoid pblas::Trmv(char uplo, char trans, char diag, int n, const F *A, const int *desca, F *x,

const int *descx, int incx)

Trsvvoid pblas::Trsv(char uplo, char trans, char diag, int n, const F *A, const int *desca, F *x,

const int *descx, int incx)

Level 3

Gemmvoid pblas::Gemm(char transa, char transb, int m, int n, int k, F alpha, const F *A, const int

*desca, const F *B, const int *descb, F beta, F *C, const int *descc)

Trmmvoid pblas::Trmm(char side, char uplo, char trans, char diag, int m, int n, F alpha, const F

*A, const int *desca, F *B, const int *descb)

Trsmvoid pblas::Trsm(char side, char uplo, char trans, char diag, int m, int n, F alpha, const F

*A, const int *desca, F *B, const int *descb)

ScaLAPACK proper

Factorizations

Choleskyvoid scalapack::Cholesky(char uplo, int n, F *A, const int *desca)

Spectral analysis

Reduction of a generalized HPD EVP to standard form

3.1. Imported library routines 33

Page 38: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Two-sided Trsmvoid TwoSidedTrsm(char uplo, int n, F *A, const int *desca, const F *B, const int *descb)

Two-sided Trmmvoid TwoSidedTrmm(char uplo, int n, F *A, const int *desca, const F *B, const int *descb)

Hessenberg Schur decompositionvoid scalapack::HessenbergSchur(int n, F *H, int *desch, Complex<Base<F>> *w, bool

fullTriangle = false, bool aed = false)Computes the eigenvalues (and possibly the full Schur factor) of an upper Hessenbergmatrix using the QR algorithm. Aggressive Early Deflation may be optionally used forreal matrices, but there are known bugs in the ScaLAPACK implementation.

void scalapack::HessenbergSchur(int n, F *H, int *desch, Complex<Base<F>> *w, F *Q,int *descq, bool fullTriangle = true, bool multiplyQ =false, bool aed = false)

Computes the eigenvalues (and possibly the full Schur factor) as well as the Schur vectorsof of an upper Hessenberg matrix using the QR algorithm. If multiplyQ is true, thenthe Schur vectors are multiplied against the input matrix from the right. AggressiveEarly Deflation may be optionally used for real matrices, but there are known bugs inthe ScaLAPACK implementation.

Hessenberg eigenvaluesvoid scalapack::HessenbergEig(int n, F *H, int *desch, Complex<Base<F>> *w)

Computes the eigenvalues of an upper Hessenberg matrix using the QR algorithm.

Note: There are not yet wrappers for computing Hessenberg eigenvectors.

3.1.7 METIS and ParMETIS

If ParMETIS was not disabled (e.g., by commercial users), then Elemental makes use ofParMETIS’s internal API’s in order to expose an interface for computing a vertex separatorin parallel. If ParMETIS was disabled, then Elemental instead makes use of the (sequential)METIS routine METIS ComputeVertexSeparator.

In either case, a primitive for performing a nodal bisection of a graph is used within Elementalin order to find Nested Dissection orderings of sparse matrices.

3.2 Environment

This section describes the routines and data structures which help set up Elemental’s program-ming environment: it discusses initialization of Elemental, call stack manipulation, a customdata structure for complex data, many routines for manipulating real and complex data, alitany of custom enums, and a few useful routines for simplifying index calculations.

34 Chapter 3. Core functionality

Page 39: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.2.1 Boiler plate

Initialization

Initializes Elemental and (if necessary) MPI. The usage is very similar to MPI Init, but the argcand argv can be directly passed in.

C++ API

void Initialize()

void Initialize(int &argc, char **&argv)

# include "El.hpp"

int main( int argc, char* argv[] )

El::Initialize( argc, argv );

// ...

El::Finalize();

return 0;

C API

ElError ElInitialize(int* argc, char*** argv)

Finalization

The following routines free all resources allocated by Elemental and (if necessary) MPI.

C++ API

void Finalize()

C API

ElError ElFinalize()

Testing for initialization

Several routines are provided for querying whether or not Elemental is currently initialized.

C++ API

bool Initialized()

3.2. Environment 35

Page 40: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElInitialized(bool* initialized)

Exception handling

C++ API

void ReportException(std::exception &e)Used for handling Elemental’s various exceptions, e.g.,

# include "El.hpp"

int main( int argc, char* argv[] )

El::Initialize( argc, argv );

try

// ...

catch( std::exception& e ) ReportException(e);

El::Finalize();

return 0;

C API

Please see the :c:type::ElError enum.

3.2.2 Error handling

C++ API

class SingularMatrixExceptionAn extension of std::runtime error which is meant to be thrown when a singular ma-trix is unexpectedly encountered.

SingularMatrixException(const char *msg = “Matrix was singular”)Builds an instance of the exception which allows one to optionally specify the errormessage.

throw El::SingularMatrixException();

class NonHPDMatrixExceptionAn extension of std::runtime error which is meant to be thrown when a non positive-definite Hermitian matrix is unexpectedly encountered (e.g., during Cholesky factoriza-tion).

NonHPDMatrixException(const char *msg = “Matrix was not HPD”)Builds an instance of the exception which allows one to optionally specify the errormessage.

throw El::NonHPDMatrixException();

36 Chapter 3. Core functionality

Page 41: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class NonHPSDMatrixExceptionAn extension of std::runtime error which is meant to be thrown when a non positivesemi-definite Hermitian matrix is unexpectedly encountered (e.g., during computationof the square root of a Hermitian matrix).

NonHPSDMatrixException(const char *msg = “Matrix was not HPSD”)Builds an instance of the exception which allows one to optionally specify the errormessage.

throw El::NonHPSDMatrixException();

C API

ElError

An enum which can be set to one of the following values:

•EL SUCCESS

•EL ALLOC ERROR

•EL OUT OF BOUNDS ERROR

•EL ARG ERROR

•EL LOGIC ERROR

•EL RUNTIME ERROR

•EL ERROR

const char* ElErrorString(ElError error)Convert the error code into a (hopefully) descriptive message

3.2.3 Call stack manipulation

Note: The following call stack manipulation routines are only available in non-release builds(i.e., Debug) and are meant to allow for the call stack to be printed (via DumpCallStack() )when an exception is caught.

void PushCallStack(std::string s)Push the given routine name onto the call stack.

void PopCallStack()

Remove the routine name at the top of the call stack.

void DumpCallStack()

Print (and empty) the contents of the call stack.

3.2.4 Default process grid

Grid &DefaultGrid()

Return a process grid built over mpi::COMM WORLD . This is typically used as a means ofallowing instances of the DistMatrix<T,MC,MR> class to be constructed without havingto manually specify a process grid, e.g.,

3.2. Environment 37

Page 42: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

// Build a 10 x 10 distributed matrix over mpi::COMM_WORLD

El::DistMatrix<T,MC,MR> A( 10, 10 );

3.2.5 Blocksize manipulation

Int Blocksize()Return the currently chosen algorithmic blocksize. The optimal value depends on theproblem size, algorithm, and architecture; the default value is 128.

void SetBlocksize(Int blocksize)Change the algorithmic blocksize to the specified value.

void PushBlocksizeStack(Int blocksize)It is frequently useful to temporarily change the algorithmic blocksize, so rather thanhaving to manually store and reset the current state, one can simply push a new valueonto a stack (and later pop the stack to reset the value).

void PopBlocksizeStack()

Pops the stack of blocksizes. See above.

Int DefaultBlockHeight()

Int DefaultBlockWidth()Returns the default block height (width) for BlockMatrix<scalarType,colDist,rowDist>.

void SetDefaultBlockHeight(Int mb)

void SetDefaultBlockWidth(Int nb)Change the default block height (width) for BlockMatrix<scalarType,colDist,rowDist>.

3.2.6 Other typedefs and enums

C++ API

type byte

typedef unsigned char byte;

type Int

Typically a typedef to int, but if the experimental EL USE 64BIT INTS compilation modeis enabled, it becomes a typedef to long long int, which is guaranteed to be at least64-bit by C++11

type Unsigned

Typically a typedef to unsigned, but if the experimental EL USE 64BIT INTS compilationmode is enabled, it becomes a typedef to long long unsigned, which is guaranteed tobe at least 64-bit by C++11

enum Conjugation

enumerator CONJUGATED

enumerator UNCONJUGATED

enum Dist

For specifying the distribution of a row or column of a distributed matrix:

38 Chapter 3. Core functionality

Page 43: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

enumerator MCColumn of a standard matrix distribution

enumerator MDDiagonal of a standard matrix distribution

enumerator MRRow of a standard matrix distribution

enumerator VCColumn-major vector distribution

enumerator VRRow-major vector distribution

enumerator STARRedundantly stored on every process

enumerator CIRCStored on a single process

enum ForwardOrBackward

enumerator FORWARD

enumerator BACKWARD

enum GridOrder

For specifying either a ROW MAJOR or COLUMN MAJOR ordering; it is used to decide howto construct process grids and is also useful for tuning one of the algorithms inHermitianTridiag() which requires building a smaller square process grid from a rect-angular process grid, as the ordering of the processes can greatly impact performance.See SetHermitianTridiagGridOrder().

enumerator ROW MAJOR

enumerator COLUMN MAJOR

enum LeftOrRight

enumerator LEFT

enumerator RIGHT

enum SortType

enumerator UNSORTEDDo not sort.

enumerator DESCENDINGSmallest values first.

enumerator ASCENDINGLargest values first.

enum NormType

3.2. Environment 39

Page 44: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

enumerator ONE NORM

‖A‖1 = max‖x‖1=1

‖Ax‖1 = maxj

m−1

∑i=0

|αi,j|

enumerator INFINITY NORM

‖A‖∞ = max‖x‖∞=1

‖Ax‖∞ = maxi

n−1

∑j=0

|αi,j|

enumerator ENTRYWISE ONE NORM

‖vec(A)‖1 = ∑i,j

|αi,j|

enumerator MAX NORM

‖A‖max = maxi,j

|αi,j|

enumerator NUCLEAR NORM

‖A‖* =min(m,n)

∑i=0

σi(A)

enumerator FROBENIUS NORM

‖A‖F =

√√√√m−1

∑i=0

n−1

∑j=0

|αi,j|2 =min(m,n)

∑i=0

σi(A)2

enumerator TWO NORM

‖A‖2 = maxi

σi(A)

enum Orientation

enumerator NORMALDo not transpose or conjugate

enumerator TRANSPOSETranspose without conjugation

enumerator ADJOINTTranspose and conjugate

enum UnitOrNonUnit

enumerator UNIT

enumerator NON UNIT

enum UpperOrLower

40 Chapter 3. Core functionality

Page 45: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

enumerator LOWER

enumerator UPPER

enum VerticalOrHorizontal

enumerator VERTICAL

enumerator HORIZONTAL

C API

The following are analogues to the above C++ definitions.

ElByte

A typedef to unsigned char

ElInt

Typically a typedef to int, but if the experimental EL USE 64BIT INTS compilation modeis enabled, it becomes a typedef to long long int

ElUnsigned

Typically a typedef to unsigned, but if the experimental EL USE 64BIT INTS compilationmode is enabled, it becomes a typedef to long long unsigned

ElConjugation

An enum equal to either EL CONJUGATED or EL UNCONJUGATED

ElDist

An enum equal to one of:

•EL MC

•EL MD

•EL MR

•EL STAR

•EL VC

•EL VR

•EL CIRC

ElForwardOrBackward

An enum equal to either EL FORWARD or EL BACKWARD

ElGridOrder

An enum equal to either EL ROW MAJOR or EL COLUMN MAJOR

ElLeftOrRight

An enum equal to either EL LEFT or EL RIGHT

ElSortType

An enum equal to EL UNSORTED, EL ASCENDING, or EL DESCENDING

ElNormType

An enum equal to one of:

•EL ONE NORM

3.2. Environment 41

Page 46: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

•EL INFINITY NORM

•EL ENTRYWISE ONE NORM

•EL MAX NORM

•EL NUCLEAR NORM

•EL FROBENIUS NORM

•EL TWO NORM

ElOrientation

An enum equal to EL NORMAL, EL TRANSPOSE, or EL ADJOINT

ElUnitOrNonUnit

An enum equal to either EL UNIT or EL NON UNIT

ElUpperOrLower

An enum equal to either EL UPPER or EL LOWER

ElVerticalOrHorizontal

An enum equal to either EL VERTICAL or EL HORIZONTAL

3.2.7 Complex data

C++ API

type Complex<Real>Currently a typedef of std::complex<Real>

type Base<F>The underlying real datatype of the (potentially complex) datatype F. For example,Base<Complex<double>> and Base<double> are both equivalent to double. This isoften extremely useful in implementing routines which are templated over real and com-plex datatypes but still make use of real datatypes.

std::ostream &operator<<(std::ostream &os, Complex<Real> alpha)Pretty prints alpha in the form a+bi.

type scomplex

typedef Complex<float> scomplex;

type dcomplex

typedef Complex<double> dcomplex;

C API

complex float

A struct equivalent to struct complex float float real, imag; which is meantto be binary compatible with std::complex<float>.

complex double

A struct equivalent to struct complex double double real, imag; which ismeant to be binary compatible with std::complex<double>.

42 Chapter 3. Core functionality

Page 47: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.2.8 Indexing utilities

Int Shift(Int rank, Int firstRank, Int numProcs)Given a element-wise cyclic distribution over numProcs processes, where the first entryis owned by the process with rank firstRank, this routine returns the first entry owned bythe process with rank rank.

Int Length(Int n, Int shift, Int numProcs)Given a vector with n entries distributed over numProcs processes with shift as definedabove, this routine returns the number of entries of the vector which are owned by thisprocess.

Int Length(Int n, Int rank, Int firstRank, Int numProcs)Given a vector with n entries distributed over numProcs processes, with the first entryowned by process firstRank, this routine returns the number of entries locally owned bythe process with rank rank.

Int MaxLength(Int n, Int numProcs)The maximum result of Length() with the given parameters. This is useful for paddingcollective communication routines which are almost regular.

Int Mod(Int a, Int b)An extension of C++’s % operator which handles cases where a is negative and still re-turns a result in [0, b).

Int GCD(Int a, Int b)Return the greatest common denominator of the integers a and b.

Unsigned Log2(Unsigned n)Return the base-two logarithm of a positive integer.

bool PowerOfTwo(Unsigned n)Return whether or not a positive integer is an integer power of two.

3.2.9 Version and configuration information

Every Elemental driver with proper command-line argument processing will run PrintVersionif the --version argument is used. If --build is used, then all of the below information isreported.

Versioning

The following routines print the Git revision, (pre-)release version, and build type. For exam-ple:

Elemental version information:

Git revision: 3c6fbdaad901a554fc27a83378d63dab55af0dd3

Version: 0.86-dev

Build type: Debug

C++ API

void PrintVersion(std::ostream &os = std::cout)

3.2. Environment 43

Page 48: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElPrintVersion(FILE* stream)

Python API

PrintVersion(f=ctypes.pythonapi.PyFile AsFile(sys.stdout))

Configuration

The following routines print several relevant configuration details. For example:

Elemental configuration:

Math libraries: /usr/lib/liblapack.so;/usr/lib/libblas.so

Have FLAME bidiagonal SVD: YES

Have OpenMP: YES

Have Qt5: YES

Avoiding complex MPI: YES

Have MPI_Reducescatter_block: YES

Have MPI_IN_PLACE: YES

AllReduce ReduceScatterBlock: YES

Use byte AllGathers: YES

C++ API

void PrintConfig(std::ostream &os = std::cout)

C API

ElError ElPrintConfig(FILE* stream)

Python API

PrintConfig(f=ctypes.pythonapi.PyFile AsFile(sys.stdout))

C compiler info

The following routines print various details about the C compilation process. For example:

Elemental's C compiler info:

EL_CMAKE_C_COMPILER: /usr/local/bin/gcc

EL_MPI_C_COMPILER: /home/poulson/Install/bin/mpicc

EL_MPI_C_INCLUDE_PATH: /home/poulson/Install/include

EL_MPI_C_COMPILE_FLAGS:

EL_MPI_C_LINK_FLAGS: -Wl,-rpath -Wl,/home/poulson/Install/lib

EL_MPI_C_LIBRARIES: /home/poulson/Install/lib/libmpich.so;/home/poulson/Install/lib/libopa.so;/home/poulson/Install/lib/libmpl.so;/usr/lib/i386-linux-gnu/librt.so;/usr/lib/i386-linux-gnu/libpthread.so

44 Chapter 3. Core functionality

Page 49: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void PrintCCompilerInfo(std::ostream &os = std::cout)

C API

ElError ElPrintCCompilerInfo(FILE* stream)

Python API

PrintCCompilerInfo(f=ctypes.pythonapi.PyFile AsFile(sys.stdout))

C++ compiler info

The following routines print various details about the C++ compilation process. For example:

Elemental's C++ compiler info:

EL_CMAKE_CXX_COMPILER: /usr/local/bin/g++

EL_CXX_FLAGS: -Wall

EL_MPI_CXX_COMPILER: /home/poulson/Install/bin/mpicxx

EL_MPI_CXX_INCLUDE_PATH: /home/poulson/Install/include

EL_MPI_CXX_COMPILE_FLAGS:

EL_MPI_CXX_LINK_FLAGS: -Wl,-rpath -Wl,/home/poulson/Install/lib

EL_MPI_CXX_LIBRARIES: /home/poulson/Install/lib/libmpichcxx.so;/home/poulson/Install/lib/libmpich.so;/home/poulson/Install/lib/libopa.so;/home/poulson/Install/lib/libmpl.so;/usr/lib/i386-linux-gnu/librt.so;/usr/lib/i386-linux-gnu/libpthread.so

C++ API

void PrintCxxCompilerInfo(std::ostream &os = std::cout)

C API

ElError ElPrintCxxCompilerInfo(FILE* stream)

Python API

PrintCxxCompilerInfo(f=ctypes.pythonapi.PyFile AsFile(sys.stdout))

3.3 Element manipulation

In order to help support generic programming over a variety of (sometimes nonstandard)datatypes within Elemental, a number of very thin wrappers over standard mathematical li-brary functions are provided. Users who prefer to program with a single datatype and arecomfortable with their language’s standard library can safely ignore these routines.

3.3. Element manipulation 45

Page 50: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.3.1 Basic element manipulation and I/O

Return the real/imaginary part of an element

C++ API

T RealPart(const T &alpha)

T ImagPart(const T &alpha)

C API

Note: Since C does not support generic programming, it is best to directly manipulate thestructure for complex data.

Set the real/imaginary part of an element

Note: If an element is non-complex, an error is thrown if an attempt is made to set its imagi-nary component.

C++ API

void SetRealPart(T &alpha, Base<T> &beta)

void SetImagPart(T &alpha, Base<T> &beta)

C API

Note: Since C does not support generic programming, it is best to directly manipulate thestructure for complex data.

Update the real/imaginary part of an element

Note: If an element is non-complex, an error is thrown if an attempt is made to update itsimaginary component.

C++ API

void UpdateRealPart(T &alpha, Base<T> &beta)

void UpdateImagPart(T &alpha, Base<T> &beta)

46 Chapter 3. Core functionality

Page 51: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

Note: Since C does not support generic programming, it is best to directly manipulate thestructure for complex data.

Conjugate an element

C++ API

F Conj(const F &alpha)

C API

Note: Since C does not support generic programming, it is best to directly manipulate thestructure for complex data.

Return the complex argument

C++ API

Base<F> Arg(const F &alpha)

C API

ElError ElArg s(float alpha, float* result)

ElError ElArg d(double alpha, double* result)

ElError ElArg c(complex float alpha, float* result)

ElError ElArg z(complex double alpha, double* result)

Construct a complex number from its polar coordinates

C++ API

Complex<Real> Polar(const R &r, const R &theta = 0)

C API

ElError ElComplexFromPolar c(float r, float theta, complex float* result)

ElError ElComplexFromPolar z(double r, double theta, complex double* result)

3.3. Element manipulation 47

Page 52: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.3.2 Magnitude and sign

C++ API

Base<F> Abs(const F &alpha)Use the naive algorithm for computing the absolute value (note that unnecessary over-flow may occur for complex values, please see SafeAbs() )

Real SafeAbs(const Complex<Real> &alpha)Carefully avoid overflow via slapy2 or dlapy2

Real FastAbs(const Complex<Real> &alpha)Return the sum of the absolute values of the real and imaginary components

Real Sgn(const Real &alpha, bool symmetric = true)If α = 0, α/|α| is returned. If symmetric is true, sgn(0) = 0, otherwise, sgn(0) = 1.

C API

ElError ElAbs i(ElInt alpha, ElInt* result)

ElError ElAbs s(float alpha, float* result)

ElError ElAbs d(double alpha, double* result)

ElError ElAbs c(complex float alpha, float* result)

ElError ElAbs z(complex double alpha, double* result)

ElError ElSafeAbs c(complex float alpha, float* result)

ElError ElSafeAbs z(complex double alpha, double* result)

ElError ElFastAbs c(complex float alpha, float* result)

ElError ElFastAbs z(complex double alpha, double* result)

ElError ElSgn i(ElInt alpha, bool symmetric, ElInt* result)

ElError ElSgn s(float alpha, bool symmetric, float* result)

ElError ElSgn d(double alpha, bool symmetric, double* result)

3.3.3 Exponentiation

C++ API

F Exp(const F &alpha)Returns the exponential of a scalar

F Pow(const F &alpha, const T &beta)Returns αβ for scalar α and scalar or integer β

F Log(const F &alpha)Returns the natural logarithm of a scalar

F Sqrt(const F &alpha)Returns the square-root of a scalar

48 Chapter 3. Core functionality

Page 53: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElExp s(float alpha, float* result)

ElError ElExp d(double alpha, double* result)

ElError ElExp c(complex float alpha, complex float* result)

ElError ElExp z(complex double alpha, complex double* result)

ElError ElPow s(float alpha, float beta, float* result)

ElError ElPow d(double alpha, double beta, double* result)

ElError ElPow c(complex float alpha, complex float beta, complex float* result)

ElError ElPow z(complex double alpha, complex double beta, complex double* result)

ElError ElLog s(float alpha, float* result)

ElError ElLog d(double alpha, double* result)

ElError ElLog c(complex float alpha, complex float* result)

ElError ElLog z(complex double alpha, complex double* result)

ElError ElSqrt s(float alpha, float* result)

ElError ElSqrt d(double alpha, double* result)

ElError ElSqrt c(complex float alpha, complex float* result)

ElError ElSqrt z(complex double alpha, complex double* result)

3.3.4 Trigonometric functions

C++ API

F Cos(const F &alpha)

F Sin(const F &alpha)

F Tan(const F &alpha)Trigonometric functions

Acos(const F &alpha)

Asin(const F &alpha)

Atan(const F &alpha)Inverse trigonometric functions

Real Atan2(const Real &y, const Real &x)Return the inverse tangent of x + iy

C API

ElError ElCos s(float alpha, float* result)

ElError ElCos d(double alpha, double* result)

3.3. Element manipulation 49

Page 54: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElCos c(complex float alpha, complex float* result)

ElError ElCos z(complex double alpha, complex double* result)

ElError ElSin s(float alpha, float* result)

ElError ElSin d(double alpha, double* result)

ElError ElSin c(complex float alpha, complex float* result)

ElError ElSin z(complex double alpha, complex double* result)

ElError ElTan s(float alpha, float* result)

ElError ElTan d(double alpha, double* result)

ElError ElTan c(complex float alpha, complex float* result)

ElError ElTan z(complex double alpha, complex double* result)Trigonometric functions

ElError ElAcos s(float alpha, float* result)

ElError ElAcos d(double alpha, double* result)

ElError ElAcos c(complex float alpha, complex float* result)

ElError ElAcos z(complex double alpha, complex double* result)

ElError ElAsin s(float alpha, float* result)

ElError ElAsin d(double alpha, double* result)

ElError ElAsin c(complex float alpha, complex float* result)

ElError ElAsin z(complex double alpha, complex double* result)

ElError ElAtan s(float alpha, float* result)

ElError ElAtan d(double alpha, double* result)

ElError ElAtan c(complex float alpha, complex float* result)

ElError ElAtan z(complex double alpha, complex double* result)Inverse trigonometric functions

ElError ElAtan2 s(float y, float x, float* result)

ElError ElAtan2 d(double y, double x, double* result)Return the inverse tangent of the point x + iy

3.3.5 Hyperbolic functions

C++ API

F Cosh(const F &alpha)

F Sinh(const F &alpha)

F Tanh(const F &alpha)Hyperbolic functions

Acosh(const F &alpha)

50 Chapter 3. Core functionality

Page 55: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Asinh(const F &alpha)

Atanh(const F &alpha)Inverse hyperbolic functions

C API

ElError ElCosh s(float alpha, float* result)

ElError ElCosh d(double alpha, double* result)

ElError ElCosh c(complex float alpha, complex float* result)

ElError ElCosh z(complex double alpha, complex double* result)

ElError ElSinh s(float alpha, float* result)

ElError ElSinh d(double alpha, double* result)

ElError ElSinh c(complex float alpha, complex float* result)

ElError ElSinh z(complex double alpha, complex double* result)

ElError ElTanh s(float alpha, float* result)

ElError ElTanh d(double alpha, double* result)

ElError ElTanh c(complex float alpha, complex float* result)

ElError ElTanh z(complex double alpha, complex double* result)Hyperbolic functions

ElError ElAcosh s(float alpha, float* result)

ElError ElAcosh d(double alpha, double* result)

ElError ElAcosh c(complex float alpha, complex float* result)

ElError ElAcosh z(complex double alpha, complex double* result)

ElError ElAsinh s(float alpha, float* result)

ElError ElAsinh d(double alpha, double* result)

ElError ElAsinh c(complex float alpha, complex float* result)

ElError ElAsinh z(complex double alpha, complex double* result)

ElError ElAtanh s(float alpha, float* result)

ElError ElAtanh d(double alpha, double* result)

ElError ElAtanh c(complex float alpha, complex float* result)

ElError ElAtanh z(complex double alpha, complex double* result)Inverse hyperbolic functions

3.3. Element manipulation 51

Page 56: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.4 Matrix

3.4.1 Matrix (Python interface)

TODO

3.4.2 Matrix (C++ interface)

The Matrix<scalarType> class is the building of the library: its purpose is to provide con-venient mechanisms for performing basic matrix manipulations, such as setting and queryingindividual matrix entries, without giving up compatibility with interfaces such as BLAS andLAPACK, which assume column-major storage.

An example of generating an m × n matrix of real double-precision numbers where the (i, j)entry is equal to i − j would be:

# include "El.hpp"

using namespace El;

...

Matrix<double> A( m, n );

for( Int j=0; j<n; ++j )

for( Int i=0; i<m; ++i )

A.Set( i, j, double(i-j) );

whereas the complex double-precision equivalent could use Complex<double>, which is cur-rently a typedef for std::complex<double>.

The underlying data storage for Matrix<scalarType> is simply a contiguous buffer thatstores entries in a column-major fashion with a leading dimension which is only requiredto be at least as large as the height of the matrix (so that entry (i, j) is located at po-sition i+j*ldim). For modifiable instances of the Matrix<scalarType> class, the rou-tine Matrix<scalarType>::Buffer() returns a pointer to the underlying buffer, whileMatrix<scalarType>::LDim() returns the leading dimension; these two routines could beused to directly perform the equivalent of the first code sample as follows:

# include "El.hpp"

using namespace El;

...

Matrix<double> A( m, n );

double* buffer = A.Buffer();

const Int ldim = A.LDim();

for( Int j=0; j<n; ++j )

for( Int i=0; i<m; ++i )

buffer[i+j*ldim] = double(i-j);

For immutable instances of the Matrix<scalarType> class, a const pointer to the underly-ing data can similarly be returned with a call to Matrix<scalarType>::LockedBuffer() .In addition, a (const) pointer to the place in the (const) buffer where entry (i, j)resides can be easily retrieved with a call to Matrix<scalarType>::Buffer() orMatrix<scalarType>::LockedBuffer() .

It is also important to be able to create matrices which are simply views of existing(sub)matrices. In general, to view the submatrix with row indices [iBeg, iEnd] and columnindices [jBeg, jEnd], one can use a statement of the form

52 Chapter 3. Core functionality

Page 57: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

# include "El.hpp"

...

auto ASub = A( IR(iBeg,iEnd), IR(jBeg,jEnd) );

class Matrix<scalarType>The goal is for the Matrix class to support any datatype scalarType which supports bothaddition and multiplication and has the associated identities (that is, when the datatypescalarType is a ring). While there are several barriers to reaching this goal, it is importantto keep in mind that, in addition to scalarType being allowed to be a real or complex(single- or double-precision) floating-point type, signed integers are also supported.

Constructors and destructors

Note: Many of the following constructors have the default parameter boolfixed=false, which can be changed to true in order to produce a Matrix whose en-tries can be modified, but the matrix’s dimensions cannot. This is useful for theDistMatrix<scalarType> class, which contains a local Matrix<scalarType> whoseentries can be locally modified in cases where it would not make sense to change the lo-cal matrix size (which should instead result from changing the size of the full distributedmatrix).

Matrix(bool fixed = false)This simply creates a default 0 × 0 matrix with a leading dimension of one (BLASand LAPACK require positive leading dimensions).

Matrix(Int height, Int width, bool fixed = false)A height × width matrix is created with an unspecified leading dimension (though itis currently implemented as max(height, 1)).

Matrix(Int height, Int width, Int ldim, bool fixed = false)A height × width matrix is created with a leading dimension equal to ldim (whichmust be greater than or equal max(height, 1)).

Matrix(Int height, Int width, const scalarType *buffer, Int ldim, bool fixed = false)

Matrix(Int height, Int width, scalarType *buffer, Int ldim, bool fixed = false)A matrix is built around a column-major (immutable) buffer with the specified di-mensions. The memory pointed to by buffer should not be freed until after theMatrix<scalarType> object is destructed.

Matrix(const Matrix<scalarType> &A)

A copy (not a view) of the matrix A is built.

Matrix(Matrix<scalarType> &&A) noexceptA C++11 move constructor which creates a new matrix by moving the metadatafrom the specified matrix over to the new matrix, which cheaply gives the newmatrix control over the resources originally assigned to the input matrix.

~Matrix()

Frees all resources owned by the matrix upon destruction.

3.4. Matrix 53

Page 58: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Submatrices

Matrix<scalarType> operator()(Range<Int> I, Range<Int> J)

const Matrix<scalarType> operator()(Range<Int> I, Range<Int> J) constReturn a view of a contiguous submatrix with the given row and column indexranges.

Matrix<scalarType> operator()(Range<Int> I, const vector<Int> &J) const

Matrix<scalarType> operator()(const vector<Int> &I, Range<Int> J) const

Matrix<scalarType> operator()(const vector<Int> &I, const vector<Int> &J)const

Return a copy of the (generally non-contiguous) submatrix given by the specifiedrow and column index lists.

Assignment and reconfiguration

const Matrix<scalarType> &operator=(const Matrix<scalarType> &A)

Create a full copy of the specified matrix.

Matrix<scalarType> &operator=(Matrix<scalarType> &&A)

A C++11 move assignment which swaps the metadata of two matrices so that theresources owned by the two objects will have been cheaply switched.

void Empty()

Sets the matrix to 0 × 0 and frees any owned resources.

void Resize(Int height, Int width)Reconfigures the matrix to be height × width.

void Resize(Int height, Int width, Int ldim)

Reconfigures the matrix to be height × width, but with leading dimension equal toldim (which must be greater than or equal to max(height, 1)).

void Attach(Int height, Int width, scalarType *buffer, Int ldim)

void LockedAttach(Int height, Int width, const scalarType *buffer, Int ldim)

Reconfigure the matrix around the specified (unmodifiable) buffer.

void Control(Int height, Int width, scalarType *buffer, Int ldim)

Reconfigure the matrix around a specified buffer and give ownership of the resourceto the matrix.

Basic queries

Int Height() const

Int Width() constReturn the height/width of the matrix.

Int LDim() constReturn the leading dimension of the underlying buffer.

54 Chapter 3. Core functionality

Page 59: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int MemorySize() constReturn the number of entries of type scalarType that this Matrix<scalarType> in-stance has allocated space for.

Int DiagonalLength(Int offset = 0) constReturn the length of the specified diagonal of the matrix: an offset of 0 refers to themain diagonal, an offset of 1 refers to the superdiagonal, an offset of −1 refers to thesubdiagonal, etc.

scalarType *Buffer()

const scalarType *LockedBuffer() constReturn a pointer to the (immutable) underlying buffer.

scalarType *Buffer(Int i, Int j)

const scalarType *LockedBuffer(Int i, Int j) constReturn a pointer to the (immutable) portion of the buffer that holds entry (i, j).

bool Viewing() constReturns true if the underlying buffer is merely a pointer into an externally-ownedbuffer.

bool FixedSize() constReturns true if the dimensions of the matrix cannot be changed.

bool Locked() constReturns true if the entries of the matrix cannot be changed.

Single-entry manipulation

scalarType Get(Int i, Int j) const

Base<scalarType> GetRealPart(Int i, Int j) const

Base<scalarType> GetImagPart(Int i, Int j) constReturn entry (i, j) (or its real or imaginary part).

void Set(Int i, Int j, scalarType alpha)

void SetRealPart(Int i, Int j, Base<scalarType> alpha)

void SetImagPart(Int i, Int j, Base<scalarType> alpha)Set entry (i, j) (or its real or imaginary part) to α.

void Update(Int i, Int j, scalarType alpha)

void UpdateRealPart(Int i, Int j, Base<scalarType> alpha)

void UpdateImagPart(Int i, Int j, Base<scalarType> alpha)Add α to entry (i, j) (or its real or imaginary part).

void MakeReal(Int i, Int j)Force the (i, j) entry to be real.

void Conjugate(Int i, Int j)Conjugate the (i, j) entry of the matrix.

3.4. Matrix 55

Page 60: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout Elemental’s source(as well as this documentation). These are all special cases of Matrix<scalarType>.

class Matrix<Real>Used to denote that the underlying datatype Real is real.

class Matrix<Complex<Real>>Used to denote that the underlying datatype Complex<Real> is complex with base typeReal.

class Matrix<F>Used to denote that the underlying datatype F is a field.

class Matrix<Int>When the underlying datatype is a signed integer.

3.4.3 Matrix (C interface)

TODO

3.5 Grid

3.5.1 Grid (Python interface)

TODO

3.5.2 Grid (C++ interface)

The Grid class is responsible for converting MPI communicators into a two-dimensional pro-cess grid meant to be used for distributing matrices (especially via the DistMatrix<T,U,V>class).

class Grid

Grid(mpi::Comm comm = mpi::COMM WORLD, GridOrder order = COL-UMN MAJOR)

Construct a process grid over the specified communicator and let Elemen-tal decide the process grid dimensions. If no communicator is specified,mpi::COMM WORLD is used. The processes in the chosen communicator are ar-ranged into a two-dimensional grid in a column-major order by default but a row-major ordering can also be specified.

Grid(mpi::Comm comm, int height, GridOrder order = COLUMN MAJOR)Construct a process grid over the specified communicator with the given height.Note that the size of the communicator must be divisible by height. The processesin the chosen communicator are arranged into a two-dimensional grid in a column-major order by default but a row-major ordering can also be specified.

56 Chapter 3. Core functionality

Page 61: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Simple interface (simpler version of distribution-based interface)

int Row() constReturn the index of the row of the process grid that this process lies in.

int Col() constReturn the index of the column of the process grid that this process lies in.

int Rank() constReturn our process’s rank in the grid: in the case that the processes in the grid werearranged with a column-major ordering, this is VCRank() , otherwise, it is VRRank() .

int Height() constReturn the height of the process grid.

int Width() constReturn the width of the process grid.

int Size() constReturn the number of active processes in the process grid. This number is equal toHeight() × Width().

GridOrder Order() constReturns whether the processes were ordered in a COLUMN MAJOR or ROW MAJOR man-ner in order to form the process grid.

mpi::Comm ColComm() constReturn the communicator for this process’s column of the process grid.

mpi::Comm RowComm() constReturn the communicator for this process’s row of the process grid.

mpi::Comm Comm() constReturn the communicator for the process grid: in the case that the processes in thegrid were arranged with a column-major ordering, this is VCComm() , otherwise, it isVRComm() .

Distribution-based interface

int MCRank() constReturn our process’s rank in the MC (Matrix Column) communicator. This corre-sponds to our row in the process grid.

int MRRank() constReturn our process’s rank in the MR (Matrix Row) communicator. This correspondsto our column in the process grid.

int VCRank() constReturn our process’s rank in the VC (Vector Column) communicator. This corre-sponds to our rank in a column-major ordering of the process grid.

int VRRank() constReturn our process’s rank in the VR (Vector Row) communicator. This correspondsto our rank in a row-major ordering of the process grid.

3.5. Grid 57

Page 62: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

int MCSize() constReturn the size of the MC (Matrix Column) communicator, which is equivalent to theheight of the process grid.

int MRSize() constReturn the size of the MR (Matrix Row) communicator, which is equivalent to thewidth of the process grid.

int VCSize() constReturn the size of the VC (Vector Column) communicator, which is equivalent to thesize of the process grid.

int VRSize() constReturn the size of the VR (Vector Row) communicator, which is equivalent to the sizeof the process grid.

mpi::Comm MCComm() constReturn the MC (Matrix Column) communicator. This consists of the set of processeswithin our column of the grid (ordered top-to-bottom).

mpi::Comm MRComm() constReturn the MR (Matrix Row) communicator. This consists of the set of processeswithin our row of the grid (ordered left-to-right).

mpi::Comm VCComm() constReturn the VC (Vector Column) communicator. This consists of the entire set of pro-cesses in the grid, but ordered in a column-major fashion.

mpi::Comm VRComm() constReturn the VR (Vector Row) communicator. This consists of the entire set of pro-cesses in the grid, but ordered in a row-major fashion.

Advanced routines

Grid(mpi::Comm viewingComm, mpi::Group owningGroup, int height, GridOrder order= COLUMN MAJOR)

Construct a process grid where only a subset of the participating processes shouldactively participate in the process grid. In particular, viewingComm should consistof the set of all processes constructing this Grid instance, and owningGroup shoulddefine a subset of the processes in viewingComm. The height of the process grid isset to the specified value and either a column-major or row-major ordering of theparticipating processes is used to form the grid. Most users should not call thisroutine, as this type of grid is only supported for a few DistMatrix types. Note thatthe size of owningGroup must be divisible by height.

int GCD() constReturn the greatest common denominator of the height and width of the processgrid.

int LCM() constReturn the lowest common multiple of the height and width of the process grid.

bool HaveViewers() constReturn true if there are processes which constructed this Grid instance but are not amember of the grid.

58 Chapter 3. Core functionality

Page 63: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool InGrid() constReturn true if our process is actively participating in the process grid.

int OwningRank() constReturn our process’s rank within the set of processes that are actively participatingin the grid.

int ViewingRank() constReturn our process’s rank within the entire set of processes that constructed thisgrid.

int VCToVR(int vcRank) constMap the given column-major grid rank to the equivalent row-major rank.

int VRToVC(int vrRank) constMap the given row-major grid rank to the equivalent column-major rank.

int VCToViewing(int vcRank) constMap the given column-major grid rank to the rank in the (potentially) larger set ofprocesses which constructed the grid.

mpi::Group OwningGroup() constReturn the group of processes which is actively participating in the grid.

mpi::Comm OwningComm() constReturn the communicator for the set of processes actively participating in the grid.Note that this can only be valid if the calling process is an active member of the grid!

mpi::Comm ViewingComm() constReturn the communicator for the entire set of processes which constructed the grid.

int Diag() constReturn our unique diagonal index in an tesselation of the process grid.

int Diag(int vectorColRank) constReturn the unique diagonal index of the process with the given column-major vectorrank in an tesselation of the process grid.

int DiagRank() constReturn our process’s rank out of the set of processes lying in our diagonal of thetesselation of the process grid.

int DiagRank(int vectorColRank) constReturn the rank of the given process out of the set of processes in its diagonal of thetesselation of the process grid.

Grid comparison functions

bool operator==(const Grid &A, const Grid &B)Returns true if !A! and !B! are the same process grid.

bool operator!=(const Grid &A, const Grid &B)Returns true if !A! and !B! are different process grids.

3.5. Grid 59

Page 64: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.5.3 Grid (C interface)

TODO

3.6 DistMatrix

The DistMatrix<scalarType,colDist,rowDist,wrapType> class is meant to provide adistributed-memory analogue of the Matrix<scalarType> class. In a manner similar to PLA-PACK, roughly ten different matrix distributions are provided and it is trivial (in the sense thatit requires a single command) to redistribute from one to another: in PLAPACK, one wouldsimply call PLA Copy, whereas, in Elemental, it is handled through overloading the = operator(or instead calling the Copy() function).

Since it is crucial to know not only how many processes to distribute the data over, butwhich processes, and in what manner they should be decomposed into a logical two-dimensional grid, an instance of the Grid class must be passed into the constructor of theDistMatrix<scalarType,colDist,rowDist,wrapType> class.

Note: Since the DistMatrix<scalarType,colDist,rowDist> class makes use of MPI formessage passing, custom interfaces must be written for nonstandard datatypes. As of now,the following datatypes are fully supported for DistMatrix<scalarType,colDist,rowDist>:int, float, double, Complex<float>, and Complex<double>.

The DistMatrix<scalarType,colDist,rowDist> class is implemented in a manner whichattempts to expose as many symmetries within the various member functions and redistri-butions as possible. In particular, there are there is a hierarchy of three increasingly-specificdistributed matrix classes: AbstractDistMatrix<scalarType>, which contains every mem-ber function which whose prototype does not depend upon the exact matrix distribution,and DistMatrix<scalarType,colDist,rowDist>, which contains implementations of mem-ber functions which are specific to a particular matrix distribution.

3.6.1 AbstractDistMatrix

This abstract class defines the list of member functions that are guaranteed to be availablefor all matrix distributions and whose prototype does not depend upon the particular matrixdistribution.

One of the many conveniences provided by :cpp:class::AbstractDistMatrix<scalarType> is theability for individual processes to easily modify arbitrary (possibly non-local) entries of thedistribute matrix using a combination of Reserve, QueueUpdate, and ProcessQueues. For ex-ample:

# include "El.hpp"

using namespace El;

...

DistMatrix<double> A;

Zeros( A, 100, 100 );

if( A.DistRank() == 0 )

A.Reserve( 3 );

A.QueueUpdate( 50, 50, 1. );

60 Chapter 3. Core functionality

Page 65: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

A.QueueUpdate( 51, 51, 2. );

A.QueueUpdate( 52, 52, 3. );

else if( A.DistRank() == 1 )

A.Reserve( 2 );

A.QueueUpdate( 0, 0, 17. );

A.QueueUpdate( 1, 0, 18. );

A.ProcessQueues();

class AbstractDistMatrix<scalarType>

Constructors and destructors

AbstractDistMatrix(AbstractDistMatrix<scalarType> &&A) noexceptA C++11 move constructor which transfers the metadata from the specified matrixover to the new matrix as a means of cheaply transferring resources.

~AbstractDistMatrix()

Assignment and reconfiguration

AbstractDistMatrix<scalarType> &operator=(AbstractDistMatrix<scalarType>&&A)

A C++11 move assignment which swaps the metadata between the two matrices asa means of cheaply swapping the resources assigned to each matrix.

const AbstractDistMatrix<scalarType> &operator*=(T alpha)Multiply every entry in the matrix by alpha.

void Empty()

Empties the data and frees all alignments.

void EmptyData()

Sets the matrix size to zero and frees associated memory (the alignments are leftunchanged).

void SetGrid(const Grid &grid)Clear the distributed matrix’s contents and reconfigure for the new process grid.

void Resize(Int height, Int width)

void Resize(Int height, Int width, Int ldim)

Reconfigure the matrix so that it is height × width. Optionally, the local leadingdimension may also be specified.

void MakeConsistent()

Gives every non-participating process a copy of the metadata stored by the rootprocess in the distribution communicator.

Realignment

void Align(Int colAlign, Int rowAlign)

3.6. DistMatrix 61

Page 66: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void AlignCols(Int colAlign)

void AlignRows(Int rowAlign)Aligns the row or column distribution (or both).

void FreeAlignments()

Free all alignment constaints.

void SetRoot(Int root)For querying and changing the process rank in the cross communicator which ownsthe data.

void AlignWith(const DistData &data)

void AlignColsWith(const DistData &data)

void AlignRowsWith(const DistData &data)Aligns the row or column distribution (or both) as necessary to conform with thespecified distribution data.

void AlignAndResize(Int colAlign, Int rowAlign, Int height, Int width, bool force =false)

void AlignColsAndResize(Int colAlign, Int height, Int width, bool force = false)

void AlignRowsAndResize(Int rowAlign, Int height, Int width, bool force = false)Attempt to realign the row or column distribution (or both), with the realignmentbeing optionally forced, and then resize the distributed matrix to the specified size.

Buffer attachment

void Attach(Int height, Int width, const Grid &grid, Int colAlign, Int rowAlign, scalar-Type *buffer, Int ldim, Int root = 0)

void LockedAttach(Int height, Int width, const Grid &grid, Int colAlign, Int rowAlign,const scalarType *buffer, Int ldim, Int root = 0)

Reconfigure around the (immutable) buffer of an implicit distributed matrix withthe specified dimensions, alignments, process grid, and local leading dimension.

void Attach(Int height, Int width, const Grid &grid, Int colAlign, Int rowAlign, Ma-trix<scalarType> &A, Int root = 0)

void LockedAttach(Int height, Int width, const Grid &grid, Int colAlign, Int rowAlign,const Matrix<scalarType> &A, Int root = 0)

Reconfigure around the (immutable) local matrix of an implicit distributed matrixwith the specified alignments, process grid, and local leading dimension.

Basic queries

Int Height() const

Int Width() constReturn the height (width) of the distributed matrix.

Int DiagonalLength(Int offset = 0) constReturn the length of the specified diagonal of the distributed matrix.

62 Chapter 3. Core functionality

Page 67: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool Viewing() constReturn true if this matrix is viewing another.

bool Locked() constReturn true if this matrix is viewing another in a manner that does not allow formodifying the viewed data.

Int LocalHeight() const

Int LocalWidth() constReturn the height (width) of the local matrix stored by a particular process.

Int LDim() constReturn the leading dimension of the local matrix stored by a particular process.

Matrix<scalarType> &Matrix()

const Matrix<scalarType> &LockedMatrix() constReturn an (immutable) reference to the local matrix.

size t AllocatedMemory() constReturn the number of entries of type scalarType that we have locally allocated spacefor.

scalarType *Buffer()

const scalarType *LockedBuffer() constReturn an (immutable) pointer to the local matrix’s buffer.

scalarType *Buffer(Int iLoc, Int jLoc)

const scalarType *LockedBuffer(Int iLoc, Int jLoc) constReturn an (immutable) pointer to the portion of the local buffer that stores entry(iLoc,jLoc).

Distribution information

const Grid &Grid() constReturn the grid that this distributed matrix is distributed over.

DistWrap Wrap() constReturns whether the matrix is distributed element-wise (ELEMENT) or block-wise(BLOCK).

Int BlockHeight() const

Int BlockWidth() constReturns the height (width) of the distribution block (which is always one forelement-wise distributions).

Int ColCut() const

Int RowCut() constReturns the number of rows down (number of columns right) in a distribution thatthe upper-left corner of the matrix occurs. For element-wise distributed matrices,this must always be zero.

bool ColConstrained() const

3.6. DistMatrix 63

Page 68: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool RowConstrained() constReturn true if the column (row) alignment is constrained.

bool RootConstrained() constReturn if the root (the alignment with respect to the CrossComm() ) is constrained.

Int ColAlign() const

Int RowAlign() constReturn the rank of the member of our ColComm() or RowComm() assigned to thetop-left entry of the matrix.

Int ColShift() const

Int RowShift() constReturn the first row or column to be locally assigned to this process, respectively.

mpi::Comm ColComm() constThe communicator used to distribute each column of the matrix.

mpi::Comm RowComm() constThe communicator used to distribute each row of the matrix.

mpi::Comm PartialColComm() const

mpi::Comm PartialUnionColComm() constThe PartialColComm() is a (not necessarily strict) subset of the ColComm() ;an element-wise distribution of each column over this communicator can bereached by unioning the local data from a distribution over the ColComm()

(via an AllGather) over the PartialUnionColComm() . One nontrivial exampleis for DistMatrix<scalarType,VC,STAR>, where the column communicator isGrid::VCComm() , the partial column communicator is Grid::MCComm() , and thepartial union column communicator is Grid::MRComm() .

mpi::Comm PartialRowComm() const

mpi::Comm PartialUnionRowComm() constThese are the same as PartialColComm() and PartialUnionColComm() , except thatthey correspond to distributions of the rows of the matrix.

mpi::Comm DistComm() constThe communicator used to distribute the entire set of entries of the matrix (in aparticular precise sense, the product of ColComm() and RowComm() ).

mpi::Comm CrossComm() constThe orthogonal complement of the product of DistComm() andRedundantComm() with respect to the process grid. For instance, forDistMatrix<scalarType,CIRC,CIRC>, this is Grid::VCComm() .

mpi::Comm RedundantComm() constThe communicator over which data is redundantly stored. For instance, forDistMatrix<scalarType,MC,STAR>, this is Grid::RowComm() .

Int ColRank() const

Int RowRank() const

Int PartialColRank() const

Int PartialRowRank() const

64 Chapter 3. Core functionality

Page 69: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int PartialUnionColRank() const

Int PartialUnionRowRank() const

Int DistRank() const

Int CrossRank() const

Int RedundantRank() constReturn our rank in our ColComm() , RowComm() , PartialColComm() ,PartialRowComm() , PartialUnionColComm() , PartialUnionRowComm() ,DistComm() , CrossComm() , or RedundantComm() , respectively.

Int ColStride() const

Int RowStride() const

Int PartialColStride() const

Int PartialRowStride() const

Int PartialUnionColStride() const

Int PartialUnionRowStride() const

Int DistSize() const

Int CrossSize() const

Int RedundantSize() constReturn the number of processes within a particular communicator associated withthe distributed matrix. For communicators associated with distributions of eitherthe rows or columns of a matrix, the communicator size is equal to the distance (orstride) between successive row or column indices assigned to a particular process.

Int Root() constReturn the rank of the member of our cross communicator (CrossComm() ) whichcan store data.

bool Participating() constReturn true if this process can be assigned matrix data (that is, if this process is bothin the process grid and the root of CrossComm() ).

Int RowOwner(Int i) constReturn the rank (in ColComm() ) of the process which owns row i.

Int ColOwner(Int j) constReturn the rank (in RowComm() ) of the process which owns column j.

Int Owner(Int i, Int j) constReturn the rank (in DistComm() ) of the process which owns entry (i,j).

Int GlobalRow(Int iLoc) const

Int GlobalCol(Int jLoc) constReturn the global row (column) index corresponding to the given local row (col-umn) index.

Int LocalRow(Int i) const

3.6. DistMatrix 65

Page 70: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int LocalCol(Int j) constReturn the local row (column) index for row i (j); if this process is not assigned rowi (column j), then throw an exception.

Int LocalRowOffset(Int i) const

Int LocalColOffset(Int j) constReturn the number of local rows (columns) occurring before the given global row(column) index.

bool IsLocalRow(Int i) const

bool IsLocalCol(Int j) const

bool IsLocal(Int i, Int j) constReturn true if the row, column, or entry, respectively, is assigned to this process.

Single-entry manipulation (global)

scalarType Get(Int i, Int j) const

Base<scalarType> GetRealPart(Int i, Int j) const

Base<scalarType> GetImagPart(Int i, Int j) constReturn the (i,j) entry (or its real or imaginary part) of the global matrix.

void Set(Int i, Int j, scalarType alpha)

void SetRealPart(Int i, Int j, Base<scalarType> alpha)

void SetImagPart(Int i, Int j, Base<scalarType> alpha)Set the (i,j) entry (or its real or imaginary part) of the global matrix to α.

void Update(Int i, Int j, scalarType alpha)

void UpdateRealPart(Int i, Int j, Base<scalarType> alpha)

void UpdateImagPart(Int i, Int j, Base<scalarType> alpha)Add α to the (i,j) entry (or its real or imaginary part) of the global matrix.

void MakeReal(Int i, Int j)Force the (i, j) entry of the global matrix to be real.

void Conjugate(Int i, Int j)Conjugate the (i, j) entry of the global matrix.

Batch remote entry updates

The following set of routines provide a convenient mechanism for allowing all processesto contribute updates to arbitrary entries of the distributed matrix. Each process shouldbegin by calling Reserve with an upper bound on the number of remote entries to con-tribute, followed by calling QueueUpdate for each (potentially remote) update, and thenall processes must collectively call ProcessQueues.

void Reserve(Int numRemoteEntries)

void QueueUpdate(const Entry<scalarType> &entry)

void QueueUpdate(Int i, Int j, scalarType value)

66 Chapter 3. Core functionality

Page 71: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void ProcessQueues()

The following routines provide a mechanism for extracting (potentially) remote entriesof a distributed matrix from each process. While each process can independently callReservePulls and QueuePull, they must collectively call ProcessPullQueue since it in-volves an mpi::AllToAll communication pattern.

void ReservePulls(Int numPulls) const

void QueuePull(Int i, Int j) const

void ProcessPullQueue(scalarType *pullBuf) const

void ProcessPullQueue(vector<scalarType> &pullBuf) const

Single-entry manipulation (local)

scalarType GetLocal(Int iLoc, Int jLoc) const

Base<scalarType> GetRealPartLocal(Int iLoc, Int jLoc) const

Base<scalarType> GetLocalImagPart(Int iLoc, Int jLoc) constReturn the (iLoc, jLoc) entry (or its real or imaginary part) of our local matrix.

void SetLocal(Int iLoc, Int jLoc, scalarType alpha)

void SetLocalRealPart(Int iLoc, Int jLoc, Base<scalarType> alpha)

void SetLocalImagPart(Int iLoc, Int jLoc, Base<scalarType> alpha)Set the (iLoc,jLoc) entry (or its real or imaginary part) of our local matrix to α.

void UpdateLocal(Int iLoc, Int jLoc, scalarType alpha)

void UpdateLocalRealPart(Int iLoc, Int jLoc, Base<scalarType> alpha)

void UpdateLocalImagPart(Int iLoc, Int jLoc, Base<scalarType> alpha)Add α to the (iLoc,jLoc) entry (or its real or imaginary part) of our local matrix.

void MakeLocalReal(Int iLoc, Int jLoc)Force the (iLoc,jLoc) entry of our local matrix to be real.

void ConjugateLocal(Int iLoc, Int jLoc)Conjugate the (iLoc,jLoc) entry of our local matrix.

Assertions

void ComplainIfReal() const

void AssertNotLocked() const

void AssertNotStoringData() const

void AssertValidEntry(Int i, Int j) const

void AssertValidSubmatrix(Int i, Int j, Int height, Int width) const

void AssertSameGrid(const Grid &grid) const

void AssertSameSize(Int height, Int width) const

3.6. DistMatrix 67

Page 72: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class AbstractDistMatrix<F>An instance of AbstractDistMatrix where the underlying datatype is assumed to be a field.

class AbstractDistMatrix<Real>An instance of AbstractDistMatrix where the underlying datatype is real (e.g., float ordouble).

class AbstractDistMatrix<Base<F>>An instance of AbstractDistMatrix where the underlying datatype is the underlying realdatatype from a field (e.g., double is the base type of Complex<double>).

class AbstractDistMatrix<Complex<Base<F>>>An instance of AbstractDistMatrix where the underlying datatype is the complex exten-sion of the base type of the field F ( (e.g., Complex<double> is the complex extension ofboth double and Complex<double>).

class AbstractDistMatrix<Int>An instance of AbstractDistMatrix where the underlying datatype is an int.

class DistData

Distribution colDist

The Distribution scheme used within each column of the matrix.

Distribution rowDist

The Distribution scheme used within each row of the matrix.

Int colAlignThe rank in the AbstractDistMatrix<scalarType>::ColComm() which is as-signed the top-left entry of the matrix.

Int rowAlignThe rank in the AbstractDistMatrix<scalarType>::RowComm() which is as-signed the top-left entry of the matrix.

Int rootThe member of the AbstractDistMatrix<scalarType>::CrossComm() which isassigned ownership of the matrix.

const Grid *gridAn immutable pointer to the underlying process grid of the distributed matrix.

DistData(const AbstractDistMatrix<scalarType> &A)

Construct the distribution data of any instance ofAbstractDistMatrix<scalarType>.

3.6.2 DistMatrix

The DistMatrix<scalarType=double,colDist=MC,rowDist=MR,wrapType=ELEMENT>class, where partial specializations to wrapType=ELEMENT derive fromElementalMatrix<scalarType>, and partial specializations to wrapType=BLOCK derivefrom BlockMatrix<scalarType>. In each case, there are thirteen different legal (colD-ist,rowDist) distribution pairs; each is a sensical pairing of one of the following applied to thecolumns of the matrix, and one applied to the rows of the matrix:

• CIRC : Only give the data to a single process

68 Chapter 3. Core functionality

Page 73: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

• STAR : Give the data to every process

• MC : Distribute round-robin within each column of the 2D process grid (M atrix C olumn)

• MR: Distribute round-robin within each row of the 2D process grid (M atrix R ow)

• VC: Distribute round-robin within a column-major ordering of the entire 2D process grid(V ector C olumn)

• VR: Distribute round-robin within a row-major ordering of the entire 2D process grid (Vector R ow)

• MD: Distribute round-robin over a diagonal of the tiling of the 2D process grid (M atrixD iagonal)

The valid pairings are:

ColDist RowDist ColComm RowComm DistComm RedundantComm Cross-Comm

CIRC CIRC self self self self VCMC MR MC MR VC self selfMC STAR MC self MC MR selfMD STAR MD self MD self MDPerpMR MC MR MC VR self selfMR STAR MR self MR MC selfSTAR MC self MC MC MR selfSTAR MD self MD MD self MDPerpSTAR MR self MR MR MC selfSTAR STAR self self self VC selfSTAR VC self VC VC self selfSTAR VR self VR VR self selfVC STAR VC self VC self selfVR STAR VR self VR self self

where DistComm refers to the communicator that the entire matrix (rather than just the rowsor columns) is distributed over. When the matrix is distributed over a communicator whichonly involves only a subset of the processes, it is possible to either assign the data to just thatsubset or redundantly store the entire matrix on each such subset of processes (e.g., withineach row of a 2D arrangement of the set of processes). The RedundantComm refers to the com-municator where each member process stores the same information, and the CrossComm is thecommunicator where only a single process (the root) is assigned any data.

To make this discussion more precise, each valid matrix distribution for DistMatrix logicallyarranges the set of p processes of the r by c process grid into a 4D mesh: ColComm x RowCommx RedundantComm x CrossComm, where DistComm is equal to ColComm x RowComm.

3.6.3 ElementalMatrix

The ElementalMatrix<scalarType> is the parent class of each partial specializationDistMatrix<scalarTypee,colDist,rowDist,ELEMENT> of DistMatrix to element-wise distri-butions; it is a child class of AbstractDistMatrix<scalarType>. Each of the derivativesof ElementalMatrix<scalarType> chooses a sensical pairing of distributions for the rows andcolumns of the matrix.

class ElementalMatrix<scalarType>

3.6. DistMatrix 69

Page 74: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<scalarType, colDist, rowDist, ELEMENT>The following routines are available for each legal pairing of row and column distribu-tions.

Constructors and destructors

DistMatrix(const Grid &grid = DefaultGrid(), Int root = 0)Construct an empty (0 × 0) distributed matrix.

DistMatrix(Int height, Int width, const Grid &grid = DefaultGrid(), Int root = 0)Create a height × width distributed matrix.

DistMatrix(const AbstractDistMatrix<scalarType> &A)

Construct the current matrix to be a redistributed copy of the input matrix.

DistMatrix(const DistMatrix<scalarType, colDist, rowDist, ELEMENT> &&A)

noexceptUse C++11 move semantics to construct the current matrix in a way which transfersthe resources from the input matrix.

~DistMatrix()

All resources owned by the DistMatrix are freed upon destruction.

ElementalData DistData() constReturns a description of the distribution and alignment information

Assignment and reconfiguration

const DistMatrix<scalarType, colDist, rowDist, ELEMENT> &operator=(constAbstract-DistMa-trix<scalarType>&A)

Set the current distributed matrix equal to the matrix A redistributed into the ap-propriate form.

DistMatrix<scalarType, colDist, rowDist, ELEMENT> &operator=(DistMatrix<scalarType,colDist, row-Dist, EL-EMENT>&&A)

A C++11 move assignment which cheaply transfers the resources from A to thecurrent matrix by swapping metadata.

const DistMatrix<scalarType, colDist, rowDist, ELEMENT> &operator*=(Talpha)

Multiply every entry in the matrix by alpha.

const DistMatrix<scalarType, colDist, rowDist, ELEMENT> &operator+=(constAb-stract-Dist-Ma-trix<T>&A)

70 Chapter 3. Core functionality

Page 75: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

const DistMatrix<scalarType, colDist, rowDist, ELEMENT> &operator-=(constAb-stract-Dist-Ma-trix<T>&A)

Updates this matrix (via either addition or subtraction) with another another matrix.

Submatrices

DistMatrix<scalarType, colDist, rowDist, ELEMENT> operator()(Range<Int> I,Range<Int> J)

const DistMatrix<scalarType, colDist, rowDist, ELEMENT> operator()(Range<Int>I,Range<Int>J) const

Return a view of a contiguous submatrix with the given row and column indexranges.

DistMatrix<scalarType, colDist, rowDist, ELEMENT> operator()(Range<Int>I, const vec-tor<Int> &J)const

DistMatrix<scalarType, colDist, rowDist, ELEMENT> operator()(const vec-tor<Int> &I,Range<Int> J)const

DistMatrix<scalarType, colDist, rowDist, ELEMENT> operator()(const vec-tor<Int> &I,const vec-tor<Int> &J)const

Return a copy of the (generally non-contiguous) submatrix given by the specifiedrow and column index lists.

The standard matrix distribution ([MC,MR])

This is by far the most important matrix distribution in Elemental, as the vast majority ofparallel routines expect the input to be in this form. For a 7 × 7 matrix distributed over a 2 × 3process grid, individual entries would be owned by the following processes (assuming thecolumn and row alignments are both 0):

0 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 0

3.6. DistMatrix 71

Page 76: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Similarly, if the column alignment is kept at 0 and the row alignment is changed to 2 (meaningthat the third process column owns the first column of the matrix), the individual entries wouldbe owned as follows:

4 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 4

It should also be noted that this is the default distribution format for theDistMatrix<scalarType,colDist,rowDist,wrapType> class, as DistMatrix<scalarType>defaults to DistMatrix<scalarType,MC,MR,ELEMENT>.

class DistMatrix<scalarType>

class DistMatrix<scalarType, MC, MR>

class DistMatrix<scalarType, MC, MR, ELEMENT>

[MC,STAR]

This distribution is often used as part of matrix-matrix multiplication. For a 7 × 7 matrix dis-tributed over a 2 × 3 process grid, individual entries would be owned by the following pro-cesses (assuming the column alignment is 0):

0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4

class DistMatrix<scalarType, MC, STAR>

class DistMatrix<scalarType, MC, STAR, ELEMENT>

[MD,STAR]

In the case of our 2 × 3 process grid, each diagonal of the tesselation of the process grid willcontain the entire set of processes, for instance, in the order 0, 3, 4, 1, 2, 5. This would result inthe following overlay for the owning processes of the entries of our 7 × 7 matrix example:

0 0 0 0 0 0 03 3 3 3 3 3 34 4 4 4 4 4 41 1 1 1 1 1 12 2 2 2 2 2 25 5 5 5 5 5 50 0 0 0 0 0 0

Notice that each column of this matrix is distributed like a diagonal of a [MC,MR] distribution.

72 Chapter 3. Core functionality

Page 77: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<scalarType, MD, STAR>

class DistMatrix<scalarType, MD, STAR, ELEMENT>

[MR,MC]

This is essentially the transpose of the standard matrix distribution, [MC,MR]. For a 7× 7 matrixdistributed over a 2 × 3 process grid, individual entries would be owned by the followingprocesses (assuming the column and row alignments are both 0):

0 1 0 1 0 1 02 3 2 3 2 3 24 5 4 5 4 5 40 1 0 1 0 1 02 3 2 3 2 3 24 5 4 5 4 5 40 1 0 1 0 1 0

class DistMatrix<scalarType, MR, MC>

class DistMatrix<scalarType, MR, MC, ELEMENT>

[MR,STAR]

This is the transpose of the [* ,MR] distribution and is, like many of the previous distributions,useful for matrix-matrix multiplication. For a 7 × 7 matrix distributed over a 2 × 3 processgrid, individual entries would be owned by the following processes (assuming the columnalignment is 0):

0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 12, 3 2, 3 2, 3 2, 3 2, 3 2, 3 2, 34, 5 4, 5 4, 5 4, 5 4, 5 4, 5 4, 50, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 12, 3 2, 3 2, 3 2, 3 2, 3 2, 3 2, 34, 5 4, 5 4, 5 4, 5 4, 5 4, 5 4, 50, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1

class DistMatrix<scalarType, MR, STAR>

class DistMatrix<scalarType, MR, STAR, ELEMENT>

[STAR,MC]

This is the transpose of the [MC,*] distribution and is, like many of the previous distributions,useful for matrix-matrix multiplication. For a 7 × 7 matrix distributed over a 2 × 3 processgrid, individual entries would be owned by the following processes (assuming the column

3.6. DistMatrix 73

Page 78: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

alignment is 0):

0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4

class DistMatrix<scalarType, STAR, MC>

class DistMatrix<scalarType, STAR, MC, ELEMENT>

[STAR,MD]

In the case of our 2 × 3 process grid, each diagonal of the tesselation of the process grid willcontain the entire set of processes, for instance, in the order 0, 3, 4, 1, 2, 5. This would result inthe following overlay for the owning processes of the entries of our 7 × 7 matrix example:

0 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 0

Notice that each row of this matrix is distributed like a diagonal of a [MC,MR] distribution.

class DistMatrix<scalarType, STAR, MD>

class DistMatrix<scalarType, STAR, MD, ELEMENT>

[STAR,MR]

This distribution is also frequently used for matrix-matrix multiplication. For a 7 × 7 matrixdistributed over a 2 × 3 process grid, individual entries would be owned by the followingprocesses (assuming the row alignment is 0):

0, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 1

class DistMatrix<scalarType, STAR, MR>

class DistMatrix<scalarType, STAR, MR, ELEMENT>

74 Chapter 3. Core functionality

Page 79: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[STAR,STAR]

This “distribution” actually redundantly stores every entry of the associated matrix on everyprocess. Again using a 2 × 3 process grid, the entries of a 7 × 7 matrix would be owned by thefollowing sets of processes:

0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5

class DistMatrix<scalarType, STAR, STAR>

class DistMatrix<scalarType, STAR, STAR, ELEMENT>

[STAR,VC]

This is the transpose of the above [VC,* ] distribution. On the standard 2 × 3 process gridwith a row alignment of zero, a 7 × 7 matrix would be distributed as:

0 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 0

class DistMatrix<scalarType, STAR, VC>

class DistMatrix<scalarType, STAR, VC, ELEMENT>

[STAR,VR]

This is the transpose of the above [VR,* ] distribution. On the standard 2 × 3 process gridwith a row alignment of zero, a 7 × 7 matrix would be distributed as:

0 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 0

class DistMatrix<scalarType, STAR, VR>

class DistMatrix<scalarType, STAR, VR, ELEMENT>

3.6. DistMatrix 75

Page 80: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[VC,STAR]

This distribution makes use of a 1d distribution which uses a column-major ordering of theentire process grid. Since 1d distributions are useful for distributing vectors, and a column-majorordering is used, the distribution symbol is VC. Again using the simple 2× 3 process grid, witha zero column alignment, each entry of a 7× 7 matrix would be owned by the marked process:

0 0 0 0 0 0 01 1 1 1 1 1 12 2 2 2 2 2 23 3 3 3 3 3 34 4 4 4 4 4 45 5 5 5 5 5 50 0 0 0 0 0 0

class DistMatrix<scalarType, VC, STAR>

class DistMatrix<scalarType, VC, STAR, ELEMENT>

[VR,STAR]

This distribution makes use of a 1d distribution which uses a row-major ordering of the entireprocess grid. Since 1d distributions are useful for distributing vectors, and a row-major orderingis used, the distribution symbol is VR. Again using the simple 2 × 3 process grid, with a zerocolumn alignment, each entry of a 7 × 7 matrix would be owned by the marked process:

0 0 0 0 0 0 02 2 2 2 2 2 24 4 4 4 4 4 41 1 1 1 1 1 13 3 3 3 3 3 35 5 5 5 5 5 50 0 0 0 0 0 0

class DistMatrix<scalarType, VR, STAR>

class DistMatrix<scalarType, VR, STAR, ELEMENT>

[CIRC,CIRC]

This distribution stores the entire matrix on a single process. For instance, if the root processis process 0 with respect to a column-major ordering of the process grid, then the correspond-ing overlay for the owners of each entry of our 7 x 7 matrix example would be:

0 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 0

76 Chapter 3. Core functionality

Page 81: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<scalarType, CIRC, CIRC>

class DistMatrix<scalarType, CIRC, CIRC, ELEMENT>

Some special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout El-emental’s source (as well as this documentation). These are all special cases ofDistMatrix<T,colDist,rowDist,ELEMENT>.

class DistMatrix<Real, colDist, rowDist>

class DistMatrix<Real>

class DistMatrix<Real, CIRC, CIRC>

class DistMatrix<Real, MC, MR>

class DistMatrix<Real, MC, STAR>

class DistMatrix<Real, MD, STAR>

class DistMatrix<Real, MR, MC>

class DistMatrix<Real, MR, STAR>

class DistMatrix<Real, STAR, MC>

class DistMatrix<Real, STAR, MD>

class DistMatrix<Real, STAR, MR>

class DistMatrix<Real, STAR, STAR>

class DistMatrix<Real, STAR, VC>

class DistMatrix<Real, STAR, VR>

class DistMatrix<Real, VC, STAR>

class DistMatrix<Real, VR, STAR>

class DistMatrix<Real, colDist, rowDist, ELEMENT>

class DistMatrix<Real, ELEMENT>

class DistMatrix<Real, CIRC, CIRC, ELEMENT>

class DistMatrix<Real, MC, MR, ELEMENT>

class DistMatrix<Real, MC, STAR, ELEMENT>

class DistMatrix<Real, MD, STAR, ELEMENT>

class DistMatrix<Real, MR, MC, ELEMENT>

class DistMatrix<Real, MR, STAR, ELEMENT>

class DistMatrix<Real, STAR, MC, ELEMENT>

class DistMatrix<Real, STAR, MD, ELEMENT>

class DistMatrix<Real, STAR, MR, ELEMENT>

class DistMatrix<Real, STAR, STAR, ELEMENT>

3.6. DistMatrix 77

Page 82: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<Real, STAR, VC, ELEMENT>

class DistMatrix<Real, STAR, VR, ELEMENT>

class DistMatrix<Real, VC, STAR, ELEMENT>

class DistMatrix<Real, VR, STAR, ELEMENT>The underlying datatype, Real, is real (as opposed to complex).

class DistMatrix<Complex<Real>, colDist, rowDist>

class DistMatrix<Complex<Real>>

class DistMatrix<Complex<Real>, CIRC, CIRC>

class DistMatrix<Complex<Real>, MC, MR>

class DistMatrix<Complex<Real>, MC, STAR>

class DistMatrix<Complex<Real>, MD, STAR>

class DistMatrix<Complex<Real>, MR, MC>

class DistMatrix<Complex<Real>, MR, STAR>

class DistMatrix<Complex<Real>, STAR, MC>

class DistMatrix<Complex<Real>, STAR, MD>

class DistMatrix<Complex<Real>, STAR, MR>

class DistMatrix<Complex<Real>, STAR, STAR>

class DistMatrix<Complex<Real>, STAR, VC>

class DistMatrix<Complex<Real>, STAR, VR>

class DistMatrix<Complex<Real>, VC, STAR>

class DistMatrix<Complex<Real>, VR, STAR>

class DistMatrix<Complex<Real>, colDist, rowDist, ELEMENT>

class DistMatrix<Complex<Real>, ELEMENT>

class DistMatrix<Complex<Real>, CIRC, CIRC, ELEMENT>

class DistMatrix<Complex<Real>, MC, MR, ELEMENT>

class DistMatrix<Complex<Real>, MC, STAR, ELEMENT>

class DistMatrix<Complex<Real>, MD, STAR, ELEMENT>

class DistMatrix<Complex<Real>, MR, MC, ELEMENT>

class DistMatrix<Complex<Real>, MR, STAR, ELEMENT>

class DistMatrix<Complex<Real>, STAR, MC, ELEMENT>

class DistMatrix<Complex<Real>, STAR, MD, ELEMENT>

class DistMatrix<Complex<Real>, STAR, MR, ELEMENT>

class DistMatrix<Complex<Real>, STAR, STAR, ELEMENT>

class DistMatrix<Complex<Real>, STAR, VC, ELEMENT>

class DistMatrix<Complex<Real>, STAR, VR, ELEMENT>

78 Chapter 3. Core functionality

Page 83: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<Complex<Real>, VC, STAR, ELEMENT>

class DistMatrix<Complex<Real>, VR, STAR, ELEMENT>The underlying datatype, Complex<Real>, is complex with base type Real.

class DistMatrix<F, colDist, rowDist>

class DistMatrix<F>

class DistMatrix<F, CIRC, CIRC>

class DistMatrix<F, MC, MR>

class DistMatrix<F, MC, STAR>

class DistMatrix<F, MD, STAR>

class DistMatrix<F, MR, MC>

class DistMatrix<F, MR, STAR>

class DistMatrix<F, STAR, MC>

class DistMatrix<F, STAR, MD>

class DistMatrix<F, STAR, MR>

class DistMatrix<F, STAR, STAR>

class DistMatrix<F, STAR, VC>

class DistMatrix<F, STAR, VR>

class DistMatrix<F, VC, STAR>

class DistMatrix<F, VR, STAR>

class DistMatrix<F, colDist, rowDist, ELEMENT>

class DistMatrix<F, ELEMENT>

class DistMatrix<F, CIRC, CIRC, ELEMENT>

class DistMatrix<F, MC, MR, ELEMENT>

class DistMatrix<F, MC, STAR, ELEMENT>

class DistMatrix<F, MD, STAR, ELEMENT>

class DistMatrix<F, MR, MC, ELEMENT>

class DistMatrix<F, MR, STAR, ELEMENT>

class DistMatrix<F, STAR, MC, ELEMENT>

class DistMatrix<F, STAR, MD, ELEMENT>

class DistMatrix<F, STAR, MR, ELEMENT>

class DistMatrix<F, STAR, STAR, ELEMENT>

class DistMatrix<F, STAR, VC, ELEMENT>

class DistMatrix<F, STAR, VR, ELEMENT>

class DistMatrix<F, VC, STAR, ELEMENT>

3.6. DistMatrix 79

Page 84: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<F, VR, STAR, ELEMENT>The underlying datatype, F, is a field.

class DistMatrix<Int, colDist, rowDist>

class DistMatrix<Int>

class DistMatrix<Int, CIRC, CIRC>

class DistMatrix<Int, MC, MR>

class DistMatrix<Int, MC, STAR>

class DistMatrix<Int, MD, STAR>

class DistMatrix<Int, MR, MC>

class DistMatrix<Int, MR, STAR>

class DistMatrix<Int, STAR, MC>

class DistMatrix<Int, STAR, MD>

class DistMatrix<Int, STAR, MR>

class DistMatrix<Int, STAR, STAR>

class DistMatrix<Int, STAR, VC>

class DistMatrix<Int, STAR, VR>

class DistMatrix<Int, VC, STAR>

class DistMatrix<Int, VR, STAR>

class DistMatrix<Int, colDist, rowDist, ELEMENT>

class DistMatrix<Int, ELEMENT>

class DistMatrix<Int, CIRC, CIRC, ELEMENT>

class DistMatrix<Int, MC, MR, ELEMENT>

class DistMatrix<Int, MC, STAR, ELEMENT>

class DistMatrix<Int, MD, STAR, ELEMENT>

class DistMatrix<Int, MR, MC, ELEMENT>

class DistMatrix<Int, MR, STAR, ELEMENT>

class DistMatrix<Int, STAR, MC, ELEMENT>

class DistMatrix<Int, STAR, MD, ELEMENT>

class DistMatrix<Int, STAR, MR, ELEMENT>

class DistMatrix<Int, STAR, STAR, ELEMENT>

class DistMatrix<Int, STAR, VC, ELEMENT>

class DistMatrix<Int, STAR, VR, ELEMENT>

class DistMatrix<Int, VC, STAR, ELEMENT>

class DistMatrix<Int, VR, STAR, ELEMENT>The underlying datatype is a signed integer (of standard size).

80 Chapter 3. Core functionality

Page 85: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.6.4 BlockMatrix

The BlockMatrix<scalarType> is the parent class of each partial specializationDistMatrix<scalarTypee,colDist,rowDist,BLOCK> of DistMatrix to block-wise distri-butions; it is a child class of AbstractDistMatrix<scalarType>. Each of the derivativesof ElementalMatrix<scalarType> chooses a sensical pairing of distributions for the rows andcolumns of the matrix.

class BlockMatrix<scalarType>

class DistMatrix<scalarType, colDist, rowDist, BLOCK>The following routines are available for each legal pairing of row and column distribu-tions.

Constructors and destructors

DistMatrix(const Grid &grid = DefaultGrid(), Int blockHeight = DefaultBlock-Height(), Int blockWidth = DefaultBlockWidth(), Int root = 0)

Construct an empty (0 × 0) distributed matrix.

DistMatrix(Int height, Int width, const Grid &grid = DefaultGrid(), Int blockHeight =DefaultBlockHeight(), Int blockWidth = DefaultBlockWidth(), Int root =0)

Create a height × width distributed matrix.

DistMatrix(const AbstractDistMatrix<scalarType> &A)

Construct the current matrix to be a redistributed copy of the input matrix.

DistMatrix(const DistMatrix<scalarType, colDist, rowDist, BLOCK> &&A) noex-cept

Use C++11 move semantics to construct the current matrix in a way which transfersthe resources from the input matrix.

~DistMatrix()

All resources owned by the DistMatrix are freed upon destruction.

El::DistData DistData() constReturns a description of the distribution and alignment information

Assignment and reconfiguration

const DistMatrix<scalarType, colDist, rowDist> &operator=(const Ab-stractDistMa-trix<scalarType>&A)

Set the current distributed matrix equal to the matrix A redistributed into the ap-propriate form.

DistMatrix<scalarType, colDist, rowDist, BLOCK> &operator=(DistMatrix<scalarType,colDist, rowDist,BLOCK> &&A)

A C++11 move assignment which cheaply transfers the resources from A to thecurrent matrix by swapping metadata.

3.6. DistMatrix 81

Page 86: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

const DistMatrix<scalarType, colDist, rowDist, BLOCK> &operator*=(T alpha)Multiply every entry in the matrix by alpha.

const DistMatrix<scalarType, colDist, rowDist, BLOCK> &operator+=(constAbstract-DistMa-trix<T>&A)

const DistMatrix<scalarType, colDist, rowDist, BLOCK> &operator-=(constAbstract-DistMa-trix<T>&A)

Updates this matrix (via either addition or subtraction) with another another matrix.

Submatrices

DistMatrix<scalarType, colDist, rowDist, BLOCK> operator()(Range<Int> I,Range<Int> J)

const DistMatrix<scalarType, colDist, rowDist, BLOCK> operator()(Range<Int>I,Range<Int>J) const

Return a view of a contiguous submatrix with the given row and column indexranges.

DistMatrix<scalarType, colDist, rowDist, BLOCK> operator()(Range<Int>I, const vec-tor<Int> &J)const

DistMatrix<scalarType, colDist, rowDist, BLOCK> operator()(const vec-tor<Int> &I,Range<Int> J)const

DistMatrix<scalarType, colDist, rowDist, BLOCK> operator()(const vec-tor<Int> &I,const vec-tor<Int> &J)const

Return a copy of the (generally non-contiguous) submatrix given by the specifiedrow and column index lists.

DistWrap Wrap() constReturns

The standard matrix distribution ([MC,MR])

This is by far the most important matrix distribution in Elemental, as the vast majority ofparallel routines expect the input to be in this form. For a 7 × 7 block matrix distributed overa 2 × 3 process grid, individual blocks would be owned by the following processes (assuming

82 Chapter 3. Core functionality

Page 87: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

the column and row alignments are both 0):

0 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 01 3 5 1 3 5 10 2 4 0 2 4 0

Similarly, if the column alignment is kept at 0 and the row alignment is changed to 2 (meaningthat the third process column owns the first column of the matrix), the individual blocks wouldbe owned as follows:

4 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 45 1 3 5 1 3 54 0 2 4 0 2 4

class DistMatrix<scalarType, MC, MR, BLOCK>

[MC,STAR]

This distribution is often used as part of matrix-matrix multiplication. For a 7× 7 block matrixdistributed over a 2 × 3 process grid, individual subblocks would be owned by the followingprocesses (assuming the column alignment is 0):

0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 41, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 5 1, 3, 50, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4 0, 2, 4

class DistMatrix<scalarType, MC, STAR, BLOCK>

[MD,STAR]

In the case of our 2 × 3 process grid, each diagonal of the tesselation of the process grid willcontain the entire set of processes, for instance, in the order 0, 3, 4, 1, 2, 5. This would resultin the following overlay for the owning processes of the subblocks of our 7 × 7 block matrix

3.6. DistMatrix 83

Page 88: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

example:

0 0 0 0 0 0 03 3 3 3 3 3 34 4 4 4 4 4 41 1 1 1 1 1 12 2 2 2 2 2 25 5 5 5 5 5 50 0 0 0 0 0 0

Notice that each block column of this matrix is distributed like a diagonal of a [MC,MR] distri-bution.

class DistMatrix<scalarType, MD, STAR, BLOCK>

[MR,MC]

This is essentially the transpose of the standard matrix distribution, [MC,MR]. For a 7 × 7 blockmatrix distributed over a 2 × 3 process grid, individual subblocks would be owned by thefollowing processes (assuming the column and row alignments are both 0):

0 1 0 1 0 1 02 3 2 3 2 3 24 5 4 5 4 5 40 1 0 1 0 1 02 3 2 3 2 3 24 5 4 5 4 5 40 1 0 1 0 1 0

class DistMatrix<scalarType, MR, MC, BLOCK>

[MR,STAR]

This is the transpose of the [* ,MR] distribution and is, like many of the previous distribu-tions, useful for matrix-matrix multiplication. For a 7 × 7 block matrix distributed over a 2 × 3process grid, individual entries would be owned by the following processes (assuming thecolumn alignment is 0):

0, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 12, 3 2, 3 2, 3 2, 3 2, 3 2, 3 2, 34, 5 4, 5 4, 5 4, 5 4, 5 4, 5 4, 50, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 12, 3 2, 3 2, 3 2, 3 2, 3 2, 3 2, 34, 5 4, 5 4, 5 4, 5 4, 5 4, 5 4, 50, 1 0, 1 0, 1 0, 1 0, 1 0, 1 0, 1

class DistMatrix<scalarType, MR, STAR, BLOCK>

84 Chapter 3. Core functionality

Page 89: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[STAR,MC]

This is the transpose of the [MC,*] distribution and is, like many of the previous distributions,useful for matrix-matrix multiplication. For a 7 × 7 block matrix distributed over a 2 × 3 pro-cess grid, individual entries would be owned by the following processes (assuming the columnalignment is 0):

0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 40, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4 1, 3, 5 0, 2, 4

class DistMatrix<scalarType, STAR, MC, BLOCK>

[STAR,MD]

In the case of our 2 × 3 process grid, each diagonal of the tesselation of the process grid willcontain the entire set of processes, for instance, in the order 0, 3, 4, 1, 2, 5. This would resultin the following overlay for the owning processes of the subblocks of our 7 × 7 block matrixexample:

0 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 00 3 4 1 2 5 0

Notice that each block row of this matrix is distributed like a diagonal of a [MC,MR] distribution.

class DistMatrix<scalarType, STAR, MD, BLOCK>

[STAR,MR]

This distribution is also frequently used for matrix-matrix multiplication. For a 7 × 7 blockmatrix distributed over a 2 × 3 process grid, individual subblocks would be owned by thefollowing processes (assuming the row alignment is 0):

0, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 10, 1 2, 3 4, 5 0, 1 2, 3 4, 5 0, 1

class DistMatrix<scalarType, STAR, MR, BLOCK>

3.6. DistMatrix 85

Page 90: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[STAR,STAR]

This “distribution” actually redundantly stores every entry of the associated matrix on everyprocess. Again using a 2 × 3 process grid, the subblocks of a 7 × 7 block matrix would beowned by the following sets of processes:

0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 50, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5 0, 1, ..., 5

class DistMatrix<scalarType, STAR, STAR, BLOCK>

[STAR,VC]

This is the transpose of the above [VC,* ] distribution. On the standard 2 × 3 process gridwith a row alignment of zero, a 7 × 7 block matrix would be distributed as:

0 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 00 1 2 3 4 5 0

class DistMatrix<scalarType, STAR, VC, BLOCK>

[STAR,VR]

This is the transpose of the above [VR,* ] distribution. On the standard 2 × 3 process gridwith a row alignment of zero, a 7 × 7 block matrix would be distributed as:

0 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 00 2 4 1 3 5 0

class DistMatrix<scalarType, STAR, VR, BLOCK>

86 Chapter 3. Core functionality

Page 91: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[VC,STAR]

This distribution makes use of a 1d distribution which uses a column-major ordering of theentire process grid. Since 1d distributions are useful for distributing vectors, and a column-major ordering is used, the distribution symbol is VC. Again using the simple 2 × 3 processgrid, with a zero column alignment, each subblock of a 7 × 7 block matrix would be owned bythe marked process:

0 0 0 0 0 0 01 1 1 1 1 1 12 2 2 2 2 2 23 3 3 3 3 3 34 4 4 4 4 4 45 5 5 5 5 5 50 0 0 0 0 0 0

class DistMatrix<scalarType, VC, STAR, BLOCK>

[VR,STAR]

This distribution makes use of a 1d distribution which uses a row-major ordering of the entireprocess grid. Since 1d distributions are useful for distributing vectors, and a row-major orderingis used, the distribution symbol is VR. Again using the simple 2 × 3 process grid, with a zerocolumn alignment, each subblock of a 7 × 7 block matrix would be owned by the markedprocess:

0 0 0 0 0 0 02 2 2 2 2 2 24 4 4 4 4 4 41 1 1 1 1 1 13 3 3 3 3 3 35 5 5 5 5 5 50 0 0 0 0 0 0

class DistMatrix<scalarType, VR, STAR, BLOCK>

[CIRC,CIRC]

This distribution stores the entire matrix on a single process. For instance, if the root processis process 0 with respect to a column-major ordering of the process grid, then the correspond-ing overlay for the owners of each subblock of our 7 x 7 block matrix example would be:

0 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 00 0 0 0 0 0 0

class DistMatrix<scalarType, CIRC, CIRC, BLOCK>

3.6. DistMatrix 87

Page 92: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Some special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout El-emental’s source (as well as this documentation). These are all special cases ofDistMatrix<scalarType,colDist,rowDist,BLOCK>.

class DistMatrix<Real, colDist, rowDist, BLOCK>

class DistMatrix<Real, CIRC, CIRC, BLOCK>

class DistMatrix<Real, MC, MR, BLOCK>

class DistMatrix<Real, MC, STAR, BLOCK>

class DistMatrix<Real, MD, STAR, BLOCK>

class DistMatrix<Real, MR, MC, BLOCK>

class DistMatrix<Real, MR, STAR, BLOCK>

class DistMatrix<Real, STAR, MC, BLOCK>

class DistMatrix<Real, STAR, MD, BLOCK>

class DistMatrix<Real, STAR, MR, BLOCK>

class DistMatrix<Real, STAR, STAR, BLOCK>

class DistMatrix<Real, STAR, VC, BLOCK>

class DistMatrix<Real, STAR, VR, BLOCK>

class DistMatrix<Real, VC, STAR, BLOCK>

class DistMatrix<Real, VR, STAR, BLOCK>The underlying datatype, Real, is real (as opposed to complex).

class DistMatrix<Complex<Real>, colDist, rowDist, BLOCK>

class DistMatrix<Complex<Real>, CIRC, CIRC, BLOCK>

class DistMatrix<Complex<Real>, MC, MR, BLOCK>

class DistMatrix<Complex<Real>, MC, STAR, BLOCK>

class DistMatrix<Complex<Real>, MD, STAR, BLOCK>

class DistMatrix<Complex<Real>, MR, MC, BLOCK>

class DistMatrix<Complex<Real>, MR, STAR, BLOCK>

class DistMatrix<Complex<Real>, STAR, MC, BLOCK>

class DistMatrix<Complex<Real>, STAR, MD, BLOCK>

class DistMatrix<Complex<Real>, STAR, MR, BLOCK>

class DistMatrix<Complex<Real>, STAR, STAR, BLOCK>

class DistMatrix<Complex<Real>, STAR, VC, BLOCK>

class DistMatrix<Complex<Real>, STAR, VR, BLOCK>

class DistMatrix<Complex<Real>, VC, STAR, BLOCK>

88 Chapter 3. Core functionality

Page 93: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class DistMatrix<Complex<Real>, VR, STAR, BLOCK>The underlying datatype, Complex<Real>, is complex with base type Real.

class DistMatrix<F, colDist, rowDist, BLOCK>

class DistMatrix<F, CIRC, CIRC, BLOCK>

class DistMatrix<F, MC, MR, BLOCK>

class DistMatrix<F, MC, STAR, BLOCK>

class DistMatrix<F, MD, STAR, BLOCK>

class DistMatrix<F, MR, MC, BLOCK>

class DistMatrix<F, MR, STAR, BLOCK>

class DistMatrix<F, STAR, MC, BLOCK>

class DistMatrix<F, STAR, MD, BLOCK>

class DistMatrix<F, STAR, MR, BLOCK>

class DistMatrix<F, STAR, STAR, BLOCK>

class DistMatrix<F, STAR, VC, BLOCK>

class DistMatrix<F, STAR, VR, BLOCK>

class DistMatrix<F, VC, STAR, BLOCK>

class DistMatrix<F, VR, STAR, BLOCK>The underlying datatype, F, is a field.

class DistMatrix<Int, colDist, rowDist, BLOCK>

class DistMatrix<Int, CIRC, CIRC, BLOCK>

class DistMatrix<Int, MC, MR, BLOCK>

class DistMatrix<Int, MC, STAR, BLOCK>

class DistMatrix<Int, MD, STAR, BLOCK>

class DistMatrix<Int, MR, MC, BLOCK>

class DistMatrix<Int, MR, STAR, BLOCK>

class DistMatrix<Int, STAR, MC, BLOCK>

class DistMatrix<Int, STAR, MD, BLOCK>

class DistMatrix<Int, STAR, MR, BLOCK>

class DistMatrix<Int, STAR, STAR, BLOCK>

class DistMatrix<Int, STAR, VC, BLOCK>

class DistMatrix<Int, STAR, VR, BLOCK>

class DistMatrix<Int, VC, STAR, BLOCK>

class DistMatrix<Int, VR, STAR, BLOCK>The underlying datatype is a signed integer (of standard size).

3.6. DistMatrix 89

Page 94: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.7 Graph

3.7.1 Graph (Python interface)

TODO

3.7.2 Graph (C++ interface)

The Graph class allows for the efficient construction and manipulation of sequentially-stored,sparse graphs within Elemental and is the primary building block for the SparsMatrix<T>class. The usual usage pattern is to construct a trivial graph, e.g., via

# include "El.hpp"

...

El::Graph graph(numSources,numTargets);

// Set aside space for the edges to be inserted

graph.Reserve(numEdgesUpperBound);

// Iterate over the set of edges to insert

...

// Queue the insertion of a particular edge

graph.QueueConnection(source,target);

...

// Handle insertation of all of the queued edges

graph.ProcessQueues();

For example, to create the graph of a 1D lattice, one could run

# include "El.hpp"

...

El::Graph graph(n);

graph.Reserve( 2*n );

for( El::Int i=0; i<n; ++i )

if( i != 0 )

graph.QueueConnection( i, i-1 );

if( i != n-1 )

graph.QueueConnection( i, i+1 );

graph.ProcessQueues();

which would be a significantly faster alternative to

# include "El.hpp"

...

El::Graph graph(n);

for( El::Int i=0; i<n; ++i )

if( i != 0 )

graph.Connect( i, i-1 );

if( i != n-1 )

graph.Connect( i, i+1 );

class Graph

90 Chapter 3. Core functionality

Page 95: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Constructors and destructors

Graph()

Construct a trivial graph with zero source and target vertices.

Graph(Int numVertices)Initialize a trivial graph with numVertices source and target vertices (with noedges). Edges can subsequently be added with either the Connect routine, or a(more efficient) combination of Graph::Reserve() , Graph::QueueConnection() ,and Graph::ProcessQueues() routines.

Graph(Int numSources, Int numTargets)Initialize a trivial graph with numSources source vertices, numTargets tar-get vertices, and no edges. Edges can subsequently be added with eitherthe Connect routine, or a (more efficient) combination of Graph::Reserve() ,Graph::QueueConnection() , and Graph::ProcessQueues() routines.

Graph(const Graph &graph)Construct a new graph as a copy of a given graph.

Graph(const DistGraph &graph)Construct a new graph as a copy of a given DistGraph which was only distributedover a single process.

~Graph()

Assignment and reconfiguration

const Graph &operator=(const Graph &A)

Set this graph equal to a copy of the given graph.

const Graph &operator=(const DistGraph &A)

Set this graph equal to a copy of the given trivially-distributed (i.e., over a singleprocess) graph.

Graph operator()(Range<Int> I, Range<Int> J) const

Graph operator()(Range<Int> I, const vector<Int> &J) const

Graph operator()(const vector<Int> &I, Range<Int> J) const

Graph operator()(const vector<Int> &I, const vector<Int> &J) constMake a copy of a subgraph

void Empty(bool clearMemory = true)Set this graph equal to a trivial (0× 0) graph (and optionally free all previously-usedresources)

void Resize(Int numVertices)

void Resize(Int numSources, Int numTargets)Change the number of source and target vertices.

void Reserve(Int numEdges)Set aside space for the efficient queueing of up to numEdges edges.

void Connect(Int source, Int target)

3.7. Graph 91

Page 96: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Disconnect(Int source, Int target)Insert or remote a new edge and perform the necessary sorting so that the graph isin a consistent state.

Note: When multiple edges are to be inserted/removed, these routineshould be avoided in favor of a combination of Graph::Reserve() , multi-ple Graph::QueueConnection() and/or QueueDisconnection() calls, and thenGraph::ProcessQueues() .

void QueueConnection(Int source, Int target)

void QueueDisconnection(Int source, Int target)

void ProcessQueues()

Basic queries

Int NumSources() const

Int NumTargets() const

Int NumEdges() const

Int Capacity() const

bool Consistent() const

Int Source(Int edge) const

Int Target(Int edge) const

Int EdgeOffset(Int source) const

Int NumConnections(Int source) const

Int *SourceBuffer()

Int *TargetBuffer()

const Int *LockedSourceBuffer() const

const Int *LockedTargetBuffer() const

3.7.3 Graph (C interface)

TODO

3.8 SparseMatrix

3.8.1 SparseMatrix (Python interface)

TODO

92 Chapter 3. Core functionality

Page 97: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.8.2 SparseMatrix (C++ interface)

# include "El.hpp"

using namespace El;

...

const Int n0 = 50;

const Int n1 = 100;

SparseMatrix<float> A;

const Int height=n0*n1;

Zeros( A, height, height );

A.Reserve( 5*hHeight );

for( Int i=0; i<height; ++i )

const Int x0 = i % n0;

const Int x1 = i / n0;

A.QueueUpdate( iLoc, i, 11 );

if( x0 > 0 )

A.QueueUpdate( i, s-1, -1 );

if( x0+1 < n0 )

A.QueueUpdate( i, s+1, 2 );

if( x1 > 0 )

A.QueueUpdate( i, s-n0, -30 );

if( x1+1 < n1 )

A.QueueUpdate( i, s+n0, 4 );

A.ProcessQueues();

class SparseMatrix<T>

Constructors and destructors

SparseMatrix()

SparseMatrix(Int height, Int width)

SparseMatrix(const SparseMatrix<T> &A)

SparseMatrix(const DistSparseMatrix<T> &A)

~SparseMatrix()

Assignment and reconfiguration

const SparseMatrix<T> &operator=(const SparseMatrix<T> &A)

const SparseMatrix<T> &operator=(const DistSparseMatrix<T> &A)

SparseMatrix<T> operator()(Range<Int> I, Range<Int> J) const

SparseMatrix<T> operator()(Range<Int> I, const vector<Int> &J) const

SparseMatrix<T> operator()(const vector<Int> &I, Range<Int> J) const

SparseMatrix<T> operator()(const vector<Int> &I, const vector<Int> &J) constMake a copy of a submatrix

void Empty(bool clearMemory = true)

3.8. SparseMatrix 93

Page 98: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Resize(Int height, Int width)

void Reserve(Int numEntries)

void Update(const Entry<T> &entry)

void Update(Int row, Int col, T value)

void Zero(Int row, Int col)

void QueueUpdate(const Entry<T> &entry)

void QueueUpdate(const Int row, Int col, T value)

void QueueZero(Int row, Int col)

void ProcessQueues()

Basic queries

Int Height() const

Int Width() const

Int NumEntries() const

Int Capacity() const

bool Consistent() const

El::Graph &Graph()

const El::Graph &LockedGraph() const

Int Row(Int index) const

Int Col(Int index) const

T Value(Int index) const

Int EntryOffset(Int row) const

Int NumConnections(Int row) const

Int *SourceBuffer()

Int *TargetBuffer()

T *ValueBuffer()

const Int *LockedSourceBuffer() const

const Int *LockedTargetBuffer() const

const T *LockedValueBuffer() const

Special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout Elemental’s source(as well as this documentation). These are all special cases of SparseMatrix<T>.

class SparseMatrix<Real>Used to denote that the underlying datatype Real is real.

94 Chapter 3. Core functionality

Page 99: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

class SparseMatrix<Complex<Real>>Used to denote that the underlying datatype Complex<Real> is complex with base typeReal.

class SparseMatrix<F>Used to denote that the underlying datatype F is a field.

class SparseMatrix<Int>When the underlying datatype is a signed integer.

3.8.3 SparseMatrix (C interface)

TODO

3.9 DistGraph

3.9.1 DistGraph (Python interface)

TODO

3.9.2 DistGraph (C++ interface)

class DistGraph

Constructors and destructors

DistGraph(mpi::Comm comm = mpi::COMM WORLD)

DistGraph(Int numVertices, mpi::Comm comm = mpi::COMM WORLD)

DistGraph(Int numSources, Int numTargets, mpi::Comm comm =mpi::COMM WORLD)

DistGraph(const Graph &graph)

DistGraph(const DistGraph &graph)

~DistGraph()

Assignment and reconfiguration

const DistGraph &operator=(const Graph &A)

const DistGraph &operator=(const DistGraph &A)

DistGraph operator()(Range<Int> I, Range<Int> J) const

DistGraph operator()(Range<Int> I, const vector<Int> &J) const

DistGraph operator()(const vector<Int> &I, Range<Int> J) const

DistGraph operator()(const vector<Int> &I, const vector<Int> &J) constMake a copy of a subgraph

3.9. DistGraph 95

Page 100: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Empty(bool clearMemory = true)

void Resize(Int numVertices)

void Resize(Int numSources, Int numTargets)

void SetComm(mpi::Comm comm)

void Reserve(Int numLocalEdges, Int numRemoteEdges = 0)

void Connect(Int source, Int target)

void Disconnect(Int source, Int target)

void ConnectLocal(Int localSource, Int target)

void DisconnectLocal(Int localSource, Int target)

void QueueConnection(Int source, Int target, bool passive = true)

void QueueDisconnection(Int source, Int target, bool passive = true)

void QueueLocalConnection(Int localSource, Int target)

void QueueLocalDisconnection(Int localSource, Int target)

void ProcessQueues()

void ProcessLocalQueues()

Basic queries

Int NumSources() const

Int NumTargets() const

Int FirstLocalSource() const

Int NumLocalSources() const

Int NumLocalEdges() const

Int Capacity() const

bool LocallyConsistent() const

mpi::Comm Comm() const

Int Blocksize() const

int SourceOwner(Int source) const

Int GlobalSource(Int localSource) const

Int Source(Int localEdge) const

Int Target(Int localEdge) const

Int EdgeOffset(Int localSource) const

Int NumConnections(Int localSource) const

Int *SourceBuffer()

Int *TargetBuffer()

96 Chapter 3. Core functionality

Page 101: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

const Int *LockedSourceBuffer() const

const Int *LockedTargetBuffer() const

3.9.3 DistGraph (C interface)

TODO

3.10 DistSparseMatrix

3.10.1 DistSparseMatrix (Python interface)

TODO

3.10.2 DistSparseMatrix (C++ interface)

# include "El.hpp"

using namespace El;

...

const Int n0 = 50;

const Int n1 = 100;

DistSparseMatrix<float> A;

Zeros( A, n0*n1, n0*n1 );

const Int localHeight = A.LocalHeight();

A.Reserve( 5*localHeight );

for( Int iLoc=0; iLoc<localHeight; ++iLoc )

const Int i = A.GlobalRow(iLoc);

const Int x0 = i % n0;

const Int x1 = i / n0;

A.QueueLocalUpdate( iLoc, i, 11 );

if( x0 > 0 )

A.QueueLocalUpdate( iLoc, s-1, -1 );

if( x0+1 < n0 )

A.QueueLocalUpdate( iLoc, s+1, 2 );

if( x1 > 0 )

A.QueueLocalUpdate( iLoc, s-n0, -30 );

if( x1+1 < n1 )

A.QueueLocalUpdate( iLoc, s+n0, 4 );

A.ProcessLocalQueues();

class DistSparseMatrix<T>

Constructors and destructors

DistSparseMatrix(mpi::Comm comm = mpi::COMM WORLD)

DistSparseMatrix(Int height, Int width, mpi::Comm comm = mpi::COMM WORLD)

~DistSparseMatrix()

3.10. DistSparseMatrix 97

Page 102: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Assignment and reconfiguration

DistSparseMatrix<T> operator()(Range<Int> I, Range<Int> J) const

DistSparseMatrix<T> operator()(Range<Int> I, const vector<Int> &J) const

DistSparseMatrix<T> operator()(const vector<Int> &I, Range<Int> J) const

DistSparseMatrix<T> operator()(const vector<Int> &I, const vector<Int> &J)const

Make a copy of a submatrix

void Empty(bool clearMemory = true)

void Resize(Int height, Int width)

void Reserve(Int numLocalEntries, Int numRemoteEntries = 0)

void Update(const Entry<T> &entry)

void Update(Int row, Int col, T value)

void Zero(Int row, Int col)

void UpdateLocal(const Entry<T> &localEntry)

void UpdateLocal(Int localRow, Int col, T value)

void ZeroLocal(Int localRow, Int col)

void QueueUpdate(const Entry<T> &entry, bool passive = true)

void QueueUpdate(const Int row, Int col, T value, bool passive = true)

void QueueZero(Int row, Int col, bool passive = true)

void QueueLocalUpdate(const Entry<T> &localEntry)

void QueueLocalUpdate(Int localRow, Int col, T value)

void QueueLocalZero(Int localRow, Int col)

void ProcessQueues()

void ProcessLocalQueues()

Basic queries

Int Height() const

Int Width() const

Int FirstLocalRow() const

Int LocalHeight() const

Int NumLocalEntries() const

Int Capacity() const

bool LocallyConsistent() const

El::DistGraph &DistGraph()

98 Chapter 3. Core functionality

Page 103: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

const El::DistGraph &LockedDistGraph() const

Int Row(Int localInd) const

Int Col(Int localInd) const

T Value(Int localInd) const

Int EntryOffset(Int localRow) const

Int NumConnections(Int localRow) const

Int *SourceBuffer()

Int *TargetBuffer()

T *ValueBuffer()

const Int *LockedSourceBuffer() const

const Int *LockedTargetBuffer() const

const T *LockedValueBuffer() const

mutable SparseMultMeta<T> multMeta

Special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout Elemental’s source(as well as this documentation). These are all special cases of DistSparseMatrix<T>.

class DistSparseMatrix<Real>Used to denote that the underlying datatype Real is real.

class DistSparseMatrix<Complex<Real>>Used to denote that the underlying datatype Complex<Real> is complex with base typeReal.

class DistSparseMatrix<F>Used to denote that the underlying datatype F is a field.

class DistSparseMatrix<Int>When the underlying datatype is a signed integer.

3.10.3 DistSparseMatrix (C interface)

TODO

3.11 DistMultiVec

3.11.1 DistMultiVec (Python interface)

TODO

3.11. DistMultiVec 99

Page 104: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.11.2 DistMultiVec (C++ interface)

class DistMultiVec<T>

Constructors and destructors

DistMultiVec(mpi::Comm comm = mpi::COMM WORLD)

DistMultiVec(Int height, Int width, mpi::Comm comm = mpi::COMM WORLD)

~DistMultiVec()

Assignment and reconfiguration

DistMultiVec<T> operator()(Range<Int> I, Range<Int> J) const

DistMultiVec<T> operator()(Range<Int> I, const vector<Int> &J) const

DistMultiVec<T> operator()(const vector<Int> &I, Range<Int> J) const

DistMultiVec<T> operator()(const vector<Int> &I, const vector<Int> &J) constMake a copy of a submatrix

const DistMultiVec<T> &operator=(const DistMultiVec<T> &X)

const DistMultiVec<T> &operator=(const AbstractDistMatrix<T> &X)

void Empty()

Sets the matrix to 0 × 0 and frees any owned resources.

void Resize(Int height, Int width)Reconfigures the matrix to be height × width.

void SetComm(mpi::Comm comm)

Basic queries

Int Height() const

Int Width() constReturn the height/width of the matrix.

Int FirstLocalRow() const

Int LocalHeight() const

El::Matrix<T> &Matrix()

const El::Matrix<T> &LockedMatrix() const

mpi::Comm Comm() const

Int Blocksize() const

int RowOwner(Int i) const

Int GlobalRow(Int iLoc) const

100 Chapter 3. Core functionality

Page 105: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Single-entry manipulation

T Get(Int i, Int j) const

T GetLocal(Int iLoc, Int j) constReturn a global/local entry

void Set(Int i, Int j, T alpha)

void SetLocal(Int iLoc, Int j, T alpha)Set entry a global/local entry

void Update(Int i, Int j, T alpha)

void UpdateLocal(Int iLoc, Int j, T alpha)Add a specifc value to a global/local entry

Special cases used in Elemental

This list of special cases is here to help clarify the notation used throughout Elemental’s source(as well as this documentation). These are all special cases of DistMultiVec<T>.

class DistMultiVec<Real>Used to denote that the underlying datatype Real is real.

class DistMultiVec<Complex<Real>>Used to denote that the underlying datatype Complex<Real> is complex with base typeReal.

class DistMultiVec<F>Used to denote that the underlying datatype F is a field.

class DistMultiVec<Int>When the underlying datatype is a signed integer.

3.11.3 DistMultiVec (C interface)

TODO

3.12 Viewing submatrices

The following routines form light-weight (O(1) storage space and construction time) objectswhich represent contiguous submatrices of a given matrix. In many ways, they are an object-oriented equivalent of the BLAS convention of representing a matrix via a pointer, a lead-ing dimension, and its dimensions. Routines with a ‘Locked’ prefix return immutable views,whereas routines without the ‘Locked’ prefix insist that the data pointed to by the constructedview can be modified.

3.12.1 Half-open range

It is useful to represent intervals in the half-open form [a, b), as this representation easily allowsfor expressing empty index intervals without the usage of negative numbers, e.g., [0, 0).

3.12. Viewing submatrices 101

Page 106: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

class Range<T>

T beg

T end

Range()

Initializes beg and end to zero

Range(T begArg, T endArg)Initializes beg to begArg and end to endArg

Range<T> operator+(T shift) constReturns a copy of this object but with the beginning and end values increased byshift

Range<T> operator-(T shift) constReturns a copy of this object but with the beginning and end values decreased byshift

class Range<Int>

class Range<float>

class Range<double>

type IR

A typedef to Range<Int> which is convenient when extracting contiguous submatrices

C API

Range i

ElInt beg

ElInt end

Range s

float beg

float end

Range d

double beg

double end

3.12.2 View a submatrix via index ranges

The following routines return a view of B(I, J), where I and J are each half-open contiguousindex ranges, i.e., [I.beg,I.end) and [J.beg,J.end).

102 Chapter 3. Core functionality

Page 107: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void View(Matrix<T> &A, Matrix<T> &B, Range<Int> I, Range<Int> J)

void LockedView(Matrix<T> &A, const Matrix<T> &B, Range<Int> I, Range<Int> J)

void View(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &B, Range<Int> I,Range<Int> J)

void LockedView(AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &B,Range<Int> I, Range<Int> J)

The view is returned in A.

Matrix<T> View(Matrix<T> &B, Range<Int> I, Range<Int> J)

Matrix<T> LockedView(const Matrix<T> &B, Range<Int> I, Range<Int> J)

DistMatrix<T, U, V> View(DistMatrix<T, U, V> &B, Range<Int> I, Range<Int> J)

DistMatrix<T, U, V> LockedView(const DistMatrix<T, U, V> &B, Range<Int> I,Range<Int> J)

The view is the return value of the function.

C API

ElError ElView i(ElMatrix i A, ElMatrix i B, ElRange i I, ElRange i J)

ElError ElView s(ElMatrix s A, ElMatrix s B, ElRange i I, ElRange i J)

ElError ElView d(ElMatrix d A, ElMatrix d B, ElRange i I, ElRange i J)

ElError ElView c(ElMatrix c A, ElMatrix c B, ElRange i I, ElRange i J)

ElError ElView z(ElMatrix z A, ElMatrix z B, ElRange i I, ElRange i J)

ElError ElViewDist i(ElDistMatrix i A, ElDistMatrix i B, ElRange i I, ElRange i J)

ElError ElViewDist s(ElDistMatrix s A, ElDistMatrix s B, ElRange i I, ElRange i J)

ElError ElViewDist d(ElDistMatrix d A, ElDistMatrix d B, ElRange i I, ElRange i J)

ElError ElViewDist c(ElDistMatrix c A, ElDistMatrix c B, ElRange i I, ElRange i J)

ElError ElViewDist z(ElDistMatrix z A, ElDistMatrix z B, ElRange i I, ElRange i J)The input matrix is mutable

ElError ElLockedView i(ElMatrix i A, ElConstMatrix i B, ElRange i I, ElRange i J)

ElError ElLockedView s(ElMatrix s A, ElConstMatrix s B, ElRange i I, ElRange i J)

ElError ElLockedView d(ElMatrix d A, ElConstMatrix d B, ElRange i I, ElRange i J)

ElError ElLockedView c(ElMatrix c A, ElConstMatrix c B, ElRange i I, ElRange i J)

ElError ElLockedView z(ElMatrix z A, ElConstMatrix z B, ElRange i I, ElRange i J)

ElError ElLockedViewDist i(ElDistMatrix i A, ElConstDistMatrix i B, ElRange i I, El-Range i J)

ElError ElLockedViewDist s(ElDistMatrix s A, ElConstDistMatrix s B, ElRange i I, El-Range i J)

3.12. Viewing submatrices 103

Page 108: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedViewDist d(ElDistMatrix d A, ElConstDistMatrix d B, ElRange i I, El-Range i J)

ElError ElLockedViewDist c(ElDistMatrix c A, ElConstDistMatrix c B, ElRange i I, El-Range i J)

ElError ElLockedViewDist z(ElDistMatrix z A, ElConstDistMatrix z B, ElRange i I, El-Range i J)

The input matrix need not be mutable

3.12.3 View a submatrix via offset and size

The following routines return a view of a height by width contiguous submatrix of the matrix Bwhose upper-left entry has coordinates (i, j).

C++ API

void View(Matrix<T> &A, Matrix<T> &B, int i, int j, int height, int width)

void LockedView(Matrix<T> &A, const Matrix<T> &B, int i, int j, int height, int width)

void View(DistMatrix<T, U, V> &A, DistMatrix<T, U, V> &B, int i, int j, int height, intwidth)

void LockedView(DistMatrix<T, U, V> &A, const DistMatrix<T, U, V> &B, int i, int j, intheight, int width)

The view is returned in A.

Matrix<T> View(Matrix<T> &B, int i, int j, int height, int width)

Matrix<T> LockedView(const Matrix<T> &B, int i, int j, int height, int width)

DistMatrix<T, U, V> View(DistMatrix<T, U, V> &B, int i, int j, int height, int width)

DistMatrix<T, U, V> LockedView(const DistMatrix<T, U, V> &B, int i, int j, int height,int width)

The view is the return value of the function.

C API

ElError ElViewOffset i(ElMatrix i A, ElMatrix i B, ElInt i, ElInt j, ElInt height,ElInt width)

ElError ElViewOffset s(ElMatrix s A, ElMatrix s B, ElInt i, ElInt j, ElInt height,ElInt width)

ElError ElViewOffset d(ElMatrix d A, ElMatrix d B, ElInt i, ElInt j, ElInt height,ElInt width)

ElError ElViewOffset c(ElMatrix c A, ElMatrix c B, ElInt i, ElInt j, ElInt height,ElInt width)

ElError ElViewOffset z(ElMatrix z A, ElMatrix z B, ElInt i, ElInt j, ElInt height,ElInt width)

ElError ElViewOffsetDist i(ElDistMatrix i A, ElDistMatrix i B, ElInt i, ElInt j,ElInt height, ElInt width)

104 Chapter 3. Core functionality

Page 109: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElViewOffsetDist s(ElDistMatrix s A, ElDistMatrix s B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElViewOffsetDist d(ElDistMatrix d A, ElDistMatrix d B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElViewOffsetDist c(ElDistMatrix c A, ElDistMatrix c B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElViewOffsetDist z(ElDistMatrix z A, ElDistMatrix z B, ElInt i, ElInt j,ElInt height, ElInt width)

The input matrix is mutable

ElError ElLockedViewOffset i(ElMatrix i A, ElConstMatrix i B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElLockedViewOffset s(ElMatrix s A, ElConstMatrix s B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElLockedViewOffset d(ElMatrix d A, ElConstMatrix d B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElLockedViewOffset c(ElMatrix c A, ElConstMatrix c B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElLockedViewOffset z(ElMatrix z A, ElConstMatrix z B, ElInt i, ElInt j,ElInt height, ElInt width)

ElError ElLockedViewOffsetDist i(ElDistMatrix i A, ElConstDistMatrix i B, ElInt i,ElInt j, ElInt height, ElInt width)

ElError ElLockedViewOffsetDist s(ElDistMatrix s A, ElConstDistMatrix s B, ElInt i,ElInt j, ElInt height, ElInt width)

ElError ElLockedViewOffsetDist d(ElDistMatrix d A, ElConstDistMatrix d B, ElInt i,ElInt j, ElInt height, ElInt width)

ElError ElLockedViewOffsetDist c(ElDistMatrix c A, ElConstDistMatrix c B, ElInt i,ElInt j, ElInt height, ElInt width)

ElError ElLockedViewOffsetDist z(ElDistMatrix z A, ElConstDistMatrix z B, ElInt i,ElInt j, ElInt height, ElInt width)

The input matrix need not be mutable

3.12.4 View a full matrix

The following routines return a view of an entire matrix.

C++ API

void View(Matrix<T> &A, Matrix<T> &B)

void LockedView(Matrix<T> &A, const Matrix<T> &B)

void View(DistMatrix<T, U, V> &A, DistMatrix<T, U, V> &B)

void LockedView(DistMatrix<T, U, V> &A, const DistMatrix<T, U, V> &B)The view is returned in A.

Matrix<T> View(Matrix<T> &B)

3.12. Viewing submatrices 105

Page 110: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Matrix<T> LockedView(const Matrix<T> &B)

DistMatrix<T, U, V> View(DistMatrix<T, U, V> &B)

DistMatrix<T, U, V> LockedView(const DistMatrix<T, U, V> &B)Return a view of the matrix B.

C API

ElError ElViewFull i(ElMatrix i A, ElMatrix i B)

ElError ElViewFull s(ElMatrix s A, ElMatrix s B)

ElError ElViewFull d(ElMatrix d A, ElMatrix d B)

ElError ElViewFull c(ElMatrix c A, ElMatrix c B)

ElError ElViewFull z(ElMatrix z A, ElMatrix z B)

ElError ElViewFullDist i(ElDistMatrix i A, ElDistMatrix i B)

ElError ElViewFullDist s(ElDistMatrix s A, ElDistMatrix s B)

ElError ElViewFullDist d(ElDistMatrix d A, ElDistMatrix d B)

ElError ElViewFullDist c(ElDistMatrix c A, ElDistMatrix c B)

ElError ElViewFullDist z(ElDistMatrix z A, ElDistMatrix z B)The input matrix is mutable

ElError ElLockedViewFull i(ElMatrix i A, ElConstMatrix i B)

ElError ElLockedViewFull s(ElMatrix s A, ElConstMatrix s B)

ElError ElLockedViewFull d(ElMatrix d A, ElConstMatrix d B)

ElError ElLockedViewFull c(ElMatrix c A, ElConstMatrix c B)

ElError ElLockedViewFull z(ElMatrix z A, ElConstMatrix z B)

ElError ElLockedViewFullDist i(ElDistMatrix i A, ElConstDistMatrix i B)

ElError ElLockedViewFullDist s(ElDistMatrix s A, ElConstDistMatrix s B)

ElError ElLockedViewFullDist d(ElDistMatrix d A, ElConstDistMatrix d B)

ElError ElLockedViewFullDist c(ElDistMatrix c A, ElConstDistMatrix c B)

ElError ElLockedViewFullDist z(ElDistMatrix z A, ElConstDistMatrix z B)The input matrix need not be mutable

3.13 Read/write proxies

Elemental provides a number of routines which provide cheap (O(1) if possible) conversionmechanisms for allowing a matrix to be operated on via a particular datatype and distribution.

106 Chapter 3. Core functionality

Page 111: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.13.1 Read proxy

A smart pointer to a matrix with the requested datatype and distribution, but filled with the(distributed) contents of the input matrix, is returned.

std::shared ptr<const Matrix<T>> ReadProxy(const Matrix<S> *A)

std::shared ptr<const DistMatrix<T, U, V>> ReadProxy(const AbstractDistMatrix<S>*A, const ProxyCtrl &ctrl =ProxyCtrl())

For immutable inputs, the output is also immutable

std::shared ptr<Matrix<T>> ReadProxy(Matrix<S> *A)

std::shared ptr<DistMatrix<T, U, V>> ReadProxy(AbstractDistMatrix<S> *A, constProxyCtrl &ctrl = ProxyCtrl())

For mutable inputs, the output is also mutable

3.13.2 Read-write proxy

A smart pointer to a matrix with the requested datatype and distribution, but filled with the(distributed) contents of the input matrix, is returned. When the shared pointer goes out ofscope, the (modified) matrix is copied back into A.

std::shared ptr<Matrix<T>> ReadWriteProxy(Matrix<S> *A)

std::shared ptr<DistMatrix<T, U, V>> ReadWriteProxy(AbstractDistMatrix<S> *A,const ProxyCtrl &ctrl = Prox-yCtrl())

3.13.3 Write proxy

A smart pointer to a matrix with the requested datatype and distribution is returned and, whenthe object goes out of scope, the matrix is copied into A.

std::shared ptr<Matrix<T>> WriteProxy(Matrix<S> *A)

std::shared ptr<DistMatrix<T, U, V>> WriteProxy(AbstractDistMatrix<S> *A, constProxyCtrl &ctrl = ProxyCtrl())

3.13.4 Configuring the proxy

class ProxyCtrl

bool colConstrain

bool rowConstrain

bool rootConstrain

Int colAlign

Int rowAlign

Int root

3.13. Read/write proxies 107

Page 112: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ProxyCtrl()

Initializes all booleans to false and all integers to zero.

3.14 FLAME-like partition tracking

3.14.1 Partitioning

The following routines are slight tweaks of the FLAME project’s (as well as PLAPACK’s) ap-proach to submatrix tracking; the difference is that they have “locked” versions, which aremeant for creating partitionings where the submatrices cannot be modified.

Downward

Given an m × n matrix A, configure AT and AB to view the local data of A corresponding tothe partition

A =

(ATAB

),

where AT is of a specified height.

C++ API

void PartitionDown(Matrix<T> &A, Matrix<T> &AT, Matrix<T> &AB, Int heightAT =Blocksize())

void LockedPartitionDown(const Matrix<T> &A, Matrix<T> &AT, Matrix<T> &AB,Int heightAT = Blocksize())

void PartitionDown(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &AT, Ab-stractDistMatrix<T> &AB, Int heightAT = Blocksize())

void LockedPartitionDown(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&AT, AbstractDistMatrix<T> &AB, Int heightAT = Block-size())

C API

ElError ElPartitionDown i(ElMatrix i A, ElMatrix i AT, ElMatrix i AB, ElInt heightAT)

ElError ElPartitionDown s(ElMatrix s A, ElMatrix s AT, ElMatrix s AB, ElInt heightAT)

ElError ElPartitionDown d(ElMatrix d A, ElMatrix d AT, ElMatrix d AB, ElInt heigh-tAT)

ElError ElPartitionDown c(ElMatrix c A, ElMatrix c AT, ElMatrix c AB, ElInt heightAT)

ElError ElPartitionDown z(ElMatrix z A, ElMatrix z AT, ElMatrix z AB, ElInt heightAT)

ElError ElPartitionDownDist i(ElDistMatrix i A, ElDistMatrix i AT, ElDistMatrix i AB,ElInt heightAT)

ElError ElPartitionDownDist s(ElDistMatrix s A, ElDistMatrix s AT, ElDistMa-trix s AB, ElInt heightAT)

108 Chapter 3. Core functionality

Page 113: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElPartitionDownDist d(ElDistMatrix d A, ElDistMatrix d AT, ElDistMa-trix d AB, ElInt heightAT)

ElError ElPartitionDownDist c(ElDistMatrix c A, ElDistMatrix c AT, ElDistMa-trix c AB, ElInt heightAT)

ElError ElPartitionDownDist z(ElDistMatrix z A, ElDistMatrix z AT, ElDistMa-trix z AB, ElInt heightAT)

ElError ElLockedPartitionDown i(ElConstMatrix i A, ElMatrix i AT, ElMatrix i AB,ElInt heightAT)

ElError ElLockedPartitionDown s(ElConstMatrix s A, ElMatrix s AT, ElMatrix s AB,ElInt heightAT)

ElError ElLockedPartitionDown d(ElConstMatrix d A, ElMatrix d AT, ElMatrix d AB,ElInt heightAT)

ElError ElLockedPartitionDown c(ElConstMatrix c A, ElMatrix c AT, ElMatrix c AB,ElInt heightAT)

ElError ElLockedPartitionDown z(ElConstMatrix z A, ElMatrix z AT, ElMatrix z AB,ElInt heightAT)

ElError ElLockedPartitionDownDist i(ElConstDistMatrix i A, ElDistMatrix i AT, ElD-istMatrix i AB, ElInt heightAT)

ElError ElLockedPartitionDownDist s(ElConstDistMatrix s A, ElDistMatrix s AT, ElD-istMatrix s AB, ElInt heightAT)

ElError ElLockedPartitionDownDist d(ElConstDistMatrix d A, ElDistMatrix d AT, El-DistMatrix d AB, ElInt heightAT)

ElError ElLockedPartitionDownDist c(ElConstDistMatrix c A, ElDistMatrix c AT, ElD-istMatrix c AB, ElInt heightAT)

ElError ElLockedPartitionDownDist z(ElConstDistMatrix z A, ElDistMatrix z AT, El-DistMatrix z AB, ElInt heightAT)

Upward

Given an m × n matrix A, configure AT and AB to view the local data of A corresponding tothe partition

A =

(ATAB

),

where AB is of a specified height.

C++ API

void PartitionUp(Matrix<T> &A, Matrix<T> &AT, Matrix<T> &AB, Int heightAB =Blocksize())

void LockedPartitionUp(const Matrix<T> &A, Matrix<T> &AT, Matrix<T> &AB, IntheightAB = Blocksize())

void PartitionUp(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &AT, Abstract-DistMatrix<T> &AB, Int heightAB = Blocksize())

3.14. FLAME-like partition tracking 109

Page 114: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void LockedPartitionUp(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&AT, AbstractDistMatrix<T> &AB, Int heightAB = Blocksize())

C API

ElError ElPartitionUp i(ElMatrix i A, ElMatrix i AT, ElMatrix i AB, ElInt heightAB)

ElError ElPartitionUp s(ElMatrix s A, ElMatrix s AT, ElMatrix s AB, ElInt heightAB)

ElError ElPartitionUp d(ElMatrix d A, ElMatrix d AT, ElMatrix d AB, ElInt heightAB)

ElError ElPartitionUp c(ElMatrix c A, ElMatrix c AT, ElMatrix c AB, ElInt heightAB)

ElError ElPartitionUp z(ElMatrix z A, ElMatrix z AT, ElMatrix z AB, ElInt heightAB)

ElError ElPartitionUpDist i(ElDistMatrix i A, ElDistMatrix i AT, ElDistMatrix i AB,ElInt heightAB)

ElError ElPartitionUpDist s(ElDistMatrix s A, ElDistMatrix s AT, ElDistMatrix s AB,ElInt heightAB)

ElError ElPartitionUpDist d(ElDistMatrix d A, ElDistMatrix d AT, ElDistMatrix d AB,ElInt heightAB)

ElError ElPartitionUpDist c(ElDistMatrix c A, ElDistMatrix c AT, ElDistMatrix c AB,ElInt heightAB)

ElError ElPartitionUpDist z(ElDistMatrix z A, ElDistMatrix z AT, ElDistMatrix z AB,ElInt heightAB)

ElError ElLockedPartitionUp i(ElConstMatrix i A, ElMatrix i AT, ElMatrix i AB,ElInt heightAB)

ElError ElLockedPartitionUp s(ElConstMatrix s A, ElMatrix s AT, ElMatrix s AB,ElInt heightAB)

ElError ElLockedPartitionUp d(ElConstMatrix d A, ElMatrix d AT, ElMatrix d AB,ElInt heightAB)

ElError ElLockedPartitionUp c(ElConstMatrix c A, ElMatrix c AT, ElMatrix c AB,ElInt heightAB)

ElError ElLockedPartitionUp z(ElConstMatrix z A, ElMatrix z AT, ElMatrix z AB,ElInt heightAB)

ElError ElLockedPartitionUpDist i(ElConstDistMatrix i A, ElDistMatrix i AT, ElDist-Matrix i AB, ElInt heightAB)

ElError ElLockedPartitionUpDist s(ElConstDistMatrix s A, ElDistMatrix s AT, ElDist-Matrix s AB, ElInt heightAB)

ElError ElLockedPartitionUpDist d(ElConstDistMatrix d A, ElDistMatrix d AT, ElD-istMatrix d AB, ElInt heightAB)

ElError ElLockedPartitionUpDist c(ElConstDistMatrix c A, ElDistMatrix c AT, ElDist-Matrix c AB, ElInt heightAB)

ElError ElLockedPartitionUpDist z(ElConstDistMatrix z A, ElDistMatrix z AT, ElDist-Matrix z AB, ElInt heightAB)

110 Chapter 3. Core functionality

Page 115: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Rightward

Given an m × n matrix A, configure AL and AR to view the local data of A corresponding tothe partition

A =(

AL AR)

,

where AL is of a specified width.

C++ API

void PartitionRight(Matrix<T> &A, Matrix<T> &AL, Matrix<T> &AR, Int widthAL= Blocksize())

void LockedPartitionRight(const Matrix<T> &A, Matrix<T> &AL, Matrix<T> &AR,Int widthAL = Blocksize())

void PartitionRight(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &AL, Ab-stractDistMatrix<T> &AR, Int widthAL = Blocksize())

void LockedPartitionRight(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&AL, AbstractDistMatrix<T> &AR, Int widthAL = Block-size())

C API

ElError ElPartitionRight i(ElgMatrix i A, ElConstMatrix i AL, ElConstMatrix i AR,ElInt widthAL)

ElError ElPartitionRight s(ElgMatrix s A, ElConstMatrix s AL, ElConstMatrix s AR,ElInt widthAL)

ElError ElPartitionRight d(ElgMatrix d A, ElConstMatrix d AL, ElConstMatrix d AR,ElInt widthAL)

ElError ElPartitionRight c(ElgMatrix c A, ElConstMatrix c AL, ElConstMatrix c AR,ElInt widthAL)

ElError ElPartitionRight z(ElgMatrix z A, ElConstMatrix z AL, ElConstMatrix z AR,ElInt widthAL)

ElError ElPartitionRightDist i(ElgDistMatrix i A, ElConstDistMatrix i AL, ElConst-DistMatrix i AR, ElInt widthAL)

ElError ElPartitionRightDist s(ElgDistMatrix s A, ElConstDistMatrix s AL, ElConst-DistMatrix s AR, ElInt widthAL)

ElError ElPartitionRightDist d(ElgDistMatrix d A, ElConstDistMatrix d AL, ElConst-DistMatrix d AR, ElInt widthAL)

ElError ElPartitionRightDist c(ElgDistMatrix c A, ElConstDistMatrix c AL, ElConst-DistMatrix c AR, ElInt widthAL)

ElError ElPartitionRightDist z(ElgDistMatrix z A, ElConstDistMatrix z AL, ElConst-DistMatrix z AR, ElInt widthAL)

ElError ElLockedPartitionRight i(ElConstMatrix i A, ElMatrix i AL, ElMatrix i AR,ElInt widthAL)

ElError ElLockedPartitionRight s(ElConstMatrix s A, ElMatrix s AL, ElMatrix s AR,ElInt widthAL)

3.14. FLAME-like partition tracking 111

Page 116: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedPartitionRight d(ElConstMatrix d A, ElMatrix d AL, ElMatrix d AR,ElInt widthAL)

ElError ElLockedPartitionRight c(ElConstMatrix c A, ElMatrix c AL, ElMatrix c AR,ElInt widthAL)

ElError ElLockedPartitionRight z(ElConstMatrix z A, ElMatrix z AL, ElMatrix z AR,ElInt widthAL)

ElError ElLockedPartitionRightDist i(ElConstDistMatrix i A, ElDistMatrix i AL, El-DistMatrix i AR, ElInt widthAL)

ElError ElLockedPartitionRightDist s(ElConstDistMatrix s A, ElDistMatrix s AL, El-DistMatrix s AR, ElInt widthAL)

ElError ElLockedPartitionRightDist d(ElConstDistMatrix d A, ElDistMatrix d AL, El-DistMatrix d AR, ElInt widthAL)

ElError ElLockedPartitionRightDist c(ElConstDistMatrix c A, ElDistMatrix c AL, El-DistMatrix c AR, ElInt widthAL)

ElError ElLockedPartitionRightDist z(ElConstDistMatrix z A, ElDistMatrix z AL, El-DistMatrix z AR, ElInt widthAL)

Leftward

Given an m × n matrix A, configure AL and AR to view the local data of A corresponding tothe partition

A =(

AL AR)

,

where AR is of a specified width.

C++ API

void PartitionLeft(Matrix<T> &A, Matrix<T> &AL, Matrix<T> &AR, Int widthAR =Blocksize())

void LockedPartitionLeft(const Matrix<T> &A, Matrix<T> &AL, Matrix<T> &AR,Int widthAR = Blocksize())

void PartitionLeft(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &AL, Ab-stractDistMatrix<T> &AR, Int widthAR = Blocksize())

void LockedPartitionLeft(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&AL, AbstractDistMatrix<T> &AR, Int widthAR = Block-size())

C API

ElError ElPartitionLeft i(ElMatrix i A, ElMatrix i AL, ElMatrix i AR, ElInt widthAR)

ElError ElPartitionLeft s(ElMatrix s A, ElMatrix s AL, ElMatrix s AR, ElInt widthAR)

ElError ElPartitionLeft d(ElMatrix d A, ElMatrix d AL, ElMatrix d AR,ElInt widthAR)

ElError ElPartitionLeft c(ElMatrix c A, ElMatrix c AL, ElMatrix c AR, ElInt widthAR)

112 Chapter 3. Core functionality

Page 117: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElPartitionLeft z(ElMatrix z A, ElMatrix z AL, ElMatrix z AR, ElInt widthAR)

ElError ElPartitionLeftDist i(ElDistMatrix i A, ElDistMatrix i AL, ElDistMatrix i AR,ElInt widthAR)

ElError ElPartitionLeftDist s(ElDistMatrix s A, ElDistMatrix s AL, ElDistMa-trix s AR, ElInt widthAR)

ElError ElPartitionLeftDist d(ElDistMatrix d A, ElDistMatrix d AL, ElDistMa-trix d AR, ElInt widthAR)

ElError ElPartitionLeftDist c(ElDistMatrix c A, ElDistMatrix c AL, ElDistMa-trix c AR, ElInt widthAR)

ElError ElPartitionLeftDist z(ElDistMatrix z A, ElDistMatrix z AL, ElDistMa-trix z AR, ElInt widthAR)

ElError ElLockedPartitionLeft i(ElConstMatrix i A, ElMatrix i AL, ElMatrix i AR,ElInt widthAR)

ElError ElLockedPartitionLeft s(ElConstMatrix s A, ElMatrix s AL, ElMatrix s AR,ElInt widthAR)

ElError ElLockedPartitionLeft d(ElConstMatrix d A, ElMatrix d AL, ElMatrix d AR,ElInt widthAR)

ElError ElLockedPartitionLeft c(ElConstMatrix c A, ElMatrix c AL, ElMatrix c AR,ElInt widthAR)

ElError ElLockedPartitionLeft z(ElConstMatrix z A, ElMatrix z AL, ElMatrix z AR,ElInt widthAR)

ElError ElLockedPartitionLeftDist i(ElConstDistMatrix i A, ElDistMatrix i AL, ElD-istMatrix i AR, ElInt widthAR)

ElError ElLockedPartitionLeftDist s(ElConstDistMatrix s A, ElDistMatrix s AL, ElD-istMatrix s AR, ElInt widthAR)

ElError ElLockedPartitionLeftDist d(ElConstDistMatrix d A, ElDistMatrix d AL, El-DistMatrix d AR, ElInt widthAR)

ElError ElLockedPartitionLeftDist c(ElConstDistMatrix c A, ElDistMatrix c AL, ElD-istMatrix c AR, ElInt widthAR)

ElError ElLockedPartitionLeftDist z(ElConstDistMatrix z A, ElDistMatrix z AL, El-DistMatrix z AR, ElInt widthAR)

Down the main diagonal

Given an m × n matrix A, configure ATL, ATR, ABL, and ABR to view the local data of Acorresponding to the partitioning

A =

(ATL ATRABL ABR

),

where the diagonal of ATL is of the specified length and lies on the main diagonal (aka, the leftdiagonal) of A.

3.14. FLAME-like partition tracking 113

Page 118: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void PartitionDownDiagonal(Matrix<T> &A, Matrix<T> &ATL, Matrix<T> &ATR,Matrix<T> &ABL, Matrix<T> &ABR, Int diagDist =Blocksize())

void LockedPartitionDownDiagonal(const Matrix<T> &A, Matrix<T> &ATL, Ma-trix<T> &ATR, Matrix<T> &ABL, Matrix<T>&ABR, Int diagDist = Blocksize())

void PartitionDownDiagonal(AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&ATL, AbstractDistMatrix<T> &ATR, AbstractDist-Matrix<T> &ABL, AbstractDistMatrix<T> &ATL, IntdiagDist = Blocksize())

void LockedPartitionDownDiagonal(const AbstractDistMatrix<T> &A, AbstractDist-Matrix<T> &ATL, AbstractDistMatrix<T> &ATR,AbstractDistMatrix<T> &ABL, AbstractDistMa-trix<T> &ABR, Int diagDist = Blocksize())

C API

ElError ElPartitionDownDiagonal i(ElMatrix i A, ElMatrix i ATL, ElMatrix i ATR, El-Matrix i ABL, ElMatrix i ABR, ElInt diagDist)

ElError ElPartitionDownDiagonal s(ElMatrix s A, ElMatrix s ATL, ElMatrix s ATR, El-Matrix s ABL, ElMatrix s ABR, ElInt diagDist)

ElError ElPartitionDownDiagonal d(ElMatrix d A, ElMatrix d ATL, ElMatrix d ATR,ElMatrix d ABL, ElMatrix d ABR, ElInt diagDist)

ElError ElPartitionDownDiagonal c(ElMatrix c A, ElMatrix c ATL, ElMatrix c ATR, El-Matrix c ABL, ElMatrix c ABR, ElInt diagDist)

ElError ElPartitionDownDiagonal z(ElMatrix z A, ElMatrix z ATL, ElMatrix z ATR, El-Matrix z ABL, ElMatrix z ABR, ElInt diagDist)

ElError ElPartitionDownDiagonalDist i(ElDistMatrix i A, ElDistMatrix i ATL, ElDist-Matrix i ATR, ElDistMatrix i ABL, ElDistMa-trix i ABR, ElInt diagDist)

ElError ElPartitionDownDiagonalDist s(ElDistMatrix s A, ElDistMatrix s ATL, ElDist-Matrix s ATR, ElDistMatrix s ABL, ElDistMa-trix s ABR, ElInt diagDist)

ElError ElPartitionDownDiagonalDist d(ElDistMatrix d A, ElDistMatrix d ATL, ElD-istMatrix d ATR, ElDistMatrix d ABL, ElDist-Matrix d ABR, ElInt diagDist)

ElError ElPartitionDownDiagonalDist c(ElDistMatrix c A, ElDistMatrix c ATL, ElDist-Matrix c ATR, ElDistMatrix c ABL, ElDistMa-trix c ABR, ElInt diagDist)

ElError ElPartitionDownDiagonalDist z(ElDistMatrix z A, ElDistMatrix z ATL, ElD-istMatrix z ATR, ElDistMatrix z ABL, ElDist-Matrix z ABR, ElInt diagDist)

114 Chapter 3. Core functionality

Page 119: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedPartitionDownDiagonal i(ElConstMatrix i A, ElMatrix i ATL, ElMa-trix i ATR, ElMatrix i ABL, ElMatrix i ABR,ElInt diagDist)

ElError ElLockedPartitionDownDiagonal s(ElConstMatrix s A, ElMatrix s ATL, El-Matrix s ATR, ElMatrix s ABL, ElMa-trix s ABR, ElInt diagDist)

ElError ElLockedPartitionDownDiagonal d(ElConstMatrix d A, ElMatrix d ATL, El-Matrix d ATR, ElMatrix d ABL, ElMa-trix d ABR, ElInt diagDist)

ElError ElLockedPartitionDownDiagonal c(ElConstMatrix c A, ElMatrix c ATL, El-Matrix c ATR, ElMatrix c ABL, ElMa-trix c ABR, ElInt diagDist)

ElError ElLockedPartitionDownDiagonal z(ElConstMatrix z A, ElMatrix z ATL, El-Matrix z ATR, ElMatrix z ABL, ElMa-trix z ABR, ElInt diagDist)

ElError ElLockedPartitionDownDiagonalDist i(ElConstDistMatrix i A, ElDistCon-stMatrix i ATL, ElDistConstMa-trix i ATR, ElDistConstMatrix i ABL,ElDistConstMatrix i ABR, ElInt di-agDist)

ElError ElLockedPartitionDownDiagonalDist s(ElConstDistMatrix s A, ElDistCon-stMatrix s ATL, ElDistConstMa-trix s ATR, ElDistConstMatrix s ABL,ElDistConstMatrix s ABR, ElInt di-agDist)

ElError ElLockedPartitionDownDiagonalDist d(ElConstDistMatrix d A, ElDistCon-stMatrix d ATL, ElDistConstMa-trix d ATR, ElDistConstMatrix d ABL,ElDistConstMatrix d ABR, ElInt di-agDist)

ElError ElLockedPartitionDownDiagonalDist c(ElConstDistMatrix c A, ElDistCon-stMatrix c ATL, ElDistConstMa-trix c ATR, ElDistConstMatrix c ABL,ElDistConstMatrix c ABR, ElInt di-agDist)

ElError ElLockedPartitionDownDiagonalDist z(ElConstDistMatrix z A, ElDistCon-stMatrix z ATL, ElDistConstMa-trix z ATR, ElDistConstMatrix z ABL,ElDistConstMatrix z ABR, ElInt di-agDist)

3.14. FLAME-like partition tracking 115

Page 120: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Down an offset diagonal

Given an m × n matrix A, configure ATL, ATR, ABL, and ABR to view the local data of Acorresponding to the partitioning

A =

(ATL ATRABL ABR

),

where the diagonal of ABR lies on the offset diagonal of A, where the main diagonal corre-sponds to an offset of 0, the subdiagonal is an offset of −1, the superdiagonal is an offset of 1,etc. The length of the diagonal of ATL is specified as diagDist.

C++ API

void PartitionDownOffsetDiagonal(Int offset, Matrix<T> &A, Matrix<T> &ATL, Ma-trix<T> &ATR, Matrix<T> &ABL, Matrix<T>&ABR, Int diagDist = Blocksize())

void LockedPartitionDownOffsetDiagonal(Int offset, const Matrix<T> &A, Ma-trix<T> &ATL, Matrix<T> &ATR, Ma-trix<T> &ABL, Matrix<T> &ABR, Int di-agDist = Blocksize())

void PartitionDownOffsetDiagonal(Int offset, AbstractDistMatrix<T> &A, Abstract-DistMatrix<T> &ATL, AbstractDistMatrix<T>&ATR, AbstractDistMatrix<T> &ABL, Abstract-DistMatrix<T> &ATL, Int diagDist = Blocksize())

void LockedPartitionDownOffsetDiagonal(Int offset, const AbstractDistMatrix<T>&A, AbstractDistMatrix<T> &ATL, Ab-stractDistMatrix<T> &ATR, AbstractDist-Matrix<T> &ABL, AbstractDistMatrix<T>&ABR, Int diagDist = Blocksize())

C API

ElError ElPartitionDownOffsetDiagonal i(ElInt offset, ElMatrix i A, ElMatrix i ATL,ElMatrix i ATR, ElMatrix i ABL, ElMa-trix i ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonal s(ElInt offset, ElMatrix s A, ElMatrix s ATL,ElMatrix s ATR, ElMatrix s ABL, ElMa-trix s ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonal d(ElInt offset, ElMatrix d A, ElMatrix d ATL,ElMatrix d ATR, ElMatrix d ABL, ElMa-trix d ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonal c(ElInt offset, ElMatrix c A, ElMatrix c ATL,ElMatrix c ATR, ElMatrix c ABL, ElMa-trix c ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonal z(ElInt offset, ElMatrix z A, ElMatrix z ATL,ElMatrix z ATR, ElMatrix z ABL, ElMa-trix z ABR, ElInt diagDist)

116 Chapter 3. Core functionality

Page 121: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElPartitionDownOffsetDiagonalDist i(ElInt offset, ElDistMatrix i A, ElDist-Matrix i ATL, ElDistMatrix i ATR, El-DistMatrix i ABL, ElDistMatrix i ABR,ElInt diagDist)

ElError ElPartitionDownOffsetDiagonalDist s(ElInt offset, ElDistMatrix s A, ElDist-Matrix s ATL, ElDistMatrix s ATR,ElDistMatrix s ABL, ElDistMa-trix s ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonalDist d(ElInt offset, ElDistMatrix d A, ElDist-Matrix d ATL, ElDistMatrix d ATR,ElDistMatrix d ABL, ElDistMa-trix d ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonalDist c(ElInt offset, ElDistMatrix c A, ElDist-Matrix c ATL, ElDistMatrix c ATR,ElDistMatrix c ABL, ElDistMa-trix c ABR, ElInt diagDist)

ElError ElPartitionDownOffsetDiagonalDist z(ElInt offset, ElDistMatrix z A, ElDist-Matrix z ATL, ElDistMatrix z ATR,ElDistMatrix z ABL, ElDistMa-trix z ABR, ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonal i(ElInt offset, ElConstMatrix i A,ElMatrix i ATL, ElMatrix i ATR,ElMatrix i ABL, ElMatrix i ABR,ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonal s(ElInt offset, ElConstMatrix s A,ElMatrix s ATL, ElMatrix s ATR,ElMatrix s ABL, ElMatrix s ABR,ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonal d(ElInt offset, ElConstMatrix d A, El-Matrix d ATL, ElMatrix d ATR, El-Matrix d ABL, ElMatrix d ABR,ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonal c(ElInt offset, ElConstMatrix c A,ElMatrix c ATL, ElMatrix c ATR,ElMatrix c ABL, ElMatrix c ABR,ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonal z(ElInt offset, ElConstMatrix z A,ElMatrix z ATL, ElMatrix z ATR,ElMatrix z ABL, ElMatrix z ABR,ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonalDist i(ElInt offset, ElConstDistMa-trix i A, ElDistMatrix i ATL,ElDistMatrix i ATR, ElDistMa-trix i ABL, ElDistMatrix i ABR,ElInt diagDist)

3.14. FLAME-like partition tracking 117

Page 122: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedPartitionDownOffsetDiagonalDist s(ElInt offset, ElConstDistMa-trix s A, ElDistMatrix s ATL,ElDistMatrix s ATR, ElD-istMatrix s ABL, ElDistMa-trix s ABR, ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonalDist d(ElInt offset, ElConstDistMa-trix d A, ElDistMatrix d ATL,ElDistMatrix d ATR, ElD-istMatrix d ABL, ElDistMa-trix d ABR, ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonalDist c(ElInt offset, ElConstDistMa-trix c A, ElDistMatrix c ATL,ElDistMatrix c ATR, ElD-istMatrix c ABL, ElDistMa-trix c ABR, ElInt diagDist)

ElError ElLockedPartitionDownOffsetDiagonalDist z(ElInt offset, ElConstDistMa-trix z A, ElDistMatrix z ATL,ElDistMatrix z ATR, ElD-istMatrix z ABL, ElDistMa-trix z ABR, ElInt diagDist)

Up the main diagonal

Given an m × n matrix A, configure ATL, ATR, ABL, and ABR to view the local data of Acorresponding to the partitioning

A =

(ATL ATRABL ABR

),

where the diagonal of ABR lies on the main diagonal (aka, the left diagonal) of A and is of thespecified height/width.

C++ API

void PartitionUpDiagonal(Matrix<T> &A, Matrix<T> &ATL, Matrix<T> &ATR, Ma-trix<T> &ABL, Matrix<T> &ABR, Int diagDist = Block-size())

void LockedPartitionUpDiagonal(const Matrix<T> &A, Matrix<T> &ATL, Ma-trix<T> &ATR, Matrix<T> &ABL, Matrix<T>&ABR, Int diagDist = Blocksize())

void PartitionUpDiagonal(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &ATL,AbstractDistMatrix<T> &ATR, AbstractDistMatrix<T>&ABL, AbstractDistMatrix<T> &ABR, Int diagDist =Blocksize())

void LockedPartitionUpDiagonal(const AbstractDistMatrix<T> &A, AbstractDistMa-trix<T> &ATL, AbstractDistMatrix<T> &ATR, Ab-stractDistMatrix<T> &ABL, AbstractDistMatrix<T>&ABR, Int diagDist = Blocksize())

118 Chapter 3. Core functionality

Page 123: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElPartitionUpDiagonal i(ElMatrix i A, ElMatrix i ATL, ElMatrix i ATR, ElMa-trix i ABL, ElMatrix i ABR, ElInt diagDist)

ElError ElPartitionUpDiagonal s(ElMatrix s A, ElMatrix s ATL, ElMatrix s ATR, ElMa-trix s ABL, ElMatrix s ABR, ElInt diagDist)

ElError ElPartitionUpDiagonal d(ElMatrix d A, ElMatrix d ATL, ElMatrix d ATR, El-Matrix d ABL, ElMatrix d ABR, ElInt diagDist)

ElError ElPartitionUpDiagonal c(ElMatrix c A, ElMatrix c ATL, ElMatrix c ATR, El-Matrix c ABL, ElMatrix c ABR, ElInt diagDist)

ElError ElPartitionUpDiagonal z(ElMatrix z A, ElMatrix z ATL, ElMatrix z ATR, El-Matrix z ABL, ElMatrix z ABR, ElInt diagDist)

ElError ElPartitionUpDiagonalDist i(ElDistMatrix i A, ElDistMatrix i ATL, ElDist-Matrix i ATR, ElDistMatrix i ABL, ElDistMa-trix i ABR, ElInt diagDist)

ElError ElPartitionUpDiagonalDist s(ElDistMatrix s A, ElDistMatrix s ATL, ElDist-Matrix s ATR, ElDistMatrix s ABL, ElDistMa-trix s ABR, ElInt diagDist)

ElError ElPartitionUpDiagonalDist d(ElDistMatrix d A, ElDistMatrix d ATL, ElDist-Matrix d ATR, ElDistMatrix d ABL, ElDistMa-trix d ABR, ElInt diagDist)

ElError ElPartitionUpDiagonalDist c(ElDistMatrix c A, ElDistMatrix c ATL, ElDist-Matrix c ATR, ElDistMatrix c ABL, ElDistMa-trix c ABR, ElInt diagDist)

ElError ElPartitionUpDiagonalDist z(ElDistMatrix z A, ElDistMatrix z ATL, ElDist-Matrix z ATR, ElDistMatrix z ABL, ElDistMa-trix z ABR, ElInt diagDist)

ElError ElLockedPartitionUpDiagonal i(ElConstMatrix i A, ElMatrix i ATL, ElMa-trix i ATR, ElMatrix i ABL, ElMatrix i ABR,ElInt diagDist)

ElError ElLockedPartitionUpDiagonal s(ElConstMatrix s A, ElMatrix s ATL, ElMa-trix s ATR, ElMatrix s ABL, ElMatrix s ABR,ElInt diagDist)

ElError ElLockedPartitionUpDiagonal d(ElConstMatrix d A, ElMatrix d ATL, ElMa-trix d ATR, ElMatrix d ABL, ElMatrix d ABR,ElInt diagDist)

ElError ElLockedPartitionUpDiagonal c(ElConstMatrix c A, ElMatrix c ATL, ElMa-trix c ATR, ElMatrix c ABL, ElMatrix c ABR,ElInt diagDist)

ElError ElLockedPartitionUpDiagonal z(ElConstMatrix z A, ElMatrix z ATL, ElMa-trix z ATR, ElMatrix z ABL, ElMatrix z ABR,ElInt diagDist)

3.14. FLAME-like partition tracking 119

Page 124: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedPartitionUpDiagonalDist i(ElConstDistMatrix i A, ElDistConstMa-trix i ATL, ElDistConstMatrix i ATR, El-DistConstMatrix i ABL, ElDistConstMa-trix i ABR, ElInt diagDist)

ElError ElLockedPartitionUpDiagonalDist s(ElConstDistMatrix s A, ElDistConstMa-trix s ATL, ElDistConstMatrix s ATR, El-DistConstMatrix s ABL, ElDistConstMa-trix s ABR, ElInt diagDist)

ElError ElLockedPartitionUpDiagonalDist d(ElConstDistMatrix d A, ElDistConstMa-trix d ATL, ElDistConstMatrix d ATR,ElDistConstMatrix d ABL, ElDistConst-Matrix d ABR, ElInt diagDist)

ElError ElLockedPartitionUpDiagonalDist c(ElConstDistMatrix c A, ElDistConstMa-trix c ATL, ElDistConstMatrix c ATR, El-DistConstMatrix c ABL, ElDistConstMa-trix c ABR, ElInt diagDist)

ElError ElLockedPartitionUpDiagonalDist z(ElConstDistMatrix z A, ElDistConstMa-trix z ATL, ElDistConstMatrix z ATR,ElDistConstMatrix z ABL, ElDistConst-Matrix z ABR, ElInt diagDist)

Up an offset diagonal

Given an m × n matrix A, configure ATL, ATR, ABL, and ABR to view the local data of Acorresponding to the partitioning

A =

(ATL ATRABL ABR

),

where the diagonal of ABR lies on the offset diagonal of A, where the main diagonal corre-sponds to an offset of 0, the subdiagonal is an offset of −1, the superdiagonal is an offset of 1,etc. The length of the diagonal of ABR is specified as diagDist.

C++ API

void PartitionUpOffsetDiagonal(Int offset, Matrix<T> &A, Matrix<T> &ATL, Ma-trix<T> &ATR, Matrix<T> &ABL, Matrix<T>&ABR, Int diagDist = Blocksize())

void LockedPartitionUpOffsetDiagonal(Int offset, const Matrix<T> &A, Matrix<T>&ATL, Matrix<T> &ATR, Matrix<T> &ABL,Matrix<T> &ABR, Int diagDist = Blocksize())

void PartitionUpOffsetDiagonal(Int offset, AbstractDistMatrix<T> &A, AbstractDist-Matrix<T> &ATL, AbstractDistMatrix<T> &ATR,AbstractDistMatrix<T> &ABL, AbstractDistMa-trix<T> &ABR, Int diagDist = Blocksize())

120 Chapter 3. Core functionality

Page 125: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void LockedPartitionUpOffsetDiagonal(Int offset, const AbstractDistMatrix<T> &A,AbstractDistMatrix<T> &ATL, AbstractDist-Matrix<T> &ATR, AbstractDistMatrix<T>&ABL, AbstractDistMatrix<T> &ABR, Int di-agDist = Blocksize())

C API

ElError ElPartitionUpOffsetDiagonal i(ElInt offset, ElMatrix i A, ElMatrix i ATL,ElMatrix i ATR, ElMatrix i ABL, ElMa-trix i ABR, ElInt diagDist)

ElError ElPartitionUpOffsetDiagonal s(ElInt offset, ElMatrix s A, ElMatrix s ATL,ElMatrix s ATR, ElMatrix s ABL, ElMa-trix s ABR, ElInt diagDist)

ElError ElPartitionUpOffsetDiagonal d(ElInt offset, ElMatrix d A, ElMatrix d ATL,ElMatrix d ATR, ElMatrix d ABL, ElMa-trix d ABR, ElInt diagDist)

ElError ElPartitionUpOffsetDiagonal c(ElInt offset, ElMatrix c A, ElMatrix c ATL,ElMatrix c ATR, ElMatrix c ABL, ElMa-trix c ABR, ElInt diagDist)

ElError ElPartitionUpOffsetDiagonal z(ElInt offset, ElMatrix z A, ElMatrix z ATL,ElMatrix z ATR, ElMatrix z ABL, ElMa-trix z ABR, ElInt diagDist)

ElError ElPartitionUpOffsetDiagonalDist i(ElInt offset, ElDistMatrix i A, ElDist-Matrix i ATL, ElDistMatrix i ATR, El-DistMatrix i ABL, ElDistMatrix i ABR,ElInt diagDist)

ElError ElPartitionUpOffsetDiagonalDist s(ElInt offset, ElDistMatrix s A, ElDist-Matrix s ATL, ElDistMatrix s ATR, El-DistMatrix s ABL, ElDistMatrix s ABR,ElInt diagDist)

ElError ElPartitionUpOffsetDiagonalDist d(ElInt offset, ElDistMatrix d A, ElDistMa-trix d ATL, ElDistMatrix d ATR, ElD-istMatrix d ABL, ElDistMatrix d ABR,ElInt diagDist)

ElError ElPartitionUpOffsetDiagonalDist c(ElInt offset, ElDistMatrix c A, ElDist-Matrix c ATL, ElDistMatrix c ATR, El-DistMatrix c ABL, ElDistMatrix c ABR,ElInt diagDist)

ElError ElPartitionUpOffsetDiagonalDist z(ElInt offset, ElDistMatrix z A, ElDist-Matrix z ATL, ElDistMatrix z ATR, El-DistMatrix z ABL, ElDistMatrix z ABR,ElInt diagDist)

ElError ElLockedPartitionUpOffsetDiagonal i(ElInt offset, ElConstMatrix i A, El-Matrix i ATL, ElMatrix i ATR, ElMa-trix i ABL, ElMatrix i ABR, ElInt di-agDist)

3.14. FLAME-like partition tracking 121

Page 126: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedPartitionUpOffsetDiagonal s(ElInt offset, ElConstMatrix s A, El-Matrix s ATL, ElMatrix s ATR, ElMa-trix s ABL, ElMatrix s ABR, ElInt di-agDist)

ElError ElLockedPartitionUpOffsetDiagonal d(ElInt offset, ElConstMatrix d A, ElMa-trix d ATL, ElMatrix d ATR, ElMa-trix d ABL, ElMatrix d ABR, ElInt di-agDist)

ElError ElLockedPartitionUpOffsetDiagonal c(ElInt offset, ElConstMatrix c A, El-Matrix c ATL, ElMatrix c ATR, ElMa-trix c ABL, ElMatrix c ABR, ElInt di-agDist)

ElError ElLockedPartitionUpOffsetDiagonal z(ElInt offset, ElConstMatrix z A, El-Matrix z ATL, ElMatrix z ATR, ElMa-trix z ABL, ElMatrix z ABR, ElInt di-agDist)

ElError ElLockedPartitionUpOffsetDiagonalDist i(ElInt offset, ElConstDistMa-trix i A, ElDistMatrix i ATL,ElDistMatrix i ATR, ElDistMa-trix i ABL, ElDistMatrix i ABR,ElInt diagDist)

ElError ElLockedPartitionUpOffsetDiagonalDist s(ElInt offset, ElConstDistMa-trix s A, ElDistMatrix s ATL,ElDistMatrix s ATR, ElDistMa-trix s ABL, ElDistMatrix s ABR,ElInt diagDist)

ElError ElLockedPartitionUpOffsetDiagonalDist d(ElInt offset, ElConstDistMa-trix d A, ElDistMatrix d ATL,ElDistMatrix d ATR, ElDistMa-trix d ABL, ElDistMatrix d ABR,ElInt diagDist)

ElError ElLockedPartitionUpOffsetDiagonalDist c(ElInt offset, ElConstDistMa-trix c A, ElDistMatrix c ATL,ElDistMatrix c ATR, ElDistMa-trix c ABL, ElDistMatrix c ABR,ElInt diagDist)

ElError ElLockedPartitionUpOffsetDiagonalDist z(ElInt offset, ElConstDistMa-trix z A, ElDistMatrix z ATL,ElDistMatrix z ATR, ElDistMa-trix z ABL, ElDistMatrix z ABR,ElInt diagDist)

122 Chapter 3. Core functionality

Page 127: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3.14.2 Repartitioning

Downward

Given the partition

A =

(ATAB

),

and a blocksize, nb, turn the two-way partition into the three-way partition

(ATAB

)=

A0

A1A2

,

where A1 is of height nb and A0 = AT.

C++ API

void RepartitionDown(Matrix<T> &AT, Matrix<T> &A0, Matrix<T> &A1, Matrix<T>&AB, Matrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionDown(const Matrix<T> &AT, Matrix<T> &A0, Matrix<T>&A1, const Matrix<T> &AB, Matrix<T> &A2, Int bsize= Blocksize())

void RepartitionDown(AbstractDistMatrix<T> &AT, AbstractDistMatrix<T> &A0, Ab-stractDistMatrix<T> &A1, AbstractDistMatrix<T> &AB, Ab-stractDistMatrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionDown(const AbstractDistMatrix<T> &AT, AbstractDistMa-trix<T> &A0, AbstractDistMatrix<T> &A1, constAbstractDistMatrix<T> &AB, AbstractDistMatrix<T>&A2, Int bsize = Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionDown( AT, A0,

/**/ /**/

A1,

AB, A2, blocksize );

C API

ElError ElRepartitionDown i(ElMatrix i AT, ElMatrix i A0, ElMatrix i A1, ElMa-trix i AB, ElMatrix i A2, ElInt bsize)

ElError ElRepartitionDown s(ElMatrix s AT, ElMatrix s A0, ElMatrix s A1, ElMa-trix s AB, ElMatrix s A2, ElInt bsize)

ElError ElRepartitionDown d(ElMatrix d AT, ElMatrix d A0, ElMatrix d A1, ElMa-trix d AB, ElMatrix d A2, ElInt bsize)

ElError ElRepartitionDown c(ElMatrix c AT, ElMatrix c A0, ElMatrix c A1, ElMa-trix c AB, ElMatrix c A2, ElInt bsize)

3.14. FLAME-like partition tracking 123

Page 128: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionDown z(ElMatrix z AT, ElMatrix z A0, ElMatrix z A1, ElMa-trix z AB, ElMatrix z A2, ElInt bsize)

ElError ElRepartitionDownDist i(ElDistMatrix i AT, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i AB, ElDistMatrix i A2,ElInt bsize)

ElError ElRepartitionDownDist s(ElDistMatrix s AT, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s AB, ElDistMatrix s A2,ElInt bsize)

ElError ElRepartitionDownDist d(ElDistMatrix d AT, ElDistMatrix d A0, ElDistMa-trix d A1, ElDistMatrix d AB, ElDistMatrix d A2,ElInt bsize)

ElError ElRepartitionDownDist c(ElDistMatrix c AT, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c AB, ElDistMatrix c A2,ElInt bsize)

ElError ElRepartitionDownDist z(ElDistMatrix z AT, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z AB, ElDistMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionDown i(ElConstMatrix i AT, ElMatrix i A0, ElMatrix i A1,ElConstMatrix i AB, ElMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionDown s(ElConstMatrix s AT, ElMatrix s A0, ElMatrix s A1,ElConstMatrix s AB, ElMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionDown d(ElConstMatrix d AT, ElMatrix d A0, ElMa-trix d A1, ElConstMatrix d AB, ElMatrix d A2,ElInt bsize)

ElError ElLockedRepartitionDown c(ElConstMatrix c AT, ElMatrix c A0, ElMa-trix c A1, ElConstMatrix c AB, ElMatrix c A2,ElInt bsize)

ElError ElLockedRepartitionDown z(ElConstMatrix z AT, ElMatrix z A0, ElMa-trix z A1, ElConstMatrix z AB, ElMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionDownDist i(ElConstDistMatrix i AT, ElDistMatrix i A0,ElDistMatrix i A1, ElConstDistMatrix i AB,ElDistMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionDownDist s(ElConstDistMatrix s AT, ElDistMatrix s A0,ElDistMatrix s A1, ElConstDistMatrix s AB,ElDistMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionDownDist d(ElConstDistMatrix d AT, ElDistMatrix d A0,ElDistMatrix d A1, ElConstDistMatrix d AB,ElDistMatrix d A2, ElInt bsize)

ElError ElLockedRepartitionDownDist c(ElConstDistMatrix c AT, ElDistMatrix c A0,ElDistMatrix c A1, ElConstDistMatrix c AB,ElDistMatrix c A2, ElInt bsize)

ElError ElLockedRepartitionDownDist z(ElConstDistMatrix z AT, ElDistMatrix z A0,ElDistMatrix z A1, ElConstDistMatrix z AB,ElDistMatrix z A2, ElInt bsize)

124 Chapter 3. Core functionality

Page 129: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Upward

Given the partition

A =

(ATAB

),

and a blocksize, nb, turn the two-way partition into the three-way partition

(ATAB

)=

A0A1A2

,

where A1 is of height nb and A2 = AB.

C++ API

void RepartitionUp(Matrix<T> &AT, Matrix<T> &A0, Matrix<T> &A1, Matrix<T>&AB, Matrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionUp(const Matrix<T> &AT, Matrix<T> &A0, Matrix<T> &A1,const Matrix<T> &AB, Matrix<T> &A2, Int bsize = Block-size())

void RepartitionUp(AbstractDistMatrix<T> &AT, AbstractDistMatrix<T> &A0, Ab-stractDistMatrix<T> &A1, AbstractDistMatrix<T> &AB, Abstract-DistMatrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionUp(const AbstractDistMatrix<T> &AT, AbstractDistMatrix<T>&A0, AbstractDistMatrix<T> &A1, const AbstractDistMa-trix<T> &AB, AbstractDistMatrix<T> &A2, Int bsize =Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionUp( AT, A0,

A1,

/**/ /**/

AB, A2, blocksize );

C API

ElError ElRepartitionUp i(ElMatrix i AT, ElMatrix i A0, ElMatrix i A1, ElMatrix i AB,ElMatrix i A2, ElInt bsize)

ElError ElRepartitionUp s(ElMatrix s AT, ElMatrix s A0, ElMatrix s A1, ElMatrix s AB,ElMatrix s A2, ElInt bsize)

ElError ElRepartitionUp d(ElMatrix d AT, ElMatrix d A0, ElMatrix d A1, ElMa-trix d AB, ElMatrix d A2, ElInt bsize)

ElError ElRepartitionUp c(ElMatrix c AT, ElMatrix c A0, ElMatrix c A1, ElMatrix c AB,ElMatrix c A2, ElInt bsize)

ElError ElRepartitionUp z(ElMatrix z AT, ElMatrix z A0, ElMatrix z A1, ElMa-trix z AB, ElMatrix z A2, ElInt bsize)

3.14. FLAME-like partition tracking 125

Page 130: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionUpDist i(ElDistMatrix i AT, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i AB, ElDistMatrix i A2,ElInt bsize)

ElError ElRepartitionUpDist s(ElDistMatrix s AT, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s AB, ElDistMatrix s A2,ElInt bsize)

ElError ElRepartitionUpDist d(ElDistMatrix d AT, ElDistMatrix d A0, ElDistMa-trix d A1, ElDistMatrix d AB, ElDistMatrix d A2,ElInt bsize)

ElError ElRepartitionUpDist c(ElDistMatrix c AT, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c AB, ElDistMatrix c A2,ElInt bsize)

ElError ElRepartitionUpDist z(ElDistMatrix z AT, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z AB, ElDistMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionUp i(ElConstMatrix i AT, ElMatrix i A0, ElMatrix i A1, El-ConstMatrix i AB, ElMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionUp s(ElConstMatrix s AT, ElMatrix s A0, ElMatrix s A1,ElConstMatrix s AB, ElMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionUp d(ElConstMatrix d AT, ElMatrix d A0, ElMatrix d A1,ElConstMatrix d AB, ElMatrix d A2, ElInt bsize)

ElError ElLockedRepartitionUp c(ElConstMatrix c AT, ElMatrix c A0, ElMatrix c A1,ElConstMatrix c AB, ElMatrix c A2, ElInt bsize)

ElError ElLockedRepartitionUp z(ElConstMatrix z AT, ElMatrix z A0, ElMatrix z A1,ElConstMatrix z AB, ElMatrix z A2, ElInt bsize)

ElError ElLockedRepartitionUpDist i(ElConstDistMatrix i AT, ElDistMatrix i A0, El-DistMatrix i A1, ElConstDistMatrix i AB, ElD-istMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionUpDist s(ElConstDistMatrix s AT, ElDistMatrix s A0, El-DistMatrix s A1, ElConstDistMatrix s AB, ElD-istMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionUpDist d(ElConstDistMatrix d AT, ElDistMatrix d A0, El-DistMatrix d A1, ElConstDistMatrix d AB, ElD-istMatrix d A2, ElInt bsize)

ElError ElLockedRepartitionUpDist c(ElConstDistMatrix c AT, ElDistMatrix c A0, El-DistMatrix c A1, ElConstDistMatrix c AB, ElD-istMatrix c A2, ElInt bsize)

ElError ElLockedRepartitionUpDist z(ElConstDistMatrix z AT, ElDistMatrix z A0, El-DistMatrix z A1, ElConstDistMatrix z AB, ElD-istMatrix z A2, ElInt bsize)

Rightward

Given the partition

A =(

AL AR)

,

126 Chapter 3. Core functionality

Page 131: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

and a blocksize, nb, turn the two-way partition into the three-way partition(AL AR

)=(

A0 A1 A2)

,

where A1 is of width nb and A0 = AL.

C++ API

void RepartitionRight(Matrix<T> &AL, Matrix<T> &AR, Matrix<T> &A0, Ma-trix<T> &A1, Matrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionRight(const Matrix<T> &AL, const Matrix<T> &AR, Ma-trix<T> &A0, Matrix<T> &A1, Matrix<T> &A2, Intbsize = Blocksize())

void RepartitionRight(AbstractDistMatrix<T> &AL, AbstractDistMatrix<T> &AR, Ab-stractDistMatrix<T> &A0, AbstractDistMatrix<T> &A1, Ab-stractDistMatrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionRight(const AbstractDistMatrix<T> &AL, const AbstractDist-Matrix<T> &AR, AbstractDistMatrix<T> &A0, Ab-stractDistMatrix<T> &A1, AbstractDistMatrix<T> &A2,Int bsize = Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionRight( AL, /**/ AR,

A0, /**/ A1, A2, blocksize );

C API

ElError ElRepartitionRight i(ElMatrix i AL, ElMatrix i AR, ElMatrix i A0, ElMa-trix i A1, ElMatrix i A2, ElInt bsize)

ElError ElRepartitionRight s(ElMatrix s AL, ElMatrix s AR, ElMatrix s A0, ElMa-trix s A1, ElMatrix s A2, ElInt bsize)

ElError ElRepartitionRight d(ElMatrix d AL, ElMatrix d AR, ElMatrix d A0, ElMa-trix d A1, ElMatrix d A2, ElInt bsize)

ElError ElRepartitionRight c(ElMatrix c AL, ElMatrix c AR, ElMatrix c A0, ElMa-trix c A1, ElMatrix c A2, ElInt bsize)

ElError ElRepartitionRight z(ElMatrix z AL, ElMatrix z AR, ElMatrix z A0, ElMa-trix z A1, ElMatrix z A2, ElInt bsize)

ElError ElRepartitionRightDist i(ElDistMatrix i AL, ElDistMatrix i AR, ElDistMa-trix i A0, ElDistMatrix i A1, ElDistMatrix i A2,ElInt bsize)

ElError ElRepartitionRightDist s(ElDistMatrix s AL, ElDistMatrix s AR, ElDistMa-trix s A0, ElDistMatrix s A1, ElDistMatrix s A2,ElInt bsize)

ElError ElRepartitionRightDist d(ElDistMatrix d AL, ElDistMatrix d AR, ElDistMa-trix d A0, ElDistMatrix d A1, ElDistMatrix d A2,ElInt bsize)

3.14. FLAME-like partition tracking 127

Page 132: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionRightDist c(ElDistMatrix c AL, ElDistMatrix c AR, ElDistMa-trix c A0, ElDistMatrix c A1, ElDistMatrix c A2,ElInt bsize)

ElError ElRepartitionRightDist z(ElDistMatrix z AL, ElDistMatrix z AR, ElDistMa-trix z A0, ElDistMatrix z A1, ElDistMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionRight i(ElConstMatrix i AL, ElConstMatrix i AR, El-Matrix i A0, ElMatrix i A1, ElMatrix i A2,ElInt bsize)

ElError ElLockedRepartitionRight s(ElConstMatrix s AL, ElConstMatrix s AR, El-Matrix s A0, ElMatrix s A1, ElMatrix s A2,ElInt bsize)

ElError ElLockedRepartitionRight d(ElConstMatrix d AL, ElConstMatrix d AR, El-Matrix d A0, ElMatrix d A1, ElMatrix d A2,ElInt bsize)

ElError ElLockedRepartitionRight c(ElConstMatrix c AL, ElConstMatrix c AR, El-Matrix c A0, ElMatrix c A1, ElMatrix c A2,ElInt bsize)

ElError ElLockedRepartitionRight z(ElConstMatrix z AL, ElConstMatrix z AR, El-Matrix z A0, ElMatrix z A1, ElMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionRightDist i(ElConstDistMatrix i AL, ElConstDistMa-trix i AR, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionRightDist s(ElConstDistMatrix s AL, ElConstDistMa-trix s AR, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionRightDist d(ElConstDistMatrix d AL, ElConstDistMa-trix d AR, ElDistMatrix d A0, ElDistMa-trix d A1, ElDistMatrix d A2, ElInt bsize)

ElError ElLockedRepartitionRightDist c(ElConstDistMatrix c AL, ElConstDistMa-trix c AR, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c A2, ElInt bsize)

ElError ElLockedRepartitionRightDist z(ElConstDistMatrix z AL, ElConstDistMa-trix z AR, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z A2, ElInt bsize)

Leftward

Given the partition

A =(

AL AR)

,

and a blocksize, nb, turn the two-way partition into the three-way partition(AL AR

)=(

A0 A1 A2)

,

where A1 is of width nb and A2 = AR.

128 Chapter 3. Core functionality

Page 133: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void RepartitionLeft(Matrix<T> &AL, Matrix<T> &AR, Matrix<T> &A0, Ma-trix<T> &A1, Matrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionLeft(const Matrix<T> &AL, const Matrix<T> &AR, Ma-trix<T> &A0, Matrix<T> &A1, Matrix<T> &A2, Intbsize = Blocksize())

void RepartitionLeft(AbstractDistMatrix<T> &AL, AbstractDistMatrix<T> &AR, Ab-stractDistMatrix<T> &A0, AbstractDistMatrix<T> &A1, Ab-stractDistMatrix<T> &A2, Int bsize = Blocksize())

void LockedRepartitionLeft(const AbstractDistMatrix<T> &AL, const AbstractDist-Matrix<T> &AR, AbstractDistMatrix<T> &A0, Abstract-DistMatrix<T> &A1, AbstractDistMatrix<T> &A2, Intbsize = Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionLeft( AL, /**/ AR,

A0, A1, /**/ A2, blocksize );

C API

ElError ElRepartitionLeft i(ElMatrix i AL, ElMatrix i AR, ElMatrix i A0, ElMa-trix i A1, ElMatrix i A2, ElInt bsize)

ElError ElRepartitionLeft s(ElMatrix s AL, ElMatrix s AR, ElMatrix s A0, ElMa-trix s A1, ElMatrix s A2, ElInt bsize)

ElError ElRepartitionLeft d(ElMatrix d AL, ElMatrix d AR, ElMatrix d A0, ElMa-trix d A1, ElMatrix d A2, ElInt bsize)

ElError ElRepartitionLeft c(ElMatrix c AL, ElMatrix c AR, ElMatrix c A0, ElMa-trix c A1, ElMatrix c A2, ElInt bsize)

ElError ElRepartitionLeft z(ElMatrix z AL, ElMatrix z AR, ElMatrix z A0, ElMa-trix z A1, ElMatrix z A2, ElInt bsize)

ElError ElRepartitionLeftDist i(ElDistMatrix i AL, ElDistMatrix i AR, ElDistMa-trix i A0, ElDistMatrix i A1, ElDistMatrix i A2,ElInt bsize)

ElError ElRepartitionLeftDist s(ElDistMatrix s AL, ElDistMatrix s AR, ElDistMa-trix s A0, ElDistMatrix s A1, ElDistMatrix s A2,ElInt bsize)

ElError ElRepartitionLeftDist d(ElDistMatrix d AL, ElDistMatrix d AR, ElDistMa-trix d A0, ElDistMatrix d A1, ElDistMatrix d A2,ElInt bsize)

ElError ElRepartitionLeftDist c(ElDistMatrix c AL, ElDistMatrix c AR, ElDistMa-trix c A0, ElDistMatrix c A1, ElDistMatrix c A2,ElInt bsize)

ElError ElRepartitionLeftDist z(ElDistMatrix z AL, ElDistMatrix z AR, ElDistMa-trix z A0, ElDistMatrix z A1, ElDistMatrix z A2,ElInt bsize)

3.14. FLAME-like partition tracking 129

Page 134: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedRepartitionLeft i(ElConstMatrix i AL, ElConstMatrix i AR, ElMa-trix i A0, ElMatrix i A1, ElMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionLeft s(ElConstMatrix s AL, ElConstMatrix s AR, ElMa-trix s A0, ElMatrix s A1, ElMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionLeft d(ElConstMatrix d AL, ElConstMatrix d AR, El-Matrix d A0, ElMatrix d A1, ElMatrix d A2,ElInt bsize)

ElError ElLockedRepartitionLeft c(ElConstMatrix c AL, ElConstMatrix c AR, El-Matrix c A0, ElMatrix c A1, ElMatrix c A2,ElInt bsize)

ElError ElLockedRepartitionLeft z(ElConstMatrix z AL, ElConstMatrix z AR, El-Matrix z A0, ElMatrix z A1, ElMatrix z A2,ElInt bsize)

ElError ElLockedRepartitionLeftDist i(ElConstDistMatrix i AL, ElConstDistMa-trix i AR, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i A2, ElInt bsize)

ElError ElLockedRepartitionLeftDist s(ElConstDistMatrix s AL, ElConstDistMa-trix s AR, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s A2, ElInt bsize)

ElError ElLockedRepartitionLeftDist d(ElConstDistMatrix d AL, ElConstDistMa-trix d AR, ElDistMatrix d A0, ElDistMa-trix d A1, ElDistMatrix d A2, ElInt bsize)

ElError ElLockedRepartitionLeftDist c(ElConstDistMatrix c AL, ElConstDistMa-trix c AR, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c A2, ElInt bsize)

ElError ElLockedRepartitionLeftDist z(ElConstDistMatrix z AL, ElConstDistMa-trix z AR, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z A2, ElInt bsize)

Down a diagonal

Given the partition

A =

(ATL ATRABL ABR

),

turn the two-by-two partition into the three-by-three partition

(ATL ATRABL ABR

)=

A00 A01 A02

A10 A11 A12A20 A21 A22

,

where A11 is nb × nb and the corresponding quadrants are equivalent.

130 Chapter 3. Core functionality

Page 135: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void RepartitionDownDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, Matrix<T>&A00, Matrix<T> &A01, Matrix<T> &A02, Ma-trix<T> &A10, Matrix<T> &A11, Matrix<T> &A12,Matrix<T> &ABL, Matrix<T> &ABR, Matrix<T>&A20, Matrix<T> &A21, Matrix<T> &A22, Int bsize= Blocksize())

void LockedRepartitionDownDiagonal(const Matrix<T> &ATL, const Matrix<T>&ATR, Matrix<T> &A00, Matrix<T> &A01,Matrix<T> &A02, Matrix<T> &A10, Ma-trix<T> &A11, Matrix<T> &A12, const Ma-trix<T> &ABL, const Matrix<T> &ABR, Ma-trix<T> &A20, Matrix<T> &A21, Matrix<T>&A22, Int bsize = Blocksize())

void RepartitionDownDiagonal(AbstractDistMatrix<T> &ATL, AbstractDistMatrix<T>&ATR, AbstractDistMatrix<T> &A00, AbstractDistMa-trix<T> &A01, AbstractDistMatrix<T> &A02, Ab-stractDistMatrix<T> &A10, AbstractDistMatrix<T>&A11, AbstractDistMatrix<T> &A12, AbstractDistMa-trix<T> &ABL, AbstractDistMatrix<T> &ABR, Ab-stractDistMatrix<T> &A20, AbstractDistMatrix<T>&A21, AbstractDistMatrix<T> &A22, Int bsize = Block-size())

void LockedRepartitionDownDiagonal(const AbstractDistMatrix<T> &ATL, const Ab-stractDistMatrix<T> &ATR, AbstractDistMa-trix<T> &A00, AbstractDistMatrix<T> &A01,AbstractDistMatrix<T> &A02, AbstractDistMa-trix<T> &A10, AbstractDistMatrix<T> &A11,AbstractDistMatrix<T> &A12, const Abstract-DistMatrix<T> &ABL, const AbstractDistMa-trix<T> &ABR, AbstractDistMatrix<T> &A20,AbstractDistMatrix<T> &A21, AbstractDistMa-trix<T> &A22, Int bsize = Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionDownDiagonal( ATL, /**/ ATR, A00, /**/ A01, A02,

/*************/ /******************/

/**/ A10, /**/ A11, A12,

ABL, /**/ ABR, A20, /**/ A21, A22, blocksize );

C API

ElError ElRepartitionDownDiagonal i(ElMatrix i ATL, ElMatrix i ATR, ElMatrix i A00,ElMatrix i A01, ElMatrix i A02, ElMatrix i A10,ElMatrix i A11, ElMatrix i A12, ElMatrix i ABL,ElMatrix i ABR, ElMatrix i A20, ElMatrix i A21,ElMatrix i A22, ElInt bsize)

3.14. FLAME-like partition tracking 131

Page 136: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionDownDiagonal s(ElMatrix s ATL, ElMatrix s ATR, ElMa-trix s A00, ElMatrix s A01, ElMatrix s A02,ElMatrix s A10, ElMatrix s A11, ElMa-trix s A12, ElMatrix s ABL, ElMatrix s ABR,ElMatrix s A20, ElMatrix s A21, ElMatrix s A22,ElInt bsize)

ElError ElRepartitionDownDiagonal d(ElMatrix d ATL, ElMatrix d ATR, ElMa-trix d A00, ElMatrix d A01, ElMatrix d A02, El-Matrix d A10, ElMatrix d A11, ElMatrix d A12,ElMatrix d ABL, ElMatrix d ABR, ElMa-trix d A20, ElMatrix d A21, ElMatrix d A22,ElInt bsize)

ElError ElRepartitionDownDiagonal c(ElMatrix c ATL, ElMatrix c ATR, ElMa-trix c A00, ElMatrix c A01, ElMatrix c A02, El-Matrix c A10, ElMatrix c A11, ElMatrix c A12,ElMatrix c ABL, ElMatrix c ABR, ElMa-trix c A20, ElMatrix c A21, ElMatrix c A22,ElInt bsize)

ElError ElRepartitionDownDiagonal z(ElMatrix z ATL, ElMatrix z ATR, ElMa-trix z A00, ElMatrix z A01, ElMatrix z A02, El-Matrix z A10, ElMatrix z A11, ElMatrix z A12,ElMatrix z ABL, ElMatrix z ABR, ElMa-trix z A20, ElMatrix z A21, ElMatrix z A22,ElInt bsize)

ElError ElRepartitionDownDiagonalDist i(ElDistMatrix i ATL, ElDistMatrix i ATR,ElDistMatrix i A00, ElDistMatrix i A01, El-DistMatrix i A02, ElDistMatrix i A10, ElD-istMatrix i A11, ElDistMatrix i A12, ElD-istMatrix i ABL, ElDistMatrix i ABR, ElD-istMatrix i A20, ElDistMatrix i A21, ElDist-Matrix i A22, ElInt bsize)

ElError ElRepartitionDownDiagonalDist s(ElDistMatrix s ATL, ElDistMatrix s ATR,ElDistMatrix s A00, ElDistMatrix s A01,ElDistMatrix s A02, ElDistMatrix s A10,ElDistMatrix s A11, ElDistMatrix s A12,ElDistMatrix s ABL, ElDistMatrix s ABR,ElDistMatrix s A20, ElDistMatrix s A21,ElDistMatrix s A22, ElInt bsize)

ElError ElRepartitionDownDiagonalDist d(ElDistMatrix d ATL, ElDistMatrix d ATR,ElDistMatrix d A00, ElDistMatrix d A01,ElDistMatrix d A02, ElDistMatrix d A10,ElDistMatrix d A11, ElDistMatrix d A12,ElDistMatrix d ABL, ElDistMatrix d ABR,ElDistMatrix d A20, ElDistMatrix d A21,ElDistMatrix d A22, ElInt bsize)

132 Chapter 3. Core functionality

Page 137: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionDownDiagonalDist c(ElDistMatrix c ATL, ElDistMatrix c ATR,ElDistMatrix c A00, ElDistMatrix c A01,ElDistMatrix c A02, ElDistMatrix c A10,ElDistMatrix c A11, ElDistMatrix c A12,ElDistMatrix c ABL, ElDistMatrix c ABR,ElDistMatrix c A20, ElDistMatrix c A21,ElDistMatrix c A22, ElInt bsize)

ElError ElRepartitionDownDiagonalDist z(ElDistMatrix z ATL, ElDistMatrix z ATR,ElDistMatrix z A00, ElDistMatrix z A01,ElDistMatrix z A02, ElDistMatrix z A10,ElDistMatrix z A11, ElDistMatrix z A12,ElDistMatrix z ABL, ElDistMatrix z ABR,ElDistMatrix z A20, ElDistMatrix z A21,ElDistMatrix z A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonal i(ElConstMatrix i ATL, ElConstMa-trix i ATR, ElMatrix i A00, ElMa-trix i A01, ElMatrix i A02, ElMa-trix i A10, ElMatrix i A11, ElMa-trix i A12, ElConstMatrix i ABL, ElCon-stMatrix i ABR, ElMatrix i A20, ElMa-trix i A21, ElMatrix i A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonal s(ElConstMatrix s ATL, ElConstMa-trix s ATR, ElMatrix s A00, ElMa-trix s A01, ElMatrix s A02, ElMa-trix s A10, ElMatrix s A11, ElMa-trix s A12, ElConstMatrix s ABL, ElCon-stMatrix s ABR, ElMatrix s A20, ElMa-trix s A21, ElMatrix s A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonal d(ElConstMatrix d ATL, ElConstMa-trix d ATR, ElMatrix d A00, ElMa-trix d A01, ElMatrix d A02, ElMa-trix d A10, ElMatrix d A11, ElMa-trix d A12, ElConstMatrix d ABL,ElConstMatrix d ABR, ElMatrix d A20,ElMatrix d A21, ElMatrix d A22,ElInt bsize)

ElError ElLockedRepartitionDownDiagonal c(ElConstMatrix c ATL, ElConstMa-trix c ATR, ElMatrix c A00, ElMa-trix c A01, ElMatrix c A02, ElMa-trix c A10, ElMatrix c A11, ElMa-trix c A12, ElConstMatrix c ABL, ElCon-stMatrix c ABR, ElMatrix c A20, ElMa-trix c A21, ElMatrix c A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonal z(ElConstMatrix z ATL, ElConstMa-trix z ATR, ElMatrix z A00, ElMa-trix z A01, ElMatrix z A02, ElMa-trix z A10, ElMatrix z A11, ElMa-trix z A12, ElConstMatrix z ABL, ElCon-stMatrix z ABR, ElMatrix z A20, ElMa-trix z A21, ElMatrix z A22, ElInt bsize)

3.14. FLAME-like partition tracking 133

Page 138: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedRepartitionDownDiagonalDist i(ElConstDistMatrix i ATL, ElCon-stDistMatrix i ATR, ElDistMa-trix i A00, ElDistMatrix i A01,ElDistMatrix i A02, ElDistMa-trix i A10, ElDistMatrix i A11,ElDistMatrix i A12, ElConstDist-Matrix i ABL, ElConstDistMa-trix i ABR, ElDistMatrix i A20,ElDistMatrix i A21, ElDistMa-trix i A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonalDist s(ElConstDistMatrix s ATL, ElCon-stDistMatrix s ATR, ElDistMa-trix s A00, ElDistMatrix s A01,ElDistMatrix s A02, ElDistMa-trix s A10, ElDistMatrix s A11,ElDistMatrix s A12, ElConstDist-Matrix s ABL, ElConstDistMa-trix s ABR, ElDistMatrix s A20,ElDistMatrix s A21, ElDistMa-trix s A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonalDist d(ElConstDistMatrix d ATL, ElCon-stDistMatrix d ATR, ElDistMa-trix d A00, ElDistMatrix d A01,ElDistMatrix d A02, ElDistMa-trix d A10, ElDistMatrix d A11,ElDistMatrix d A12, ElConstDist-Matrix d ABL, ElConstDistMa-trix d ABR, ElDistMatrix d A20,ElDistMatrix d A21, ElDistMa-trix d A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonalDist c(ElConstDistMatrix c ATL, ElCon-stDistMatrix c ATR, ElDistMa-trix c A00, ElDistMatrix c A01,ElDistMatrix c A02, ElDistMa-trix c A10, ElDistMatrix c A11,ElDistMatrix c A12, ElConstDist-Matrix c ABL, ElConstDistMa-trix c ABR, ElDistMatrix c A20,ElDistMatrix c A21, ElDistMa-trix c A22, ElInt bsize)

ElError ElLockedRepartitionDownDiagonalDist z(ElConstDistMatrix z ATL, ElCon-stDistMatrix z ATR, ElDistMa-trix z A00, ElDistMatrix z A01,ElDistMatrix z A02, ElDistMa-trix z A10, ElDistMatrix z A11,ElDistMatrix z A12, ElConstDist-Matrix z ABL, ElConstDistMa-trix z ABR, ElDistMatrix z A20,ElDistMatrix z A21, ElDistMa-trix z A22, ElInt bsize)

134 Chapter 3. Core functionality

Page 139: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Up a diagonal

Given the partition

A =

(ATL ATRABL ABR

),

turn the two-by-two partition into the three-by-three partition(ATL ATRABL ABR

)=

A00 A01 A02A10 A11 A12A20 A21 A22

,

where A11 is nb × nb and the corresponding quadrants are equivalent.

C++ API

void RepartitionUpDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, Matrix<T> &A00,Matrix<T> &A01, Matrix<T> &A02, Matrix<T> &A10,Matrix<T> &A11, Matrix<T> &A12, Matrix<T> &ABL,Matrix<T> &ABR, Matrix<T> &A20, Matrix<T> &A21,Matrix<T> &A22, Int bsize = Blocksize())

void LockedRepartitionUpDiagonal(const Matrix<T> &ATL, const Matrix<T> &ATR,Matrix<T> &A00, Matrix<T> &A01, Matrix<T>&A02, Matrix<T> &A10, Matrix<T> &A11, Ma-trix<T> &A12, const Matrix<T> &ABL, constMatrix<T> &ABR, Matrix<T> &A20, Matrix<T>&A21, Matrix<T> &A22, Int bsize = Blocksize())

void RepartitionUpDiagonal(AbstractDistMatrix<T> &ATL, AbstractDistMatrix<T>&ATR, AbstractDistMatrix<T> &A00, AbstractDistMa-trix<T> &A01, AbstractDistMatrix<T> &A02, Abstract-DistMatrix<T> &A10, AbstractDistMatrix<T> &A11,AbstractDistMatrix<T> &A12, AbstractDistMatrix<T>&ABL, AbstractDistMatrix<T> &ABR, AbstractDistMa-trix<T> &A20, AbstractDistMatrix<T> &A21, Abstract-DistMatrix<T> &A22, Int bsize = Blocksize())

void LockedRepartitionUpDiagonal(const AbstractDistMatrix<T> &ATL, constAbstractDistMatrix<T> &ATR, AbstractDistMa-trix<T> &A00, AbstractDistMatrix<T> &A01,AbstractDistMatrix<T> &A02, AbstractDistMa-trix<T> &A10, AbstractDistMatrix<T> &A11,AbstractDistMatrix<T> &A12, const AbstractDist-Matrix<T> &ABL, const AbstractDistMatrix<T>&ABR, AbstractDistMatrix<T> &A20, Abstract-DistMatrix<T> &A21, AbstractDistMatrix<T>&A22, Int bsize = Blocksize())

Each of the above routines is meant to be used in a manner similar to:

RepartitionUpDiagonal( ATL, /**/ ATR, A00, A01, /**/ A02,

/**/ A10, A11, /**/ A12,

/*************/ /******************/

ABL, /**/ ABR, A20, A21, /**/ A22, blocksize );

3.14. FLAME-like partition tracking 135

Page 140: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElRepartitionUpDiagonal i(ElMatrix i ATL, ElMatrix i ATR, ElMatrix i A00,ElMatrix i A01, ElMatrix i A02, ElMatrix i A10, El-Matrix i A11, ElMatrix i A12, ElMatrix i ABL, El-Matrix i ABR, ElMatrix i A20, ElMatrix i A21, El-Matrix i A22, ElInt bsize)

ElError ElRepartitionUpDiagonal s(ElMatrix s ATL, ElMatrix s ATR, ElMatrix s A00,ElMatrix s A01, ElMatrix s A02, ElMatrix s A10,ElMatrix s A11, ElMatrix s A12, ElMatrix s ABL,ElMatrix s ABR, ElMatrix s A20, ElMatrix s A21,ElMatrix s A22, ElInt bsize)

ElError ElRepartitionUpDiagonal d(ElMatrix d ATL, ElMatrix d ATR, ElMatrix d A00,ElMatrix d A01, ElMatrix d A02, ElMatrix d A10,ElMatrix d A11, ElMatrix d A12, ElMatrix d ABL,ElMatrix d ABR, ElMatrix d A20, ElMatrix d A21,ElMatrix d A22, ElInt bsize)

ElError ElRepartitionUpDiagonal c(ElMatrix c ATL, ElMatrix c ATR, ElMatrix c A00,ElMatrix c A01, ElMatrix c A02, ElMatrix c A10,ElMatrix c A11, ElMatrix c A12, ElMatrix c ABL,ElMatrix c ABR, ElMatrix c A20, ElMatrix c A21,ElMatrix c A22, ElInt bsize)

ElError ElRepartitionUpDiagonal z(ElMatrix z ATL, ElMatrix z ATR, ElMatrix z A00,ElMatrix z A01, ElMatrix z A02, ElMatrix z A10,ElMatrix z A11, ElMatrix z A12, ElMatrix z ABL,ElMatrix z ABR, ElMatrix z A20, ElMatrix z A21,ElMatrix z A22, ElInt bsize)

ElError ElRepartitionUpDiagonalDist i(ElDistMatrix i ATL, ElDistMatrix i ATR, El-DistMatrix i A00, ElDistMatrix i A01, ElD-istMatrix i A02, ElDistMatrix i A10, ElDist-Matrix i A11, ElDistMatrix i A12, ElDist-Matrix i ABL, ElDistMatrix i ABR, ElDist-Matrix i A20, ElDistMatrix i A21, ElDistMa-trix i A22, ElInt bsize)

ElError ElRepartitionUpDiagonalDist s(ElDistMatrix s ATL, ElDistMatrix s ATR, El-DistMatrix s A00, ElDistMatrix s A01, ElD-istMatrix s A02, ElDistMatrix s A10, ElD-istMatrix s A11, ElDistMatrix s A12, ElDist-Matrix s ABL, ElDistMatrix s ABR, ElDist-Matrix s A20, ElDistMatrix s A21, ElDistMa-trix s A22, ElInt bsize)

ElError ElRepartitionUpDiagonalDist d(ElDistMatrix d ATL, ElDistMatrix d ATR, El-DistMatrix d A00, ElDistMatrix d A01, ElD-istMatrix d A02, ElDistMatrix d A10, ElDist-Matrix d A11, ElDistMatrix d A12, ElDist-Matrix d ABL, ElDistMatrix d ABR, ElDist-Matrix d A20, ElDistMatrix d A21, ElDistMa-trix d A22, ElInt bsize)

136 Chapter 3. Core functionality

Page 141: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRepartitionUpDiagonalDist c(ElDistMatrix c ATL, ElDistMatrix c ATR, El-DistMatrix c A00, ElDistMatrix c A01, ElD-istMatrix c A02, ElDistMatrix c A10, ElD-istMatrix c A11, ElDistMatrix c A12, ElDist-Matrix c ABL, ElDistMatrix c ABR, ElDist-Matrix c A20, ElDistMatrix c A21, ElDistMa-trix c A22, ElInt bsize)

ElError ElRepartitionUpDiagonalDist z(ElDistMatrix z ATL, ElDistMatrix z ATR, El-DistMatrix z A00, ElDistMatrix z A01, ElD-istMatrix z A02, ElDistMatrix z A10, ElD-istMatrix z A11, ElDistMatrix z A12, ElDist-Matrix z ABL, ElDistMatrix z ABR, ElDist-Matrix z A20, ElDistMatrix z A21, ElDistMa-trix z A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonal i(ElConstMatrix i ATL, ElConstMa-trix i ATR, ElMatrix i A00, ElMatrix i A01,ElMatrix i A02, ElMatrix i A10, ElMa-trix i A11, ElMatrix i A12, ElConstMa-trix i ABL, ElConstMatrix i ABR, ElMa-trix i A20, ElMatrix i A21, ElMatrix i A22,ElInt bsize)

ElError ElLockedRepartitionUpDiagonal s(ElConstMatrix s ATL, ElConstMa-trix s ATR, ElMatrix s A00, ElMatrix s A01,ElMatrix s A02, ElMatrix s A10, ElMa-trix s A11, ElMatrix s A12, ElConstMa-trix s ABL, ElConstMatrix s ABR, ElMa-trix s A20, ElMatrix s A21, ElMatrix s A22,ElInt bsize)

ElError ElLockedRepartitionUpDiagonal d(ElConstMatrix d ATL, ElConstMa-trix d ATR, ElMatrix d A00, ElMa-trix d A01, ElMatrix d A02, ElMa-trix d A10, ElMatrix d A11, ElMa-trix d A12, ElConstMatrix d ABL, El-ConstMatrix d ABR, ElMatrix d A20, El-Matrix d A21, ElMatrix d A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonal c(ElConstMatrix c ATL, ElConstMa-trix c ATR, ElMatrix c A00, ElMatrix c A01,ElMatrix c A02, ElMatrix c A10, ElMa-trix c A11, ElMatrix c A12, ElConstMa-trix c ABL, ElConstMatrix c ABR, ElMa-trix c A20, ElMatrix c A21, ElMatrix c A22,ElInt bsize)

ElError ElLockedRepartitionUpDiagonal z(ElConstMatrix z ATL, ElConstMa-trix z ATR, ElMatrix z A00, ElMa-trix z A01, ElMatrix z A02, ElMatrix z A10,ElMatrix z A11, ElMatrix z A12, ElCon-stMatrix z ABL, ElConstMatrix z ABR,ElMatrix z A20, ElMatrix z A21, ElMa-trix z A22, ElInt bsize)

3.14. FLAME-like partition tracking 137

Page 142: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLockedRepartitionUpDiagonalDist i(ElConstDistMatrix i ATL, ElConst-DistMatrix i ATR, ElDistMatrix i A00,ElDistMatrix i A01, ElDistMa-trix i A02, ElDistMatrix i A10,ElDistMatrix i A11, ElDistMa-trix i A12, ElConstDistMatrix i ABL,ElConstDistMatrix i ABR, ElDist-Matrix i A20, ElDistMatrix i A21,ElDistMatrix i A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonalDist s(ElConstDistMatrix s ATL, ElCon-stDistMatrix s ATR, ElDistMa-trix s A00, ElDistMatrix s A01, ElD-istMatrix s A02, ElDistMatrix s A10,ElDistMatrix s A11, ElDistMa-trix s A12, ElConstDistMatrix s ABL,ElConstDistMatrix s ABR, ElDist-Matrix s A20, ElDistMatrix s A21,ElDistMatrix s A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonalDist d(ElConstDistMatrix d ATL, ElCon-stDistMatrix d ATR, ElDistMa-trix d A00, ElDistMatrix d A01, ElD-istMatrix d A02, ElDistMatrix d A10,ElDistMatrix d A11, ElDistMa-trix d A12, ElConstDistMatrix d ABL,ElConstDistMatrix d ABR, ElDist-Matrix d A20, ElDistMatrix d A21,ElDistMatrix d A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonalDist c(ElConstDistMatrix c ATL, ElCon-stDistMatrix c ATR, ElDistMa-trix c A00, ElDistMatrix c A01, ElD-istMatrix c A02, ElDistMatrix c A10,ElDistMatrix c A11, ElDistMa-trix c A12, ElConstDistMatrix c ABL,ElConstDistMatrix c ABR, ElDist-Matrix c A20, ElDistMatrix c A21,ElDistMatrix c A22, ElInt bsize)

ElError ElLockedRepartitionUpDiagonalDist z(ElConstDistMatrix z ATL, ElCon-stDistMatrix z ATR, ElDistMa-trix z A00, ElDistMatrix z A01, ElD-istMatrix z A02, ElDistMatrix z A10,ElDistMatrix z A11, ElDistMa-trix z A12, ElConstDistMatrix z ABL,ElConstDistMatrix z ABR, ElDist-Matrix z A20, ElDistMatrix z A21,ElDistMatrix z A22, ElInt bsize)

3.14.3 Merging submatrices

Many matrix algorithms can be formulated as a sequence of operations on submatrices whichare repeatedly split into smaller (contiguous) submatrices and then reformed in a different

138 Chapter 3. Core functionality

Page 143: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

manner. Such a reformation process requires only a small (constant) number of operationswhen the matrices to be “merged” are stored contiguously in memory, and so the followingroutines make this assumption.

Note: These routines are currently exclusively used within Elemental’s SlidePartitionUp() ,SlidePartitionDown() , etc., routines and are likely only of use to advanced users in veryspecial circumstances.

1x2 matrix of blocks

The following routines horizontally merge two matrices which have consistent leading dimen-sions and sizes. When the matrices are distributed, their alignments must also be distributed.That is to say, if the inputs are consistent, a view is constructed of

(BL BR

).

Note: BL and BR must be contiguous in the sense that, if the local portion of BL is m × n withleading dimension ldim, then the top-left entry of BR must occur precisely ldim times n entriesafter the top-left entry of BL, and BR must have an equivalent leading dimension.

C++ API

void Merge1x2(Matrix<T> &A, Matrix<T> &BL, Matrix<T> &BR)

void LockedMerge1x2(Matrix<T> &A, const Matrix<T> &BL, const Matrix<T> &BR)

void Merge1x2(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &BL, AbstractDist-Matrix<T> &BR)

void LockedMerge1x2(AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &BL,const AbstractDistMatrix<T> &BR)

The view is returned in A.

Matrix<T> Merge1x2(Matrix<T> &BL, Matrix<T> &BR)

Matrix<T> LockedMerge1x2(const Matrix<T> &BL, const Matrix<T> &BR)

DistMatrix<T, U, V> Merge1x2(DistMatrix<T, U, V> &BL, DistMatrix<T, U, V> &BR)

DistMatrix<T, U, V> LockedMerge1x2(const DistMatrix<T, U, V> &BL, const DistMa-trix<T, U, V> &BR)

The view is the return value of the function.

C API

ElError ElMerge1x2 i(ElMatrix i A, ElMatrix i BL, ElMatrix i BR)

ElError ElMerge1x2 s(ElMatrix s A, ElMatrix s BL, ElMatrix s BR)

ElError ElMerge1x2 d(ElMatrix d A, ElMatrix d BL, ElMatrix d BR)

ElError ElMerge1x2 c(ElMatrix c A, ElMatrix c BL, ElMatrix c BR)

ElError ElMerge1x2 z(ElMatrix z A, ElMatrix z BL, ElMatrix z BR)

ElError ElMerge1x2Dist i(ElDistMatrix i A, ElDistMatrix i BL, ElDistMatrix i BR)

3.14. FLAME-like partition tracking 139

Page 144: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMerge1x2Dist s(ElDistMatrix s A, ElDistMatrix s BL, ElDistMatrix s BR)

ElError ElMerge1x2Dist d(ElDistMatrix d A, ElDistMatrix d BL, ElDistMatrix d BR)

ElError ElMerge1x2Dist c(ElDistMatrix c A, ElDistMatrix c BL, ElDistMatrix c BR)

ElError ElMerge1x2Dist z(ElDistMatrix z A, ElDistMatrix z BL, ElDistMatrix z BR)

ElError ElLockedMerge1x2 i(ElMatrix i A, ElMatrix i BL, ElMatrix i BR)

ElError ElLockedMerge1x2 s(ElMatrix s A, ElMatrix s BL, ElMatrix s BR)

ElError ElLockedMerge1x2 d(ElMatrix d A, ElMatrix d BL, ElMatrix d BR)

ElError ElLockedMerge1x2 c(ElMatrix c A, ElMatrix c BL, ElMatrix c BR)

ElError ElLockedMerge1x2 z(ElMatrix z A, ElMatrix z BL, ElMatrix z BR)

ElError ElLockedMerge1x2Dist i(ElDistMatrix i A, ElConstDistMatrix i BL, ElConst-DistMatrix i BR)

ElError ElLockedMerge1x2Dist s(ElDistMatrix s A, ElConstDistMatrix s BL, ElConst-DistMatrix s BR)

ElError ElLockedMerge1x2Dist d(ElDistMatrix d A, ElConstDistMatrix d BL, ElConst-DistMatrix d BR)

ElError ElLockedMerge1x2Dist c(ElDistMatrix c A, ElConstDistMatrix c BL, ElConst-DistMatrix c BR)

ElError ElLockedMerge1x2Dist z(ElDistMatrix z A, ElConstDistMatrix z BL, ElConst-DistMatrix z BR)

2x1 matrix of blocks

The following routines vertically merge two matrices which have consistent leading dimen-sions and sizes. When the matrices are distributed, their alignments must also be consistent.

That is to say, if the inputs are consistent, a view of(

BTBB

)is returned.

Note: BT and BB must be contiguous in the sense that, if the local portion of BT is m × n withleading dimension ldim, then the top-left entry of BB must occur precisely m entries after thetop-left entry of BT, and both the leading dimensions and widths of the two matricees must beidentical.

C++ API

void Merge2x1(Matrix<T> &A, Matrix<T> &BT, Matrix<T> &BB)

void LockedMerge2x1(Matrix<T> &A, const Matrix<T> &BT, const Matrix<T> &BB)

void Merge2x1(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &BT, DistMatrix<T,U, V> &BB)

void LockedMerge2x1(AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &BT,const AbstractDistMatrix<T> &BB)

The view is returned in A.

Matrix<T> Merge2x1(Matrix<T> &BT, Matrix<T> &BB)

140 Chapter 3. Core functionality

Page 145: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Matrix<T> LockedMerge2x1(const Matrix<T> &BT, const Matrix<T> &BB)

DistMatrix<T, U, V> Merge2x1(DistMatrix<T, U, V> &BT, DistMatrix<T, U, V> &BB)

DistMatrix<T, U, V> LockedMerge2x1(const DistMatrix<T, U, V> &BT, const DistMa-trix<T, U, V> &BB)

The view is the return value of the function.

C API

ElError ElMerge2x1 i(ElMatrix i A, ElMatrix i BT, ElMatrix i BB)

ElError ElMerge2x1 s(ElMatrix s A, ElMatrix s BT, ElMatrix s BB)

ElError ElMerge2x1 d(ElMatrix d A, ElMatrix d BT, ElMatrix d BB)

ElError ElMerge2x1 c(ElMatrix c A, ElMatrix c BT, ElMatrix c BB)

ElError ElMerge2x1 z(ElMatrix z A, ElMatrix z BT, ElMatrix z BB)

ElError ElMerge2x1Dist i(ElDistMatrix i A, ElDistMatrix i BT, ElDistMatrix i BB)

ElError ElMerge2x1Dist s(ElDistMatrix s A, ElDistMatrix s BT, ElDistMatrix s BB)

ElError ElMerge2x1Dist d(ElDistMatrix d A, ElDistMatrix d BT, ElDistMatrix d BB)

ElError ElMerge2x1Dist c(ElDistMatrix c A, ElDistMatrix c BT, ElDistMatrix c BB)

ElError ElMerge2x1Dist z(ElDistMatrix z A, ElDistMatrix z BT, ElDistMatrix z BB)

ElError ElLockedMerge2x1 i(ElMatrix i A, ElConstMatrix i BT, ElConstMatrix i BB)

ElError ElLockedMerge2x1 s(ElMatrix s A, ElConstMatrix s BT, ElConstMatrix s BB)

ElError ElLockedMerge2x1 d(ElMatrix d A, ElConstMatrix d BT, ElConstMatrix d BB)

ElError ElLockedMerge2x1 c(ElMatrix c A, ElConstMatrix c BT, ElConstMatrix c BB)

ElError ElLockedMerge2x1 z(ElMatrix z A, ElConstMatrix z BT, ElConstMatrix z BB)

ElError ElLockedMerge2x1Dist i(ElDistMatrix i A, ElConstDistMatrix i BT, ElConst-DistMatrix i BB)

ElError ElLockedMerge2x1Dist s(ElDistMatrix s A, ElConstDistMatrix s BT, ElConst-DistMatrix s BB)

ElError ElLockedMerge2x1Dist d(ElDistMatrix d A, ElConstDistMatrix d BT, ElConst-DistMatrix d BB)

ElError ElLockedMerge2x1Dist c(ElDistMatrix c A, ElConstDistMatrix c BT, ElConst-DistMatrix c BB)

ElError ElLockedMerge2x1Dist z(ElDistMatrix z A, ElConstDistMatrix z BT, ElConst-DistMatrix z BB)

2x2 matrix of blocks

The following routines merge a two-by-two set of contiguous submatrices which have confor-mal leading dimensions, sizes, and, if applicable, alignments. That is to say, if the inputs are

consistent, a view of(

BTL BTRBBL BBR

)is returned.

3.14. FLAME-like partition tracking 141

Page 146: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Note: The constraints described above for horizontally and vertically merging submatricesboth apply here.

C++ API

void Merge2x2(Matrix<T> &A, Matrix<T> &BTL, Matrix<T> &BTR, Matrix<T> &BBL,Matrix<T> &BBR)

void LockedMerge2x2(Matrix<T> &A, const Matrix<T> &BTL, const Matrix<T>&BTR, const Matrix<T> &BBL, const Matrix<T> &BBR)

void Merge2x2(AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &BTL, Abstract-DistMatrix<T> &BTR, AbstractDistMatrix<T> &BBL, AbstractDistMa-trix<T> &BBR)

void LockedMerge2x2(AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &BTL,const AbstractDistMatrix<T> &BTR, const AbstractDistMa-trix<T> &BBL, const AbstractDistMatrix<T> &BBR)

The view is returned in A.

Matrix<T> Merge2x2(Matrix<T> &BTL, Matrix<T> &BTR, Matrix<T> &BBL, Ma-trix<T> &BBR)

Matrix<T> LockedMerge2x2(const Matrix<T> &BTL, const Matrix<T> &BTR, constMatrix<T> &BBL, const Matrix<T> &BBR)

DistMatrix<T, U, V> Merge2x2(DistMatrix<T, U, V> &BTL, DistMatrix<T, U, V>&BTR, DistMatrix<T, U, V> &BBL, DistMatrix<T, U, V>&BBR)

DistMatrix<T, U, V> LockedMerge2x2(const DistMatrix<T, U, V> &BTL, const DistMa-trix<T, U, V> &BTR, const DistMatrix<T, U, V>&BBL, const DistMatrix<T, U, V> &BBR)

The view is the return value of the function

C API

ElError ElMerge2x2 i(ElMatrix i A, ElMatrix i BTL, ElMatrix i BTR, ElMatrix i BBL, El-Matrix i BBR)

ElError ElMerge2x2 s(ElMatrix s A, ElMatrix s BTL, ElMatrix s BTR, ElMatrix s BBL, El-Matrix s BBR)

ElError ElMerge2x2 d(ElMatrix d A, ElMatrix d BTL, ElMatrix d BTR, ElMatrix d BBL,ElMatrix d BBR)

ElError ElMerge2x2 c(ElMatrix c A, ElMatrix c BTL, ElMatrix c BTR, ElMatrix c BBL, El-Matrix c BBR)

ElError ElMerge2x2 z(ElMatrix z A, ElMatrix z BTL, ElMatrix z BTR, ElMatrix z BBL,ElMatrix z BBR)

ElError ElMerge2x2Dist i(ElDistMatrix i A, ElDistMatrix i BTL, ElDistMatrix i BTR, El-DistMatrix i BBL, ElDistMatrix i BBR)

ElError ElMerge2x2Dist s(ElDistMatrix s A, ElDistMatrix s BTL, ElDistMatrix s BTR,ElDistMatrix s BBL, ElDistMatrix s BBR)

ElError ElMerge2x2Dist d(ElDistMatrix d A, ElDistMatrix d BTL, ElDistMatrix d BTR,ElDistMatrix d BBL, ElDistMatrix d BBR)

142 Chapter 3. Core functionality

Page 147: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMerge2x2Dist c(ElDistMatrix c A, ElDistMatrix c BTL, ElDistMatrix c BTR,ElDistMatrix c BBL, ElDistMatrix c BBR)

ElError ElMerge2x2Dist z(ElDistMatrix z A, ElDistMatrix z BTL, ElDistMatrix z BTR,ElDistMatrix z BBL, ElDistMatrix z BBR)

ElError ElLockedMerge2x2 i(ElMatrix i A, ElConstMatrix i BTL, ElConstMatrix i BTR,ElConstMatrix i BBL, ElConstMatrix i BBR)

ElError ElLockedMerge2x2 s(ElMatrix s A, ElConstMatrix s BTL, ElConstMatrix s BTR,ElConstMatrix s BBL, ElConstMatrix s BBR)

ElError ElLockedMerge2x2 d(ElMatrix d A, ElConstMatrix d BTL, ElConstMa-trix d BTR, ElConstMatrix d BBL, ElConstMatrix d BBR)

ElError ElLockedMerge2x2 c(ElMatrix c A, ElConstMatrix c BTL, ElConstMatrix c BTR,ElConstMatrix c BBL, ElConstMatrix c BBR)

ElError ElLockedMerge2x2 z(ElMatrix z A, ElConstMatrix z BTL, ElConstMatrix z BTR,ElConstMatrix z BBL, ElConstMatrix z BBR)

ElError ElLockedMerge2x2Dist i(ElDistMatrix i A, ElConstDistMatrix i BTL, ElConst-DistMatrix i BTR, ElConstDistMatrix i BBL, ElConst-DistMatrix i BBR)

ElError ElLockedMerge2x2Dist s(ElDistMatrix s A, ElConstDistMatrix s BTL, ElConst-DistMatrix s BTR, ElConstDistMatrix s BBL, ElConst-DistMatrix s BBR)

ElError ElLockedMerge2x2Dist d(ElDistMatrix d A, ElConstDistMatrix d BTL, ElConst-DistMatrix d BTR, ElConstDistMatrix d BBL, ElCon-stDistMatrix d BBR)

ElError ElLockedMerge2x2Dist c(ElDistMatrix c A, ElConstDistMatrix c BTL, ElConst-DistMatrix c BTR, ElConstDistMatrix c BBL, ElConst-DistMatrix c BBR)

ElError ElLockedMerge2x2Dist z(ElDistMatrix z A, ElConstDistMatrix z BTL, ElConst-DistMatrix z BTR, ElConstDistMatrix z BBL, ElConst-DistMatrix z BBR)

3.14.4 Moving partition boundaries

Downward

Simultaneously slide and merge the partition

A =

A0

A1A2

,

into (ATAB

)=

A0A1A2

.

3.14. FLAME-like partition tracking 143

Page 148: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void SlidePartitionDown(Matrix<T> &AT, Matrix<T> &A0, Matrix<T> &A1, Ma-trix<T> &AB, Matrix<T> &A2)

void SlideLockedPartitionDown(Matrix<T> &AT, const Matrix<T> &A0, const Ma-trix<T> &A1, Matrix<T> &AB, const Matrix<T>&A2)

void SlidePartitionDown(AbstractDistMatrix<T> &AT, AbstractDistMatrix<T> &A0,AbstractDistMatrix<T> &A1, AbstractDistMatrix<T> &AB,AbstractDistMatrix<T> &A2)

void SlideLockedPartitionDown(AbstractDistMatrix<T> &AT, const AbstractDistMa-trix<T> &A0, const AbstractDistMatrix<T> &A1,AbstractDistMatrix<T> &AB, const AbstractDistMa-trix<T> &A2)

Each of the above routines is meant to be used in a manner similar to:

SlidePartitionDown( AT, A0,

A1,

/**/ /**/

AB, A2 );

C API

ElError ElSlidePartitionDown i(ElMatrix i AT, ElMatrix i A0, ElMatrix i A1, ElMa-trix i AB, ElMatrix i A2)

ElError ElSlidePartitionDown s(ElMatrix s AT, ElMatrix s A0, ElMatrix s A1, ElMa-trix s AB, ElMatrix s A2)

ElError ElSlidePartitionDown d(ElMatrix d AT, ElMatrix d A0, ElMatrix d A1, ElMa-trix d AB, ElMatrix d A2)

ElError ElSlidePartitionDown c(ElMatrix c AT, ElMatrix c A0, ElMatrix c A1, ElMa-trix c AB, ElMatrix c A2)

ElError ElSlidePartitionDown z(ElMatrix z AT, ElMatrix z A0, ElMatrix z A1, ElMa-trix z AB, ElMatrix z A2)

ElError ElSlidePartitionDownDist i(ElDistMatrix i AT, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i AB, ElDistMatrix i A2)

ElError ElSlidePartitionDownDist s(ElDistMatrix s AT, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s AB, ElDistMatrix s A2)

ElError ElSlidePartitionDownDist d(ElDistMatrix d AT, ElDistMatrix d A0, ElD-istMatrix d A1, ElDistMatrix d AB, ElDistMa-trix d A2)

ElError ElSlidePartitionDownDist c(ElDistMatrix c AT, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c AB, ElDistMatrix c A2)

ElError ElSlidePartitionDownDist z(ElDistMatrix z AT, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z AB, ElDistMatrix z A2)

ElError ElSlideLockedPartitionDown i(ElMatrix i AT, ElConstMatrix i A0, ElCon-stMatrix i A1, ElMatrix i AB, ElConstMa-trix i A2)

144 Chapter 3. Core functionality

Page 149: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionDown s(ElMatrix s AT, ElConstMatrix s A0, ElCon-stMatrix s A1, ElMatrix s AB, ElConstMa-trix s A2)

ElError ElSlidePartitionDown d(ElMatrix d AT, ElConstMatrix d A0, ElConstMa-trix d A1, ElMatrix d AB, ElConstMatrix d A2)

ElError ElSlideLockedPartitionDown c(ElMatrix c AT, ElConstMatrix c A0, ElCon-stMatrix c A1, ElMatrix c AB, ElConstMa-trix c A2)

ElError ElSlideLockedPartitionDown z(ElMatrix z AT, ElConstMatrix z A0, ElCon-stMatrix z A1, ElMatrix z AB, ElConstMa-trix z A2)

ElError ElSlideLockedPartitionDownDist i(ElDistMatrix i AT, ElConstDistMa-trix i A0, ElConstDistMatrix i A1, ElDist-Matrix i AB, ElConstDistMatrix i A2)

ElError ElSlideLockedPartitionDownDist s(ElDistMatrix s AT, ElConstDistMa-trix s A0, ElConstDistMatrix s A1, ElDist-Matrix s AB, ElConstDistMatrix s A2)

ElError ElSlideLockedPartitionDownDist d(ElDistMatrix d AT, ElConstDistMa-trix d A0, ElConstDistMatrix d A1,ElDistMatrix d AB, ElConstDistMa-trix d A2)

ElError ElSlideLockedPartitionDownDist c(ElDistMatrix c AT, ElConstDistMa-trix c A0, ElConstDistMatrix c A1, ElDist-Matrix c AB, ElConstDistMatrix c A2)

ElError ElSlideLockedPartitionDownDist z(ElDistMatrix z AT, ElConstDistMa-trix z A0, ElConstDistMatrix z A1, ElD-istMatrix z AB, ElConstDistMatrix z A2)

Upward

Simultaneously slide and merge the partition

A =

A0A1A2

,

into (ATAB

)=

A0

A1A2

.

C++ API

void SlidePartitionUp(Matrix<T> &AT, Matrix<T> &A0, Matrix<T> &A1, Ma-trix<T> &AB, Matrix<T> &A2)

void SlideLockedPartitionUp(Matrix<T> &AT, const Matrix<T> &A0, const Ma-trix<T> &A1, Matrix<T> &AB, const Matrix<T> &A2)

3.14. FLAME-like partition tracking 145

Page 150: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void SlidePartitionUp(AbstractDistMatrix<T> &AT, AbstractDistMatrix<T> &A0, Ab-stractDistMatrix<T> &A1, AbstractDistMatrix<T> &AB, Ab-stractDistMatrix<T> &A2)

void SlideLockedPartitionUp(DistMatrix<T, U, V> &AT, const DistMatrix<T, U, V>&A0, const DistMatrix<T, U, V> &A1, DistMatrix<T, U,V> &AB, const DistMatrix<T, U, V> &A2)

Each of the above routines is meant to be used in a manner similar to:

SlidePartitionUp( AT, A0,

/**/ /**/

A1,

AB, A2 );

C API

ElError ElSlidePartitionUp i(ElMatrix i AT, ElMatrix i A0, ElMatrix i A1, ElMa-trix i AB, ElMatrix i A2)

ElError ElSlidePartitionUp s(ElMatrix s AT, ElMatrix s A0, ElMatrix s A1, ElMa-trix s AB, ElMatrix s A2)

ElError ElSlidePartitionUp d(ElMatrix d AT, ElMatrix d A0, ElMatrix d A1, ElMa-trix d AB, ElMatrix d A2)

ElError ElSlidePartitionUp c(ElMatrix c AT, ElMatrix c A0, ElMatrix c A1, ElMa-trix c AB, ElMatrix c A2)

ElError ElSlidePartitionUp z(ElMatrix z AT, ElMatrix z A0, ElMatrix z A1, ElMa-trix z AB, ElMatrix z A2)

ElError ElSlidePartitionUpDist i(ElDistMatrix i AT, ElDistMatrix i A0, ElDistMa-trix i A1, ElDistMatrix i AB, ElDistMatrix i A2)

ElError ElSlidePartitionUpDist s(ElDistMatrix s AT, ElDistMatrix s A0, ElDistMa-trix s A1, ElDistMatrix s AB, ElDistMatrix s A2)

ElError ElSlidePartitionUpDist d(ElDistMatrix d AT, ElDistMatrix d A0, ElDistMa-trix d A1, ElDistMatrix d AB, ElDistMatrix d A2)

ElError ElSlidePartitionUpDist c(ElDistMatrix c AT, ElDistMatrix c A0, ElDistMa-trix c A1, ElDistMatrix c AB, ElDistMatrix c A2)

ElError ElSlidePartitionUpDist z(ElDistMatrix z AT, ElDistMatrix z A0, ElDistMa-trix z A1, ElDistMatrix z AB, ElDistMatrix z A2)

ElError ElSlideLockedPartitionUp i(ElMatrix i AT, ElConstMatrix i A0, ElConstMa-trix i A1, ElMatrix i AB, ElConstMatrix i A2)

ElError ElSlideLockedPartitionUp s(ElMatrix s AT, ElConstMatrix s A0, ElConstMa-trix s A1, ElMatrix s AB, ElConstMatrix s A2)

ElError ElSlidePartitionUp d(ElMatrix d AT, ElConstMatrix d A0, ElConstMa-trix d A1, ElMatrix d AB, ElConstMatrix d A2)

ElError ElSlideLockedPartitionUp c(ElMatrix c AT, ElConstMatrix c A0, ElConstMa-trix c A1, ElMatrix c AB, ElConstMatrix c A2)

ElError ElSlideLockedPartitionUp z(ElMatrix z AT, ElConstMatrix z A0, ElConstMa-trix z A1, ElMatrix z AB, ElConstMatrix z A2)

146 Chapter 3. Core functionality

Page 151: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionUpDist i(ElDistMatrix i AT, ElConstDistMatrix i A0,ElConstDistMatrix i A1, ElDistMatrix i AB,ElConstDistMatrix i A2)

ElError ElSlideLockedPartitionUpDist s(ElDistMatrix s AT, ElConstDistMatrix s A0,ElConstDistMatrix s A1, ElDistMatrix s AB,ElConstDistMatrix s A2)

ElError ElSlideLockedPartitionUpDist d(ElDistMatrix d AT, ElConstDistMa-trix d A0, ElConstDistMatrix d A1, El-DistMatrix d AB, ElConstDistMatrix d A2)

ElError ElSlideLockedPartitionUpDist c(ElDistMatrix c AT, ElConstDistMatrix c A0,ElConstDistMatrix c A1, ElDistMatrix c AB,ElConstDistMatrix c A2)

ElError ElSlideLockedPartitionUpDist z(ElDistMatrix z AT, ElConstDistMatrix z A0,ElConstDistMatrix z A1, ElDistMatrix z AB,ElConstDistMatrix z A2)

Rightward

Simultaneously slide and merge the partition

A =(

A0 A1 A2)

into (AL AR

)=(

A0 A1 A2)

.

C++ API

void SlidePartitionRight(Matrix<T> &AL, Matrix<T> &AR, Matrix<T> &A0, Ma-trix<T> &A1, Matrix<T> &A2)

void SlideLockedPartitionRight(Matrix<T> &AL, Matrix<T> &AR, const Ma-trix<T> &A0, const Matrix<T> &A1, const Ma-trix<T> &A2)

void SlidePartitionRight(AbstractDistMatrix<T> &AL, AbstractDistMatrix<T> &AR,AbstractDistMatrix<T> &A0, AbstractDistMatrix<T> &A1,AbstractDistMatrix<T> &A2)

void SlideLockedPartitionRight(AbstractDistMatrix<T> &AL, AbstractDistMa-trix<T> &AR, const AbstractDistMatrix<T> &A0,const AbstractDistMatrix<T> &A1, const Abstract-DistMatrix<T> &A2)

Each of the above routines is meant to be used in a manner similar to:

SlidePartitionRight( AL, /**/ AR,

A0, A1, /**/ A2 );

C API

ElError ElSlidePartitionRight i(ElMatrix i AL, ElMatrix i AR, ElMatrix i A0, ElMa-trix i A1, ElMatrix i A2)

3.14. FLAME-like partition tracking 147

Page 152: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlidePartitionRight s(ElMatrix s AL, ElMatrix s AR, ElMatrix s A0, ElMa-trix s A1, ElMatrix s A2)

ElError ElSlidePartitionRight d(ElMatrix d AL, ElMatrix d AR, ElMatrix d A0, ElMa-trix d A1, ElMatrix d A2)

ElError ElSlidePartitionRight c(ElMatrix c AL, ElMatrix c AR, ElMatrix c A0, ElMa-trix c A1, ElMatrix c A2)

ElError ElSlidePartitionRight z(ElMatrix z AL, ElMatrix z AR, ElMatrix z A0, ElMa-trix z A1, ElMatrix z A2)

ElError ElSlidePartitionRightDist i(ElDistMatrix i AL, ElDistMatrix i AR, ElD-istMatrix i A0, ElDistMatrix i A1, ElDistMa-trix i A2)

ElError ElSlidePartitionRightDist s(ElDistMatrix s AL, ElDistMatrix s AR, ElD-istMatrix s A0, ElDistMatrix s A1, ElDistMa-trix s A2)

ElError ElSlidePartitionRightDist d(ElDistMatrix d AL, ElDistMatrix d AR, ElD-istMatrix d A0, ElDistMatrix d A1, ElDistMa-trix d A2)

ElError ElSlidePartitionRightDist c(ElDistMatrix c AL, ElDistMatrix c AR, ElD-istMatrix c A0, ElDistMatrix c A1, ElDistMa-trix c A2)

ElError ElSlidePartitionRightDist z(ElDistMatrix z AL, ElDistMatrix z AR, ElD-istMatrix z A0, ElDistMatrix z A1, ElDistMa-trix z A2)

ElError ElSlideLockedPartitionRight i(ElMatrix i AL, ElMatrix i AR, ElConstMa-trix i A0, ElConstMatrix i A1, ElConstMa-trix i A2)

ElError ElSlideLockedPartitionRight s(ElMatrix s AL, ElMatrix s AR, ElConstMa-trix s A0, ElConstMatrix s A1, ElConstMa-trix s A2)

ElError ElSlideLockedPartitionRight d(ElMatrix d AL, ElMatrix d AR, ElConstMa-trix d A0, ElConstMatrix d A1, ElConstMa-trix d A2)

ElError ElSlideLockedPartitionRight c(ElMatrix c AL, ElMatrix c AR, ElConstMa-trix c A0, ElConstMatrix c A1, ElConstMa-trix c A2)

ElError ElSlideLockedPartitionRight z(ElMatrix z AL, ElMatrix z AR, ElConstMa-trix z A0, ElConstMatrix z A1, ElConstMa-trix z A2)

ElError ElSlideLockedPartitionRightDist i(ElDistMatrix i AL, ElDistMatrix i AR,ElConstDistMatrix i A0, ElConstDist-Matrix i A1, ElConstDistMatrix i A2)

ElError ElSlideLockedPartitionRightDist s(ElDistMatrix s AL, ElDistMatrix s AR,ElConstDistMatrix s A0, ElConstDist-Matrix s A1, ElConstDistMatrix s A2)

ElError ElSlideLockedPartitionRightDist d(ElDistMatrix d AL, ElDistMatrix d AR,ElConstDistMatrix d A0, ElConstDist-Matrix d A1, ElConstDistMatrix d A2)

148 Chapter 3. Core functionality

Page 153: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionRightDist c(ElDistMatrix c AL, ElDistMatrix c AR,ElConstDistMatrix c A0, ElConstDist-Matrix c A1, ElConstDistMatrix c A2)

ElError ElSlideLockedPartitionRightDist z(ElDistMatrix z AL, ElDistMatrix z AR,ElConstDistMatrix z A0, ElConstDist-Matrix z A1, ElConstDistMatrix z A2)

Leftward

Simultaneously slide and merge the partition

A =(

A0 A1 A2)

into (AL AR

)=(

A0 A1 A2)

.

C++ API

void SlidePartitionLeft(Matrix<T> &AL, Matrix<T> &AR, Matrix<T> &A0, Ma-trix<T> &A1, Matrix<T> &A2)

void SlideLockedPartitionLeft(Matrix<T> &AL, Matrix<T> &AR, const Matrix<T>&A0, const Matrix<T> &A1, const Matrix<T> &A2)

void SlidePartitionLeft(AbstractDistMatrix<T> &AL, AbstractDistMatrix<T> &AR,AbstractDistMatrix<T> &A0, AbstractDistMatrix<T> &A1,AbstractDistMatrix<T> &A2)

void SlideLockedPartitionLeft(AbstractDistMatrix<T> &AL, AbstractDistMatrix<T>&AR, const AbstractDistMatrix<T> &A0, const Ab-stractDistMatrix<T> &A1, const AbstractDistMa-trix<T> &A2)

Each of the above routines is meant to be used in a manner similar to:

SlidePartitionLeft( AL, /**/ AR,

A0, /**/ A1, A2 );

C API

ElError ElSlidePartitionLeft i(ElMatrix i AL, ElMatrix i AR, ElMatrix i A0, ElMa-trix i A1, ElMatrix i A2)

ElError ElSlidePartitionLeft s(ElMatrix s AL, ElMatrix s AR, ElMatrix s A0, ElMa-trix s A1, ElMatrix s A2)

ElError ElSlidePartitionLeft d(ElMatrix d AL, ElMatrix d AR, ElMatrix d A0, ElMa-trix d A1, ElMatrix d A2)

ElError ElSlidePartitionLeft c(ElMatrix c AL, ElMatrix c AR, ElMatrix c A0, ElMa-trix c A1, ElMatrix c A2)

ElError ElSlidePartitionLeft z(ElMatrix z AL, ElMatrix z AR, ElMatrix z A0, ElMa-trix z A1, ElMatrix z A2)

3.14. FLAME-like partition tracking 149

Page 154: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlidePartitionLeftDist i(ElDistMatrix i AL, ElDistMatrix i AR, ElDistMa-trix i A0, ElDistMatrix i A1, ElDistMatrix i A2)

ElError ElSlidePartitionLeftDist s(ElDistMatrix s AL, ElDistMatrix s AR, ElDistMa-trix s A0, ElDistMatrix s A1, ElDistMatrix s A2)

ElError ElSlidePartitionLeftDist d(ElDistMatrix d AL, ElDistMatrix d AR, ElD-istMatrix d A0, ElDistMatrix d A1, ElDistMa-trix d A2)

ElError ElSlidePartitionLeftDist c(ElDistMatrix c AL, ElDistMatrix c AR, ElDistMa-trix c A0, ElDistMatrix c A1, ElDistMatrix c A2)

ElError ElSlidePartitionLeftDist z(ElDistMatrix z AL, ElDistMatrix z AR, ElD-istMatrix z A0, ElDistMatrix z A1, ElDistMa-trix z A2)

ElError ElSlideLockedPartitionLeft i(ElMatrix i AL, ElMatrix i AR, ElConstMa-trix i A0, ElConstMatrix i A1, ElConstMa-trix i A2)

ElError ElSlideLockedPartitionLeft s(ElMatrix s AL, ElMatrix s AR, ElConstMa-trix s A0, ElConstMatrix s A1, ElConstMa-trix s A2)

ElError ElSlideLockedPartitionLeft d(ElMatrix d AL, ElMatrix d AR, ElConstMa-trix d A0, ElConstMatrix d A1, ElConstMa-trix d A2)

ElError ElSlideLockedPartitionLeft c(ElMatrix c AL, ElMatrix c AR, ElConstMa-trix c A0, ElConstMatrix c A1, ElConstMa-trix c A2)

ElError ElSlideLockedPartitionLeft z(ElMatrix z AL, ElMatrix z AR, ElConstMa-trix z A0, ElConstMatrix z A1, ElConstMa-trix z A2)

ElError ElSlideLockedPartitionLeftDist i(ElDistMatrix i AL, ElDistMatrix i AR, El-ConstDistMatrix i A0, ElConstDistMa-trix i A1, ElConstDistMatrix i A2)

ElError ElSlideLockedPartitionLeftDist s(ElDistMatrix s AL, ElDistMatrix s AR,ElConstDistMatrix s A0, ElConstDistMa-trix s A1, ElConstDistMatrix s A2)

ElError ElSlideLockedPartitionLeftDist d(ElDistMatrix d AL, ElDistMatrix d AR,ElConstDistMatrix d A0, ElConstDistMa-trix d A1, ElConstDistMatrix d A2)

ElError ElSlideLockedPartitionLeftDist c(ElDistMatrix c AL, ElDistMatrix c AR,ElConstDistMatrix c A0, ElConstDistMa-trix c A1, ElConstDistMatrix c A2)

ElError ElSlideLockedPartitionLeftDist z(ElDistMatrix z AL, ElDistMatrix z AR,ElConstDistMatrix z A0, ElConstDistMa-trix z A1, ElConstDistMatrix z A2)

150 Chapter 3. Core functionality

Page 155: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Down a diagonal

Simultaneously slide and merge the partition

A =

A00 A01 A02

A10 A11 A12A20 A21 A22

into (

ATL ATRABL ABR

)=

A00 A01 A02A10 A11 A12A20 A21 A22

.

C++ API

void SlidePartitionDownDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, const Ma-trix<T> &A00, const Matrix<T> &A01, constMatrix<T> &A02, const Matrix<T> &A10, constMatrix<T> &A11, const Matrix<T> &A12, Ma-trix<T> &ABL, Matrix<T> &ABR, const Ma-trix<T> &A20, const Matrix<T> &A21, const Ma-trix<T> &A22)

void SlideLockedPartitionDownDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, constMatrix<T> &A00, const Matrix<T> &A01,const Matrix<T> &A02, const Matrix<T>&A10, const Matrix<T> &A11, const Ma-trix<T> &A12, Matrix<T> &ABL, Ma-trix<T> &ABR, const Matrix<T> &A20,const Matrix<T> &A21, const Matrix<T>&A22)

void SlidePartitionDownDiagonal(AbstractDistMatrix<T> &ATL, AbstractDistMa-trix<T> &ATR, const AbstractDistMatrix<T>&A00, const AbstractDistMatrix<T> &A01, constAbstractDistMatrix<T> &A02, const AbstractDist-Matrix<T> &A10, const AbstractDistMatrix<T>&A11, const AbstractDistMatrix<T> &A12,AbstractDistMatrix<T> &ABL, AbstractDistMa-trix<T> &ABR, const AbstractDistMatrix<T>&A20, const AbstractDistMatrix<T> &A21, constAbstractDistMatrix<T> &A22)

3.14. FLAME-like partition tracking 151

Page 156: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void SlideLockedPartitionDownDiagonal(AbstractDistMatrix<T> &ATL, Abstract-DistMatrix<T> &ATR, const Abstract-DistMatrix<T> &A00, const Abstract-DistMatrix<T> &A01, const Abstract-DistMatrix<T> &A02, const Abstract-DistMatrix<T> &A10, const AbstractDist-Matrix<T> &A11, const AbstractDistMa-trix<T> &A12, AbstractDistMatrix<T>&ABL, AbstractDistMatrix<T> &ABR,const AbstractDistMatrix<T> &A20, constAbstractDistMatrix<T> &A21, const Ab-stractDistMatrix<T> &A22)

Note that the above routines are meant to be used as:

SlidePartitionDownDiagonal( ATL, /**/ ATR, A00, A01, /**/ A02,

/**/ A10, A11, /**/ A12,

/*************/ /******************/

ABL, /**/ ABR, A20, A21, /**/ A22 );

C API

ElError ElSlidePartitionDownDiagonal i(ElMatrix i ATL, ElMatrix i ATR, ElMa-trix i A00, ElMatrix i A01, ElMatrix i A02,ElMatrix i A10, ElMatrix i A11, ElMa-trix i A12, ElMatrix i ABL, ElMatrix i ABR,ElMatrix i A20, ElMatrix i A21, ElMa-trix i A22)

ElError ElSlidePartitionDownDiagonal s(ElMatrix s ATL, ElMatrix s ATR, ElMa-trix s A00, ElMatrix s A01, ElMatrix s A02,ElMatrix s A10, ElMatrix s A11, ElMa-trix s A12, ElMatrix s ABL, ElMatrix s ABR,ElMatrix s A20, ElMatrix s A21, ElMa-trix s A22)

ElError ElSlidePartitionDownDiagonal d(ElMatrix d ATL, ElMatrix d ATR, El-Matrix d A00, ElMatrix d A01, ElMa-trix d A02, ElMatrix d A10, ElMatrix d A11,ElMatrix d A12, ElMatrix d ABL, ElMa-trix d ABR, ElMatrix d A20, ElMatrix d A21,ElMatrix d A22)

ElError ElSlidePartitionDownDiagonal c(ElMatrix c ATL, ElMatrix c ATR, ElMa-trix c A00, ElMatrix c A01, ElMatrix c A02,ElMatrix c A10, ElMatrix c A11, ElMa-trix c A12, ElMatrix c ABL, ElMatrix c ABR,ElMatrix c A20, ElMatrix c A21, ElMa-trix c A22)

152 Chapter 3. Core functionality

Page 157: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlidePartitionDownDiagonal z(ElMatrix z ATL, ElMatrix z ATR, ElMa-trix z A00, ElMatrix z A01, ElMatrix z A02,ElMatrix z A10, ElMatrix z A11, ElMa-trix z A12, ElMatrix z ABL, ElMatrix z ABR,ElMatrix z A20, ElMatrix z A21, ElMa-trix z A22)

ElError ElSlidePartitionDownDiagonalDist i(ElDistMatrix i ATL, ElDistMa-trix i ATR, ElDistMatrix i A00, El-DistMatrix i A01, ElDistMatrix i A02,ElDistMatrix i A10, ElDistMatrix i A11,ElDistMatrix i A12, ElDistMa-trix i ABL, ElDistMatrix i ABR, El-DistMatrix i A20, ElDistMatrix i A21,ElDistMatrix i A22)

ElError ElSlidePartitionDownDiagonalDist s(ElDistMatrix s ATL, ElDistMa-trix s ATR, ElDistMatrix s A00, ElDist-Matrix s A01, ElDistMatrix s A02, El-DistMatrix s A10, ElDistMatrix s A11,ElDistMatrix s A12, ElDistMa-trix s ABL, ElDistMatrix s ABR, El-DistMatrix s A20, ElDistMatrix s A21,ElDistMatrix s A22)

ElError ElSlidePartitionDownDiagonalDist d(ElDistMatrix d ATL, ElDistMa-trix d ATR, ElDistMatrix d A00, ElDist-Matrix d A01, ElDistMatrix d A02,ElDistMatrix d A10, ElDistMa-trix d A11, ElDistMatrix d A12, ElDist-Matrix d ABL, ElDistMatrix d ABR, El-DistMatrix d A20, ElDistMatrix d A21,ElDistMatrix d A22)

ElError ElSlidePartitionDownDiagonalDist c(ElDistMatrix c ATL, ElDistMa-trix c ATR, ElDistMatrix c A00, ElDist-Matrix c A01, ElDistMatrix c A02, El-DistMatrix c A10, ElDistMatrix c A11,ElDistMatrix c A12, ElDistMa-trix c ABL, ElDistMatrix c ABR, El-DistMatrix c A20, ElDistMatrix c A21,ElDistMatrix c A22)

ElError ElSlidePartitionDownDiagonalDist z(ElDistMatrix z ATL, ElDistMa-trix z ATR, ElDistMatrix z A00, El-DistMatrix z A01, ElDistMatrix z A02,ElDistMatrix z A10, ElDistMa-trix z A11, ElDistMatrix z A12, ElDist-Matrix z ABL, ElDistMatrix z ABR, El-DistMatrix z A20, ElDistMatrix z A21,ElDistMatrix z A22)

3.14. FLAME-like partition tracking 153

Page 158: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionDownDiagonal i(ElMatrix i ATL, ElMatrix i ATR,ElConstMatrix i A00, ElConstMa-trix i A01, ElConstMatrix i A02,ElConstMatrix i A10, ElConstMa-trix i A11, ElConstMatrix i A12,ElMatrix i ABL, ElMatrix i ABR,ElConstMatrix i A20, ElConstMa-trix i A21, ElConstMatrix i A22)

ElError ElSlideLockedPartitionDownDiagonal s(ElMatrix s ATL, ElMatrix s ATR,ElConstMatrix s A00, ElConstMa-trix s A01, ElConstMatrix s A02,ElConstMatrix s A10, ElConstMa-trix s A11, ElConstMatrix s A12,ElMatrix s ABL, ElMatrix s ABR,ElConstMatrix s A20, ElConstMa-trix s A21, ElConstMatrix s A22)

ElError ElSlideLockedPartitionDownDiagonal d(ElMatrix d ATL, ElMatrix d ATR,ElConstMatrix d A00, ElConstMa-trix d A01, ElConstMatrix d A02,ElConstMatrix d A10, ElConstMa-trix d A11, ElConstMatrix d A12,ElMatrix d ABL, ElMatrix d ABR,ElConstMatrix d A20, ElConstMa-trix d A21, ElConstMatrix d A22)

ElError ElSlideLockedPartitionDownDiagonal c(ElMatrix c ATL, ElMatrix c ATR,ElConstMatrix c A00, ElConstMa-trix c A01, ElConstMatrix c A02,ElConstMatrix c A10, ElConstMa-trix c A11, ElConstMatrix c A12,ElMatrix c ABL, ElMatrix c ABR,ElConstMatrix c A20, ElConstMa-trix c A21, ElConstMatrix c A22)

ElError ElSlideLockedPartitionDownDiagonal z(ElMatrix z ATL, ElMatrix z ATR,ElConstMatrix z A00, ElConstMa-trix z A01, ElConstMatrix z A02,ElConstMatrix z A10, ElConstMa-trix z A11, ElConstMatrix z A12,ElMatrix z ABL, ElMatrix z ABR,ElConstMatrix z A20, ElConstMa-trix z A21, ElConstMatrix z A22)

154 Chapter 3. Core functionality

Page 159: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionDownDiagonalDist i(ElDistMatrix i ATL, ElDist-Matrix i ATR, ElConstDist-Matrix i A00, ElConstDist-Matrix i A01, ElConstDist-Matrix i A02, ElConstDist-Matrix i A10, ElConstDist-Matrix i A11, ElConstDistMa-trix i A12, ElDistMatrix i ABL,ElDistMatrix i ABR, ElConst-DistMatrix i A20, ElConstDist-Matrix i A21, ElConstDistMa-trix i A22)

ElError ElSlideLockedPartitionDownDiagonalDist s(ElDistMatrix s ATL, ElDist-Matrix s ATR, ElConstDist-Matrix s A00, ElConstDist-Matrix s A01, ElConstDist-Matrix s A02, ElConstDist-Matrix s A10, ElConstDist-Matrix s A11, ElConstDistMa-trix s A12, ElDistMatrix s ABL,ElDistMatrix s ABR, ElConst-DistMatrix s A20, ElConstDist-Matrix s A21, ElConstDistMa-trix s A22)

ElError ElSlideLockedPartitionDownDiagonalDist d(ElDistMatrix d ATL, ElDist-Matrix d ATR, ElConstDist-Matrix d A00, ElConstDist-Matrix d A01, ElConstDist-Matrix d A02, ElConstDist-Matrix d A10, ElConstDist-Matrix d A11, ElConstDistMa-trix d A12, ElDistMatrix d ABL,ElDistMatrix d ABR, ElConst-DistMatrix d A20, ElConstDist-Matrix d A21, ElConstDistMa-trix d A22)

ElError ElSlideLockedPartitionDownDiagonalDist c(ElDistMatrix c ATL, ElDist-Matrix c ATR, ElConstDist-Matrix c A00, ElConstDist-Matrix c A01, ElConstDist-Matrix c A02, ElConstDist-Matrix c A10, ElConstDist-Matrix c A11, ElConstDistMa-trix c A12, ElDistMatrix c ABL,ElDistMatrix c ABR, ElConst-DistMatrix c A20, ElConstDist-Matrix c A21, ElConstDistMa-trix c A22)

3.14. FLAME-like partition tracking 155

Page 160: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionDownDiagonalDist z(ElDistMatrix z ATL, ElDist-Matrix z ATR, ElConstDist-Matrix z A00, ElConstDist-Matrix z A01, ElConstDist-Matrix z A02, ElConstDist-Matrix z A10, ElConstDist-Matrix z A11, ElConstDistMa-trix z A12, ElDistMatrix z ABL,ElDistMatrix z ABR, ElConst-DistMatrix z A20, ElConstDist-Matrix z A21, ElConstDistMa-trix z A22)

Up a diagonal

Simultaneously slide and merge the partition

A =

A00 A01 A02A10 A11 A12A20 A21 A22

into (

ATL ATRABL ABR

)=

A00 A01 A02

A10 A11 A12A20 A21 A22

.

C++ API

void SlidePartitionUpDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, const Ma-trix<T> &A00, const Matrix<T> &A01, const Ma-trix<T> &A02, const Matrix<T> &A10, const Ma-trix<T> &A11, const Matrix<T> &A12, Matrix<T>&ABL, Matrix<T> &ABR, const Matrix<T> &A20,const Matrix<T> &A21, const Matrix<T> &A22)

void SlideLockedPartitionUpDiagonal(Matrix<T> &ATL, Matrix<T> &ATR, constMatrix<T> &A00, const Matrix<T> &A01,const Matrix<T> &A02, const Matrix<T>&A10, const Matrix<T> &A11, const Ma-trix<T> &A12, Matrix<T> &ABL, Matrix<T>&ABR, const Matrix<T> &A20, const Ma-trix<T> &A21, const Matrix<T> &A22)

void SlidePartitionUpDiagonal(AbstractDistMatrix<T> &ATL, AbstractDistMa-trix<T> &ATR, const AbstractDistMatrix<T> &A00,const AbstractDistMatrix<T> &A01, const Abstract-DistMatrix<T> &A02, const AbstractDistMatrix<T>&A10, const AbstractDistMatrix<T> &A11, const Ab-stractDistMatrix<T> &A12, AbstractDistMatrix<T>&ABL, AbstractDistMatrix<T> &ABR, const Abstract-DistMatrix<T> &A20, const AbstractDistMatrix<T>&A21, const AbstractDistMatrix<T> &A22)

156 Chapter 3. Core functionality

Page 161: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void SlideLockedPartitionUpDiagonal(AbstractDistMatrix<T> &ATL, AbstractDist-Matrix<T> &ATR, const AbstractDistMa-trix<T> &A00, const AbstractDistMatrix<T>&A01, const AbstractDistMatrix<T> &A02,const AbstractDistMatrix<T> &A10, constAbstractDistMatrix<T> &A11, const Ab-stractDistMatrix<T> &A12, AbstractDist-Matrix<T> &ABL, AbstractDistMatrix<T>&ABR, const AbstractDistMatrix<T> &A20,const AbstractDistMatrix<T> &A21, constAbstractDistMatrix<T> &A22)

Note that the above routines are meant to be used as:

SlidePartitionUpDiagonal( ATL, /**/ ATR, A00, /**/ A01, A02,

/*************/ /******************/

/**/ A10, /**/ A11, A12,

ABL, /**/ ABR, A20, /**/ A21, A22 );

C API

ElError ElSlidePartitionUpDiagonal i(ElMatrix i ATL, ElMatrix i ATR, ElMa-trix i A00, ElMatrix i A01, ElMatrix i A02, El-Matrix i A10, ElMatrix i A11, ElMatrix i A12,ElMatrix i ABL, ElMatrix i ABR, ElMa-trix i A20, ElMatrix i A21, ElMatrix i A22)

ElError ElSlidePartitionUpDiagonal s(ElMatrix s ATL, ElMatrix s ATR, ElMa-trix s A00, ElMatrix s A01, ElMatrix s A02, El-Matrix s A10, ElMatrix s A11, ElMatrix s A12,ElMatrix s ABL, ElMatrix s ABR, ElMa-trix s A20, ElMatrix s A21, ElMatrix s A22)

ElError ElSlidePartitionUpDiagonal d(ElMatrix d ATL, ElMatrix d ATR, ElMa-trix d A00, ElMatrix d A01, ElMatrix d A02,ElMatrix d A10, ElMatrix d A11, ElMa-trix d A12, ElMatrix d ABL, ElMatrix d ABR,ElMatrix d A20, ElMatrix d A21, ElMa-trix d A22)

ElError ElSlidePartitionUpDiagonal c(ElMatrix c ATL, ElMatrix c ATR, ElMa-trix c A00, ElMatrix c A01, ElMatrix c A02, El-Matrix c A10, ElMatrix c A11, ElMatrix c A12,ElMatrix c ABL, ElMatrix c ABR, ElMa-trix c A20, ElMatrix c A21, ElMatrix c A22)

ElError ElSlidePartitionUpDiagonal z(ElMatrix z ATL, ElMatrix z ATR, ElMa-trix z A00, ElMatrix z A01, ElMatrix z A02, El-Matrix z A10, ElMatrix z A11, ElMatrix z A12,ElMatrix z ABL, ElMatrix z ABR, ElMa-trix z A20, ElMatrix z A21, ElMatrix z A22)

3.14. FLAME-like partition tracking 157

Page 162: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlidePartitionUpDiagonalDist i(ElDistMatrix i ATL, ElDistMatrix i ATR,ElDistMatrix i A00, ElDistMatrix i A01,ElDistMatrix i A02, ElDistMatrix i A10,ElDistMatrix i A11, ElDistMatrix i A12,ElDistMatrix i ABL, ElDistMatrix i ABR,ElDistMatrix i A20, ElDistMatrix i A21,ElDistMatrix i A22)

ElError ElSlidePartitionUpDiagonalDist s(ElDistMatrix s ATL, ElDistMatrix s ATR,ElDistMatrix s A00, ElDistMatrix s A01,ElDistMatrix s A02, ElDistMatrix s A10,ElDistMatrix s A11, ElDistMatrix s A12,ElDistMatrix s ABL, ElDistMatrix s ABR,ElDistMatrix s A20, ElDistMatrix s A21,ElDistMatrix s A22)

ElError ElSlidePartitionUpDiagonalDist d(ElDistMatrix d ATL, ElDistMatrix d ATR,ElDistMatrix d A00, ElDistMatrix d A01,ElDistMatrix d A02, ElDistMatrix d A10,ElDistMatrix d A11, ElDistMatrix d A12,ElDistMatrix d ABL, ElDistMatrix d ABR,ElDistMatrix d A20, ElDistMatrix d A21,ElDistMatrix d A22)

ElError ElSlidePartitionUpDiagonalDist c(ElDistMatrix c ATL, ElDistMatrix c ATR,ElDistMatrix c A00, ElDistMatrix c A01,ElDistMatrix c A02, ElDistMatrix c A10,ElDistMatrix c A11, ElDistMatrix c A12,ElDistMatrix c ABL, ElDistMatrix c ABR,ElDistMatrix c A20, ElDistMatrix c A21,ElDistMatrix c A22)

ElError ElSlidePartitionUpDiagonalDist z(ElDistMatrix z ATL, ElDistMatrix z ATR,ElDistMatrix z A00, ElDistMatrix z A01,ElDistMatrix z A02, ElDistMatrix z A10,ElDistMatrix z A11, ElDistMatrix z A12,ElDistMatrix z ABL, ElDistMatrix z ABR,ElDistMatrix z A20, ElDistMatrix z A21,ElDistMatrix z A22)

ElError ElSlideLockedPartitionUpDiagonal i(ElMatrix i ATL, ElMatrix i ATR, ElCon-stMatrix i A00, ElConstMatrix i A01,ElConstMatrix i A02, ElConstMa-trix i A10, ElConstMatrix i A11,ElConstMatrix i A12, ElMatrix i ABL,ElMatrix i ABR, ElConstMatrix i A20,ElConstMatrix i A21, ElConstMa-trix i A22)

158 Chapter 3. Core functionality

Page 163: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionUpDiagonal s(ElMatrix s ATL, ElMatrix s ATR,ElConstMatrix s A00, ElConstMa-trix s A01, ElConstMatrix s A02,ElConstMatrix s A10, ElConstMa-trix s A11, ElConstMatrix s A12,ElMatrix s ABL, ElMatrix s ABR,ElConstMatrix s A20, ElConstMa-trix s A21, ElConstMatrix s A22)

ElError ElSlideLockedPartitionUpDiagonal d(ElMatrix d ATL, ElMatrix d ATR,ElConstMatrix d A00, ElConstMa-trix d A01, ElConstMatrix d A02,ElConstMatrix d A10, ElConstMa-trix d A11, ElConstMatrix d A12,ElMatrix d ABL, ElMatrix d ABR,ElConstMatrix d A20, ElConstMa-trix d A21, ElConstMatrix d A22)

ElError ElSlideLockedPartitionUpDiagonal c(ElMatrix c ATL, ElMatrix c ATR,ElConstMatrix c A00, ElConstMa-trix c A01, ElConstMatrix c A02,ElConstMatrix c A10, ElConstMa-trix c A11, ElConstMatrix c A12,ElMatrix c ABL, ElMatrix c ABR,ElConstMatrix c A20, ElConstMa-trix c A21, ElConstMatrix c A22)

ElError ElSlideLockedPartitionUpDiagonal z(ElMatrix z ATL, ElMatrix z ATR,ElConstMatrix z A00, ElConstMa-trix z A01, ElConstMatrix z A02,ElConstMatrix z A10, ElConstMa-trix z A11, ElConstMatrix z A12,ElMatrix z ABL, ElMatrix z ABR,ElConstMatrix z A20, ElConstMa-trix z A21, ElConstMatrix z A22)

ElError ElSlideLockedPartitionUpDiagonalDist i(ElDistMatrix i ATL, ElDist-Matrix i ATR, ElConstDist-Matrix i A00, ElConstDist-Matrix i A01, ElConstDist-Matrix i A02, ElConstDist-Matrix i A10, ElConstDist-Matrix i A11, ElConstDistMa-trix i A12, ElDistMatrix i ABL,ElDistMatrix i ABR, ElConst-DistMatrix i A20, ElConstDist-Matrix i A21, ElConstDistMa-trix i A22)

3.14. FLAME-like partition tracking 159

Page 164: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSlideLockedPartitionUpDiagonalDist s(ElDistMatrix s ATL, ElDist-Matrix s ATR, ElConstDist-Matrix s A00, ElConstDistMa-trix s A01, ElConstDistMa-trix s A02, ElConstDistMa-trix s A10, ElConstDistMa-trix s A11, ElConstDistMa-trix s A12, ElDistMatrix s ABL,ElDistMatrix s ABR, ElConst-DistMatrix s A20, ElConstDist-Matrix s A21, ElConstDistMa-trix s A22)

ElError ElSlideLockedPartitionUpDiagonalDist d(ElDistMatrix d ATL, ElDist-Matrix d ATR, ElConstDist-Matrix d A00, ElConstDistMa-trix d A01, ElConstDistMa-trix d A02, ElConstDistMa-trix d A10, ElConstDistMa-trix d A11, ElConstDistMa-trix d A12, ElDistMatrix d ABL,ElDistMatrix d ABR, ElConst-DistMatrix d A20, ElConstDist-Matrix d A21, ElConstDistMa-trix d A22)

ElError ElSlideLockedPartitionUpDiagonalDist c(ElDistMatrix c ATL, ElDist-Matrix c ATR, ElConstDist-Matrix c A00, ElConstDistMa-trix c A01, ElConstDistMa-trix c A02, ElConstDistMa-trix c A10, ElConstDistMa-trix c A11, ElConstDistMa-trix c A12, ElDistMatrix c ABL,ElDistMatrix c ABR, ElConst-DistMatrix c A20, ElConstDist-Matrix c A21, ElConstDistMa-trix c A22)

ElError ElSlideLockedPartitionUpDiagonalDist z(ElDistMatrix z ATL, ElDist-Matrix z ATR, ElConstDist-Matrix z A00, ElConstDistMa-trix z A01, ElConstDistMa-trix z A02, ElConstDistMa-trix z A10, ElConstDistMa-trix z A11, ElConstDistMa-trix z A12, ElDistMatrix z ABL,ElDistMatrix z ABR, ElConst-DistMatrix z A20, ElConstDist-Matrix z A21, ElConstDistMa-trix z A22)

160 Chapter 3. Core functionality

Page 165: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

FOUR

BLAS-LIKE LINEAR ALGEBRA

This chapter describes Elemental’s support for basic linear algebra routines, such as matrix-matrix multiplication, triangular solves, and matrix-vector multiplication. Most of these rou-tines have counterparts in the Basic Linear Algebra Subprograms (BLAS).

4.1 Level 1

The prototypes for the following routines can be found at include/El/blas like/level1.hpp,while the implementations are in src/blas like/level1/.

4.1.1 Adjoint

B := AH.

C++ API

void Adjoint(const Matrix<T> &A, Matrix<T> &B)

void Adjoint(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &B)

void Adjoint(const SparseMatrix<T> &A, SparseMatrix<T> &B)

void Adjoint(const DistSparseMatrix<T> &A, DistSparseMatrix<T> &B)

C API

ElError ElAdjoint c(ElConstMatrix c A, ElMatrix c B)

ElError ElAdjoint z(ElConstMatrix z A, ElMatrix z B)

ElError ElAdjointDist c(ElConstDistMatrix c A, ElDistMatrix c B)

ElError ElAdjointDist z(ElConstDistMatrix z A, ElDistMatrix z B)

ElError ElAdjointSparse c(ElConstSparseMatrix c A, ElSparseMatrix c B)

ElError ElAdjointSparse z(ElConstSparseMatrix z A, ElSparseMatrix z B)

ElError ElAdjointDistSparse c(ElConstDistSparseMatrix c A, ElDistSparseMatrix c B)

ElError ElAdjointDistSparse z(ElConstDistSparseMatrix z A, ElDistSparseMa-trix z B)

161

Page 166: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Adjoint(A, B)

4.1.2 AdjointContract

Perform B := ∑i AHi , where the summation is performed over the local data of each mem-

ber of the process team that was redundantly assigned entries of A but is not redundantlyassigned entries of B. Thus, in the general case where each column and row of A is respec-tively distributed over the process sets U0 × U1 and V0 × V1, while each column and row of Bis respectively distributed over U0 and V0, then the result is of the form

B = ∑i∈U1×V1

AHi .

C++ API

void AdjointContract(const ElementalMatrix<T> &A, ElementalMatrix<T> &B)

void AdjointContract(const BlockMatrix<T> &A, BlockMatrix<T> &B)

C API

TODO

Python API

TODO

4.1.3 AdjointAxpy

Performs Y := αXH + Y (hence the name axpy).

C++ API

void AdjointAxpy(S alpha, const Matrix<T> &X, Matrix<T> &Y)

void AdjointAxpy(S alpha, const AbstractDistMatrix<T> &X, AbstractDistMatrix<T>&Y)

void AdjointAxpy(S alpha, const SparseMatrix<T> &X, SparseMatrix<T> &Y)

void AdjointAxpy(S alpha, const DistSparseMatrix<T> &X, DistSparseMatrix<T> &Y)

adjoint axpy namespace

TODO

162 Chapter 4. BLAS-like linear algebra

Page 167: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElAdjointAxpy c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAdjointAxpy z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAdjointAxpyDist c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAdjointAxpyDist z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAdjointAxpySparse c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAdjointAxpySparse z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAdjointAxpyDistSparse c(complex float alpha, ElConstMatrix c X, ElMa-trix c Y)

ElError ElAdjointAxpyDistSparse z(complex double alpha, ElConstMatrix z X, ElMa-trix z Y)

Python API

AdjointAxpy(alpha, X, Y)

4.1.4 AdjointAxpyContract

Perform B := α ∑i AHi + B, where the summation is performed over the local data of each

member of the process team that was redundantly assigned entries of A but is not redundantlyassigned entries of B. Thus, in the general case where each column and row of A is respectivelydistributed over the process sets U0 × U1 and V0 × V1, while each column and row of B isrespectively distributed over U0 and V0, then the result is of the form

B := α ∑i∈U1×V1

AHi + B.

C++ API

void AdjointAxpyContract(T alpha, const ElementalMatrix<T> &A, ElementalMa-trix<T> &B)

void AdjointAxpyContract(T alpha, const BlockMatrix<T> &A, BlockMatrix<T> &B)

C API

TODO

Python API

TODO

4.1. Level 1 163

Page 168: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.1.5 AllReduce

Perform an (MPI) AllReduce over the contents of a matrix stored on different process (whichoverwrites every process’s input with the summation over all process’s copies).

C++ API

void AllReduce(Matrix<T> &A, mpi::Comm comm, mpi::Op op = mpi::SUM)

void AllReduce(AbstractDistMatrix<T> &A, mpi::Comm comm, mpi::Op op = mpi::SUM)

C API

TODO

Python API

TODO

4.1.6 Axpy

Update a matrix Y with αX, i.e.,

Y := αX + Y,

which is the reason for the name axpy: “alpha X plus Y”.

C++ API

void Axpy(S alpha, const Matrix<T> &X, Matrix<T> &Y)

void Axpy(S alpha, const AbstractDistMatrix<T> &X, AbstractDistMatrix<T> &Y)

void Axpy(S alpha, const SparseMatrix<T> &X, SparseMatrix<T> &Y)

void Axpy(S alpha, const DistSparseMatrix<T> &X, DistSparseMatrix<T> &Y)

void Axpy(T alpha, const DistMultiVec<T> &X, DistMultiVec<T> &Y)

C API

ElError ElAxpy i(ElInt alpha, ElConstMatrix i X, ElMatrix i Y)

ElError ElAxpy s(float alpha, ElConstMatrix s X, ElMatrix s Y)

ElError ElAxpy d(double alpha, ElConstMatrix d X, ElMatrix d Y)

ElError ElAxpy c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAxpy z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAxpyDist i(ElInt alpha, ElConstMatrix i X, ElMatrix i Y)

164 Chapter 4. BLAS-like linear algebra

Page 169: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElAxpyDist s(float alpha, ElConstMatrix s X, ElMatrix s Y)

ElError ElAxpyDist d(double alpha, ElConstMatrix d X, ElMatrix d Y)

ElError ElAxpyDist c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAxpyDist z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAxpySparse i(ElInt alpha, ElConstMatrix i X, ElMatrix i Y)

ElError ElAxpySparse s(float alpha, ElConstMatrix s X, ElMatrix s Y)

ElError ElAxpySparse d(double alpha, ElConstMatrix d X, ElMatrix d Y)

ElError ElAxpySparse c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAxpySparse z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAxpyDistSparse i(ElInt alpha, ElConstMatrix i X, ElMatrix i Y)

ElError ElAxpyDistSparse s(float alpha, ElConstMatrix s X, ElMatrix s Y)

ElError ElAxpyDistSparse d(double alpha, ElConstMatrix d X, ElMatrix d Y)

ElError ElAxpyDistSparse c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAxpyDistSparse z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

ElError ElAxpyDistMultiVec i(ElInt alpha, ElConstMatrix i X, ElMatrix i Y)

ElError ElAxpyDistMultiVec s(float alpha, ElConstMatrix s X, ElMatrix s Y)

ElError ElAxpyDistMultiVec d(double alpha, ElConstMatrix d X, ElMatrix d Y)

ElError ElAxpyDistMultiVec c(complex float alpha, ElConstMatrix c X, ElMatrix c Y)

ElError ElAxpyDistMultiVec z(complex double alpha, ElConstMatrix z X, ElMatrix z Y)

Python API

Axpy(alpha, X, Y)

4.1.7 AxpyTrapezoid

Performs the trapezoidal portion of an axpy Y := αX + Y; the trapezoid is defined by theuplo and offset parameters, where offset determines which sub or superdiagonal to use asthe cutoff for the upper or lower-trapezoidal portion of the update. Elemental uses the sameconvention as MATLAB and Octave for labeling the diagonals: an offset of zero corresponds tothe main diagonal and will produce a triangular matrix, and an offset of 1 corresponds to thesuperdiagonal which, combined with uplo=LOWER, would produce a lower-Hessenberg matrix.

C++ API

void AxpyTrapezoid(UpperOrLower uplo, S alpha, const Matrix<T> &X, Matrix<T> &Y,Int offset = 0)

void AxpyTrapezoid(UpperOrLower uplo, S alpha, const AbstractDistMatrix<T> &X, Ab-stractDistMatrix<T> &Y, Int offset = 0)

4.1. Level 1 165

Page 170: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void AxpyTrapezoid(UpperOrLower uplo, S alpha, const SparseMatrix<T> &X, SparseMa-trix<T> &Y, Int offset = 0)

void AxpyTrapezoid(UpperOrLower uplo, S alpha, const DistSparseMatrix<T> &X,DistSparseMatrix<T> &Y, Int offset = 0)

C API

ElError ElAxpyTrapezoid i(UpperOrLower uplo, ElInt alpha, ElConstMatrix i X, ElMa-trix i Y, ElInt offset)

ElError ElAxpyTrapezoid s(UpperOrLower uplo, float alpha, ElConstMatrix s X, ElMa-trix s Y, ElInt offset)

ElError ElAxpyTrapezoid d(UpperOrLower uplo, double alpha, ElConstMatrix d X, El-Matrix d Y, ElInt offset)

ElError ElAxpyTrapezoid c(UpperOrLower uplo, complex float alpha, ElConstMatrix c X,ElMatrix c Y, ElInt offset)

ElError ElAxpyTrapezoid z(UpperOrLower uplo, complex double alpha, ElConstMa-trix z X, ElMatrix z Y, ElInt offset)

ElError ElAxpyTrapezoidDist i(UpperOrLower uplo, ElInt alpha, ElConstMatrix i X, El-Matrix i Y, ElInt offset)

ElError ElAxpyTrapezoidDist s(UpperOrLower uplo, float alpha, ElConstMatrix s X, El-Matrix s Y, ElInt offset)

ElError ElAxpyTrapezoidDist d(UpperOrLower uplo, double alpha, ElConstMatrix d X,ElMatrix d Y, ElInt offset)

ElError ElAxpyTrapezoidDist c(UpperOrLower uplo, complex float alpha, ElConstMa-trix c X, ElMatrix c Y, ElInt offset)

ElError ElAxpyTrapezoidDist z(UpperOrLower uplo, complex double alpha, ElConstMa-trix z X, ElMatrix z Y, ElInt offset)

ElError ElAxpyTrapezoidSparse i(UpperOrLower uplo, ElInt alpha, ElConstMatrix i X,ElMatrix i Y, ElInt offset)

ElError ElAxpyTrapezoidSparse s(UpperOrLower uplo, float alpha, ElConstMatrix s X,ElMatrix s Y, ElInt offset)

ElError ElAxpyTrapezoidSparse d(UpperOrLower uplo, double alpha, ElConstMa-trix d X, ElMatrix d Y, ElInt offset)

ElError ElAxpyTrapezoidSparse c(UpperOrLower uplo, complex float alpha, ElConstMa-trix c X, ElMatrix c Y, ElInt offset)

ElError ElAxpyTrapezoidSparse z(UpperOrLower uplo, complex double alpha, ElConst-Matrix z X, ElMatrix z Y, ElInt offset)

ElError ElAxpyTrapezoidDistSparse i(UpperOrLower uplo, ElInt alpha, ElConstMa-trix i X, ElMatrix i Y, ElInt offset)

ElError ElAxpyTrapezoidDistSparse s(UpperOrLower uplo, float alpha, ElConstMa-trix s X, ElMatrix s Y, ElInt offset)

ElError ElAxpyTrapezoidDistSparse d(UpperOrLower uplo, double alpha, ElConstMa-trix d X, ElMatrix d Y, ElInt offset)

166 Chapter 4. BLAS-like linear algebra

Page 171: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElAxpyTrapezoidDistSparse c(UpperOrLower uplo, complex float alpha, ElCon-stMatrix c X, ElMatrix c Y, ElInt offset)

ElError ElAxpyTrapezoidDistSparse z(UpperOrLower uplo, complex double alpha, El-ConstMatrix z X, ElMatrix z Y, ElInt offset)

Python API

AxpyTrapezoid(uplo, alpha, X, Y, offset=0)

4.1.8 Broadcast

Give every process in the specified communicator a copy of the matrix stored on the processwith the given rank.

C++ API

void Broadcast(Matrix<T> &A, mpi::Comm comm, int rank = 0)

void Broadcast(AbstractDistMatrix<T> &A, mpi::Comm comm, int rank = 0)

C API

TODO

Python API

TODO

4.1.9 Conjugate

Depending upon whether one or two matrices are given, either conjugate the single matrix orset the second matrix equal to the conjugate of the first, i.e., either A := A or B := A. For realdatatypes, this is a no-op.

C++ API

A := A

void Conjugate(Matrix<T> &A)

void Conjugate(AbstractDistMatrix<T> &A)

B := A

void Conjugate(const Matrix<T> &A, Matrix<T> &B)

void Conjugate(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &B)

4.1. Level 1 167

Page 172: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElConjugate c(ElMatrix c A)

ElError ElConjugate z(ElMatrix z A)

ElError ElConjugateDist c(ElDistMatrix c A)

ElError ElConjugateDist z(ElDistMatrix z A)

Python API

Conjugate(A)

4.1.10 ConjugateDiagonal

Conjugate a specified diagonal of a matrix.

C++ API

void ConjugateDiagonal(Matrix<T> &A, Int offset = 0)

void ConjugateDiagonal(AbstractDistMatrix<T> &A, Int offset = 0)

C API

TODO

Python API

TODO

4.1.11 ConjugateSubmatrix

Conjugate a specific submatrix.

C++ API

void ConjugateSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J)

void ConjugateSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J)

C API

TODO

168 Chapter 4. BLAS-like linear algebra

Page 173: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

TODO

4.1.12 Copy

Sets Y := X.

C++ API

void Copy(const Matrix<S> &X, Matrix<T> &Y)

void Copy(const AbstractDistMatrix<S> &A, AbstractDistMatrix<T> &B)

void CopyFromRoot(const Matrix<T> &A, DistMatrix<T, CIRC, CIRC> &B, bool includ-ingViewers = false)

void CopyFromNonRoot(DistMatrix<T, CIRC, CIRC> &B, bool includingViewers = false)

void Copy(const SparseMatrix<S> &A, SparseMatrix<T> &B)

void Copy(const SparseMatrix<S> &A, Matrix<T> &B)

void Copy(const DistSparseMatrix<S> &A, DistSparseMatrix<T> &B)

void Copy(const DistSparseMatrix<S> &A, AbstractDistMatrix<T> &B)

void Copy(const DistMultiVec<T> &A, DistMultiVec<T> &B)

void Copy(const DistMultiVec<T> &A, AbstractDistMatrix<T> &B)

void Copy(const AbstractDistMatrix<T> &A, DistMultiVec<T> &B)

void CopyFromRoot(const DistSparseMatrix<T> &ADist, SparseMatrix<T> &A)

void CopyFromNonRoot(const DistSparseMatrix<T> &ADist, int root = 0)

void CopyFromRoot(const DistMultiVec<T> &XDist, Matrix<T> &X)

void CopyFromNonRoot(const DistMultiVec<T> &XDist, int root = 0)

void Copy(const Graph &A, Graph &B)

void Copy(const Graph &A, DistGraph &B)

void Copy(const DistGraph &A, Graph &B)

void Copy(const DistGraph &A, DistGraph &B)

void CopyFromRoot(const DistGraph &distGraph, Graph &graph)

void CopyFromNonRoot(const DistGraph &distGraph, int root = 0)

copy namespace

TODO

4.1. Level 1 169

Page 174: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElCopy i(ElConstMatrix i X, ElMatrix i Y)

ElError ElCopy s(ElConstMatrix s X, ElMatrix s Y)

ElError ElCopy d(ElConstMatrix d X, ElMatrix d Y)

ElError ElCopy c(ElConstMatrix c X, ElMatrix c Y)

ElError ElCopy z(ElConstMatrix z X, ElMatrix z Y)

ElError ElCopyDist i(ElConstDistMatrix i X, ElDistMatrix i Y)

ElError ElCopyDist s(ElConstDistMatrix s X, ElDistMatrix s Y)

ElError ElCopyDist d(ElConstDistMatrix d X, ElDistMatrix d Y)

ElError ElCopyDist c(ElConstDistMatrix c X, ElDistMatrix c Y)

ElError ElCopyDist z(ElConstDistMatrix z X, ElDistMatrix z Y)

ElError ElCopySparse i(ElConstSparseMatrix i X, ElSparseMatrix i Y)

ElError ElCopySparse s(ElConstSparseMatrix s X, ElSparseMatrix s Y)

ElError ElCopySparse d(ElConstSparseMatrix d X, ElSparseMatrix d Y)

ElError ElCopySparse c(ElConstSparseMatrix c X, ElSparseMatrix c Y)

ElError ElCopySparse z(ElConstSparseMatrix z X, ElSparseMatrix z Y)

ElError ElCopyDistSparse i(ElConstDistSparseMatrix i X, ElDistSparseMatrix i Y)

ElError ElCopyDistSparse s(ElConstDistSparseMatrix s X, ElDistSparseMatrix s Y)

ElError ElCopyDistSparse d(ElConstDistSparseMatrix d X, ElDistSparseMatrix d Y)

ElError ElCopyDistSparse c(ElConstDistSparseMatrix c X, ElDistSparseMatrix c Y)

ElError ElCopyDistSparse z(ElConstDistSparseMatrix z X, ElDistSparseMatrix z Y)

ElError ElCopyDistMultiVec i(ElConstDistMultiVec i A, ElDistMultiVec i B)

ElError ElCopyDistMultiVec s(ElConstDistMultiVec s A, ElDistMultiVec s B)

ElError ElCopyDistMultiVec d(ElConstDistMultiVec d A, ElDistMultiVec d B)

ElError ElCopyDistMultiVec c(ElConstDistMultiVec c A, ElDistMultiVec c B)

ElError ElCopyDistMultiVec z(ElConstDistMultiVec z A, ElDistMultiVec z B)

ElError ElCopySparseToDense i(ElConstSparseMatrix i A, ElMatrix i B)

ElError ElCopySparseToDense s(ElConstSparseMatrix s A, ElMatrix s B)

ElError ElCopySparseToDense d(ElConstSparseMatrix d A, ElMatrix d B)

ElError ElCopySparseToDense c(ElConstSparseMatrix c A, ElMatrix c B)

ElError ElCopySparseToDense z(ElConstSparseMatrix z A, ElMatrix z B)

ElError ElCopyDistSparseToDense i(ElConstDistSparseMatrix i A, ElSparseMatrix i B)

ElError ElCopyDistSparseToDense s(ElConstDistSparseMatrix s A, ElSparseMa-trix s B)

170 Chapter 4. BLAS-like linear algebra

Page 175: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElCopyDistSparseToDense d(ElConstDistSparseMatrix d A, ElSparseMa-trix d B)

ElError ElCopyDistSparseToDense c(ElConstDistSparseMatrix c A, ElSparseMa-trix c B)

ElError ElCopyDistSparseToDense z(ElConstDistSparseMatrix z A, ElSparseMa-trix z B)

ElError ElCopySparseMatrixFromRoot i(ElConstDistSparseMatrix i ADist, ElSparse-Matrix i A)

ElError ElCopySparseMatrixFromRoot s(ElConstDistSparseMatrix s ADist, ElSparse-Matrix s A)

ElError ElCopySparseMatrixFromRoot d(ElConstDistSparseMatrix d ADist, ElSparse-Matrix d A)

ElError ElCopySparseMatrixFromRoot c(ElConstDistSparseMatrix c ADist, ElSparse-Matrix c A)

ElError ElCopySparseMatrixFromRoot z(ElConstDistSparseMatrix z ADist, ElSparse-Matrix z A)

ElError ElCopySparseMatrixFromNonRoot i(ElConstDistSparseMatrix i ADist, int root)

ElError ElCopySparseMatrixFromNonRoot s(ElConstDistSparseMatrix s ADist, int root)

ElError ElCopySparseMatrixFromNonRoot d(ElConstDistSparseMatrix d ADist, int root)

ElError ElCopySparseMatrixFromNonRoot c(ElConstDistSparseMatrix c ADist, int root)

ElError ElCopySparseMatrixFromNonRoot z(ElConstDistSparseMatrix z ADist, int root)

ElError ElCopyMultiVecFromRoot i(ElConstDistMultiVec i XDist, ElMatrix i X)

ElError ElCopyMultiVecFromRoot s(ElConstDistMultiVec s XDist, ElMatrix s X)

ElError ElCopyMultiVecFromRoot d(ElConstDistMultiVec d XDist, ElMatrix d X)

ElError ElCopyMultiVecFromRoot c(ElConstDistMultiVec c XDist, ElMatrix c X)

ElError ElCopyMultiVecFromRoot z(ElConstDistMultiVec z XDist, ElMatrix z X)

ElError ElCopyMultiVecFromNonRoot i(ElConstDistMultiVec i XDist, int root)

ElError ElCopyMultiVecFromNonRoot s(ElConstDistMultiVec s XDist, int root)

ElError ElCopyMultiVecFromNonRoot d(ElConstDistMultiVec d XDist, int root)

ElError ElCopyMultiVecFromNonRoot c(ElConstDistMultiVec c XDist, int root)

ElError ElCopyMultiVecFromNonRoot z(ElConstDistMultiVec z XDist, int root)

ElError ElCopyGraph(ElConstGraph A, ElGraph B)

ElError ElCopyDistGraph(ElConstDistGraph A, ElDistGraph B)

ElError ElCopyGraphFromRoot(ElConstDistGraph distGraph, ElGraph graph)

ElError ElCopyGraphFromNonRoot(ElConstDistGraph distGraph, int root)

Python API

Copy(X, Y)

4.1. Level 1 171

Page 176: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

CopyFromRoot(ADist, ASeq)

CopyFromNonRoot(ADist, root=0)

4.1.13 DiagonalScale

Performs either X := op(D)X or X := Xop(D), where op(D) equals D = DT, or DH = D,where D = diag(d) and d is a column vector.

C++ API

void DiagonalScale(LeftOrRight side, Orientation orientation, const Matrix<TDiag> &d,Matrix<T> &X)

void DiagonalScale(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<TDiag> &d, AbstractDistMatrix<T> &X)

void DiagonalScale(LeftOrRight side, Orientation orientation, const Matrix<TDiag> &d,SparseMatrix<T> &X)

void DiagonalScale(LeftOrRight side, Orientation orientation, const DistMulti-Vec<TDiag> &d, DistSparseMatrix<T> &X)

void DiagonalScale(Orientation orientation, const DistMultiVec<TDiag> &d, DistMulti-Vec<T> &X)

C API

ElError ElDiagonalScale i(ElLeftOrRight side, ElConstMatrix i d, ElMatrix i X)

ElError ElDiagonalScale s(ElLeftOrRight side, ElConstMatrix s d, ElMatrix s X)

ElError ElDiagonalScale d(ElLeftOrRight side, ElConstMatrix d d, ElMatrix d X)

ElError ElDiagonalScale c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c d, ElMatrix c X)

ElError ElDiagonalScale z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z d, ElMatrix z X)

ElError ElDiagonalScaleDist i(ElLeftOrRight side, ElConstDistMatrix i d, ElDistMa-trix i X)

ElError ElDiagonalScaleDist s(ElLeftOrRight side, ElConstDistMatrix s d, ElDistMa-trix s X)

ElError ElDiagonalScaleDist d(ElLeftOrRight side, ElConstDistMatrix d d, ElDistMa-trix d X)

ElError ElDiagonalScaleDist c(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix c d, ElDistMatrix c X)

ElError ElDiagonalScaleDist z(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix z d, ElDistMatrix z X)

ElError ElDiagonalScaleSparse i(ElLeftOrRight side, ElConstMatrix i d, ElSparseMa-trix i X)

ElError ElDiagonalScaleSparse s(ElLeftOrRight side, ElConstMatrix s d, ElSparseMa-trix s X)

172 Chapter 4. BLAS-like linear algebra

Page 177: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElDiagonalScaleSparse d(ElLeftOrRight side, ElConstMatrix d d, ElSparseMa-trix d X)

ElError ElDiagonalScaleSparse c(ElLeftOrRight side, ElOrientation orientation, ElConst-Matrix c d, ElSparseMatrix c X)

ElError ElDiagonalScaleSparse z(ElLeftOrRight side, ElOrientation orientation, ElConst-Matrix z d, ElSparseMatrix z X)

ElError ElDiagonalScaleDistSparse i(ElLeftOrRight side, ElConstDistMultiVec i d, El-DistSparseMatrix i X)

ElError ElDiagonalScaleDistSparse s(ElLeftOrRight side, ElConstDistMultiVec s d, El-DistSparseMatrix s X)

ElError ElDiagonalScaleDistSparse d(ElLeftOrRight side, ElConstDistMultiVec d d, El-DistSparseMatrix d X)

ElError ElDiagonalScaleDistSparse c(ElLeftOrRight side, ElOrientation orientation,ElConstDistMultiVec c d, ElDistSparseMa-trix c X)

ElError ElDiagonalScaleDistSparse z(ElLeftOrRight side, ElOrientation orientation,ElConstDistMultiVec z d, ElDistSparseMa-trix z X)

Python API

DiagonalScale(side, orient, d, X)

4.1.14 DiagonalScaleTrapezoid

Performs either A := op(D)A or A := Aop(D), where A is trapezoidal (upper or lower withthe boundary diagonal of given offset), op(D) equals D = DT, or DH = D, where D = diag(d)and d is a column vector.

C++ API

void DiagonalScaleTrapezoid(LeftOrRight side, UpperOrLower uplo, Orientation orienta-tion, const Matrix<TDiag> &d, Matrix<T> &A, Int offset= 0)

void DiagonalScaleTrapezoid(LeftOrRight side, UpperOrLower uplo, Orientation orien-tation, const AbstractDistMatrix<TDiag> &d, Abstract-DistMatrix<T> &A, Int offset = 0)

void DiagonalScaleTrapezoid(LeftOrRight side, UpperOrLower uplo, Orientation orienta-tion, const Matrix<TDiag> &d, SparseMatrix<T> &A,Int offset = 0)

void DiagonalScaleTrapezoid(LeftOrRight side, UpperOrLower uplo, Orientation orien-tation, const DistMultiVec<TDiag> &d, DistSparseMa-trix<T> &A, Int offset = 0)

4.1. Level 1 173

Page 178: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElDiagonalScaleTrapezoid i(ElLeftOrRight side, ElUpperOrLower uplo, ElConst-Matrix i d, ElMatrix i X, ElInt offset)

ElError ElDiagonalScaleTrapezoid s(ElLeftOrRight side, ElUpperOrLower uplo, ElConst-Matrix s d, ElMatrix s X, ElInt offset)

ElError ElDiagonalScaleTrapezoid d(ElLeftOrRight side, ElUpperOrLower uplo, ElConst-Matrix d d, ElMatrix d X, ElInt offset)

ElError ElDiagonalScaleTrapezoid c(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstMatrix c d, ElMa-trix c X, ElInt offset)

ElError ElDiagonalScaleTrapezoid z(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstMatrix z d, ElMa-trix z X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDist i(ElLeftOrRight side, ElUpperOrLower uplo,ElConstDistMatrix i d, ElDistMatrix i X,ElInt offset)

ElError ElDiagonalScaleTrapezoidDist s(ElLeftOrRight side, ElUpperOrLower uplo,ElConstDistMatrix s d, ElDistMatrix s X,ElInt offset)

ElError ElDiagonalScaleTrapezoidDist d(ElLeftOrRight side, ElUpperOrLower uplo,ElConstDistMatrix d d, ElDistMatrix d X,ElInt offset)

ElError ElDiagonalScaleTrapezoidDist c(ElLeftOrRight side, ElUpperOrLower uplo,ElOrientation orientation, ElConstDistMa-trix c d, ElDistMatrix c X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDist z(ElLeftOrRight side, ElUpperOrLower uplo,ElOrientation orientation, ElConstDistMa-trix z d, ElDistMatrix z X, ElInt offset)

ElError ElDiagonalScaleTrapezoidSparse i(ElLeftOrRight side, ElUpperOrLower uplo,ElConstMatrix i d, ElSparseMatrix i X,ElInt offset)

ElError ElDiagonalScaleTrapezoidSparse s(ElLeftOrRight side, ElUpperOrLower uplo,ElConstMatrix s d, ElSparseMatrix s X,ElInt offset)

ElError ElDiagonalScaleTrapezoidSparse d(ElLeftOrRight side, ElUpperOrLower uplo,ElConstMatrix d d, ElSparseMatrix d X,ElInt offset)

ElError ElDiagonalScaleTrapezoidSparse c(ElLeftOrRight side, ElUpperOrLower uplo,ElOrientation orientation, ElConstMa-trix c d, ElSparseMatrix c X, ElInt offset)

ElError ElDiagonalScaleTrapezoidSparse z(ElLeftOrRight side, ElUpperOrLower uplo,ElOrientation orientation, ElConstMa-trix z d, ElSparseMatrix z X, ElInt offset)

174 Chapter 4. BLAS-like linear algebra

Page 179: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElDiagonalScaleTrapezoidDistSparse i(ElLeftOrRight side, ElUpperOr-Lower uplo, ElConstDistMultiVec i d,ElDistSparseMatrix i X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDistSparse s(ElLeftOrRight side, ElUpperOr-Lower uplo, ElConstDistMultiVec s d,ElDistSparseMatrix s X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDistSparse d(ElLeftOrRight side, ElUpperOr-Lower uplo, ElConstDistMultiVec d d,ElDistSparseMatrix d X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDistSparse c(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMultiVec c d, ElD-istSparseMatrix c X, ElInt offset)

ElError ElDiagonalScaleTrapezoidDistSparse z(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMultiVec z d, ElD-istSparseMatrix z X, ElInt offset)

Python API

DiagonalScaleTrapezoid(side, uplo, d, X, offset=0)

4.1.15 DiagonalSolve

Performs either X := op(D)−1X or X := Xop(D)−1, where D = diag(d) and d is a columnvector.

C++ API

void DiagonalSolve(LeftOrRight side, Orientation orientation, const Matrix<FDiag> &d,Matrix<F> &X, bool checkIfSingular = true)

void DiagonalSolve(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<FDiag> &d, AbstractDistMatrix<F> &X, bool checkIfSingular= true)

void DiagonalSolve(LeftOrRight side, Orientation orientation, const Matrix<FDiag> &d,SparseMatrix<F> &X, bool checkIfSingular = true)

void DiagonalSolve(LeftOrRight side, Orientation orientation, const DistMulti-Vec<FDiag> &d, DistSparseMatrix<F> &X, bool checkIfSingular =true)

void DiagonalSolve(Orientation orientation, const DistMultiVec<FDiag> &d, DistMulti-Vec<F> &X, bool checkIfSingular = true)

C API

ElError ElDiagonalSolve s(ElLeftOrRight side, ElConstMatrix s d, ElMatrix s X)

4.1. Level 1 175

Page 180: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElDiagonalSolve d(ElLeftOrRight side, ElConstMatrix d d, ElMatrix d X)

ElError ElDiagonalSolve c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c d, ElMatrix c X)

ElError ElDiagonalSolve z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z d, ElMatrix z X)

ElError ElDiagonalSolveDist s(ElLeftOrRight side, ElConstDistMatrix s d, ElDistMa-trix s X)

ElError ElDiagonalSolveDist d(ElLeftOrRight side, ElConstDistMatrix d d, ElDistMa-trix d X)

ElError ElDiagonalSolveDist c(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix c d, ElDistMatrix c X)

ElError ElDiagonalSolveDist z(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix z d, ElDistMatrix z X)

ElError ElDiagonalSolveSparse s(ElLeftOrRight side, ElConstMatrix s d, ElSparseMa-trix s X)

ElError ElDiagonalSolveSparse d(ElLeftOrRight side, ElConstMatrix d d, ElSparseMa-trix d X)

ElError ElDiagonalSolveSparse c(ElLeftOrRight side, ElOrientation orientation, ElConst-Matrix c d, ElSparseMatrix c X)

ElError ElDiagonalSolveSparse z(ElLeftOrRight side, ElOrientation orientation, ElConst-Matrix z d, ElSparseMatrix z X)

ElError ElDiagonalSolveDistSparse s(ElLeftOrRight side, ElConstDistMultiVec s d, El-DistSparseMatrix s X)

ElError ElDiagonalSolveDistSparse d(ElLeftOrRight side, ElConstDistMultiVec d d, El-DistSparseMatrix d X)

ElError ElDiagonalSolveDistSparse c(ElLeftOrRight side, ElOrientation orientation,ElConstDistMultiVec c d, ElDistSparseMa-trix c X)

ElError ElDiagonalSolveDistSparse z(ElLeftOrRight side, ElOrientation orientation,ElConstDistMultiVec z d, ElDistSparseMa-trix z X)

Python API

DiagonalSolve(side, orient, d, X)

4.1.16 Dot

Returns ⟨A, B⟩ = vec(A)Hvec(B). Note that this is precisely a Hilbert-Schmidt inner product.

C++ API

T Dot(const Matrix<T> &A, const Matrix<T> &B)

T Dot(const AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &B)

176 Chapter 4. BLAS-like linear algebra

Page 181: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

T Dot(const DistMultiVec<T> &A, const DistMultiVec<T> &B)

C API

ElError ElDot i(ElConstMatrix i A, ElConstMatrix i B, ElInt* prod)

ElError ElDot s(ElConstMatrix s A, ElConstMatrix s B, float* prod)

ElError ElDot d(ElConstMatrix d A, ElConstMatrix d B, double* prod)

ElError ElDot c(ElConstMatrix c A, ElConstMatrix c B, complex float* prod)

ElError ElDot z(ElConstMatrix z A, ElConstMatrix z B, complex double* prod)

ElError ElDotDist i(ElConstDistMatrix i A, ElConstDistMatrix i B, ElInt* prod)

ElError ElDotDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, float* prod)

ElError ElDotDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, double* prod)

ElError ElDotDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, complex float* prod)

ElError ElDotDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, com-plex double* prod)

ElError ElDotDistMultiVec i(ElConstDistMultiVec i A, ElConstDistMultiVec i B,ElInt* prod)

ElError ElDotDistMultiVec s(ElConstDistMultiVec s A, ElConstDistMultiVec s B,float* prod)

ElError ElDotDistMultiVec d(ElConstDistMultiVec d A, ElConstDistMultiVec d B,double* prod)

ElError ElDotDistMultiVec c(ElConstDistMultiVec c A, ElConstDistMultiVec c B, com-plex float* prod)

ElError ElDotDistMultiVec z(ElConstDistMultiVec z A, ElConstDistMultiVec z B, com-plex double* prod)

Python API

Dot(A, B)

4.1.17 Dotu

Returns a textvec(A)ˆT textvec(B).

C++ API

T Dotu(const Matrix<T> &A, const Matrix<T> &B)

T Dotu(const AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &B)

T Dotu(const DistMultiVec<T> &A, const DistMultiVec<T> &B)

4.1. Level 1 177

Page 182: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElDotu i(ElConstMatrix i A, ElConstMatrix i B, ElInt* prod)

ElError ElDotu s(ElConstMatrix s A, ElConstMatrix s B, float* prod)

ElError ElDotu d(ElConstMatrix d A, ElConstMatrix d B, double* prod)

ElError ElDotu c(ElConstMatrix c A, ElConstMatrix c B, complex float* prod)

ElError ElDotu z(ElConstMatrix z A, ElConstMatrix z B, complex double* prod)

ElError ElDotuDist i(ElConstDistMatrix i A, ElConstDistMatrix i B, ElInt* prod)

ElError ElDotuDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, float* prod)

ElError ElDotuDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, double* prod)

ElError ElDotuDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, com-plex float* prod)

ElError ElDotuDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, com-plex double* prod)

ElError ElDotuDistMultiVec i(ElConstDistMultiVec i A, ElConstDistMultiVec i B,ElInt* prod)

ElError ElDotuDistMultiVec s(ElConstDistMultiVec s A, ElConstDistMultiVec s B,float* prod)

ElError ElDotuDistMultiVec d(ElConstDistMultiVec d A, ElConstDistMultiVec d B,double* prod)

ElError ElDotuDistMultiVec c(ElConstDistMultiVec c A, ElConstDistMultiVec c B,complex float* prod)

ElError ElDotuDistMultiVec z(ElConstDistMultiVec z A, ElConstDistMultiVec z B,complex double* prod)

Python API

Dotu(A, B)

4.1.18 EntrywiseFill

Fill each entry of the passed in matrix by querying the specified function.

C++ API

void EntrywiseFill(Matrix<T> &A, std::function<T)void> func

void EntrywiseFill(AbstractDistMatrix<T> &A, std::function<T)void> func

void EntrywiseFill(DistMultiVec<T> &A, std::function<T)void> func

178 Chapter 4. BLAS-like linear algebra

Page 183: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElEntrywiseFill i(ElMatrix i A, ElInt (*fill)())

ElError ElEntrywiseFill s(ElMatrix s A, float (*fill)())

ElError ElEntrywiseFill d(ElMatrix d A, double (*fill)())

ElError ElEntrywiseFill c(ElMatrix c A, complex float (*fill)())

ElError ElEntrywiseFill z(ElMatrix z A, complex double (*fill)())

ElError ElEntrywiseFillDist i(ElDistMatrix i A, ElInt (*fill)())

ElError ElEntrywiseFillDist s(ElDistMatrix s A, float (*fill)())

ElError ElEntrywiseFillDist d(ElDistMatrix d A, double (*fill)())

ElError ElEntrywiseFillDist c(ElDistMatrix c A, complex float (*fill)())

ElError ElEntrywiseFillDist z(ElDistMatrix z A, complex double (*fill)())

ElError ElEntrywiseFillDistMultiVec i(ElDistMultiVec i A, ElInt (*fill)())

ElError ElEntrywiseFillDistMultiVec s(ElDistMultiVec s A, float (*fill)())

ElError ElEntrywiseFillDistMultiVec d(ElDistMultiVec d A, double (*fill)())

ElError ElEntrywiseFillDistMultiVec c(ElDistMultiVec c A, complex float (*fill)())

ElError ElEntrywiseFillDistMultiVec z(ElDistMultiVec z A, complex double (*fill)())

Python API

EntrywiseFill(A, fill)

4.1.19 EntrywiseMap

Replace each entry of the passed in matrix with a specified function of the existing entry.

C++ API

void EntrywiseMap(Matrix<T> &A, std::function<T)T> func

void EntrywiseMap(AbstractDistMatrix<T> &A, std::function<T)T> func

void EntrywiseMap(SparseMatrix<T> &A, std::function<T)T> func

void EntrywiseMap(DistSparseMatrix<T> &A, std::function<T)T> func

void EntrywiseMap(DistMultiVec<T> &A, std::function<T)T> func

void EntrywiseMap(const Matrix<S> &A, Matrix<T> &B, std::function<T)S> func

4.1. Level 1 179

Page 184: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void EntrywiseMap(const AbstractDistMatrix<S> &A, AbstractDistMatrix<T> &B,std::function<T)S

> func

void EntrywiseMap(const SparseMatrix<S> &A, SparseMatrix<T> &B,std::function<T)S

> func

void EntrywiseMap(const DistSparseMatrix<S> &A, DistSparseMatrix<T> &B,std::function<T)S

> func

void EntrywiseMap(const DistMultiVec<S> &A, DistMultiVec<T> &B,std::function<T)S

> func

C API

ElError ElEntrywiseMap i(ElMatrix i A, ElInt (*func)(ElInt))

ElError ElEntrywiseMap s(ElMatrix s A, float (*func)(float))

ElError ElEntrywiseMap d(ElMatrix d A, double (*func)(double))

ElError ElEntrywiseMap c(ElMatrix c A, complex float (*func)(complex float))

ElError ElEntrywiseMap z(ElMatrix z A, complex double (*func)(complex double))

ElError ElEntrywiseMapDist i(ElDistMatrix i A, ElInt (*func)(ElInt))

ElError ElEntrywiseMapDist s(ElDistMatrix s A, float (*func)(float))

ElError ElEntrywiseMapDist d(ElDistMatrix d A, double (*func)(double))

ElError ElEntrywiseMapDist c(ElDistMatrix c A, complex float (*func)(complex float))

ElError ElEntrywiseMapDist z(ElDistMatrix z A, complex double(*func)(complex double))

ElError ElEntrywiseMapSparse i(ElSparseMatrix i A, ElInt (*func)(ElInt))

ElError ElEntrywiseMapSparse s(ElSparseMatrix s A, float (*func)(float))

ElError ElEntrywiseMapSparse d(ElSparseMatrix d A, double (*func)(double))

ElError ElEntrywiseMapSparse c(ElSparseMatrix c A, complex float(*func)(complex float))

ElError ElEntrywiseMapSparse z(ElSparseMatrix z A, complex double(*func)(complex double))

ElError ElEntrywiseMapDistSparse i(ElDistSparseMatrix i A, ElInt (*func)(ElInt))

ElError ElEntrywiseMapDistSparse s(ElDistSparseMatrix s A, float (*func)(float))

ElError ElEntrywiseMapDistSparse d(ElDistSparseMatrix d A, double (*func)(double))

ElError ElEntrywiseMapDistSparse c(ElDistSparseMatrix c A, complex float(*func)(complex float))

ElError ElEntrywiseMapDistSparse z(ElDistSparseMatrix z A, complex double(*func)(complex double))

ElError ElEntrywiseMapDistMultiVec i(ElDistMultiVec i A, ElInt (*func)(ElInt))

180 Chapter 4. BLAS-like linear algebra

Page 185: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElEntrywiseMapDistMultiVec s(ElDistMultiVec s A, float (*func)(float))

ElError ElEntrywiseMapDistMultiVec d(ElDistMultiVec d A, double (*func)(double))

ElError ElEntrywiseMapDistMultiVec c(ElDistMultiVec c A, complex float(*func)(complex float))

ElError ElEntrywiseMapDistMultiVec z(ElDistMultiVec z A, complex double(*func)(complex double))

Python API

EntrywiseMap(A, func)

4.1.20 Fill

Fill each entry of a matrix with the same value.

C++ API

void Fill(Matrix<T> &A, T alpha)

void Fill(AbstractDistMatrix<T> &A, T alpha)

void Fill(DistMultiVec<T> &A, T alpha)

C API

ElError ElFill i(ElMatrix i A, ElInt alpha)

ElError ElFill s(ElMatrix s A, float alpha)

ElError ElFill d(ElMatrix d A, double alpha)

ElError ElFill c(ElMatrix c A, complex float alpha)

ElError ElFill z(ElMatrix z A, complex double alpha)

ElError ElFillDist i(ElDistMatrix i A, ElInt alpha)

ElError ElFillDist s(ElDistMatrix s A, float alpha)

ElError ElFillDist d(ElDistMatrix d A, double alpha)

ElError ElFillDist c(ElDistMatrix c A, complex float alpha)

ElError ElFillDist z(ElDistMatrix z A, complex double alpha)

Python API

Fill(A, alpha)

4.1.21 FillDiagonal

Fills all of the diagonal entries of a matrix to a given value.

4.1. Level 1 181

Page 186: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void FillDiagonal(Matrix<T> &A, T alpha, Int offset = 0)

void FillDiagonal(AbstractDistMatrix<T> &A, T alpha, Int offset = 0)

C API

ElError ElFillDiagonal i(ElMatrix i A, ElInt alpha, ElInt offset)

ElError ElFillDiagonal s(ElMatrix s A, float alpha, ElInt offset)

ElError ElFillDiagonal d(ElMatrix d A, double alpha, ElInt offset)

ElError ElFillDiagonal c(ElMatrix c A, complex float alpha, ElInt offset)

ElError ElFillDiagonal z(ElMatrix z A, complex double alpha, ElInt offset)

ElError ElFillDiagonalDist i(ElDistMatrix i A, ElInt alpha, ElInt offset)

ElError ElFillDiagonalDist s(ElDistMatrix s A, float alpha, ElInt offset)

ElError ElFillDiagonalDist d(ElDistMatrix d A, double alpha, ElInt offset)

ElError ElFillDiagonalDist c(ElDistMatrix c A, complex float alpha, ElInt offset)

ElError ElFillDiagonalDist z(ElDistMatrix z A, complex double alpha, ElInt offset)

Python API

FillDiagonal(A, alpha, offset=0)

4.1.22 GetDiagonal

Return a diagonal of a matrix as a vector.

C++ API

void GetDiagonal(const Matrix<T> &A, Matrix<T> &d, Int offset = 0)

void GetDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMatrix<T> &d, Int offset= 0)

void GetRealPartOfDiagonal(const Matrix<T> &A, Matrix<Base<T>> &d, Int offset =0)

void GetRealPartOfDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMa-trix<Base<T>> &d, Int offset = 0)

void GetImagPartOfDiagonal(const Matrix<T> &A, Matrix<Base<T>> &d, Int offset =0)

void GetImagPartOfDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMa-trix<Base<T>> &d, Int offset = 0)

Matrix<T> GetDiagonal(const Matrix<T> &A, Int offset = 0)

182 Chapter 4. BLAS-like linear algebra

Page 187: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<T, DiagCol<U, V>(), DiagRow<U, V>> GetDiagonalconst DistMatrix<T, U, V> &A, Int offset = 0

Matrix<Base<T>> GetRealPartOfDiagonal(const Matrix<T> &A, Int offset = 0)

DistMatrix<Base<T>, DiagCol<U, V>(), DiagRow<U, V>> GetRealPartOfDiagonalconst DistMatrix<T, U, V> &A, Int offset = 0

Matrix<Base<T>> GetImagPartOfDiagonal(const Matrix<T> &A, Int offset = 0)

DistMatrix<Base<T>, DiagCol<U, V>(), DiagRow<U, V>> GetImagPartOfDiagonalconst DistMatrix<T, U, V> &A, Int offset = 0

C API

TODO

Python API

TODO

4.1.23 GetMappedDiagonal

Return a function of a diagonal of a matrix as a vector.

C++ API

void GetMappedDiagonal(const Matrix<T> &A, Matrix<S> &d, std::function<S)T> func, Int offset = 0

void GetMappedDiagonal(const DistMatrix<T, U, V> &A, AbstractDistMatrix<S> &d,std::function<S)T

> func, Int offset = 0

C API

TODO

Python API

TODO

4.1.24 GetSubmatrix

Gets a (possibly non-contiguous) submatrix of a given matrix.

Python API

GetSubmatrix(A, I, J)

4.1. Level 1 183

Page 188: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Contiguous

void GetSubmatrix(const Matrix<T> &A, const Range<Int> &I, const Range<Int> &J,Matrix<T> &ASub)

Matrix<T> GetSubmatrix(const Matrix<T> &A, const Range<Int> &I, constRange<Int> &J)

void GetSubmatrix(const AbstractDistMatrix<T> &A, const Range<Int> &I, constRange<Int> &J, AbstractDistMatrix<T> &ASub)

AbstractDistMatrix<T> GetSubmatrix(const AbstractDistMatrix<T> &A, constRange<Int> &I, const Range<Int> &J)

void GetSubmatrix(const SparseMatrix<T> &A, const Range<Int> &I, constRange<Int> &J, SparseMatrix<T> &ASub)

SparseMatrix<T> GetSubmatrix(const SparseMatrix<T> &A, const Range<Int> &I,const Range<Int> &J)

void GetSubmatrix(const DistSparseMatrix<T> &A, const Range<Int> &I, constRange<Int> &J, DistSparseMatrix<T> &ASub)

DistSparseMatrix<T> GetSubmatrix(const DistSparseMatrix<T> &A, const Range<Int>&I, const Range<Int> &J)

void GetSubmatrix(const DistMultiVec<T> &A, const Range<Int> &I, constRange<Int> &J, DistMultiVec<T> &ASub)

DistMultiVec<T> GetSubmatrix(const DistMultiVec<T> &A, const Range<Int> &I,const Range<Int> &J)

Noncontiguous

void GetSubmatrix(const Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, Matrix<T> &ASub)

Matrix<T> GetSubmatrix(const Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J)

void GetSubmatrix(const AbstractDistMatrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, AbstractDistMatrix<T> &ASub)

DistMatrix<T> GetSubmatrix(const AbstractDistMatrix<T> &A, conststd::vector<Int> &I, const std::vector<Int> &J)

C API

Contiguous

IntegerElError ElGetContigSubmatrix i(ElConstMatrix i A, ElIndexRange I, ElIndexRange J,

ElMatrix i ASub)ElError ElGetContigSubmatrixDist i(ElConstDistMatrix i A, ElIndexRange I, ElIn-

dexRange J, ElDistMatrix i ASub)

184 Chapter 4. BLAS-like linear algebra

Page 189: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGetContigSubmatrixSparse i(ElConstSparseMatrix i A, ElIndexRange I,ElIndexRange J, ElSparseMatrix i ASub)

ElError ElGetContigSubmatrixDistSparse i(ElConstDistSparseMatrix i A, ElIn-dexRange I, ElIndexRange J, ElD-istSparseMatrix i ASub)

ElError ElGetContigSubmatrixDistMultiVec i(ElConstDistMultiVec i A, ElIn-dexRange I, ElIndexRange J, ElD-istMultiVec i ASub)

Single-precisionElError ElGetContigSubmatrix s(ElConstMatrix s A, ElIndexRange I, ElIndexRange J,

ElMatrix s ASub)ElError ElGetContigSubmatrixDist s(ElConstDistMatrix s A, ElIndexRange I, ElIn-

dexRange J, ElDistMatrix s ASub)

ElError ElGetContigSubmatrixSparse s(ElConstSparseMatrix s A, ElIndexRange I,ElIndexRange J, ElSparseMatrix s ASub)

ElError ElGetContigSubmatrixDistSparse s(ElConstDistSparseMatrix s A, ElIn-dexRange I, ElIndexRange J, ElD-istSparseMatrix s ASub)

ElError ElGetContigSubmatrixDistMultiVec s(ElConstDistMultiVec s A, ElIn-dexRange I, ElIndexRange J, ElD-istMultiVec s ASub)

Double-precisionElError ElGetContigSubmatrix d(ElConstMatrix d A, ElIndexRange I, ElIndexRange J,

ElMatrix d ASub)ElError ElGetContigSubmatrixDist d(ElConstDistMatrix d A, ElIndexRange I, ElIn-

dexRange J, ElDistMatrix d ASub)

ElError ElGetContigSubmatrixSparse d(ElConstSparseMatrix d A, ElIndexRange I,ElIndexRange J, ElSparseMatrix d ASub)

ElError ElGetContigSubmatrixDistSparse d(ElConstDistSparseMatrix d A, ElIn-dexRange I, ElIndexRange J, ElD-istSparseMatrix d ASub)

ElError ElGetContigSubmatrixDistMultiVec d(ElConstDistMultiVec d A, ElIn-dexRange I, ElIndexRange J, ElD-istMultiVec d ASub)

Single-precision complexElError ElGetContigSubmatrix c(ElConstMatrix c A, ElIndexRange I, ElIndexRange J,

ElMatrix c ASub)ElError ElGetContigSubmatrixDist c(ElConstDistMatrix c A, ElIndexRange I, ElIn-

dexRange J, ElDistMatrix c ASub)

ElError ElGetContigSubmatrixSparse c(ElConstSparseMatrix c A, ElIndexRange I,ElIndexRange J, ElSparseMatrix c ASub)

ElError ElGetContigSubmatrixDistSparse c(ElConstDistSparseMatrix c A, ElIn-dexRange I, ElIndexRange J, ElD-istSparseMatrix c ASub)

4.1. Level 1 185

Page 190: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGetContigSubmatrixDistMultiVec c(ElConstDistMultiVec c A, ElIn-dexRange I, ElIndexRange J, ElD-istMultiVec c ASub)

Double-precision complexElError ElGetContigSubmatrix z(ElConstMatrix z A, ElIndexRange I, ElIndexRange J,

ElMatrix z ASub)ElError ElGetContigSubmatrixDist z(ElConstDistMatrix z A, ElIndexRange I, ElIn-

dexRange J, ElDistMatrix z ASub)

ElError ElGetContigSubmatrixSparse z(ElConstSparseMatrix z A, ElIndexRange I,ElIndexRange J, ElSparseMatrix z ASub)

ElError ElGetContigSubmatrixDistSparse z(ElConstDistSparseMatrix z A, ElIn-dexRange I, ElIndexRange J, ElD-istSparseMatrix z ASub)

ElError ElGetContigSubmatrixDistMultiVec z(ElConstDistMultiVec z A, ElIn-dexRange I, ElIndexRange J, ElD-istMultiVec z ASub)

Noncontiguous

TODO

4.1.25 Hadamard

The Hadamard product of two m × n matrices A and B is given entrywise by αi,jβi,j and de-noted by C = A ∘ B.

C++ API

void Hadamard(const Matrix<F> &A, const Matrix<F> &B, Matrix<F> &C)

void Hadamard(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B, Ab-stractDistMatrix<F> &C)

C API

ElError ElHadamard i(ElConstMatrix i A, ElConstMatrix i B, ElMatrix i C)

ElError ElHadamard s(ElConstMatrix s A, ElConstMatrix s B, ElMatrix s C)

ElError ElHadamard d(ElConstMatrix d A, ElConstMatrix d B, ElMatrix d C)

ElError ElHadamard c(ElConstMatrix c A, ElConstMatrix c B, ElMatrix c C)

ElError ElHadamard z(ElConstMatrix z A, ElConstMatrix z B, ElMatrix z C)

ElError ElHadamardDist i(ElConstDistMatrix i A, ElConstDistMatrix i B, ElDistMa-trix i C)

ElError ElHadamardDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElDistMa-trix s C)

186 Chapter 4. BLAS-like linear algebra

Page 191: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHadamardDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElDistMa-trix d C)

ElError ElHadamardDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, ElDistMa-trix c C)

ElError ElHadamardDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, ElDistMa-trix z C)

Python API

TODO

4.1.26 HilbertSchmidt

Note: This is not a standard BLAS routine, but it is BLAS-like.

The Hilbert-Schmidt inner-product of two m × n matrices A and B is tr(AHB).

C++ API

F HilbertSchmidt(const Matrix<F> &A, const Matrix<F> &B)

F HilbertSchmidt(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B)

C API

ElError ElHilbertSchmidt i(ElConstMatrix i A, ElConstMatrix i B, ElInt* prod)

ElError ElHilbertSchmidt s(ElConstMatrix s A, ElConstMatrix s B, float* prod)

ElError ElHilbertSchmidt d(ElConstMatrix d A, ElConstMatrix d B, double* prod)

ElError ElHilbertSchmidt c(ElConstMatrix c A, ElConstMatrix c B, complex float* prod)

ElError ElHilbertSchmidt z(ElConstMatrix z A, ElConstMatrix z B, com-plex double* prod)

ElError ElHilbertSchmidtDist i(ElConstDistMatrix i A, ElConstDistMatrix i B,ElInt* prod)

ElError ElHilbertSchmidtDist s(ElConstDistMatrix s A, ElConstDistMatrix s B,float* prod)

ElError ElHilbertSchmidtDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, dou-ble* prod)

ElError ElHilbertSchmidtDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, com-plex float* prod)

ElError ElHilbertSchmidtDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, com-plex double* prod)

4.1. Level 1 187

Page 192: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.1.27 IndexDependentFill

Fill each entry of the passed in matrix by querying the specified function which depends uponthe global index of the entry.

C++ API

void IndexDependentFill(Matrix<T> &A, std::function<T)Int, Int> func

void IndexDependentFill(AbstractDistMatrix<T> &A, std::function<T)Int, Int> func

C API

ElError ElIndexDependentFill i(ElMatrix i A, ElInt (*fill)(ElInt,ElInt))

ElError ElIndexDependentFill s(ElMatrix s A, float (*fill)(ElInt,ElInt))

ElError ElIndexDependentFill d(ElMatrix d A, double (*fill)(ElInt,ElInt))

ElError ElIndexDependentFill c(ElMatrix c A, complex float (*fill)(ElInt,ElInt))

ElError ElIndexDependentFill z(ElMatrix z A, complex double (*fill)(ElInt,ElInt))

ElError ElIndexDependentFillDist i(ElDistMatrix i A, ElInt (*fill)(ElInt,ElInt))

ElError ElIndexDependentFillDist s(ElDistMatrix s A, float (*fill)(ElInt,ElInt))

ElError ElIndexDependentFillDist d(ElDistMatrix d A, double (*fill)(ElInt,ElInt))

ElError ElIndexDependentFillDist c(ElDistMatrix c A, complex float (*fill)(ElInt,ElInt))

ElError ElIndexDependentFillDist z(ElDistMatrix z A, complex double(*fill)(ElInt,ElInt))

4.1.28 IndexDependentMap

Replace each entry of the passed in matrix with a specified function of the existing entry andits global indices.

C++ API

void IndexDependentMap(Matrix<T> &A, std::function<T)Int, Int, T> func

void IndexDependentMap(AbstractDistMatrix<T> &A, std::function<T)Int, Int, T> func

C API

ElError ElIndexDependentMap i(ElMatrix i A, ElInt (*func)(ElInt,ElInt,ElInt))

ElError ElIndexDependentMap s(ElMatrix s A, float (*func)(ElInt,ElInt,float))

188 Chapter 4. BLAS-like linear algebra

Page 193: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElIndexDependentMap d(ElMatrix d A, double (*func)(ElInt,ElInt,double))

ElError ElIndexDependentMap c(ElMatrix c A, complex float(*func)(ElInt,ElInt,complex float))

ElError ElIndexDependentMap z(ElMatrix z A, complex double(*func)(ElInt,ElInt,complex double))

ElError ElIndexDependentMapDist i(ElDistMatrix i A, ElInt (*func)(ElInt,ElInt,ElInt))

ElError ElIndexDependentMapDist s(ElDistMatrix s A, float (*func)(ElInt,ElInt,float))

ElError ElIndexDependentMapDist d(ElDistMatrix d A, double(*func)(ElInt,ElInt,double))

ElError ElIndexDependentMapDist c(ElDistMatrix c A, complex float(*func)(ElInt,ElInt,complex float))

ElError ElIndexDependentMapDist z(ElDistMatrix z A, complex double(*func)(ElInt,ElInt,complex double))

4.1.29 MakeTrapezoidal

Note: This is not a standard BLAS routine, but it is BLAS-like.

Sets all entries outside of the specified trapezoidal submatrix to zero. Whether or not thetrapezoid is upper or lower (analogous to an upper or lower-triangular matrix) is determinedby the uplo parameter, and the last diagonal is defined with the offset integer.

C++ API

void MakeTrapezoidal(UpperOrLower uplo, Matrix<T> &A, Int offset = 0)

void MakeTrapezoidal(UpperOrLower uplo, AbstractDistMatrix<T> &A, Int offset = 0)

void MakeTrapezoidal(UpperOrLower uplo, SparseMatrix<T> &A, Int offset = 0)

void MakeTrapezoidal(UpperOrLower uplo, DistSparseMatrix<T> &A, Int offset = 0)

C API

ElError ElMakeTrapezoidal i(ElUpperOrLower uplo, ElMatrix i A, ElInt offset)

ElError ElMakeTrapezoidal s(ElUpperOrLower uplo, ElMatrix s A, ElInt offset)

ElError ElMakeTrapezoidal d(ElUpperOrLower uplo, ElMatrix d A, ElInt offset)

ElError ElMakeTrapezoidal c(ElUpperOrLower uplo, ElMatrix c A, ElInt offset)

ElError ElMakeTrapezoidal z(ElUpperOrLower uplo, ElMatrix z A, ElInt offset)

ElError ElMakeTrapezoidalDist i(ElUpperOrLower uplo, ElDistMatrix i A, ElInt offset)

ElError ElMakeTrapezoidalDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElInt offset)

ElError ElMakeTrapezoidalDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElInt offset)

ElError ElMakeTrapezoidalDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElInt offset)

4.1. Level 1 189

Page 194: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMakeTrapezoidalDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElInt offset)

ElError ElMakeTrapezoidalSparse i(ElUpperOrLower uplo, ElSparseMatrix i A, ElInt off-set)

ElError ElMakeTrapezoidalSparse s(ElUpperOrLower uplo, ElSparseMatrix s A,ElInt offset)

ElError ElMakeTrapezoidalSparse d(ElUpperOrLower uplo, ElSparseMatrix d A,ElInt offset)

ElError ElMakeTrapezoidalSparse c(ElUpperOrLower uplo, ElSparseMatrix c A,ElInt offset)

ElError ElMakeTrapezoidalSparse z(ElUpperOrLower uplo, ElSparseMatrix z A,ElInt offset)

ElError ElMakeTrapezoidalDistSparse i(ElUpperOrLower uplo, ElDistSparseMa-trix i A, ElInt offset)

ElError ElMakeTrapezoidalDistSparse s(ElUpperOrLower uplo, ElDistSparseMa-trix s A, ElInt offset)

ElError ElMakeTrapezoidalDistSparse d(ElUpperOrLower uplo, ElDistSparseMa-trix d A, ElInt offset)

ElError ElMakeTrapezoidalDistSparse c(ElUpperOrLower uplo, ElDistSparseMa-trix c A, ElInt offset)

ElError ElMakeTrapezoidalDistSparse z(ElUpperOrLower uplo, ElDistSparseMa-trix z A, ElInt offset)

Python API

MakeTrapezoidal(uplo, A, offset=0)

4.1.30 Max

The following routines return the location and value of the entry with the maximum value(note: NOT the maximum absolute value).

C++ API

ValueIntPair<Real> Max(const Matrix<Real> &A)

ValueIntPair<Real> Max(const AbstractDistMatrix<Real> &A)

ValueIntPair<Real> SymmetricMax(UpperOrLower uplo, const Matrix<Real> &A)

ValueIntPair<Real> SymmetricMax(UpperOrLower uplo, const AbstractDistMa-trix<Real> &A)

ValueInt<Real> VectorMax(const Matrix<Real> &x)

ValueInt<Real> VectorMax(const AbstractDistMatrix<Real> &x)

190 Chapter 4. BLAS-like linear algebra

Page 195: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElMax i(ElConstMatrix i A, ElValueIntPair i* entry)

ElError ElMax s(ElConstMatrix s A, ElValueIntPair s* entry)

ElError ElMax d(ElConstMatrix d A, ElValueIntPair d* entry)

ElError ElMaxDist i(ElConstDistMatrix i A, ElValueIntPair i* entry)

ElError ElMaxDist s(ElConstDistMatrix s A, ElValueIntPair s* entry)

ElError ElMaxDist d(ElConstDistMatrix d A, ElValueIntPair d* entry)

ElError ElSymmetricMax i(ElUpperOrLower uplo, ElConstMatrix i A, ElValueInt-Pair i* entry)

ElError ElSymmetricMax s(ElUpperOrLower uplo, ElConstMatrix s A, ElValueInt-Pair s* entry)

ElError ElSymmetricMax d(ElUpperOrLower uplo, ElConstMatrix d A, ElValueInt-Pair d* entry)

ElError ElSymmetricMaxDist i(ElUpperOrLower uplo, ElConstDistMatrix i A, ElVal-ueIntPair i* entry)

ElError ElSymmetricMaxDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElVal-ueIntPair s* entry)

ElError ElSymmetricMaxDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElVal-ueIntPair d* entry)

ElError ElVectorMax i(ElConstMatrix i x, ElValueInt i* entry)

ElError ElVectorMax s(ElConstMatrix s x, ElValueInt s* entry)

ElError ElVectorMax d(ElConstMatrix d x, ElValueInt d* entry)

ElError ElVectorMaxDist i(ElConstDistMatrix i x, ElValueInt i* entry)

ElError ElVectorMaxDist s(ElConstDistMatrix s x, ElValueInt s* entry)

ElError ElVectorMaxDist d(ElConstDistMatrix d x, ElValueInt d* entry)

Python API

TODO

4.1.31 MaxAbs

The following routines return the coordinates and magnitude of the entry with the largestabsolute value.

C++ API

ValueIntPair<Base<F>> MaxAbs(const Matrix<F> &A)

ValueIntPair<Base<F>> MaxAbs(const AbstractDistMatrix<F> &A)

4.1. Level 1 191

Page 196: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ValueIntPair<Base<F>> SymmetricMaxAbs(UpperOrLower uplo, const Matrix<F> &A)

ValueIntPair<Base<F>> SymmetricMaxAbs(UpperOrLower uplo, const AbstractDistMa-trix<F> &A)

ValueInt<Base<F>> VectorMaxAbs(const Matrix<F> &x)

ValueInt<Base<F>> VectorMaxAbs(const AbstractDistMatrix<F> &x)

C API

ElError ElMaxAbs i(ElConstMatrix i A, ElValueIntPair i* entry)

ElError ElMaxAbs s(ElConstMatrix s A, ElValueIntPair s* entry)

ElError ElMaxAbs d(ElConstMatrix d A, ElValueIntPair d* entry)

ElError ElMaxAbs c(ElConstMatrix c A, ElValueIntPair c* entry)

ElError ElMaxAbs z(ElConstMatrix z A, ElValueIntPair z* entry)

ElError ElMaxAbsDist i(ElConstDistMatrix i A, ElValueIntPair i* entry)

ElError ElMaxAbsDist s(ElConstDistMatrix s A, ElValueIntPair s* entry)

ElError ElMaxAbsDist d(ElConstDistMatrix d A, ElValueIntPair d* entry)

ElError ElMaxAbsDist c(ElConstDistMatrix c A, ElValueIntPair c* entry)

ElError ElMaxAbsDist z(ElConstDistMatrix z A, ElValueIntPair z* entry)

ElError ElSymmetricMaxAbs i(ElUpperOrLower uplo, ElConstMatrix i A, ElValueInt-Pair i* entry)

ElError ElSymmetricMaxAbs s(ElUpperOrLower uplo, ElConstMatrix s A, ElValueInt-Pair s* entry)

ElError ElSymmetricMaxAbs d(ElUpperOrLower uplo, ElConstMatrix d A, ElValueInt-Pair d* entry)

ElError ElSymmetricMaxAbs c(ElUpperOrLower uplo, ElConstMatrix c A, ElValueInt-Pair c* entry)

ElError ElSymmetricMaxAbs z(ElUpperOrLower uplo, ElConstMatrix z A, ElValueInt-Pair z* entry)

ElError ElSymmetricMaxAbsDist i(ElUpperOrLower uplo, ElConstDistMatrix i A, ElVal-ueIntPair i* entry)

ElError ElSymmetricMaxAbsDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElVal-ueIntPair s* entry)

ElError ElSymmetricMaxAbsDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElVal-ueIntPair d* entry)

ElError ElSymmetricMaxAbsDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElVal-ueIntPair c* entry)

ElError ElSymmetricMaxAbsDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElVal-ueIntPair z* entry)

ElError ElVectorMaxAbs i(ElConstMatrix i x, ElValueInt i* entry)

ElError ElVectorMaxAbs s(ElConstMatrix s x, ElValueInt s* entry)

192 Chapter 4. BLAS-like linear algebra

Page 197: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElVectorMaxAbs d(ElConstMatrix d x, ElValueInt d* entry)

ElError ElVectorMaxAbs c(ElConstMatrix c x, ElValueInt c* entry)

ElError ElVectorMaxAbs z(ElConstMatrix z x, ElValueInt z* entry)

ElError ElVectorMaxAbsDist i(ElConstDistMatrix i x, ElValueInt i* entry)

ElError ElVectorMaxAbsDist s(ElConstDistMatrix s x, ElValueInt s* entry)

ElError ElVectorMaxAbsDist d(ElConstDistMatrix d x, ElValueInt d* entry)

ElError ElVectorMaxAbsDist c(ElConstDistMatrix c x, ElValueInt c* entry)

ElError ElVectorMaxAbsDist z(ElConstDistMatrix z x, ElValueInt z* entry)

4.1.32 Min

The following routines return the location and value of the entry with the minimum value(note: NOT the minimum absolute value).

C++ API

ValueIntPair<Real> Max(const Matrix<Real> &A)

ValueIntPair<Real> Max(const AbstractDistMatrix<Real> &A)

ValueIntPair<Real> SymmetricMax(UpperOrLower uplo, const Matrix<Real> &A)

ValueIntPair<Real> SymmetricMax(UpperOrLower uplo, const AbstractDistMa-trix<Real> &A)

ValueInt<Real> VectorMax(const Matrix<Real> &x)

ValueInt<Real> VectorMax(const AbstractDistMatrix<Real> &x)

C API

ElError ElMin i(ElConstMatrix i A, ElValueIntPair i* entry)

ElError ElMin s(ElConstMatrix s A, ElValueIntPair s* entry)

ElError ElMin d(ElConstMatrix d A, ElValueIntPair d* entry)

ElError ElMinDist i(ElConstDistMatrix i A, ElValueIntPair i* entry)

ElError ElMinDist s(ElConstDistMatrix s A, ElValueIntPair s* entry)

ElError ElMinDist d(ElConstDistMatrix d A, ElValueIntPair d* entry)

ElError ElSymmetricMin i(ElUpperOrLower uplo, ElConstMatrix i A, ElValueInt-Pair i* entry)

ElError ElSymmetricMin s(ElUpperOrLower uplo, ElConstMatrix s A, ElValueInt-Pair s* entry)

ElError ElSymmetricMin d(ElUpperOrLower uplo, ElConstMatrix d A, ElValueInt-Pair d* entry)

ElError ElSymmetricMinDist i(ElUpperOrLower uplo, ElConstDistMatrix i A, ElVal-ueIntPair i* entry)

4.1. Level 1 193

Page 198: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSymmetricMinDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElVal-ueIntPair s* entry)

ElError ElSymmetricMinDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElVal-ueIntPair d* entry)

ElError ElVectorMin i(ElConstMatrix i x, ElValueInt i* entry)

ElError ElVectorMin s(ElConstMatrix s x, ElValueInt s* entry)

ElError ElVectorMin d(ElConstMatrix d x, ElValueInt d* entry)

ElError ElVectorMinDist i(ElConstDistMatrix i x, ElValueInt i* entry)

ElError ElVectorMinDist s(ElConstDistMatrix s x, ElValueInt s* entry)

ElError ElVectorMinDist d(ElConstDistMatrix d x, ElValueInt d* entry)

Python API

TODO

4.1.33 MinAbs

The following routines return the coordinates and magnitude of the entry with the smallestabsolute value.

C++ API

ValueIntPair<Base<F>> MinAbs(const Matrix<F> &A)

ValueIntPair<Base<F>> MinAbs(const AbstractDistMatrix<F> &A)

ValueIntPair<Base<F>> SymmetricMinAbs(UpperOrLower uplo, const Matrix<F> &A)

ValueIntPair<Base<F>> SymmetricMinAbs(UpperOrLower uplo, const AbstractDistMa-trix<F> &A)

ValueInt<Base<F>> VectorMinAbs(const Matrix<F> &x)

ValueInt<Base<F>> VectorMinAbs(const AbstractDistMatrix<F> &x)

C API

ElError ElMinAbs i(ElConstMatrix i A, ElValueIntPair i* entry)

ElError ElMinAbs s(ElConstMatrix s A, ElValueIntPair s* entry)

ElError ElMinAbs d(ElConstMatrix d A, ElValueIntPair d* entry)

ElError ElMinAbs c(ElConstMatrix c A, ElValueIntPair c* entry)

ElError ElMinAbs z(ElConstMatrix z A, ElValueIntPair z* entry)

ElError ElMinAbsDist i(ElConstDistMatrix i A, ElValueIntPair i* entry)

ElError ElMinAbsDist s(ElConstDistMatrix s A, ElValueIntPair s* entry)

ElError ElMinAbsDist d(ElConstDistMatrix d A, ElValueIntPair d* entry)

194 Chapter 4. BLAS-like linear algebra

Page 199: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMinAbsDist c(ElConstDistMatrix c A, ElValueIntPair c* entry)

ElError ElMinAbsDist z(ElConstDistMatrix z A, ElValueIntPair z* entry)

ElError ElSymmetricMinAbs i(ElUpperOrLower uplo, ElConstMatrix i A, ElValueInt-Pair i* entry)

ElError ElSymmetricMinAbs s(ElUpperOrLower uplo, ElConstMatrix s A, ElValueInt-Pair s* entry)

ElError ElSymmetricMinAbs d(ElUpperOrLower uplo, ElConstMatrix d A, ElValueInt-Pair d* entry)

ElError ElSymmetricMinAbs c(ElUpperOrLower uplo, ElConstMatrix c A, ElValueInt-Pair c* entry)

ElError ElSymmetricMinAbs z(ElUpperOrLower uplo, ElConstMatrix z A, ElValueInt-Pair z* entry)

ElError ElSymmetricMinAbsDist i(ElUpperOrLower uplo, ElConstDistMatrix i A, ElVal-ueIntPair i* entry)

ElError ElSymmetricMinAbsDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElVal-ueIntPair s* entry)

ElError ElSymmetricMinAbsDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElVal-ueIntPair d* entry)

ElError ElSymmetricMinAbsDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElVal-ueIntPair c* entry)

ElError ElSymmetricMinAbsDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElVal-ueIntPair z* entry)

ElError ElVectorMinAbs i(ElConstMatrix i x, ElValueInt i* entry)

ElError ElVectorMinAbs s(ElConstMatrix s x, ElValueInt s* entry)

ElError ElVectorMinAbs d(ElConstMatrix d x, ElValueInt d* entry)

ElError ElVectorMinAbs c(ElConstMatrix c x, ElValueInt c* entry)

ElError ElVectorMinAbs z(ElConstMatrix z x, ElValueInt z* entry)

ElError ElVectorMinAbsDist i(ElConstDistMatrix i x, ElValueInt i* entry)

ElError ElVectorMinAbsDist s(ElConstDistMatrix s x, ElValueInt s* entry)

ElError ElVectorMinAbsDist d(ElConstDistMatrix d x, ElValueInt d* entry)

ElError ElVectorMinAbsDist c(ElConstDistMatrix c x, ElValueInt c* entry)

ElError ElVectorMinAbsDist z(ElConstDistMatrix z x, ElValueInt z* entry)

4.1.34 Nrm2

Returns ||x||2 =√(x, x) =

√xHx. As with most other routines, even if x is stored as a row

vector, it will be interpreted as a column vector.

4.1. Level 1 195

Page 200: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Base<F> Nrm2(const Matrix<F> &x)

Base<F> Nrm2(const AbstractDistMatrix<F> &x)

C API

ElError ElNrm2 s(ElConstMatrix s A, float* gamma)

ElError ElNrm2 d(ElConstMatrix d A, double* gamma)

ElError ElNrm2 c(ElConstMatrix c A, float* gamma)

ElError ElNrm2 z(ElConstMatrix z A, double* gamma)

ElError ElNrm2Dist s(ElConstDistMatrix s A, float* gamma)

ElError ElNrm2Dist d(ElConstDistMatrix d A, double* gamma)

ElError ElNrm2Dist c(ElConstDistMatrix c A, float* gamma)

ElError ElNrm2Dist z(ElConstDistMatrix z A, double* gamma)

4.1.35 QuasiDiagonalScale

Apply a symmetric (Hermitian) quasi-diagonal matrix to the matrix X.

C++ API

void QuasiDiagonalScale(LeftOrRight side, UpperOrLower uplo, const Matrix<FMain>&d, const Matrix<F> &dSub, Matrix<F> &X, bool conjugate= false)

void QuasiDiagonalScale(LeftOrRight side, UpperOrLower uplo, const AbstractDistMa-trix<FMain> &d, const AbstractDistMatrix<F> &dSub, Ab-stractDistMatrix<F> &X, bool conjugate = false)

C API

TODO

Python API

TODO

4.1.36 QuasiDiagonalSolve

Apply the inverse of a symmetric (Hermitian) quasi-diagonal matrix to the matrix X.

196 Chapter 4. BLAS-like linear algebra

Page 201: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void QuasiDiagonalSolve(LeftOrRight side, UpperOrLower uplo, const Matrix<FMain>&d, const Matrix<F> &dSub, Matrix<F> &X, bool conjugate= false)

void QuasiDiagonalSolve(LeftOrRight side, UpperOrLower uplo, const AbstractDistMa-trix<FMain> &d, const AbstractDistMatrix<F> &dSub, Ab-stractDistMatrix<F> &X, bool conjugate = false)

C API

TODO

Python API

TODO

4.1.37 Reshape

Reshape an m′× n′ matrix into an m× n matrix, where m′n′ = mn, with the entries maintainingtheir column-major ordering.

Python API

Reshape(m, n, A)

C++ API

void Reshape(Int m, Int n, const Matrix<T> &A, Matrix<T> &ASub)

Matrix<T> Reshape(Int m, Int n, const Matrix<T> &A)

void Reshape(Int m, Int n, const AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&ASub)

AbstractDistMatrix<T> Reshape(Int m, Int n, const AbstractDistMatrix<T> &A)

void Reshape(Int m, Int n, const SparseMatrix<T> &A, SparseMatrix<T> &ASub)

SparseMatrix<T> Reshape(Int m, Int n, const SparseMatrix<T> &A)

void Reshape(Int m, Int n, const DistSparseMatrix<T> &A, DistSparseMatrix<T>&ASub)

DistSparseMatrix<T> Reshape(Int m, Int n, const DistSparseMatrix<T> &A)

C API

Integer

ElError ElReshape i(ElInt m, ElInt n, ElConstMatrix i A, ElMatrix i B)

4.1. Level 1 197

Page 202: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElReshapeDist i(ElInt m, ElInt n, ElConstDistMatrix i A, ElDistMatrix i B)

ElError ElReshapeSparse i(ElInt m, ElInt n, ElConstSparseMatrix i A, ElSparseMa-trix i B)

ElError ElReshapeDistSparse i(ElInt m, ElInt n, ElConstDistSparseMatrix i A, ElD-istSparseMatrix i B)

Single-precision

ElError ElReshape s(ElInt m, ElInt n, ElConstMatrix s A, ElMatrix s B)

ElError ElReshapeDist s(ElInt m, ElInt n, ElConstDistMatrix s A, ElDistMatrix s B)

ElError ElReshapeSparse s(ElInt m, ElInt n, ElConstSparseMatrix s A, ElSparseMa-trix s B)

ElError ElReshapeDistSparse s(ElInt m, ElInt n, ElConstDistSparseMatrix s A, ElD-istSparseMatrix s B)

Double-precision

ElError ElReshape d(ElInt m, ElInt n, ElConstMatrix d A, ElMatrix d B)

ElError ElReshapeDist d(ElInt m, ElInt n, ElConstDistMatrix d A, ElDistMatrix d B)

ElError ElReshapeSparse d(ElInt m, ElInt n, ElConstSparseMatrix d A, ElSparseMa-trix d B)

ElError ElReshapeDistSparse d(ElInt m, ElInt n, ElConstDistSparseMatrix d A, ElD-istSparseMatrix d B)

Single-precision complex

ElError ElReshape c(ElInt m, ElInt n, ElConstMatrix c A, ElMatrix c B)

ElError ElReshapeDist c(ElInt m, ElInt n, ElConstDistMatrix c A, ElDistMatrix c B)

ElError ElReshapeSparse c(ElInt m, ElInt n, ElConstSparseMatrix c A, ElSparseMa-trix c B)

ElError ElReshapeDistSparse c(ElInt m, ElInt n, ElConstDistSparseMatrix c A, ElD-istSparseMatrix c B)

Double-precision complex

ElError ElReshape z(ElInt m, ElInt n, ElConstMatrix z A, ElMatrix z B)

ElError ElReshapeDist z(ElInt m, ElInt n, ElConstDistMatrix z A, ElDistMatrix z B)

ElError ElReshapeSparse z(ElInt m, ElInt n, ElConstSparseMatrix z A, ElSparseMa-trix z B)

ElError ElReshapeDistSparse z(ElInt m, ElInt n, ElConstDistSparseMatrix z A, ElD-istSparseMatrix z B)

198 Chapter 4. BLAS-like linear algebra

Page 203: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.1.38 Scale

X := αX.

C++ API

void Scale(T alpha, Matrix<T> &X)

void Scale(T alpha, AbstractDistMatrix<T> &X)

void Scale(T alpha, SparseMatrix<T> &X)

void Scale(T alpha, DistSparseMatrix<T> &X)

C API

ElError ElScale i(ElInt alpha, ElMatrix i A)

ElError ElScale s(float alpha, ElMatrix s A)

ElError ElScale d(double alpha, ElMatrix d A)

ElError ElScale c(complex float alpha, ElMatrix c A)

ElError ElScale z(complex double alpha, ElMatrix z A)

ElError ElScaleDist i(ElInt alpha, ElDistMatrix i A)

ElError ElScaleDist s(float alpha, ElDistMatrix s A)

ElError ElScaleDist d(double alpha, ElDistMatrix d A)

ElError ElScaleDist c(complex float alpha, ElDistMatrix c A)

ElError ElScaleDist z(complex double alpha, ElDistMatrix z A)

ElError ElScaleSparse i(ElInt alpha, ElSparseMatrix i A)

ElError ElScaleSparse s(float alpha, ElSparseMatrix s A)

ElError ElScaleSparse d(double alpha, ElSparseMatrix d A)

ElError ElScaleSparse c(complex float alpha, ElSparseMatrix c A)

ElError ElScaleSparse z(complex double alpha, ElSparseMatrix z A)

ElError ElScaleDistSparse i(ElInt alpha, ElDistSparseMatrix i A)

ElError ElScaleDistSparse s(float alpha, ElDistSparseMatrix s A)

ElError ElScaleDistSparse d(double alpha, ElDistSparseMatrix d A)

ElError ElScaleDistSparse c(complex float alpha, ElDistSparseMatrix c A)

ElError ElScaleDistSparse z(complex double alpha, ElDistSparseMatrix z A)

Python API

Scale(allpha, A)

4.1. Level 1 199

Page 204: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.1.39 ScaleTrapezoid

Scales the entries within the specified trapezoid of a general matrix. The parameter conven-tions follow those of MakeTrapezoidal described above.

C++ API

void ScaleTrapezoid(T alpha, UpperOrLower uplo, Matrix<T> &A, Int offset = 0)

void ScaleTrapezoid(T alpha, UpperOrLower uplo, AbstractDistMatrix<T> &A, Int offset= 0)

void ScaleTrapezoid(T alpha, UpperOrLower uplo, SparseMatrix<T> &A, Int offset = 0)

void ScaleTrapezoid(T alpha, UpperOrLower uplo, DistSparseMatrix<T> &A, Int offset =0)

C API

ElError ElScaleTrapezoid i(ElInt alpha, ElUpperOrLower uplo, ElMatrix i A, ElInt offset)

ElError ElScaleTrapezoid s(float alpha, ElUpperOrLower uplo, ElMatrix s A, ElInt offset)

ElError ElScaleTrapezoid d(double alpha, ElUpperOrLower uplo, ElMatrix d A, ElInt off-set)

ElError ElScaleTrapezoid c(complex float alpha, ElUpperOrLower uplo, ElMatrix c A,ElInt offset)

ElError ElScaleTrapezoid z(complex double alpha, ElUpperOrLower uplo, ElMatrix z A,ElInt offset)

ElError ElScaleTrapezoidDist i(ElInt alpha, ElUpperOrLower uplo, ElDistMatrix i A,ElInt offset)

ElError ElScaleTrapezoidDist s(float alpha, ElUpperOrLower uplo, ElDistMatrix s A,ElInt offset)

ElError ElScaleTrapezoidDist d(double alpha, ElUpperOrLower uplo, ElDistMatrix d A,ElInt offset)

ElError ElScaleTrapezoidDist c(complex float alpha, ElUpperOrLower uplo, ElDistMa-trix c A, ElInt offset)

ElError ElScaleTrapezoidDist z(complex double alpha, ElUpperOrLower uplo, ElDistMa-trix z A, ElInt offset)

ElError ElScaleTrapezoidSparse i(ElInt alpha, ElUpperOrLower uplo, ElSparseMa-trix i A, ElInt offset)

ElError ElScaleTrapezoidSparse s(float alpha, ElUpperOrLower uplo, ElSparseMa-trix s A, ElInt offset)

ElError ElScaleTrapezoidSparse d(double alpha, ElUpperOrLower uplo, ElSparseMa-trix d A, ElInt offset)

ElError ElScaleTrapezoidSparse c(complex float alpha, ElUpperOrLower uplo, ElSparse-Matrix c A, ElInt offset)

ElError ElScaleTrapezoidSparse z(complex double alpha, ElUpperOrLower uplo,ElSparseMatrix z A, ElInt offset)

200 Chapter 4. BLAS-like linear algebra

Page 205: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElScaleTrapezoidDistSparse i(ElInt alpha, ElUpperOrLower uplo, ElDistSparse-Matrix i A, ElInt offset)

ElError ElScaleTrapezoidDistSparse s(float alpha, ElUpperOrLower uplo, ElDistSparse-Matrix s A, ElInt offset)

ElError ElScaleTrapezoidDistSparse d(double alpha, ElUpperOrLower uplo, ElD-istSparseMatrix d A, ElInt offset)

ElError ElScaleTrapezoidDistSparse c(complex float alpha, ElUpperOrLower uplo, ElD-istSparseMatrix c A, ElInt offset)

ElError ElScaleTrapezoidDistSparse z(complex double alpha, ElUpperOrLower uplo, El-DistSparseMatrix z A, ElInt offset)

Python API

ScaleTrapezoid(alpha, uplo, A, offset=0)

4.1.40 SetDiagonal

Sets a diagonal of a matrix equal to a particular vector.

C++ API

void SetDiagonal(Matrix<T> &A, const Matrix<T> &d, Int offset = 0)

void SetDiagonal(DistMatrix<T, U, V> &A, const AbstractDistMatrix<T> &d, Int offset= 0)

void SetRealPartOfDiagonal(Matrix<T> &A, const Matrix<Base<T>> &d, Int offset =0)

void SetRealPartOfDiagonal(DistMatrix<T, U, V> &A, const AbstractDistMa-trix<Base<T>> &d, Int offset = 0)

void SetImagPartOfDiagonal(Matrix<T> &A, const Matrix<Base<T>> &d, Int offset =0)

void SetImagPartOfDiagonal(DistMatrix<T, U, V> &A, const AbstractDistMa-trix<Base<T>> &d, Int offset = 0)

C API

TODO

Python API

TODO

4.1.41 SetSubmatrix

Sets a (possibly non-contiguous) submatrix to a given matrix. another matrix.

4.1. Level 1 201

Page 206: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void SetSubmatrix(Matrix<T> &A, const std::vector<Int> &I, const std::vector<Int>&J, const Matrix<T> &ASub)

void SetSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, const AbstractDistMatrix<T> &ASub)

void SetRealPartOfSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, const Matrix<Base<T>> &ASub)

void SetRealPartOfSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int>&I, const std::vector<Int> &J, const AbstractDistMa-trix<Base<T>> &ASub)

void SetImagPartOfSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, const Matrix<Base<T>> &ASub)

void SetImagPartOfSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int>&I, const std::vector<Int> &J, const AbstractDistMa-trix<Base<T>> &ASub)

C API

TODO

Python API

TODO

4.1.42 ShiftDiagonal

Adds a given value to a diagonal of a matrix.

C++ API

void ShiftDiagonal(Matrix<T> &A, S alpha, Int offset = 0)

void ShiftDiagonal(AbstractDistMatrix<T> &A, S alpha, Int offset = 0)

void ShiftDiagonal(SparseMatrix<T> &A, S alpha, Int offset = 0)

void ShiftDiagonal(DistSparseMatrix<T> &A, S alpha, Int offset = 0)

C API

ElError ElShiftDiagonal i(ElMatrix i A, ElInt alpha, ElInt offset)

ElError ElShiftDiagonal s(ElMatrix s A, float alpha, ElInt offset)

ElError ElShiftDiagonal d(ElMatrix d A, double alpha, ElInt offset)

ElError ElShiftDiagonal c(ElMatrix c A, complex float alpha, ElInt offset)

ElError ElShiftDiagonal z(ElMatrix z A, complex double alpha, ElInt offset)

202 Chapter 4. BLAS-like linear algebra

Page 207: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElShiftDiagonalDist i(ElDistMatrix i A, ElInt alpha, ElInt offset)

ElError ElShiftDiagonalDist s(ElDistMatrix s A, float alpha, ElInt offset)

ElError ElShiftDiagonalDist d(ElDistMatrix d A, double alpha, ElInt offset)

ElError ElShiftDiagonalDist c(ElDistMatrix c A, complex float alpha, ElInt offset)

ElError ElShiftDiagonalDist z(ElDistMatrix z A, complex double alpha, ElInt offset)

ElError ElShiftDiagonalSparse i(ElSparseMatrix i A, ElInt alpha, ElInt offset)

ElError ElShiftDiagonalSparse s(ElSparseMatrix s A, float alpha, ElInt offset)

ElError ElShiftDiagonalSparse d(ElSparseMatrix d A, double alpha, ElInt offset)

ElError ElShiftDiagonalSparse c(ElSparseMatrix c A, complex float alpha, ElInt offset)

ElError ElShiftDiagonalSparse z(ElSparseMatrix z A, complex double alpha, ElInt offset)

ElError ElShiftDiagonalDistSparse i(ElDistSparseMatrix i A, ElInt alpha, ElInt offset)

ElError ElShiftDiagonalDistSparse s(ElDistSparseMatrix s A, float alpha, ElInt offset)

ElError ElShiftDiagonalDistSparse d(ElDistSparseMatrix d A, double alpha, ElInt off-set)

ElError ElShiftDiagonalDistSparse c(ElDistSparseMatrix c A, complex float alpha,ElInt offset)

ElError ElShiftDiagonalDistSparse z(ElDistSparseMatrix z A, complex double alpha,ElInt offset)

Python API

ShiftDiagonal(A, alpha, offset=0)

4.1.43 Swap

Entire matrices

The following routines replace A and B with each other, their transpose, or their adjoint.

C++ API

void Swap(Orientation orientation, Matrix<T> &A, Matrix<T> &B)

void Swap(Orientation orientation, AbstractDistMatrix<T> &A, AbstractDistMatrix<T>&B)

C API

ElError ElSwap i(ElOrientation orientation, ElMatrix i X, ElMatrix i Y)

ElError ElSwap s(ElOrientation orientation, ElMatrix s X, ElMatrix s Y)

ElError ElSwap d(ElOrientation orientation, ElMatrix d X, ElMatrix d Y)

4.1. Level 1 203

Page 208: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSwap c(ElOrientation orientation, ElMatrix c X, ElMatrix c Y)

ElError ElSwap z(ElOrientation orientation, ElMatrix z X, ElMatrix z Y)

ElError ElSwapDist i(ElOrientation orientation, ElDistMatrix i X, ElDistMatrix i Y)

ElError ElSwapDist s(ElOrientation orientation, ElDistMatrix s X, ElDistMatrix s Y)

ElError ElSwapDist d(ElOrientation orientation, ElDistMatrix d X, ElDistMatrix d Y)

ElError ElSwapDist c(ElOrientation orientation, ElDistMatrix c X, ElDistMatrix c Y)

ElError ElSwapDist z(ElOrientation orientation, ElDistMatrix z X, ElDistMatrix z Y)

Pairs of rows

Swap rows to and from in the matrix.

C++ API

void RowSwap(Matrix<T> &A, Int to, Int from)

void RowSwap(AbstractDistMatrix<T> &A, Int to, Int from)

C API

ElError ElRowSwap i(ElMatrix i A, ElInt to, ElInt from)

ElError ElRowSwap s(ElMatrix s A, ElInt to, ElInt from)

ElError ElRowSwap d(ElMatrix d A, ElInt to, ElInt from)

ElError ElRowSwap c(ElMatrix c A, ElInt to, ElInt from)

ElError ElRowSwap z(ElMatrix z A, ElInt to, ElInt from)

ElError ElRowSwapDist i(ElDistMatrix i A, ElInt to, ElInt from)

ElError ElRowSwapDist s(ElDistMatrix s A, ElInt to, ElInt from)

ElError ElRowSwapDist d(ElDistMatrix d A, ElInt to, ElInt from)

ElError ElRowSwapDist c(ElDistMatrix c A, ElInt to, ElInt from)

ElError ElRowSwapDist z(ElDistMatrix z A, ElInt to, ElInt from)

Pairs of columns

Swap columns to and from in the matrix.

C++ API

void ColSwap(Matrix<T> &A, Int to, Int from)

void ColSwap(AbstractDistMatrix<T> &A, Int to, Int from)

204 Chapter 4. BLAS-like linear algebra

Page 209: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElColSwap i(ElMatrix i A, ElInt to, ElInt from)

ElError ElColSwap s(ElMatrix s A, ElInt to, ElInt from)

ElError ElColSwap d(ElMatrix d A, ElInt to, ElInt from)

ElError ElColSwap c(ElMatrix c A, ElInt to, ElInt from)

ElError ElColSwap z(ElMatrix z A, ElInt to, ElInt from)

ElError ElColSwapDist i(ElDistMatrix i A, ElInt to, ElInt from)

ElError ElColSwapDist s(ElDistMatrix s A, ElInt to, ElInt from)

ElError ElColSwapDist d(ElDistMatrix d A, ElInt to, ElInt from)

ElError ElColSwapDist c(ElDistMatrix c A, ElInt to, ElInt from)

ElError ElColSwapDist z(ElDistMatrix z A, ElInt to, ElInt from)

Symmetric/Hermitian swap

Symmetrically permute the to and from degrees of freedom within the implicitly symmetric(Hermitian) matrix A which stores its data in the specified triangle.

C++ API

void SymmetricSwap(UpperOrLower uplo, Matrix<T> &A, Int to, Int from, bool conjugate= false)

void SymmetricSwap(UpperOrLower uplo, AbstractDistMatrix<T> &A, Int to, Int from,bool conjugate = false)

void HermitianSwap(UpperOrLower uplo, Matrix<T> &A, Int to, Int from)

void HermitianSwap(UpperOrLower uplo, AbstractDistMatrix<T> &A, Int to, Int from)

C API

ElError ElSymmetricSwap i(ElUpperOrLower uplo, ElMatrix i A, ElInt to, ElInt from)

ElError ElSymmetricSwap s(ElUpperOrLower uplo, ElMatrix s A, ElInt to, ElInt from)

ElError ElSymmetricSwap d(ElUpperOrLower uplo, ElMatrix d A, ElInt to, ElInt from)

ElError ElSymmetricSwap c(ElUpperOrLower uplo, ElMatrix c A, ElInt to, ElInt from)

ElError ElSymmetricSwap z(ElUpperOrLower uplo, ElMatrix z A, ElInt to, ElInt from)

ElError ElSymmetricSwapDist i(ElUpperOrLower uplo, ElDistMatrix i A, ElInt to,ElInt from)

ElError ElSymmetricSwapDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElInt to,ElInt from)

ElError ElSymmetricSwapDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElInt to,ElInt from)

4.1. Level 1 205

Page 210: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSymmetricSwapDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElInt to,ElInt from)

ElError ElSymmetricSwapDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElInt to,ElInt from)

ElError ElHermitianSwap c(ElUpperOrLower uplo, ElMatrix c A, ElInt to, ElInt from)

ElError ElHermitianSwap z(ElUpperOrLower uplo, ElMatrix z A, ElInt to, ElInt from)

ElError ElHermitianSwapDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElInt to,ElInt from)

ElError ElHermitianSwapDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElInt to,ElInt from)

4.1.44 Symmetric2x2Scale

Apply a 2x2 symmetric (Hermitian) matrix to the matrix A.

C++ API

void Symmetric2x2Scale(LeftOrRight side, UpperOrLower uplo, const Matrix<F> &D,Matrix<F> &A, bool conjugate = false)

void Symmetric2x2Scale(LeftOrRight side, UpperOrLower uplo, const AbstractDistMa-trix<F> &D, AbstractDistMatrix<F> &A, bool conjugate =false)

C API

TODO

Python API

TODO

4.1.45 Symmetric2x2Solve

Apply the inverse of a 2x2 symmetric (Hermitian) matrix to the matrix A.

C++ API

void Symmetric2x2Solve(LeftOrRight side, UpperOrLower uplo, const Matrix<F> &D,Matrix<F> &A, bool conjugate = false)

void Symmetric2x2Solve(LeftOrRight side, UpperOrLower uplo, const AbstractDistMa-trix<F> &D, AbstractDistMatrix<F> &A, bool conjugate =false)

206 Chapter 4. BLAS-like linear algebra

Page 211: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

TODO

Python API

TODO

4.1.46 Transpose

B := AT or B := AH.

C++ API

void Transpose(const Matrix<T> &A, Matrix<T> &B, bool conjugate = false)

void Transpose(const AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &B)

void Transpose(const SparseMatrix<T> &A, SparseMatrix<T> &B, bool conjugate =false)

void Transpose(const DistSparseMatrix<T> &A, DistSparseMatrix<T> &B, bool conju-gate = false)

C API

ElError ElTranspose i(ElConstMatrix i A, ElMatrix i B)

ElError ElTranspose s(ElConstMatrix s A, ElMatrix s B)

ElError ElTranspose d(ElConstMatrix d A, ElMatrix d B)

ElError ElTranspose c(ElConstMatrix c A, ElMatrix c B)

ElError ElTranspose z(ElConstMatrix z A, ElMatrix z B)

ElError ElTransposeDist i(ElConstDistMatrix i A, ElDistMatrix i B)

ElError ElTransposeDist s(ElConstDistMatrix s A, ElDistMatrix s B)

ElError ElTransposeDist d(ElConstDistMatrix d A, ElDistMatrix d B)

ElError ElTransposeDist c(ElConstDistMatrix c A, ElDistMatrix c B)

ElError ElTransposeDist z(ElConstDistMatrix z A, ElDistMatrix z B)

ElError ElTransposeSparse i(ElConstSparseMatrix i A, ElSparseMatrix i B)

ElError ElTransposeSparse s(ElConstSparseMatrix s A, ElSparseMatrix s B)

ElError ElTransposeSparse d(ElConstSparseMatrix d A, ElSparseMatrix d B)

ElError ElTransposeSparse c(ElConstSparseMatrix c A, ElSparseMatrix c B)

ElError ElTransposeSparse z(ElConstSparseMatrix z A, ElSparseMatrix z B)

ElError ElTransposeDistSparse i(ElConstDistSparseMatrix i A, ElDistSparseMa-trix i B)

4.1. Level 1 207

Page 212: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTransposeDistSparse s(ElConstDistSparseMatrix s A, ElDistSparseMa-trix s B)

ElError ElTransposeDistSparse d(ElConstDistSparseMatrix d A, ElDistSparseMa-trix d B)

ElError ElTransposeDistSparse c(ElConstDistSparseMatrix c A, ElDistSparseMa-trix c B)

ElError ElTransposeDistSparse z(ElConstDistSparseMatrix z A, ElDistSparseMa-trix z B)

Python API

Transpose(A, B, conjugate=False)

4.1.47 TransposeAxpyContract

Perform B := α ∑i ATi + B or B := α ∑i AH

i + B, where the summation is performed over thelocal data of each member of the process team that was redundantly assigned entries of A butis not redundantly assigned entries of B. Thus, in the general case where each column and rowof A is respectively distributed over the process sets U0 × U1 and V0 × V1, while each columnand row of B is respectively distributed over U0 and V0, then the result is of the form

B := α ∑i∈U1×V1

ATi + B

or

B := α ∑i∈U1×V1

AHi + B.

C++ API

void TransposeAxpyContract(T alpha, const ElementalMatrix<T> &A, ElementalMa-trix<T> &B, bool conjugate = false)

void TransposeAxpyContract(T alpha, const BlockMatrix<T> &A, BlockMatrix<T> &B,bool conjugate = false)

C API

TODO

Python API

TODO

208 Chapter 4. BLAS-like linear algebra

Page 213: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.1.48 TransposeContract

Perform B := ∑i ATi or B := ∑i AH

i , where the summation is performed over the local dataof each member of the process team that was redundantly assigned entries of A but is notredundantly assigned entries of B. Thus, in the general case where each column and row of Ais respectively distributed over the process sets U0 × U1 and V0 × V1, while each column androw of B is respectively distributed over U0 and V0, then the result is of the form

B = ∑i∈U1×V1

ATi

or

B = ∑i∈U1×V1

AHi .

C++ API

void TransposeContract(const ElementalMatrix<T> &A, ElementalMatrix<T> &B, boolconjugate = false)

void TransposeContract(const BlockMatrix<T> &A, BlockMatrix<T> &B, bool conju-gate = false)

C API

TODO

Python API

TODO

4.1.49 UpdateDiagonal

Adds a multiple of a given vector to a diagonal of a matrix.

C++ API

void UpdateDiagonal(Matrix<T> &A, T alpha, const Matrix<T> &d, Int offset = 0)

void UpdateDiagonal(DistMatrix<T, U, V> &A, T alpha, const AbstractDistMatrix<T>&d, Int offset = 0)

void UpdateRealPartOfDiagonal(Matrix<T> &A, Base<T> alpha, const Ma-trix<Base<T>> &d, Int offset = 0)

void UpdateRealPartOfDiagonal(DistMatrix<T, U, V> &A, Base<T> alpha, const Ab-stractDistMatrix<Base<T>> &d, Int offset = 0)

void UpdateImagPartOfDiagonal(Matrix<T> &A, Base<T> alpha, const Ma-trix<Base<T>> &d, Int offset = 0)

void UpdateImagPartOfDiagonal(DistMatrix<T, U, V> &A, Base<T> alpha, const Ab-stractDistMatrix<Base<T>> &d, Int offset = 0)

4.1. Level 1 209

Page 214: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

TODO

Python API

TODO

4.1.50 UpdateSubmatrix

Adds a multiple of a matrix to a (possibly non-contiguous) submatrix of another matrix.

C++ API

void UpdateSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, T alpha, const Matrix<T> &ASub)

void UpdateSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, T alpha, const AbstractDistMatrix<T>&ASub)

void UpdateRealPartOfSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, Base<T> alpha, const Ma-trix<Base<T>> &ASub)

void UpdateRealPartOfSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int>&I, const std::vector<Int> &J, Base<T> alpha, constAbstractDistMatrix<Base<T>> &ASub)

void UpdateImagPartOfSubmatrix(Matrix<T> &A, const std::vector<Int> &I, conststd::vector<Int> &J, Base<T> alpha, const Ma-trix<Base<T>> &ASub)

void UpdateImagPartOfSubmatrix(AbstractDistMatrix<T> &A, const std::vector<Int>&I, const std::vector<Int> &J, Base<T> alpha, constAbstractDistMatrix<Base<T>> &ASub)

C API

TODO

Python API

TODO

4.1.51 Zero

Sets all of the entries of the input matrix to zero.

210 Chapter 4. BLAS-like linear algebra

Page 215: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Zero(Matrix<T> &A)

void Zero(AbstractDistMatrix<T> &A)

C API

ElError ElZero i(ElMatrix i A)

ElError ElZero s(ElMatrix s A)

ElError ElZero d(ElMatrix d A)

ElError ElZero c(ElMatrix c A)

ElError ElZero z(ElMatrix z A)

ElError ElZeroDist i(ElDistMatrix i A)

ElError ElZeroDist s(ElDistMatrix s A)

ElError ElZeroDist d(ElDistMatrix d A)

ElError ElZeroDist c(ElDistMatrix c A)

ElError ElZeroDist z(ElDistMatrix z A)

4.2 Level 2

The prototypes for the following routines can be found at include/El/blas like/level2.hpp,while the implementations are in src/blas like/level2/.

4.2.1 Gemv

General matrix-vector multiply: y := αop(A)x + βy, where op(A) can be A, AT, or AH.Whether or not x and y are stored as row vectors, they will be interpreted as column vectors.

C++ API

void Gemv(Orientation orientation, T alpha, const Matrix<T> &A, const Matrix<T> &x, Tbeta, Matrix<T> &y)

void Gemv(Orientation orientation, T alpha, const AbstractDistMatrix<T> &A, const Ab-stractDistMatrix<T> &x, T beta, AbstractDistMatrix<T> &y)

C API

ElError ElGemv i(ElOrientation orientation, ElInt alpha, ElConstMatrix i A, ElConstMa-trix i x, ElInt beta, ElMatrix i y)

ElError ElGemv s(ElOrientation orientation, float alpha, ElConstMatrix s A, ElConstMa-trix s x, float beta, ElMatrix s y)

4.2. Level 2 211

Page 216: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGemv d(ElOrientation orientation, double alpha, ElConstMatrix d A, ElConstMa-trix d x, double beta, ElMatrix d y)

ElError ElGemv c(ElOrientation orientation, complex float alpha, ElConstMatrix c A, ElCon-stMatrix c x, complex float beta, ElMatrix c y)

ElError ElGemv z(ElOrientation orientation, complex double alpha, ElConstMatrix z A, El-ConstMatrix z x, complex double beta, ElMatrix z y)

ElError ElGemvDist i(ElOrientation orientation, ElInt alpha, ElConstDistMatrix i A, El-ConstDistMatrix i x, ElInt beta, ElDistMatrix i y)

ElError ElGemvDist s(ElOrientation orientation, float alpha, ElConstDistMatrix s A, El-ConstDistMatrix s x, float beta, ElDistMatrix s y)

ElError ElGemvDist d(ElOrientation orientation, double alpha, ElConstDistMatrix d A, El-ConstDistMatrix d x, double beta, ElDistMatrix d y)

ElError ElGemvDist c(ElOrientation orientation, complex float alpha, ElConstDistMa-trix c A, ElConstDistMatrix c x, complex float beta, ElDistMa-trix c y)

ElError ElGemvDist z(ElOrientation orientation, complex double alpha, ElConstDistMa-trix z A, ElConstDistMatrix z x, complex double beta, ElDistMa-trix z y)

4.2.2 Ger

General rank-one update: A := αxyH + A. x and y are free to be stored as either row or columnvectors, but they will be interpreted as column vectors.

C++ API

void Ger(T alpha, const Matrix<T> &x, const Matrix<T> &y, Matrix<T> &A)

void Ger(T alpha, const AbstractDistMatrix<T> &x, const AbstractDistMatrix<T> &y,AbstractDistMatrix<T> &A)

C API

ElError ElGer i(ElInt alpha, ElConstMatrix i x, ElConstMatrix i y, ElMatrix i A)

ElError ElGer s(float alpha, ElConstMatrix s x, ElConstMatrix s y, ElMatrix s A)

ElError ElGer d(double alpha, ElConstMatrix d x, ElConstMatrix d y, ElMatrix d A)

ElError ElGer c(complex float alpha, ElConstMatrix c x, ElConstMatrix c y, ElMatrix c A)

ElError ElGer z(complex double alpha, ElConstMatrix z x, ElConstMatrix z y, ElMa-trix z A)

ElError ElGerDist i(ElInt alpha, ElConstDistMatrix i x, ElConstDistMatrix i y, ElDist-Matrix i A)

ElError ElGerDist s(float alpha, ElConstDistMatrix s x, ElConstDistMatrix s y, ElDist-Matrix s A)

ElError ElGerDist d(double alpha, ElConstDistMatrix d x, ElConstDistMatrix d y, ElD-istMatrix d A)

212 Chapter 4. BLAS-like linear algebra

Page 217: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGerDist c(complex float alpha, ElConstDistMatrix c x, ElConstDistMatrix c y,ElDistMatrix c A)

ElError ElGerDist z(complex double alpha, ElConstDistMatrix z x, ElConstDistMa-trix z y, ElDistMatrix z A)

4.2.3 Geru

General rank-one update (unconjugated): A := αxyT + A. x and y are free to be stored aseither row or column vectors, but they will be interpreted as column vectors.

C++ API

void Geru(T alpha, const Matrix<T> &x, const Matrix<T> &y, Matrix<T> &A)

void Geru(T alpha, const AbstractDistMatrix<T> &x, const AbstractDistMatrix<T> &y,AbstractDistMatrix<T> &A)

C API

ElError ElGeru c(complex float alpha, ElConstMatrix c x, ElConstMatrix c y, ElMa-trix c A)

ElError ElGeru z(complex double alpha, ElConstMatrix z x, ElConstMatrix z y, ElMa-trix z A)

ElError ElGeruDist c(complex float alpha, ElConstDistMatrix c x, ElConstDistMatrix c y,ElDistMatrix c A)

ElError ElGeruDist z(complex double alpha, ElConstDistMatrix z x, ElConstDistMa-trix z y, ElDistMatrix z A)

4.2.4 Hemv

Hermitian matrix-vector multiply: y := αAx + βy, where A is Hermitian.

Please see SetLocalSymvBlocksize<T>() and LocalSymvBlocksize<T>() in the Tuning pa-rameters section for information on tuning the distributed Hemv() .

C++ API

void Hemv(UpperOrLower uplo, T alpha, const Matrix<T> &A, const Matrix<T> &x, Tbeta, Matrix<T> &y)

void Hemv(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &A, const Abstract-DistMatrix<T> &x, T beta, AbstractDistMatrix<T> &y)

C API

ElError ElHemv c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c A, ElConst-Matrix c x, complex float beta, ElMatrix c y)

4.2. Level 2 213

Page 218: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHemv z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z A, ElCon-stMatrix z x, complex double beta, ElMatrix c y)

ElError ElHemvDist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c A,ElConstDistMatrix c x, complex float beta, ElDistMatrix c y)

ElError ElHemvDist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMa-trix z A, ElConstDistMatrix z x, complex double beta, ElDistMa-trix c y)

4.2.5 Her

Hermitian rank-one update: implicitly performs A := αxxH + A, where only the triangle of Aspecified by uplo is updated.

C++ API

void Her(UpperOrLower uplo, T alpha, const Matrix<T> &x, Matrix<T> &A)

void Her(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &x, AbstractDistMa-trix<T> &A)

C API

ElError ElHer c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c x, ElMa-trix c A)

ElError ElHer z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z x, ElMa-trix z A)

ElError ElHerDist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c x, El-DistMatrix c A)

ElError ElHerDist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMatrix z x,ElDistMatrix z A)

4.2.6 Her2

Hermitian rank-two update: implicitly performs A := αxyH + αyxH + A, where only the tri-angle of A specified by uplo is updated.

C++ API

void Her2(UpperOrLower uplo, T alpha, const Matrix<T> &x, const Matrix<T> &y, Ma-trix<T> &A)

void Her2(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &x, const Abstract-DistMatrix<T> &y, AbstractDistMatrix<T> &A)

214 Chapter 4. BLAS-like linear algebra

Page 219: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElHer2 c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c x, ElConst-Matrix c y, ElMatrix c A)

ElError ElHer2 z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z x, ElCon-stMatrix z y, ElMatrix z A)

ElError ElHer2Dist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c x,ElConstDistMatrix c y, ElDistMatrix c A)

ElError ElHer2Dist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMatrix z x,ElConstDistMatrix z y, ElDistMatrix z A)

4.2.7 QuasiTrsv

Quasi-triangular solve with a vector: computes x := op(A)−1x, where op(A) is either A, AT, orAH, and A is treated an either a lower or upper quasi-triangular matrix, depending upon uplo.

Note that the term quasi-triangular is in the context of real Schur decompositions, which pro-duce triangular matrices with mixes of 1 × 1 and 2 × 2 diagonal blocks.

Note: There is no corresponding BLAS routine, but it is a natural extension of Trsv.

Note: For the best performance, both A and x should be in [MC,MR] distributions.

C++ API

void QuasiTrsv(UpperOrLower uplo, Orientation orientation, const Matrix<F> &A, Ma-trix<F> &x, bool checkIfSingular = false)

void QuasiTrsv(UpperOrLower uplo, Orientation orientation, const AbstractDistMatrix<F>&A, AbstractDistMatrix<F> &x, bool checkIfSingular = false)

C API

ElError ElQuasiTrsv s(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix s A, ElMatrix s x)

ElError ElQuasiTrsv d(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix d A, ElMatrix d x)

ElError ElQuasiTrsv c(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix c A, ElMatrix c x)

ElError ElQuasiTrsv z(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix z A, ElMatrix z x)

ElError ElQuasiTrsvDist s(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix s A, ElDistMatrix s x)

ElError ElQuasiTrsvDist d(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix d A, ElDistMatrix d x)

ElError ElQuasiTrsvDist c(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix c A, ElDistMatrix c x)

4.2. Level 2 215

Page 220: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElQuasiTrsvDist z(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix z A, ElDistMatrix z x)

4.2.8 Symv

Symmetric matrix-vector multiply: y := αAx + βy, where A is symmetric.

Please see SetLocalSymvBlocksize<T>() and LocalSymvBlocksize<T>() in the Tuning pa-rameters section for information on tuning the distributed Symv() .

C++ API

void Symv(UpperOrLower uplo, T alpha, const Matrix<T> &A, const Matrix<T> &x, Tbeta, Matrix<T> &y, bool conjugate = false)

void Symv(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &A, const Abstract-DistMatrix<T> &x, T beta, AbstractDistMatrix<T> &y, bool conjugate = false)

C API

ElError ElSymv i(ElUpperOrLower uplo, ElInt alpha, ElConstMatrix i A, ElConstMa-trix i x, ElInt beta, ElMatrix i y)

ElError ElSymv s(ElUpperOrLower uplo, float alpha, ElConstMatrix s A, ElConstMa-trix s x, float beta, ElMatrix s y)

ElError ElSymv d(ElUpperOrLower uplo, double alpha, ElConstMatrix d A, ElConstMa-trix d x, double beta, ElMatrix d y)

ElError ElSymv c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c A, ElConst-Matrix c x, complex float beta, ElMatrix c y)

ElError ElSymv z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z A, ElCon-stMatrix z x, complex double beta, ElMatrix z y)

ElError ElSymvDist i(ElUpperOrLower uplo, ElInt alpha, ElConstDistMatrix i A, ElConst-DistMatrix i x, ElInt beta, ElDistMatrix i y)

ElError ElSymvDist s(ElUpperOrLower uplo, float alpha, ElConstDistMatrix s A, ElConst-DistMatrix s x, float beta, ElDistMatrix s y)

ElError ElSymvDist d(ElUpperOrLower uplo, double alpha, ElConstDistMatrix d A, El-ConstDistMatrix d x, double beta, ElDistMatrix d y)

ElError ElSymvDist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c A,ElConstDistMatrix c x, complex float beta, ElDistMatrix c y)

ElError ElSymvDist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMa-trix z A, ElConstDistMatrix z x, complex double beta, ElDistMa-trix z y)

4.2.9 Syr

Symmetric rank-one update: implicitly performs A := αxxT + A, where only the triangle of Aspecified by uplo is updated.

216 Chapter 4. BLAS-like linear algebra

Page 221: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Syr(UpperOrLower uplo, T alpha, const Matrix<T> &x, Matrix<T> &A, bool conju-gate = false)

void Syr(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &x, AbstractDistMa-trix<T> &A, bool conjugate = false)

C API

ElError ElSyr i(ElUpperOrLower uplo, ElInt alpha, ElConstMatrix i x, ElMatrix i A)

ElError ElSyr s(ElUpperOrLower uplo, float alpha, ElConstMatrix s x, ElMatrix s A)

ElError ElSyr d(ElUpperOrLower uplo, double alpha, ElConstMatrix d x, ElMatrix d A)

ElError ElSyr c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c x, ElMa-trix c A)

ElError ElSyr z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z x, ElMa-trix z A)

ElError ElSyrDist i(ElUpperOrLower uplo, ElInt alpha, ElConstDistMatrix i x, ElDistMa-trix i A)

ElError ElSyrDist s(ElUpperOrLower uplo, float alpha, ElConstDistMatrix s x, ElDistMa-trix s A)

ElError ElSyrDist d(ElUpperOrLower uplo, double alpha, ElConstDistMatrix d x, ElDist-Matrix d A)

ElError ElSyrDist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c x, El-DistMatrix c A)

ElError ElSyrDist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMatrix z x,ElDistMatrix z A)

4.2.10 Syr2

Symmetric rank-two update: implicitly performs A := α(xyT + yxT) + A, where only thetriangle of A specified by uplo is updated.

C++ API

void Syr2(UpperOrLower uplo, T alpha, const Matrix<T> &x, const Matrix<T> &y, Ma-trix<T> &A, bool conjugate = false)

void Syr2(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &x, const Abstract-DistMatrix<T> &y, AbstractDistMatrix<T> &A, bool conjugate = false)

C API

ElError ElSyr2 i(ElUpperOrLower uplo, ElInt alpha, ElConstMatrix i x, ElConstMatrix i y,ElMatrix i A)

ElError ElSyr2 s(ElUpperOrLower uplo, float alpha, ElConstMatrix s x, ElConstMatrix s y,ElMatrix s A)

4.2. Level 2 217

Page 222: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSyr2 d(ElUpperOrLower uplo, double alpha, ElConstMatrix d x, ElConstMa-trix d y, ElMatrix d A)

ElError ElSyr2 c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c x, ElConst-Matrix c y, ElMatrix c A)

ElError ElSyr2 z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z x, ElCon-stMatrix z y, ElMatrix z A)

ElError ElSyr2Dist i(ElUpperOrLower uplo, ElInt alpha, ElConstDistMatrix i x, ElConst-DistMatrix i y, ElDistMatrix i A)

ElError ElSyr2Dist s(ElUpperOrLower uplo, float alpha, ElConstDistMatrix s x, ElConst-DistMatrix s y, ElDistMatrix s A)

ElError ElSyr2Dist d(ElUpperOrLower uplo, double alpha, ElConstDistMatrix d x, El-ConstDistMatrix d y, ElDistMatrix d A)

ElError ElSyr2Dist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c x,ElConstDistMatrix c y, ElDistMatrix c A)

ElError ElSyr2Dist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMatrix z x,ElConstDistMatrix z y, ElDistMatrix z A)

4.2.11 Trmv

x := tri(A)♯x

Note: Distributed Trmv not yet written. Please call Trmm() for now.

C++ API

void Trmv(UpperOrLower uplo, Orientation orientation, UnitOrNonUnit diag, const Ma-trix<T> &A, Matrix<T> &x)

C API

ElError ElTrmv s(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix s A, ElMatrix s x)

ElError ElTrmv d(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix d A, ElMatrix d x)

ElError ElTrmv c(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix c A, ElMatrix c x)

ElError ElTrmv z(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix z A, ElMatrix z x)

4.2.12 Trr

tri(A) := tri(A + αxy′)

218 Chapter 4. BLAS-like linear algebra

Page 223: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Trr(UpperOrLower uplo, T alpha, const Matrix<T> &x, const Matrix<T> &y, Ma-trix<T> &A, bool conjugate = false)

void Trr(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &x, const Abstract-DistMatrix<T> &y, AbstractDistMatrix<T> &A, bool conjugate = false)

C API

ElError ElTrr i(ElUpperOrLower uplo, ElInt alpha, ElConstMatrix i x, ElConstMatrix i y,ElMatrix i A)

ElError ElTrr s(ElUpperOrLower uplo, float alpha, ElConstMatrix s x, ElConstMatrix s y,ElMatrix s A)

ElError ElTrr d(ElUpperOrLower uplo, double alpha, ElConstMatrix d x, ElConstMa-trix d y, ElMatrix d A)

ElError ElTrr c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c x, ElConstMa-trix c y, ElMatrix c A)

ElError ElTrr z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z x, ElConst-Matrix z y, ElMatrix z A)

ElError ElTrrDist i(ElUpperOrLower uplo, ElInt alpha, ElConstDistMatrix i x, ElConst-DistMatrix i y, ElDistMatrix i A)

ElError ElTrrDist s(ElUpperOrLower uplo, float alpha, ElConstDistMatrix s x, ElConst-DistMatrix s y, ElDistMatrix s A)

ElError ElTrrDist d(ElUpperOrLower uplo, double alpha, ElConstDistMatrix d x, ElCon-stDistMatrix d y, ElDistMatrix d A)

ElError ElTrrDist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c x, El-ConstDistMatrix c y, ElDistMatrix c A)

ElError ElTrrDist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMatrix z x,ElConstDistMatrix z y, ElDistMatrix z A)

4.2.13 Trr2

tri(A) := tri(A + αXY′),

where X and Y each consist of two columns

C++ API

void Trr2(UpperOrLower uplo, T alpha, const Matrix<T> &X, const Matrix<T> &Y, Ma-trix<T> &A, bool conjugate = false)

void Trr2(UpperOrLower uplo, T alpha, const AbstractDistMatrix<T> &X, const Abstract-DistMatrix<T> &Y, AbstractDistMatrix<T> &A, bool conjugate = false)

4.2. Level 2 219

Page 224: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElTrr2 i(ElUpperOrLower uplo, ElInt alpha, ElConstMatrix i X, ElConstMa-trix i Y, ElMatrix i A)

ElError ElTrr2 s(ElUpperOrLower uplo, float alpha, ElConstMatrix s X, ElConstMa-trix s Y, ElMatrix s A)

ElError ElTrr2 d(ElUpperOrLower uplo, double alpha, ElConstMatrix d X, ElConstMa-trix d Y, ElMatrix d A)

ElError ElTrr2 c(ElUpperOrLower uplo, complex float alpha, ElConstMatrix c X, ElConst-Matrix c Y, ElMatrix c A)

ElError ElTrr2 z(ElUpperOrLower uplo, complex double alpha, ElConstMatrix z X, ElCon-stMatrix z Y, ElMatrix z A)

ElError ElTrr2Dist i(ElUpperOrLower uplo, ElInt alpha, ElConstDistMatrix i X, ElConst-DistMatrix i Y, ElDistMatrix i A)

ElError ElTrr2Dist s(ElUpperOrLower uplo, float alpha, ElConstDistMatrix s X, ElConst-DistMatrix s Y, ElDistMatrix s A)

ElError ElTrr2Dist d(ElUpperOrLower uplo, double alpha, ElConstDistMatrix d X, El-ConstDistMatrix d Y, ElDistMatrix d A)

ElError ElTrr2Dist c(ElUpperOrLower uplo, complex float alpha, ElConstDistMatrix c X,ElConstDistMatrix c Y, ElDistMatrix c A)

ElError ElTrr2Dist z(ElUpperOrLower uplo, complex double alpha, ElConstDistMa-trix z X, ElConstDistMatrix z Y, ElDistMatrix z A)

4.2.14 Trsv

Triangular solve with a vector: computes x := op(A)−1x, where op(A) is either A, AT, or AH,and A is treated an either a lower or upper triangular matrix, depending upon uplo. A can alsobe treated as implicitly having a unit-diagonal if diag is set to UNIT.

Note: For the best performance, A and x should both be in [MC,MR] distributions.

C++ API

void Trsv(UpperOrLower uplo, Orientation orientation, UnitOrNonUnit diag, const Ma-trix<F> &A, Matrix<F> &x)

void Trsv(UpperOrLower uplo, Orientation orientation, UnitOrNonUnit diag, const Ab-stractDistMatrix<F> &A, AbstractDistMatrix<F> &x)

C API

ElError ElTrsv s(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix s A, ElMatrix s x)

ElError ElTrsv d(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix d A, ElMatrix d x)

ElError ElTrsv c(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix c A, ElMatrix c x)

220 Chapter 4. BLAS-like linear algebra

Page 225: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTrsv z(ElUpperOrLower uplo, ElOrientation orientation, ElUnitOrNonUnit diag,ElConstMatrix z A, ElMatrix z x)

ElError ElTrsvDist s(ElUpperOrLower uplo, ElOrientation orientation, ElUni-tOrNonUnit diag, ElConstDistMatrix s A, ElDistMatrix s x)

ElError ElTrsvDist d(ElUpperOrLower uplo, ElOrientation orientation, ElUni-tOrNonUnit diag, ElConstDistMatrix d A, ElDistMatrix d x)

ElError ElTrsvDist c(ElUpperOrLower uplo, ElOrientation orientation, ElUni-tOrNonUnit diag, ElConstDistMatrix c A, ElDistMatrix c x)

ElError ElTrsvDist z(ElUpperOrLower uplo, ElOrientation orientation, ElUni-tOrNonUnit diag, ElConstDistMatrix z A, ElDistMatrix z x)

4.3 Level 3

The prototypes for the following routines can be found at include/El/blas like/level3.hpp,while the implementations are in src/blas like/level3/.

4.3.1 Gemm

General matrix-matrix multiplication: updates C := αA#B♯ + βC, where M# and M♯ are indi-vidually defined to be one of M, MT, MH.

Note: For the best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

enum GemmAlgorithm

enumerator GEMM DEFAULT

enumerator GEMM SUMMA A

enumerator GEMM SUMMA B

enumerator GEMM SUMMA C

enumerator GEMM SUMMA DOT

enumerator GEMM CANNON

void Gemm(Orientation orientationOfA, Orientation orientationOfB, T alpha, const Ma-trix<T> &A, const Matrix<T> &B, T beta, Matrix<T> &C)

void Gemm(Orientation orientationOfA, Orientation orientationOfB, T alpha, const Abstract-DistMatrix<T> &A, const AbstractDistMatrix<T> &B, T beta, AbstractDistMa-trix<T> &C, GemmAlgorithm alg = GEMM DEFAULT)

4.3. Level 3 221

Page 226: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElGemm i(ElOrientation orientationOfA, ElOrientation orientationOfB, ElInt alpha,ElConstMatrix i A, ElConstMatrix i B, ElInt beta, ElMatrix i C)

ElError ElGemm s(ElOrientation orientationOfA, ElOrientation orientationOfB, float alpha,ElConstMatrix s A, ElConstMatrix s B, float beta, ElMatrix s C)

ElError ElGemm d(ElOrientation orientationOfA, ElOrientation orientationOfB, double alpha,ElConstMatrix d A, ElConstMatrix d B, double beta, ElMatrix d C)

ElError ElGemm c(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex float alpha, ElConstMatrix c A, ElConstMatrix c B, com-plex float beta, ElMatrix c C)

ElError ElGemm z(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex double alpha, ElConstMatrix z A, ElConstMatrix z B, com-plex double beta, ElMatrix z C)

ElError ElGemmDist i(ElOrientation orientationOfA, ElOrientation orientationOfB, ElInt al-pha, ElConstDistMatrix i A, ElConstDistMatrix i B, ElInt beta, El-DistMatrix i C)

ElError ElGemmDist s(ElOrientation orientationOfA, ElOrientation orientationOfB, float al-pha, ElConstDistMatrix s A, ElConstDistMatrix s B, float beta, El-DistMatrix s C)

ElError ElGemmDist d(ElOrientation orientationOfA, ElOrientation orientationOfB, dou-ble alpha, ElConstDistMatrix d A, ElConstDistMatrix d B, dou-ble beta, ElDistMatrix d C)

ElError ElGemmDist c(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex float alpha, ElConstDistMatrix c A, ElConstDistMatrix c B,complex float beta, ElDistMatrix c C)

ElError ElGemmDist z(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex double alpha, ElConstDistMatrix z A, ElConstDistMatrix z B,complex double beta, ElDistMatrix z C)

ElGemmAlgorithm

An enum which can take on the values:

•EL GEMM DEFAULT

•EL GEMM SUMMA A

•EL GEMM SUMMA B

•EL GEMM SUMMA C

•EL GEMM SUMMA DOT

•EL GEMM CANNON

ElError ElGemmXDist i(ElOrientation orientationOfA, ElOrientation orientationOfB, ElInt al-pha, ElConstDistMatrix i A, ElConstDistMatrix i B, ElInt beta, El-DistMatrix i C, ElGemmAlgorithm alg)

ElError ElGemmXDist s(ElOrientation orientationOfA, ElOrientation orientationOfB, float al-pha, ElConstDistMatrix s A, ElConstDistMatrix s B, float beta, El-DistMatrix s C, ElGemmAlgorithm alg)

222 Chapter 4. BLAS-like linear algebra

Page 227: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGemmXDist d(ElOrientation orientationOfA, ElOrientation orientationOfB, dou-ble alpha, ElConstDistMatrix d A, ElConstDistMatrix d B, dou-ble beta, ElDistMatrix d C, ElGemmAlgorithm alg)

ElError ElGemmXDist c(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex float alpha, ElConstDistMatrix c A, ElConstDistMatrix c B,complex float beta, ElDistMatrix c C, ElGemmAlgorithm alg)

ElError ElGemmXDist z(ElOrientation orientationOfA, ElOrientation orientationOfB, com-plex double alpha, ElConstDistMatrix z A, ElConstDistMatrix z B,complex double beta, ElDistMatrix z C, ElGemmAlgorithm alg)

Python API

GemmAlgorithm

An enum which can take the values...**TODO**

Gemm(orientA, orientB, alpha, A, B, beta, C[, alg=GEMM DEFAULT ])

4.3.2 Hemm

Hermitian matrix-matrix multiplication: updates C := αAB + βC, or C := αBA + βC, depend-ing upon whether side is set to LEFT or RIGHT, respectively. In both of these types of updates,A is implicitly Hermitian and only the triangle specified by uplo is accessed.

Note: For the best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

void Hemm(LeftOrRight side, UpperOrLower uplo, T alpha, const Matrix<T> &A, const Ma-trix<T> &B, T beta, Matrix<T> &C)

void Hemm(LeftOrRight side, UpperOrLower uplo, T alpha, const AbstractDistMatrix<T>&A, const AbstractDistMatrix<T> &B, T beta, AbstractDistMatrix<T> &C)

C API

ElError ElHemm c(ElLeftOrRight side, ElUpperOrLower uplo, complex float alpha, ElConst-Matrix c A, ElConstMatrix c B, complex float beta, ElMatrix c C)

ElError ElHemm z(ElLeftOrRight side, ElUpperOrLower uplo, complex double alpha, ElConst-Matrix z A, ElConstMatrix z B, complex double beta, ElMatrix z C)

ElError ElHemmDist c(ElLeftOrRight side, ElUpperOrLower uplo, complex float alpha, El-ConstDistMatrix c A, ElConstDistMatrix c B, complex float beta, El-DistMatrix c C)

ElError ElHemmDist z(ElLeftOrRight side, ElUpperOrLower uplo, complex double alpha, El-ConstDistMatrix z A, ElConstDistMatrix z B, complex double beta,ElDistMatrix z C)

4.3. Level 3 223

Page 228: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Hemm(side, uplo, alpha, A, B, beta, C)

4.3.3 Herk

Hermitian rank-K update: updates C := αAAH + βC, or C := αAH A + βC, depending uponwhether orientation is set to NORMAL or ADJOINT, respectively. Only the triangle of C specifiedby the uplo parameter is modified.

Please see SetLocalTrrkBlocksize<T>() and LocalTrrkBlocksize<T>() in the Tuning pa-rameters section for information on tuning the distributed Herk() .

Note: For the best performance, A and C should both be in [MC,MR] distributions.

C++ API

void Herk(UpperOrLower uplo, Orientation orientation, T alpha, const Matrix<T> &A, Tbeta, Matrix<T> &C)

void Herk(UpperOrLower uplo, Orientation orientation, T alpha, const AbstractDistMa-trix<T> &A, T beta, AbstractDistMatrix<T> &C)

C API

ElError ElHerk c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha, El-ConstMatrix c A, complex float beta, ElMatrix c C)

ElError ElHerk z(ElUpperOrLower uplo, ElOrientation orientation, complex double alpha, El-ConstMatrix z A, complex double beta, ElMatrix z C)

ElError ElHerkDist c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha,ElConstDistMatrix c A, complex float beta, ElDistMatrix c C)

ElError ElHerkDist z(ElUpperOrLower uplo, ElOrientation orientation, complex double al-pha, ElConstDistMatrix z A, complex double beta, ElDistMa-trix z C)

Python API

Herk(uplo, orient, alpha, A, beta, C)

4.3.4 Her2k

Hermitian rank-2K update: updates C := αABH + αBAH + βC, or C := αAHB + αBH A + βC,depending upon whether orientation is set to NORMAL or ADJOINT, respectively. Only the triangleof C specified by the uplo parameter is modified.

Please see SetLocalTrr2kBlocksize<T>() and LocalTrr2kBlocksize<T>() in the Tuningparameters section for information on tuning the distributed Her2k() .

224 Chapter 4. BLAS-like linear algebra

Page 229: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Note: For the best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

void Her2k(UpperOrLower uplo, Orientation orientation, T alpha, const Matrix<T> &A,const Matrix<T> &B, Base<T> beta, Matrix<T> &C)

void Her2k(UpperOrLower uplo, Orientation orientation, T alpha, const AbstractDistMa-trix<T> &A, const AbstractDistMatrix<T> &B, Base<T> beta, AbstractDist-Matrix<T> &C)

C API

ElError ElHer2k c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha, El-ConstMatrix c A, ElConstMatrix c B, float beta, ElMatrix c C)

ElError ElHer2k z(ElUpperOrLower uplo, ElOrientation orientation, complex double alpha,ElConstMatrix z A, ElConstMatrix z B, double beta, ElMatrix z C)

ElError ElHer2kDist c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha,ElConstDistMatrix c A, ElConstDistMatrix c B, float beta, ElDist-Matrix c C)

ElError ElHer2kDist z(ElUpperOrLower uplo, ElOrientation orientation, complex double al-pha, ElConstDistMatrix z A, ElConstDistMatrix z B, double beta,ElDistMatrix z C)

Python API

Her2k(uplo, orient, alpha, A, B, beta, C)

4.3.5 Multi-shift QuasiTrsm

Solve for X in the linear system

T#X − XD# = Y

or

XT# − D#X = Y

where T is quasi-triangular, D is diagonal, and A# is defined to be one of A, AT, AH. The datamovement requires almost no modification from that of QuasiTrsm() .

Note that the term quasi-triangular is in the context of real Schur decompositions, which pro-duce triangular matrices with mixes of 1 × 1 and 2 × 2 diagonal blocks.

Note: There is no corresponding BLAS routine, but it is a natural extension of Trsm.

4.3. Level 3 225

Page 230: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void MultiShiftQuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation,F alpha, const Matrix<F> &T, const Matrix<F> &shifts, Ma-trix<F> &X)

void MultiShiftQuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation,F alpha, const AbstractDistMatrix<F> &T, const Abstract-DistMatrix<F> &shifts, AbstractDistMatrix<F> &X)

Overwrite the columns of X with the solutions to the shifted linear systems.

void MultiShiftQuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation,Complex<Real> alpha, const Matrix<Real> &T, const Ma-trix<Complex<Real>> &shifts, Matrix<Real> &XReal, Ma-trix<Real> &XImag)

void MultiShiftQuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation,Complex<Real> alpha, const AbstractDistMatrix<Real> &T,const AbstractDistMatrix<Complex<Real>> &shifts, Ab-stractDistMatrix<Real> &XReal, AbstractDistMatrix<Real>&XImag)

Overwrite the columns of the real and imaginary parts of X with the solutions to theshifted linear systems.

C API

ElError ElMultiShiftQuasiTrsm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, float alpha, ElConstMatrix s A, El-ConstMatrix s shifts, ElMatrix s B)

ElError ElMultiShiftQuasiTrsm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, double alpha, ElConstMatrix d A, El-ConstMatrix d shifts, ElMatrix d B)

ElError ElMultiShiftQuasiTrsm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-tation orientation, complex float alpha, ElConstMa-trix c A, ElConstMatrix c shifts, ElMatrix c B)

ElError ElMultiShiftQuasiTrsm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-tation orientation, complex double alpha, ElConstMa-trix z A, ElConstMatrix z shifts, ElMatrix z B)

ElError ElMultiShiftQuasiTrsmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOri-entation orientation, float alpha, ElConstDistMa-trix s A, ElConstDistMatrix s shifts, ElDistMa-trix s B)

ElError ElMultiShiftQuasiTrsmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOri-entation orientation, double alpha, ElConstDist-Matrix d A, ElConstDistMatrix d shifts, ElDist-Matrix d B)

ElError ElMultiShiftQuasiTrsmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOri-entation orientation, complex float alpha, ElConst-DistMatrix c A, ElConstDistMatrix c shifts, ElD-istMatrix c B)

226 Chapter 4. BLAS-like linear algebra

Page 231: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMultiShiftQuasiTrsmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOri-entation orientation, complex double alpha, ElCon-stDistMatrix z A, ElConstDistMatrix z shifts, El-DistMatrix z B)

Python API

MultiShiftQuasiTrsm(side, uplo, orient, alpha, A, shifts, B)

4.3.6 Multi-shift Trsm

Solve for X in the linear system

T#X − XD# = Y

or

XT# − D#X = Y

where T is triangular, D is diagonal, and A# is defined to be one of A, AT, AH. The datamovement requires almost no modification from that of Trsm() .

Note: There is no corresponding BLAS routine, but it is a natural modification of Trsm.

C++ API

void MultiShiftTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, F al-pha, const Matrix<F> &T, const Matrix<F> &shifts, Matrix<F>&X)

void MultiShiftTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, Falpha, const AbstractDistMatrix<F> &T, const AbstractDistMa-trix<F> &shifts, AbstractDistMatrix<F> &X)

Overwrite the columns of X with the solutions to the shifted linear systems.

void MultiShiftTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation,Complex<Real> alpha, const Matrix<Real> &T, const Ma-trix<Complex<Real>> &shifts, Matrix<Real> &XReal, Ma-trix<Real> &XImag)

void MultiShiftTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, Com-plex<Real> alpha, const AbstractDistMatrix<Real> &T, constAbstractDistMatrix<Complex<Real>> &shifts, AbstractDistMa-trix<Real> &XReal, AbstractDistMatrix<Real> &XImag)

Overwrite the columns of the real and imaginary parts of X with the solutions to theshifted linear systems.

C API

ElError ElMultiShiftTrsm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation ori-entation, float alpha, ElMatrix s A, ElConstMatrix s shifts,ElMatrix s B)

4.3. Level 3 227

Page 232: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMultiShiftTrsm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, double alpha, ElMatrix d A, ElConstMa-trix d shifts, ElMatrix d B)

ElError ElMultiShiftTrsm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation ori-entation, complex float alpha, ElMatrix c A, ElConstMa-trix c shifts, ElMatrix c B)

ElError ElMultiShiftTrsm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation ori-entation, complex double alpha, ElMatrix z A, ElConstMa-trix z shifts, ElMatrix z B)

ElError ElMultiShiftTrsmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, float alpha, ElDistMatrix s A, ElCon-stDistMatrix s shifts, ElDistMatrix s B)

ElError ElMultiShiftTrsmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, double alpha, ElDistMatrix d A, El-ConstDistMatrix d shifts, ElDistMatrix d B)

ElError ElMultiShiftTrsmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, complex float alpha, ElDistMatrix c A,ElConstDistMatrix c shifts, ElDistMatrix c B)

ElError ElMultiShiftTrsmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrienta-tion orientation, complex double alpha, ElDistMatrix z A,ElConstDistMatrix z shifts, ElDistMatrix z B)

Python API

MultiShiftTrsm(side, uplo, orient, alpha, A, shifts, B)

4.3.7 QuasiTrsm

Solve for X in the linear system

T#X = Y

or

XT# = Y

where T is quasi-triangular and A# is defined to be one of A, AT, AH. The algorithm is verysimilar to that of Trsm() .

Note that the term quasi-triangular is in the context of real Schur decompositions, which pro-duce triangular matrices with mixes of 1 × 1 and 2 × 2 diagonal blocks.

The following routines overwrite the columns of X with the solutions to the quasi-triangularlinear systems.

Note: There is no corresponding BLAS routine, but it is a natural extension of Trsm.

Note: For best performance, T and X should be in [MC,MR] distributions.

228 Chapter 4. BLAS-like linear algebra

Page 233: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void QuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, F alpha,const Matrix<F> &T, Matrix<F> &X, bool checkIfSingular = false)

void QuasiTrsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, F alpha,const AbstractDistMatrix<F> &T, AbstractDistMatrix<F> &X, boolcheckIfSingular = false)

C API

ElError ElQuasiTrsm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstMatrix s A, ElMatrix s B)

ElError ElQuasiTrsm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,double alpha, ElConstMatrix d A, ElMatrix d B)

ElError ElQuasiTrsm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,complex float alpha, ElConstMatrix c A, ElMatrix c B)

ElError ElQuasiTrsm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,complex double alpha, ElConstMatrix z A, ElMatrix z B)

ElError ElQuasiTrsmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orien-tation, float alpha, ElConstDistMatrix s A, ElDistMatrix s B)

ElError ElQuasiTrsmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation ori-entation, double alpha, ElConstDistMatrix d A, ElDistMa-trix d B)

ElError ElQuasiTrsmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orien-tation, complex float alpha, ElConstDistMatrix c A, ElDistMa-trix c B)

ElError ElQuasiTrsmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orien-tation, complex double alpha, ElConstDistMatrix z A, ElDist-Matrix z B)

Python API

QuasiTrsm(side, uplo, orient, alpha, A, B)

4.3.8 Symm

Symmetric matrix-matrix multiplication: updates C := αAB+ βC, or C := αBA+ βC, depend-ing upon whether side is set to LEFT or RIGHT, respectively. In both of these types of updates,A is implicitly symmetric and only the triangle specified by uplo is accessed.

Note: For best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

void Symm(LeftOrRight side, UpperOrLower uplo, T alpha, const Matrix<T> &A, const Ma-trix<T> &B, T beta, Matrix<T> &C, bool conjugate = false)

4.3. Level 3 229

Page 234: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Symm(LeftOrRight side, UpperOrLower uplo, T alpha, const AbstractDistMatrix<T>&A, const AbstractDistMatrix<T> &B, T beta, AbstractDistMatrix<T> &C,bool conjugate = false)

C API

ElError ElSymm s(ElLeftOrRight side, ElUpperOrLower uplo, float alpha, ElConstMatrix s A,ElConstMatrix s B, float beta, ElMatrix s C)

ElError ElSymm d(ElLeftOrRight side, ElUpperOrLower uplo, double alpha, ElConstMa-trix d A, ElConstMatrix d B, double beta, ElMatrix d C)

ElError ElSymm c(ElLeftOrRight side, ElUpperOrLower uplo, complex float alpha, ElConst-Matrix c A, ElConstMatrix c B, complex float beta, ElMatrix c C)

ElError ElSymm z(ElLeftOrRight side, ElUpperOrLower uplo, complex double alpha, ElConst-Matrix z A, ElConstMatrix z B, complex double beta, ElMatrix z C)

ElError ElSymmDist s(ElLeftOrRight side, ElUpperOrLower uplo, float alpha, ElConstDist-Matrix s A, ElConstDistMatrix s B, float beta, ElDistMatrix s C)

ElError ElSymmDist d(ElLeftOrRight side, ElUpperOrLower uplo, double alpha, ElConst-DistMatrix d A, ElConstDistMatrix d B, double beta, ElDistMa-trix d C)

ElError ElSymmDist c(ElLeftOrRight side, ElUpperOrLower uplo, complex float alpha, El-ConstDistMatrix c A, ElConstDistMatrix c B, complex float beta, El-DistMatrix c C)

ElError ElSymmDist z(ElLeftOrRight side, ElUpperOrLower uplo, complex double alpha, El-ConstDistMatrix z A, ElConstDistMatrix z B, complex double beta,ElDistMatrix z C)

Python API

Symm(side, uplo, alpha, A, B, beta, C, conjugate=False)

4.3.9 Syrk

Symmetric rank-K update: updates C := αAAT + βC, or C := αAT A + βC, depending uponwhether orientation is set to NORMAL or TRANSPOSE, respectively. Only the triangle of C specifiedby the uplo parameter is modified.

Please see SetLocalTrrkBlocksize<T>() and LocalTrrkBlocksize<T>() in the Tuning pa-rameters section for information on tuning the distributed Syrk() .

Note: For the best performance, A and C should both be in [MC,MR] distributions.

C++ API

void Syrk(UpperOrLower uplo, Orientation orientation, T alpha, const Matrix<T> &A, Tbeta, Matrix<T> &C, bool conjugate = false)

230 Chapter 4. BLAS-like linear algebra

Page 235: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Syrk(UpperOrLower uplo, Orientation orientation, T alpha, const AbstractDistMa-trix<T> &A, T beta, AbstractDistMatrix<T> &C, bool conjugate = false)

C API

ElError ElSyrk s(ElUpperOrLower uplo, ElOrientation orientation, float alpha, ElConstMa-trix s A, float beta, ElMatrix s C)

ElError ElSyrk d(ElUpperOrLower uplo, ElOrientation orientation, double alpha, ElConst-Matrix d A, double beta, ElMatrix d C)

ElError ElSyrk c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha, El-ConstMatrix c A, complex float beta, ElMatrix c C)

ElError ElSyrk z(ElUpperOrLower uplo, ElOrientation orientation, complex double alpha, El-ConstMatrix z A, complex double beta, ElMatrix z C)

ElError ElSyrkDist s(ElUpperOrLower uplo, ElOrientation orientation, float alpha, ElCon-stDistMatrix s A, float beta, ElDistMatrix s C)

ElError ElSyrkDist d(ElUpperOrLower uplo, ElOrientation orientation, double alpha, El-ConstDistMatrix d A, double beta, ElDistMatrix d C)

ElError ElSyrkDist c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha,ElConstDistMatrix c A, complex float beta, ElDistMatrix c C)

ElError ElSyrkDist z(ElUpperOrLower uplo, ElOrientation orientation, complex double al-pha, ElConstDistMatrix z A, complex double beta, ElDistMa-trix z C)

Python API

Syrk(uplo, orient, alpha, A, beta, C, conjugate=False)

4.3.10 Syr2k

Symmetric rank-2K update: updates C := α(ABT + BAT) + βC, or C := α(ATB + BT A) +βC, depending upon whether orientation is set to NORMAL or TRANSPOSE, respectively. Only thetriangle of C specified by the uplo parameter is modified.

Please see SetLocalTrr2kBlocksize<T>() and LocalTrr2kBlocksize<T>() in the Tuningparameters section for information on tuning the distributed Syr2k() .

Note: For the best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

void Syr2k(UpperOrLower uplo, Orientation orientation, T alpha, const Matrix<T> &A,const Matrix<T> &B, T beta, Matrix<T> &C, bool conjugate = false)

void Syr2k(UpperOrLower uplo, Orientation orientation, T alpha, const AbstractDistMa-trix<T> &A, const AbstractDistMatrix<T> &B, T beta, AbstractDistMa-trix<T> &C, bool conjugate = false)

4.3. Level 3 231

Page 236: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElSyr2k s(ElUpperOrLower uplo, ElOrientation orientation, float alpha, ElConstMa-trix s A, ElConstMatrix s B, float beta, ElMatrix s C)

ElError ElSyr2k d(ElUpperOrLower uplo, ElOrientation orientation, double alpha, ElConst-Matrix d A, ElConstMatrix d B, double beta, ElMatrix d C)

ElError ElSyr2k c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha, El-ConstMatrix c A, ElConstMatrix c B, complex float beta, ElMatrix c C)

ElError ElSyr2k z(ElUpperOrLower uplo, ElOrientation orientation, complex double alpha,ElConstMatrix z A, ElConstMatrix z B, complex double beta, ElMa-trix z C)

ElError ElSyr2kDist s(ElUpperOrLower uplo, ElOrientation orientation, float alpha, ElCon-stDistMatrix s A, ElConstDistMatrix s B, float beta, ElDistMa-trix s C)

ElError ElSyr2kDist d(ElUpperOrLower uplo, ElOrientation orientation, double alpha, El-ConstDistMatrix d A, ElConstDistMatrix d B, double beta, ElD-istMatrix d C)

ElError ElSyr2kDist c(ElUpperOrLower uplo, ElOrientation orientation, complex float alpha,ElConstDistMatrix c A, ElConstDistMatrix c B, complex float beta,ElDistMatrix c C)

ElError ElSyr2kDist z(ElUpperOrLower uplo, ElOrientation orientation, complex double al-pha, ElConstDistMatrix z A, ElConstDistMatrix z B, com-plex double beta, ElDistMatrix z C)

Python API

Syr2k(uplo, orient, alpha, A, B, beta, C, conjugate=False)

4.3.11 Trdtrmm

Note: This is a modification of Trtrmm for LDL factorizations.

Symmetric/Hermitian triangular matrix-matrix multiply (with diagonal scaling): performsL := LTD−1L, L := LHD−1L, U := UD−1UT, or U := UD−1UH, depending upon the choice ofthe orientation and uplo parameters. Note that L and U are unit-diagonal and their diagonal isoverwritten with D.

C++ API

void Trdtrmm(UpperOrLower uplo, Matrix<F> &A, bool conjugate = false)

void Trdtrmm(UpperOrLower uplo, AbstractDistMatrix<F> &A, bool conjugate = false)

void Trdtrmm(UpperOrLower uplo, Matrix<F> &A, const Matrix<F> &dSub, bool conju-gate = false)

232 Chapter 4. BLAS-like linear algebra

Page 237: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Trdtrmm(UpperOrLower uplo, AbstractDistMatrix<F> &A, const AbstractDistMa-trix<F> &dSub, bool conjugate = false)

An extension to quasi-diagonal D, where the main diagonal is stored over the main di-agonal of A and the subdiagonal is given by dSub.

C API

ElError ElTrdtrmm s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElTrdtrmm d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElTrdtrmm c(ElUpperOrLower uplo, ElMatrix c A, bool conjugate)

ElError ElTrdtrmm z(ElUpperOrLower uplo, ElMatrix z A, bool conjugate)

ElError ElTrdtrmmDist s(ElUpperOrLower uplo, ElDistMatrix s A)

ElError ElTrdtrmmDist d(ElUpperOrLower uplo, ElDistMatrix d A)

ElError ElTrdtrmmDist c(ElUpperOrLower uplo, ElDistMatrix c A, bool conjugate)

ElError ElTrdtrmmDist z(ElUpperOrLower uplo, ElDistMatrix z A, bool conjugate)

ElError ElTrdtrmmQuasi s(ElUpperOrLower uplo, ElMatrix s A, ElConstMatrix s dOff)

ElError ElTrdtrmmQuasi d(ElUpperOrLower uplo, ElMatrix d A, ElConstMatrix d dOff)

ElError ElTrdtrmmQuasi c(ElUpperOrLower uplo, ElMatrix c A, ElConstMatrix c dOff,bool conjugate)

ElError ElTrdtrmmQuasi z(ElUpperOrLower uplo, ElMatrix z A, ElConstMatrix z dOff,bool conjugate)

ElError ElTrdtrmmQuasiDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElConstDistMa-trix s dOff)

ElError ElTrdtrmmQuasiDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElConstDistMa-trix d dOff)

ElError ElTrdtrmmQuasiDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElConstDistMa-trix c dOff, bool conjugate)

ElError ElTrdtrmmQuasiDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElConstDistMa-trix z dOff, bool conjugate)

Python API

Trdtrmm(uplo, A, conjugate=False)

TrdtrmmQuasi(uplo, A, dSub, conjugate=False)

4.3.12 Trmm

Triangular matrix-matrix multiplication: performs C := αA#B, or C := αBA#, depending uponwhether side was chosen to be LEFT or RIGHT, respectively. Whether A is treated as lower orupper triangular is determined by uplo, and A# is defined to be one of A, AT, AH (and diagdetermines whether A is treated as unit-diagonal or not).

4.3. Level 3 233

Page 238: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Note: For the best performance, A and B should both be in [MC,MR] distributions.

C++ API

void Trmm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, T alpha, const Matrix<T> &A, Matrix<T> &B)

void Trmm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, T alpha, const AbstractDistMatrix<T> &A, AbstractDistMatrix<T> &B)

C API

ElError ElTrmm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, float alpha, ElConstMatrix s A, ElMatrix s B)

ElError ElTrmm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, double alpha, ElConstMatrix d A, ElMatrix d B)

ElError ElTrmm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElUn-itOrNonUnit diag, complex float alpha, ElConstMatrix c A, ElMatrix c B)

ElError ElTrmm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, complex double alpha, ElConstMatrix z A, ElMa-trix z B)

ElError ElTrmmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, float alpha, ElConstDistMatrix s A, ElDist-Matrix s B)

ElError ElTrmmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, double alpha, ElConstDistMatrix d A, ElD-istMatrix d B)

ElError ElTrmmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, complex float alpha, ElConstDistMatrix c A,ElDistMatrix c B)

ElError ElTrmmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orienta-tion, ElUnitOrNonUnit diag, complex double alpha, ElConstDistMa-trix z A, ElDistMatrix z B)

Python API

Trmm(side, uplo, orient, diag, alpha, A, B)

4.3.13 Trrk

Triangular rank-k update: performs C := αA#B♯ + βC, where only the triangle of C speci-fied by uplo is modified, and the orientations A# and B♯ are determined by orientationOfA andorientationOfB, respectively.

Note: There is no corresponding BLAS routine, but this type of update is frequently encoun-tered, even in serial. For instance, the symmetric rank-k update performed during an LDLfactorization is symmetric but one of the two update matrices is scaled by D.

234 Chapter 4. BLAS-like linear algebra

Page 239: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Note: For the best performance, A, B, and C should all be in [MC,MR] distributions.

C++ API

void Trrk(UpperOrLower uplo, Orientation orientationOfA, Orientation orientationOfB, T al-pha, const Matrix<T> &A, const Matrix<T> &B, T beta, Matrix<T> &C)

void Trrk(UpperOrLower uplo, Orientation orientationOfA, Orientation orientationOfB, T al-pha, const AbstractDistMatrix<T> &A, const AbstractDistMatrix<T> &B, Tbeta, AbstractDistMatrix<T> &C)

C API

ElError ElTrrk s(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,float alpha, ElConstMatrix s A, ElConstMatrix s B, float beta, ElMa-trix s C)

ElError ElTrrk d(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB, dou-ble alpha, ElConstMatrix d A, ElConstMatrix d B, double beta, ElMa-trix d C)

ElError ElTrrk c(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,complex float alpha, ElConstMatrix c A, ElConstMatrix c B, com-plex float beta, ElMatrix c C)

ElError ElTrrk z(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,complex double alpha, ElConstMatrix z A, ElConstMatrix z B, com-plex double beta, ElMatrix z C)

ElError ElTrrkDist s(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation ori-entB, float alpha, ElConstDistMatrix s A, ElConstDistMatrix s B,float beta, ElDistMatrix s C)

ElError ElTrrkDist d(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,double alpha, ElConstDistMatrix d A, ElConstDistMatrix d B,double beta, ElDistMatrix d C)

ElError ElTrrkDist c(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,complex float alpha, ElConstDistMatrix c A, ElConstDistMatrix c B,complex float beta, ElDistMatrix c C)

ElError ElTrrkDist z(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation ori-entB, complex double alpha, ElConstDistMatrix z A, ElConstDist-Matrix z B, complex double beta, ElDistMatrix z C)

Python API

Trrk(uplo, orientA, orientB, alpha, A, B, beta, C)

4.3. Level 3 235

Page 240: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.3.14 Trr2k

Triangular rank-2k update: performs E := αA#B♯ + βC♦D + γE, where only the triangle of Especified by uplo is modified, and the orientation of each input matrix, e.g., A# ∈ A, AT, AH,is determined by orientationOfX for each X ∈ A, B, C, D.

Note: There is no corresponding BLAS routine, but it is a natural generalization of “symmet-ric” and “Hermitian” updates.

Note: For the best performance, A, B, C, D, and E should all be in [MC,MR] distributions.

C++ API

void Trr2k(UpperOrLower uplo, Orientation orientationOfA, Orientation orientationOfB,Orientation orientationOfC, Orientation orientationOfD, T alpha, const Ma-trix<T> &A, const Matrix<T> &B, T beta, const Matrix<T> &C, const Ma-trix<T> &D, T gamma, Matrix<T> &E)

void Trr2k(UpperOrLower uplo, Orientation orientationOfA, Orientation orientationOfB,Orientation orientationOfC, Orientation orientationOfD, T alpha, const Abstract-DistMatrix<T> &A, const AbstractDistMatrix<T> &B, T beta, const Abstract-DistMatrix<T> &C, const AbstractDistMatrix<T> &D, T gamma, Abstract-DistMatrix<T> &E)

C API

ElError ElTrr2k s(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB, ElO-rientation orientC, ElOrientation orientD, float alpha, ElConstMatrix s A,ElConstMatrix s B, float beta, ElConstMatrix s C, ElConstMatrix s D,float gamma, ElMatrix s E)

ElError ElTrr2k d(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB, ElO-rientation orientC, ElOrientation orientD, double alpha, ElConstMa-trix d A, ElConstMatrix d B, double beta, ElConstMatrix d C, ElCon-stMatrix d D, double gamma, ElMatrix d E)

ElError ElTrr2k c(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB, ElO-rientation orientC, ElOrientation orientD, complex float alpha, ElConst-Matrix c A, ElConstMatrix c B, complex float beta, ElConstMatrix c C,ElConstMatrix c D, complex float gamma, ElMatrix c E)

ElError ElTrr2k z(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB, ElO-rientation orientC, ElOrientation orientD, complex double alpha, ElCon-stMatrix z A, ElConstMatrix z B, complex double beta, ElConstMa-trix z C, ElConstMatrix z D, complex double gamma, ElMatrix z E)

ElError ElTrr2kDist s(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,ElOrientation orientC, ElOrientation orientD, float alpha, ElCon-stDistMatrix s A, ElConstDistMatrix s B, float beta, ElConst-DistMatrix s C, ElConstDistMatrix s D, float gamma, ElDistMa-trix s E)

236 Chapter 4. BLAS-like linear algebra

Page 241: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTrr2kDist d(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,ElOrientation orientC, ElOrientation orientD, double alpha, ElCon-stDistMatrix d A, ElConstDistMatrix d B, double beta, ElConst-DistMatrix d C, ElConstDistMatrix d D, double gamma, ElDist-Matrix d E)

ElError ElTrr2kDist c(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation ori-entB, ElOrientation orientC, ElOrientation orientD, complex float al-pha, ElConstDistMatrix c A, ElConstDistMatrix c B, com-plex float beta, ElConstDistMatrix c C, ElConstDistMatrix c D,complex float gamma, ElDistMatrix c E)

ElError ElTrr2kDist z(ElUpperOrLower uplo, ElOrientation orientA, ElOrientation orientB,ElOrientation orientC, ElOrientation orientD, complex double al-pha, ElConstDistMatrix z A, ElConstDistMatrix z B, com-plex double beta, ElConstDistMatrix z C, ElConstDistMatrix z D,complex double gamma, ElDistMatrix z E)

Python API

Trr2k(uplo, orientA, orientB, orientC, orientD, alpha, A, B, beta, C, D, gamma, E)

4.3.15 Trsm

Triangular solve with multiple right-hand sides: performs C := αA−#B, or C := αBA−#, de-pending upon whether side was chosen to be LEFT or RIGHT, respectively. Whether A is treatedas lower or upper triangular is determined by uplo, and A−# can be A−1, A−T, or A−H (anddiag determines whether A is treated as unit-diagonal or not).

Note: For the best performance, A and B should both be in [MC,MR] distributions.

C++ API

void Trsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, F alpha, const Matrix<F> &A, Matrix<F> &B)

void Trsm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, F alpha, const AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B)

C API

ElError ElTrsm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, float alpha, ElConstMatrix s A, ElMatrix s B)

ElError ElTrsm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, double alpha, ElConstMatrix d A, ElMatrix d B)

ElError ElTrsm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElUn-itOrNonUnit diag, complex float alpha, ElConstMatrix c A, ElMatrix c B)

4.3. Level 3 237

Page 242: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTrsm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation, ElU-nitOrNonUnit diag, complex double alpha, ElConstMatrix z A, ElMa-trix z B)

ElError ElTrsmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, float alpha, ElConstDistMatrix s A, ElDist-Matrix s B)

ElError ElTrsmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, double alpha, ElConstDistMatrix d A, ElD-istMatrix d B)

ElError ElTrsmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, complex float alpha, ElConstDistMatrix c A,ElDistMatrix c B)

ElError ElTrsmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orienta-tion, ElUnitOrNonUnit diag, complex double alpha, ElConstDistMa-trix z A, ElDistMatrix z B)

Python API

Trsm(side, uplo, orient, diag, alpha, A, B)

4.3.16 Trtrmm

Note: This routine loosely corresponds with the LAPACK routines ?lauum.

Symmetric/Hermitian triangular matrix-matrix multiply: performs L := LT L, L := LH L, U :=UUT, or U := UUH, depending upon the choice of the orientation and uplo parameters.

Note: For the best performance, A should be in a [MC,MR] distribution.

C++ API

void Trtrmm(UpperOrLower uplo, Matrix<T> &A, bool conjugate = false)

void Trtrmm(UpperOrLower uplo, AbstractDistMatrix<T> &A, bool conjugate = false)

C API

ElError ElTrtrmm s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElTrtrmm d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElTrtrmm c(ElUpperOrLower uplo, ElMatrix c A, bool conjugate)

ElError ElTrtrmm z(ElUpperOrLower uplo, ElMatrix z A, bool conjugate)

ElError ElTrtrmmDist s(ElUpperOrLower uplo, ElDistMatrix s A)

ElError ElTrtrmmDist d(ElUpperOrLower uplo, ElDistMatrix d A)

ElError ElTrtrmmDist c(ElUpperOrLower uplo, ElDistMatrix c A, bool conjugate)

238 Chapter 4. BLAS-like linear algebra

Page 243: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTrtrmmDist z(ElUpperOrLower uplo, ElDistMatrix z A, bool conjugate)

Python API

Trtrmm(uplo, A, conjugate=False)

4.3.17 Trstrm

Performs a triangular solve against a triangular matrix. Only the Left Lower Normal option iscurrently supported.

Note: For the best performance, A and B should both be in [MC,MR] distributions.

C++ API

void Trstrm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, F alpha, const Matrix<F> &A, Matrix<F> &X, bool checkIfSingular =true)

void Trstrm(LeftOrRight side, UpperOrLower uplo, Orientation orientation, UnitOrNonUnitdiag, F alpha, const AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &X,bool checkIfSingular = true)

C API

ElError ElTrstrm s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, float alpha, ElConstMatrix s A, ElMatrix s B)

ElError ElTrstrm d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, double alpha, ElConstMatrix d A, ElMa-trix d B)

ElError ElTrstrm c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, complex float alpha, ElConstMatrix c A, ElMa-trix c B)

ElError ElTrstrm z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orientation,ElUnitOrNonUnit diag, complex double alpha, ElConstMatrix z A, El-Matrix z B)

ElError ElTrstrmDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orienta-tion, ElUnitOrNonUnit diag, float alpha, ElConstDistMatrix s A,ElDistMatrix s B)

ElError ElTrstrmDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orien-tation, ElUnitOrNonUnit diag, double alpha, ElConstDistMa-trix d A, ElDistMatrix d B)

ElError ElTrstrmDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orienta-tion, ElUnitOrNonUnit diag, complex float alpha, ElConstDistMa-trix c A, ElDistMatrix c B)

4.3. Level 3 239

Page 244: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElTrstrmDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrientation orienta-tion, ElUnitOrNonUnit diag, complex double alpha, ElConstDist-Matrix z A, ElDistMatrix z B)

Python API

Trstrm(side, uplo, orient, diag, alpha, A, X)

4.3.18 Two-sided Trmm

Performs a two-sided triangular multiplication with multiple right-hand sides which preservesthe symmetry of the input matrix, either A := LH AL or A := UAUH.

Note: For the best performance, A and B should both be in [MC,MR] distributions.

C++ API

void TwoSidedTrmm(UpperOrLower uplo, UnitOrNonUnit diag, Matrix<T> &A, const Ma-trix<T> &B)

void TwoSidedTrmm(UpperOrLower uplo, UnitOrNonUnit diag, AbstractDistMatrix<T>&A, const AbstractDistMatrix<T> &B)

C API

ElError ElTwoSidedTrmm s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix s A,ElConstMatrix s B)

ElError ElTwoSidedTrmm d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix d A,ElConstMatrix d B)

ElError ElTwoSidedTrmm c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix c A,ElConstMatrix c B)

ElError ElTwoSidedTrmm z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix z A,ElConstMatrix z B)

ElError ElTwoSidedTrmmDist s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix s A, ElConstDistMatrix s B)

ElError ElTwoSidedTrmmDist d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix d A, ElConstDistMatrix d B)

ElError ElTwoSidedTrmmDist c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix c A, ElConstDistMatrix c B)

ElError ElTwoSidedTrmmDist z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix z A, ElConstDistMatrix z B)

Python API

TwoSidedTrmm(uplo, diag, A, B)

240 Chapter 4. BLAS-like linear algebra

Page 245: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.3.19 Two-sided Trsm

Performs a two-sided triangular solves with multiple right-hand sides which preserves thesymmetry of the input matrix, either A := L−1AL−H or A := U−H AU−1.

Note: For the best performance, A and B should both be in [MC,MR] distributions.

C++ API

void TwoSidedTrsm(UpperOrLower uplo, UnitOrNonUnit diag, Matrix<F> &A, const Ma-trix<F> &B)

void TwoSidedTrsm(UpperOrLower uplo, UnitOrNonUnit diag, AbstractDistMatrix<F>&A, const AbstractDistMatrix<F> &B)

C API

ElError ElTwoSidedTrsm s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix s A,ElConstMatrix s B)

ElError ElTwoSidedTrsm d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix d A,ElConstMatrix d B)

ElError ElTwoSidedTrsm c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix c A,ElConstMatrix c B)

ElError ElTwoSidedTrsm z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMatrix z A,ElConstMatrix z B)

ElError ElTwoSidedTrsmDist s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix s A, ElConstDistMatrix s B)

ElError ElTwoSidedTrsmDist d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix d A, ElConstDistMatrix d B)

ElError ElTwoSidedTrsmDist c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix c A, ElConstDistMatrix c B)

ElError ElTwoSidedTrsmDist z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElDistMa-trix z A, ElConstDistMatrix z B)

Python API

TwoSidedTrsm(uplo, diag, A, B)

4.4 Tuning parameters

The following tuning parameters have been exposed since they are system-dependent and canhave a large impact on performance.

4.4. Tuning parameters 241

Page 246: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

4.4.1 LocalSymvBlocksize

void SetLocalSymvBlocksize<T>(int blocksize)Sets the local blocksize for the distributed Symv() routine for datatype T. It is set to 64by default and is important for the reduction of a real symmetric matrix to symmetrictridiagonal form.

int LocalSymvBlocksize<T>()Retrieves the local Symv() blocksize for datatype T.

4.4.2 LocalTrrkBlocksize

void SetLocalTrrkBlocksize<T>(int blocksize)Sets the local blocksize for the distributed LocalTrrk routine for datatype T. It is set to64 by default and is important for routines that perform distributed Syrk() or Herk()updates, e.g., Cholesky factorization.

int LocalTrrkBlocksize<T>()Retrieves the local blocksize for the distributed LocalTrrk routine for datatype T.

4.4.3 LocalTrr2kBlocksize

void SetLocalTrr2kBlocksize<T>(int blocksize)Sets the local blocksize for the distributed LocalTrr2k routine for datatype T. It is set to64 by default and is important for routines that perform distributed Syr2k() or Her2k()updates, e.g., Householder tridiagonalization.

int LocalTrr2kBlocksize<T>()Retrieves the local blocksize for the distributed LocalTrr2k routine for datatype T.

242 Chapter 4. BLAS-like linear algebra

Page 247: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

FIVE

LAPACK-LIKE LINEAR ALGEBRA

This chapter describes all of the linear algebra operations which are not basic enough to fallwithin the BLAS (Basic Linear Algebra Subprograms) framework. In particular, algorithmswhich would traditionally have fallen into the domain of LAPACK (Linear Algebra PACKage),such as factorizations and matrix decompositions, are placed here.

5.1 Reduction to condensed form

Computing the eigenvalues or singular values of a matrix, as a general rule, boils down to aniterative procedure. Naive applications of this iterative algorithm would often both requireO(n4) work for n × n matrices and be less numerically stable than first spending O(n3) workto condense the matrix to a form where each of roughly O(n) iterations requires at most O(n2)work. In the case of a full eigenvalue decomposition of a Hermitian matrix, a similarity trans-formation composed of Householder transformations is applied to condense the matrix downto real symmetric tridiagonal form, where an iterative algorithm can be quickly (read: in atmost cubic time) applied. Similarly, it is standard practice to condense a general matrix tobidiagonal form in order to compute its Singular Value Decomposition, and to reduce a gen-eral square matrix to upper Hessenberg form in order to compute its Schur decomposition. Ineach of these cases, it is possible cast a significant portion of the reduction to condensed forminto high-performance matrix-matrix multiplications [DSH1989].

5.1.1 Hermitian to tridiagonal

The standard approach for computing eigenpairs of dense Hermitian matrices begins by per-forming a unitary similarity transformation which reduces the matrix to real symmetric tridi-agonal form (usually through Householder transformations). The following routines performsaid reduction on a Hermitian matrix and store the scaled Householder vectors in place of theintroduced zeroes.

Note: While so-called Successive Band Reduction approaches, which reduce the matrix to tridi-agonal form using a two-stage process, are sometimes preferred, they are not yet supportedwithin Elemental. Please see [ELPA2011] for such an implementation.

Reduction

Elemental currently provides two different basic strategies for the reduction of a Hermitianmatrix to tridiagonal form via unitary similarity:

243

Page 248: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1. Run a pipelined algorithm designed for general (rectangular) process grids.

2. Redistribute the matrix so that it is owned by a perfect square number of processes,perform a fast reduction to tridiaogal form, and redistribute the data back to the originalprocess grid. This algorithm is nearly identical to that of [HJS1999] and [Stanley1997].

There is clearly a small penalty associated with the extra redistributions necessary for the sec-ond approach, but the benefit from using a square process grid is usually quite signficant. Bydefault, HermitianTridiag() will run the standard algorithm (approach 1) unless the matrixis already distributed over a square process grid. The reasoning is that good performancedepends upon a “good” ordering of the square (say, p × p) subgrid, though usually either arow-major or column-major ordering of the first p2 processes suffices.

enum HermitianTridiagApproach

enumerator HERMITIAN TRIDIAG NORMAL

Run the pipelined rectangular algorithm.

enumerator HERMITIAN TRIDIAG SQUARE

Run the square grid algorithm on the largest possible square process grid.

enumerator HERMITIAN TRIDIAG DEFAULT

If the given process grid is already square, run the square grid algorithm, otherwiseuse the pipelined non-square approach.

Note: A properly tuned HERMITIAN TRIDIAG SQUARE approach is almost always fastest,so it is worthwhile to test it with both the COLUMN MAJOR and ROW MAJOR subgrid order-ings, as described below.

Note: The first algorithm heavily depends upon the performance of distributedSymv() , so users interested in maximizing the performance of the first algorithm willlikely want to investigate different values for the local blocksizes through the routineSetLocalSymvBlocksize<T>( int blocksize ); the default value is 64.

Python API

HermitianTridiag(uplo, A[, onlyTridiag=False, ctrl=None])

C++ API

void HermitianTridiag(UpperOrLower uplo, Matrix<F> &A, Matrix<F> &t)

void HermitianTridiag(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDist-Matrix<F> &t, const HermitianTridiagCtrl &ctrl = Hermi-tianTridiagCtrl())

Overwrites the main and sub (super) diagonal of the real matrix A with its similar sym-metric tridiagonal matrix and stores the scaled Householder vectors below (above) itstridiagonal entries. Complex Hermitian reductions have the added complication of need-ing to also store the scalings for the Householder vectors (the scaling can be inferred sincethe Householder vectors must be unit length) if they are to be applied (in the column vec-tor t).

244 Chapter 5. LAPACK-like linear algebra

Page 249: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void herm tridiag::ExplicitCondensed(UpperOrLower uplo, Matrix<F> &A)

void herm tridiag::ExplicitCondensed(UpperOrLower uplo, AbstractDistMatrix<F>&A, const HermitianTridiagCtrl &ctrl = Hermi-tianTridiagCtrl())

Returns just the (appropriate triangle of the) resulting tridiagonal matrix.

class HermitianTridiagCtrl

HermitianTridiagApproach approach

GridOrder order

HermitianTridiagCtrl()

Sets approach to HERMITIAN TRIDIAG SQUARE and order to ROW MAJOR.

C API

ElHermitianTridiagCtrl

ElHermitianTridiagApproach approach

ElGridOrder order

ElHermitianTridiagCtrlDefault(ElHermitianTridiagCtrl* ctrl)Sets approach to HERMITIAN TRIDIAG SQUARE and order to ROW MAJOR.

Single-precisionElError ElHermitianTridiag s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s t)ElError ElHermitianTridiagDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMa-

trix s t)ElError ElHermitianTridiagXDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMa-

trix s t, ElHermitianTridiagCtrl ctrl)

ElError ElHermitianTridiagExplicitCondensed s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHermitianTridiagExplicitCondensedDist s(ElUpperOrLower uplo, ElDist-Matrix s A)

ElError ElHermitianTridiagExplicitCondensedXDist s(ElUpperOrLower uplo, El-DistMatrix s A, ElHermi-tianTridiag ctrl)

Double-precisionElError ElHermitianTridiag d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d t)ElError ElHermitianTridiagDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDistMa-

trix d t)ElError ElHermitianTridiagXDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDist-

Matrix d t, ElHermitianTridiagCtrl ctrl)

ElError ElHermitianTridiagExplicitCondensed d(ElUpperOrLower uplo, ElMa-trix d A)

ElError ElHermitianTridiagExplicitCondensedDist d(ElUpperOrLower uplo, ElDist-Matrix d A)

5.1. Reduction to condensed form 245

Page 250: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianTridiagExplicitCondensedXDist d(ElUpperOrLower uplo, El-DistMatrix d A, ElHermi-tianTridiag ctrl)

Single-precision complexElError ElHermitianTridiag c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix c t)ElError ElHermitianTridiagDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMa-

trix c t)ElError ElHermitianTridiagXDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMa-

trix c t, ElHermitianTridiagCtrl ctrl)

ElError ElHermitianTridiagExplicitCondensed c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHermitianTridiagExplicitCondensedDist c(ElUpperOrLower uplo, ElDist-Matrix c A)

ElError ElHermitianTridiagExplicitCondensedXDist c(ElUpperOrLower uplo, El-DistMatrix c A, ElHermi-tianTridiag ctrl)

Double-precision complexElError ElHermitianTridiag z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix z t)ElError ElHermitianTridiagDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMa-

trix z t)ElError ElHermitianTridiagXDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMa-

trix z t, ElHermitianTridiagCtrl ctrl)

ElError ElHermitianTridiagExplicitCondensed z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHermitianTridiagExplicitCondensedDist z(ElUpperOrLower uplo, ElDist-Matrix z A)

ElError ElHermitianTridiagExplicitCondensedXDist z(ElUpperOrLower uplo, El-DistMatrix z A, ElHermi-tianTridiag ctrl)

Applying the change of basis

Apply (from the left or right) the implicitly defined unitary matrix (or its adjoint) representedby the Householder transformations stored within the specified triangle of A and their scalingsare stored in the vector t.

Implementation

Python API

ApplyQAfterHermitianTridiag(side, uplo, orient, A, t, B)

246 Chapter 5. LAPACK-like linear algebra

Page 251: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void herm tridiag::ApplyQ(LeftOrRight side, UpperOrLower uplo, Orientation orientation,const Matrix<F> &A, const Matrix<F> &t, Matrix<F>&B)

void herm tridiag::ApplyQ(LeftOrRight side, UpperOrLower uplo, Orientation orientation,const AbstractDistMatrix<F> &A, const AbstractDistMa-trix<F> &t, AbstractDistMatrix<F> &B)

C API

Single-precisionElError ElApplyQAfterHermitianTridiag z(ElLeftOrRight side, ElUpperOrLower uplo,

ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElMatrix z B)

ElError ElApplyQAfterHermitianTridiagDist z(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMatrix z A, ElConstDist-Matrix z t, ElDistMatrix z B)

Double-precisionElError ElApplyQAfterHermitianTridiag d(ElLeftOrRight side, ElUpperOrLower uplo,

ElOrientation orientation, ElConstMa-trix d A, ElConstMatrix d t, ElMatrix d B)

ElError ElApplyQAfterHermitianTridiagDist d(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMatrix d A, ElConstDist-Matrix d t, ElDistMatrix d B)

Single-precision complexElError ElApplyQAfterHermitianTridiag c(ElLeftOrRight side, ElUpperOrLower uplo,

ElOrientation orientation, ElConstMa-trix c A, ElConstMatrix c t, ElMatrix c B)

ElError ElApplyQAfterHermitianTridiagDist c(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMatrix c A, ElConstDist-Matrix c t, ElDistMatrix c B)

Double-precision complexElError ElApplyQAfterHermitianTridiag z(ElLeftOrRight side, ElUpperOrLower uplo,

ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElMatrix z B)

ElError ElApplyQAfterHermitianTridiagDist z(ElLeftOrRight side, ElUpperOr-Lower uplo, ElOrientation orientation,ElConstDistMatrix z A, ElConstDist-Matrix z t, ElDistMatrix z B)

5.1. Reduction to condensed form 247

Page 252: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

References

Implementation

Subroutine implementations

Test driver

5.1.2 Square to Hessenberg

Reduction

Elemental’s algorithms for reducing square matrices to Hessenberg form via products ofHouseholder similarity transformations are straight-forward parallelizations (and extensionsto the complex field) of an algorithm described within [QvdG2006], which can be viewed as amodification of the corresponding algorithm from [DSH1989] which shifts some of the workfrom level 2 to level 3 BLAS.

Python API

Hessenberg(uplo, A[, hessOnly=False])

C++ API

void Hessenberg(UpperOrLower uplo, Matrix<F> &A, Matrix<F> &t)

void Hessenberg(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<F> &t)

Return the in-place reduction of the matrix A to lower-/upper-Hessenberg form. Thevector t contains the scalings for the Householder reflectors, which are stored in the lo-cations of the zeros that they introduced.

void hessenberg::ExplicitCondensed(UpperOrLower uplo, Matrix<F> &A)

void hessenberg::ExplicitCondensed(UpperOrLower uplo, AbstractDistMatrix<F>&A)

Return just the Hessenberg matrix.

C API

Single-precisionElError ElHessenberg s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s t)ElError ElHessenbergDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMatrix s t)

Return the in-place reduction of the matrix A to lower-/upper-Hessenberg form. Thevector t contains the scalings for the Householder reflectors, which are stored in the lo-cations of the zeros that they introduced.

ElError ElHessenbergExplicitCondensed s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHessenbergExplicitCondensedDist s(ElUpperOrLower uplo, ElDistMa-trix s A)

Return just the Hessenberg matrix.

248 Chapter 5. LAPACK-like linear algebra

Page 253: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precisionElError ElHessenberg d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d t)ElError ElHessenbergDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDistMatrix d t)

Return the in-place reduction of the matrix A to lower-/upper-Hessenberg form. Thevector t contains the scalings for the Householder reflectors, which are stored in the lo-cations of the zeros that they introduced.

ElError ElHessenbergExplicitCondensed d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHessenbergExplicitCondensedDist d(ElUpperOrLower uplo, ElDistMa-trix d A)

Return just the Hessenberg matrix.

Single-precision complexElError ElHessenberg c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix c t)ElError ElHessenbergDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMatrix c t)

Return the in-place reduction of the matrix A to lower-/upper-Hessenberg form. Thevector t contains the scalings for the Householder reflectors, which are stored in the lo-cations of the zeros that they introduced.

ElError ElHessenbergExplicitCondensed c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHessenbergExplicitCondensedDist c(ElUpperOrLower uplo, ElDistMa-trix c A)

Return just the Hessenberg matrix.

Double-precision complexElError ElHessenberg z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix z t)ElError ElHessenbergDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMatrix z t)

Return the in-place reduction of the matrix A to lower-/upper-Hessenberg form. Thevector t contains the scalings for the Householder reflectors, which are stored in the lo-cations of the zeros that they introduced.

ElError ElHessenbergExplicitCondensed z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHessenbergExplicitCondensedDist z(ElUpperOrLower uplo, ElDistMa-trix z A)

Return just the Hessenberg matrix.

Applying the change of basis

Python API

ApplyQAfterHessenberg(side, uplo, orient, A, t, B)

C++ API

void hessenberg::ApplyQ(LeftOrRight side, UpperOrLower uplo, Orientation orientation,const Matrix<F> &A, const Matrix<F> &t, Matrix<F> &H)

void hessenberg::ApplyQ(LeftOrRight side, UpperOrLower uplo, Orientation orienta-tion, const AbstractDistMatrix<F> &A, const AbstractDistMa-trix<F> &t, AbstractDistMatrix<F> &H)

5.1. Reduction to condensed form 249

Page 254: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

Single-precisionElError ElApplyQAfterHessenberg s(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-

tation orientation, ElConstMatrix s A, ElConstMa-trix s t, ElMatrix s H)

ElError ElApplyQAfterHessenbergDist s(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstDistMatrix s A,ElConstDistMatrix s t, ElDistMatrix s H)

Double-precisionElError ElApplyQAfterHessenberg d(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-

tation orientation, ElConstMatrix d A, ElConstMa-trix d t, ElMatrix d H)

ElError ElApplyQAfterHessenbergDist d(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstDistMatrix d A,ElConstDistMatrix d t, ElDistMatrix d H)

Single-precision complexElError ElApplyQAfterHessenberg c(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-

tation orientation, ElConstMatrix c A, ElConstMa-trix c t, ElMatrix c H)

ElError ElApplyQAfterHessenbergDist c(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstDistMatrix c A,ElConstDistMatrix c t, ElDistMatrix c H)

Double-precision complexElError ElApplyQAfterHessenberg z(ElLeftOrRight side, ElUpperOrLower uplo, ElOrien-

tation orientation, ElConstMatrix z A, ElConstMa-trix z t, ElMatrix z H)

ElError ElApplyQAfterHessenbergDist z(ElLeftOrRight side, ElUpperOrLower uplo, ElO-rientation orientation, ElConstDistMatrix z A,ElConstDistMatrix z t, ElDistMatrix z H)

References

Implementation

Subroutine header files

Test driver

5.1.3 General to bidiagonal

Reduces a general fully-populated m × n matrix to bidiagonal form through two-sided House-holder transformations; when the m ≥ n, the result is upper bidiagonal, otherwise it is lowerbidiagonal. This routine is most commonly used as a preprocessing step in computing the SVDof a general matrix.

250 Chapter 5. LAPACK-like linear algebra

Page 255: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Reduction

Python API

Bidiag(A[, bidiagOnly=False])

C++ API

void Bidiag(Matrix<F> &A, Matrix<F> &tP, Matrix<F> &tQ)

void Bidiag(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &tP, AbstractDistMa-trix<F> &tQ)

Overwrites the main and sub (or super) diagonal of the real matrix A with the resultingbidiagonal matrix and stores the scaled Householder vectors in the remainder of the ma-trix. The complex case must also store the scalings of the Householder transformations(in tP and tQ) if they are to be applied.

void bidiag::Explicit(Matrix<F> &A, Matrix<F> &P, Matrix<F> &Q)

void bidiag::Explicit(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &P, Ab-stractDistMatrix<F> &Q)

Overwrite A with the bidiagonal matrix, B = QH AP, and also return P and Q.

void bidiag::ExplicitCondensed(Matrix<F> &A)

void bidiag::ExplicitCondensed(AbstractDistMatrix<F> &A)

Returns just the resulting bidiagonal matrix, B = QH AP.

C API

Single-precisionElError ElBidiag s(ElMatrix s A, ElMatrix s tP, ElMatrix s tQ)

ElError ElBidiagDist s(ElDistMatrix s A, ElDistMatrix s tP, ElDistMatrix s tQ)

Overwrites the main and sub (or super) diagonal of the real matrix A with the resultingbidiagonal matrix and stores the scaled Householder vectors in the remainder of the ma-trix. The complex case must also store the scalings of the Householder transformations(in tP and tQ) if they are to be applied.

ElError ElBidiagExplicit s(ElMatrix s A, ElMatrix s P, ElMatrix s Q)

ElError ElBidiagExplicitDist s(ElDistMatrix s A, ElDistMatrix s P, ElDistMatrix s Q)

Overwrite A with the bidiagonal matrix, B = QH AP, and also return P and Q.

ElError ElBidiagExplicitCondensed s(ElMatrix s A)

ElError ElBidiagExplicitCondensedDist s(ElDistMatrix s A)

Returns just the resulting bidiagonal matrix, B = QH AP.

Double-precisionElError ElBidiag d(ElMatrix d A, ElMatrix d tP, ElMatrix d tQ)

ElError ElBidiagDist d(ElDistMatrix d A, ElDistMatrix d tP, ElDistMatrix d tQ)

Overwrites the main and sub (or super) diagonal of the real matrix A with the resulting

5.1. Reduction to condensed form 251

Page 256: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bidiagonal matrix and stores the scaled Householder vectors in the remainder of the ma-trix. The complex case must also store the scalings of the Householder transformations(in tP and tQ) if they are to be applied.

ElError ElBidiagExplicit d(ElMatrix d A, ElMatrix d P, ElMatrix d Q)

ElError ElBidiagExplicitDist d(ElDistMatrix d A, ElDistMatrix d P, ElDistMa-trix d Q)

Overwrite A with the bidiagonal matrix, B = QH AP, and also return P and Q.

ElError ElBidiagExplicitCondensed d(ElMatrix d A)

ElError ElBidiagExplicitCondensedDist d(ElDistMatrix d A)

Returns just the resulting bidiagonal matrix, B = QH AP.

Single-precision complexElError ElBidiag c(ElMatrix c A, ElMatrix c tP, ElMatrix c tQ)

ElError ElBidiagDist c(ElDistMatrix c A, ElDistMatrix c tP, ElDistMatrix c tQ)

Overwrites the main and sub (or super) diagonal of the real matrix A with the resultingbidiagonal matrix and stores the scaled Householder vectors in the remainder of the ma-trix. The complex case must also store the scalings of the Householder transformations(in tP and tQ) if they are to be applied.

ElError ElBidiagExplicit c(ElMatrix c A, ElMatrix c P, ElMatrix c Q)

ElError ElBidiagExplicitDist c(ElDistMatrix c A, ElDistMatrix c P, ElDistMatrix c Q)

Overwrite A with the bidiagonal matrix, B = QH AP, and also return P and Q.

ElError ElBidiagExplicitCondensed c(ElMatrix c A)

ElError ElBidiagExplicitCondensedDist c(ElDistMatrix c A)

Returns just the resulting bidiagonal matrix, B = QH AP.

Double-precision complexElError ElBidiag z(ElMatrix z A, ElMatrix z tP, ElMatrix z tQ)

ElError ElBidiagDist z(ElDistMatrix z A, ElDistMatrix z tP, ElDistMatrix z tQ)

Overwrites the main and sub (or super) diagonal of the real matrix A with the resultingbidiagonal matrix and stores the scaled Householder vectors in the remainder of the ma-trix. The complex case must also store the scalings of the Householder transformations(in tP and tQ) if they are to be applied.

ElError ElBidiagExplicit z(ElMatrix z A, ElMatrix z P, ElMatrix z Q)

ElError ElBidiagExplicitDist z(ElDistMatrix z A, ElDistMatrix z P, ElDistMa-trix z Q)

Overwrite A with the bidiagonal matrix, B = QH AP, and also return P and Q.

ElError ElBidiagExplicitCondensed z(ElMatrix z A)

ElError ElBidiagExplicitCondensedDist z(ElDistMatrix z A)

Returns just the resulting bidiagonal matrix, B = QH AP.

252 Chapter 5. LAPACK-like linear algebra

Page 257: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Applying the changes of basis

Python API

ApplyQAfterBidiag(side, orient, A, t, B)

C++ API

void bidiag::ApplyQ(LeftOrRight side, Orientation orientation, const Matrix<F> &A,const Matrix<F> &t, Matrix<F> &B)

void bidiag::ApplyQ(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<F> &A, const AbstractDistMatrix<F> &t, AbstractDistMa-trix<F> &B)

void bidiag::ApplyP(LeftOrRight side, Orientation orientation, const Matrix<F> &A,const Matrix<F> &t, Matrix<F> &B)

void bidiag::ApplyP(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<F> &A, const AbstractDistMatrix<F> &t, AbstractDistMa-trix<F> &B)

C API

Single-precisionElError ElApplyQAfterBidiag s(ElLeftOrRight side, ElOrientation orientation, ElConstMa-

trix s A, ElConstMatrix s t, ElMatrix s B)ElError ElApplyQAfterBidiagDist s(ElLeftOrRight side, ElOrientation orientation, ElCon-

stDistMatrix s A, ElConstDistMatrix s t, ElDist-Matrix s B)

ElError ElApplyPAfterBidiag s(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix s A, ElConstMatrix s t, ElMatrix s B)

ElError ElApplyPAfterBidiagDist s(ElLeftOrRight side, ElOrientation orientation, ElCon-stDistMatrix s A, ElConstDistMatrix s t, ElDist-Matrix s B)

Double-precisionElError ElApplyQAfterBidiag d(ElLeftOrRight side, ElOrientation orientation, ElConstMa-

trix d A, ElConstMatrix d t, ElMatrix d B)ElError ElApplyQAfterBidiagDist d(ElLeftOrRight side, ElOrientation orientation, ElCon-

stDistMatrix d A, ElConstDistMatrix d t, ElDist-Matrix d B)

ElError ElApplyPAfterBidiag d(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix d A, ElConstMatrix d t, ElMatrix d B)

ElError ElApplyPAfterBidiagDist d(ElLeftOrRight side, ElOrientation orientation, ElCon-stDistMatrix d A, ElConstDistMatrix d t, ElDist-Matrix d B)

5.1. Reduction to condensed form 253

Page 258: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Single-precision complexElError ElApplyQAfterBidiag c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-

trix c A, ElConstMatrix c t, ElMatrix c B)ElError ElApplyQAfterBidiagDist c(ElLeftOrRight side, ElOrientation orientation, ElCon-

stDistMatrix c A, ElConstDistMatrix c t, ElDist-Matrix c B)

ElError ElApplyPAfterBidiag c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c A, ElConstMatrix c t, ElMatrix c B)

ElError ElApplyPAfterBidiagDist c(ElLeftOrRight side, ElOrientation orientation, ElCon-stDistMatrix c A, ElConstDistMatrix c t, ElDist-Matrix c B)

Double-precision complexElError ElApplyQAfterBidiag z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-

trix z A, ElConstMatrix z t, ElMatrix z B)ElError ElApplyQAfterBidiagDist z(ElLeftOrRight side, ElOrientation orientation, ElCon-

stDistMatrix z A, ElConstDistMatrix z t, ElDist-Matrix z B)

ElError ElApplyPAfterBidiag z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElMatrix z B)

ElError ElApplyPAfterBidiagDist z(ElLeftOrRight side, ElOrientation orientation, ElCon-stDistMatrix z A, ElConstDistMatrix z t, ElDist-Matrix z B)

References

Implementation

Subroutine implementations

Test driver

5.1.4 References

C++ Header

C Header

Python wrappers

5.2 Factorizations

5.2.1 Cholesky factorization

Factorization

It is well-known that Hermitian positive-definite (HPD) matrices can be decomposed into theform A = LLH or A = UHU, where L = UH is lower triangular, and Cholesky factorizationprovides such an L (or U) given an HPD A. If A is found to be numerically indefinite, then aNonHPDMatrixException will be thrown.

254 Chapter 5. LAPACK-like linear algebra

Page 259: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Elemental provides support for versions which perform no pivoting, perform full (in this case,equivalent to diagonal) pivoting, and a version which makes use of a matrix square-root of aHermitian matrix: Let A = UΛUH be the eigenvalue decomposition of A, where all entries ofΛ are non-negative. Then B = U

√ΛUH is the matrix square root of A, i.e., BB = A, and it

follows that the QR and LQ factorizations of B yield Cholesky factors of A:

A = BHB = (QR)H(QR) = RHR.

If A is found to have eigenvalues less than −nε‖A‖2, then a NonHPSDMatrixException will bethrown.

Python API

Cholesky(uplo, A[, piv=False])HPSDCholesky(uplo, A)

C++ API

void Cholesky(UpperOrLower uplo, Matrix<F> &A)

void Cholesky(UpperOrLower uplo, AbstractDistMatrix<F> &A)

No pivoting

void Cholesky(UpperOrLower uplo, Matrix<F> &A, Matrix<int> &p)

void Cholesky(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<int> &p)

Full (diagonal) pivoting

void HPSDCholesky(UpperOrLower uplo, Matrix<F> &A)

void HPSDCholesky(UpperOrLower uplo, AbstractDistMatrix<F> &A)

Use the QR (or LQ) factorization of the matrix square-root of A to find the Choleskyfactor.

C API

Single-precisionElError ElCholesky s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElCholeskyDist s(ElUpperOrLower uplo, ElDistMatrix s A)

No pivoting

ElError ElCholeskyPiv s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix i p)

ElError ElCholeskyPivDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElMatrix i p)Full (diagonal) pivoting

ElError ElHPSDCholesky s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHPSDCholeskyDist s(ElUpperOrLower uplo, ElDistMatrix s A)

Use the QR (or LQ) factorization of the matrix square-root of A to find the Choleskyfactor.

5.2. Factorizations 255

Page 260: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precisionElError ElCholesky d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElCholeskyDist d(ElUpperOrLower uplo, ElDistMatrix d A)

No pivoting

ElError ElCholeskyPiv d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix i p)

ElError ElCholeskyPivDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElMatrix i p)Full (diagonal) pivoting

ElError ElHPSDCholesky d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHPSDCholeskyDist d(ElUpperOrLower uplo, ElDistMatrix d A)

Use the QR (or LQ) factorization of the matrix square-root of A to find the Choleskyfactor.

Single-precision complexElError ElCholesky c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElCholeskyDist c(ElUpperOrLower uplo, ElDistMatrix c A)

No pivoting

ElError ElCholeskyPiv c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix i p)

ElError ElCholeskyPivDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElMatrix i p)Full (diagonal) pivoting

ElError ElHPSDCholesky c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHPSDCholeskyDist c(ElUpperOrLower uplo, ElDistMatrix c A)

Use the QR (or LQ) factorization of the matrix square-root of A to find the Choleskyfactor.

Double-precision complexElError ElCholesky z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElCholeskyDist z(ElUpperOrLower uplo, ElDistMatrix z A)

No pivoting

ElError ElCholeskyPiv z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix i p)

ElError ElCholeskyPivDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElMatrix i p)Full (diagonal) pivoting

ElError ElHPSDCholesky z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHPSDCholeskyDist z(ElUpperOrLower uplo, ElDistMatrix z A)

Use the QR (or LQ) factorization of the matrix square-root of A to find the Choleskyfactor.

Solving linear systems with the factorization

After a (possibly pivoted) Cholesky factorization has been formed, it is possible to solve linearsystems in quadratic time. The following routines apply the inverse in such a fast manner.

256 Chapter 5. LAPACK-like linear algebra

Page 261: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

SolveAfterCholesky(uplo, orient, A, B)No pivoting

SolveAfterCholesky(uplo, orient, A, p, B)Full (diagonal) pivoting

C++ API

void cholesky::SolveAfter(UpperOrLower uplo, Orientation orientation, const Ma-trix<F> &A, Matrix<F> &B)

void cholesky::SolveAfter(UpperOrLower uplo, Orientation orientation, const Abstract-DistMatrix<F> &A, AbstractDistMatrix<F> &B)

No pivoting

void cholesky::SolveAfter(UpperOrLower uplo, Orientation orientation, const Ma-trix<F> &A, Matrix<F> &B, Matrix<int> &p)

void cholesky::SolveAfter(UpperOrLower uplo, Orientation orientation, const Abstract-DistMatrix<F> &A, AbstractDistMatrix<F> &B, Abstract-DistMatrix<int> &p)

Full (diagonal) pivoting

C API

Single-precisionElError ElSolveAfterCholesky s(ElUpperOrLower uplo, ElOrientation orientation, ElCon-

stMatrix s A, ElMatrix s B)ElError ElSolveAfterCholeskyDist s(ElUpperOrLower uplo, ElOrientation orientation,

ElConstDistMatrix s A, ElDistMatrix s B)No pivoting

ElError ElSolveAfterCholeskyPiv s(ElUpperOrLower uplo, ElOrientation orientation, El-ConstMatrix s A, ElConstMatrix i p, ElMatrix s B)

ElError ElSolveAfterCholeskyPivDist s(ElUpperOrLower uplo, ElOrientation orienta-tion, ElConstDistMatrix s A, ElConstDistMa-trix i p, ElDistMatrix s B)

Full (diagonal) pivoting

Double-precisionElError ElSolveAfterCholesky d(ElUpperOrLower uplo, ElOrientation orientation, ElCon-

stMatrix d A, ElMatrix d B)ElError ElSolveAfterCholeskyDist d(ElUpperOrLower uplo, ElOrientation orientation,

ElConstDistMatrix d A, ElDistMatrix d B)No pivoting

ElError ElSolveAfterCholeskyPiv d(ElUpperOrLower uplo, ElOrientation orientation,ElConstMatrix d A, ElConstMatrix i p, ElMa-trix d B)

5.2. Factorizations 257

Page 262: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSolveAfterCholeskyPivDist d(ElUpperOrLower uplo, ElOrientation orienta-tion, ElConstDistMatrix d A, ElConstDistMa-trix i p, ElDistMatrix d B)

Full (diagonal) pivoting

Single-precision complexElError ElSolveAfterCholesky c(ElUpperOrLower uplo, ElOrientation orientation, ElCon-

stMatrix c A, ElMatrix c B)ElError ElSolveAfterCholeskyDist c(ElUpperOrLower uplo, ElOrientation orientation,

ElConstDistMatrix c A, ElDistMatrix c B)No pivoting

ElError ElSolveAfterCholeskyPiv c(ElUpperOrLower uplo, ElOrientation orientation, El-ConstMatrix c A, ElConstMatrix i p, ElMatrix c B)

ElError ElSolveAfterCholeskyPivDist c(ElUpperOrLower uplo, ElOrientation orienta-tion, ElConstDistMatrix c A, ElConstDistMa-trix i p, ElDistMatrix c B)

Full (diagonal) pivoting

Double-precision complexElError ElSolveAfterCholesky z(ElUpperOrLower uplo, ElOrientation orientation, ElCon-

stMatrix z A, ElMatrix z B)ElError ElSolveAfterCholeskyDist z(ElUpperOrLower uplo, ElOrientation orientation,

ElConstDistMatrix z A, ElDistMatrix z B)No pivoting

ElError ElSolveAfterCholeskyPiv z(ElUpperOrLower uplo, ElOrientation orientation,ElConstMatrix z A, ElConstMatrix i p, ElMa-trix z B)

ElError ElSolveAfterCholeskyPivDist z(ElUpperOrLower uplo, ElOrientation orienta-tion, ElConstDistMatrix z A, ElConstDistMa-trix i p, ElDistMatrix z B)

Full (diagonal) pivoting

Low-rank updates to a factorization

It is well-known that it is possible to update an existing Cholesky factorization to incorporatea low-rank modification αVVH in quadratic time. The following algorithms use Householdertransformations for updates (α ≥ 0) and hyperbolic Householder transformations for down-dates.

Python API

CholeskyMod(uplo, T, alpha, V)

C++ API

void CholeskyMod(UpperOrLower uplo, Matrix<F> &T, Base<F> &alpha, Matrix<F>&V)

258 Chapter 5. LAPACK-like linear algebra

Page 263: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void CholeskyMod(UpperOrLower uplo, AbstractDistMatrix<F> &T, Base<F> &alpha, Ab-stractDistMatrix<F> &V)

C API

Single-precisionElError ElCholeskyMod s(ElUpperOrLower uplo, ElMatrix s T, float alpha, ElMatrix s V)

ElError ElCholeskyModDist s(ElUpperOrLower uplo, ElDistMatrix s T, float alpha, ElDist-Matrix s V)

Double-precisionElError ElCholeskyMod d(ElUpperOrLower uplo, ElMatrix d T, double alpha, ElMa-

trix d V)ElError ElCholeskyModDist d(ElUpperOrLower uplo, ElDistMatrix d T, double alpha, El-

DistMatrix d V)

Single-precision complexElError ElCholeskyMod c(ElUpperOrLower uplo, ElMatrix c T, float alpha, ElMatrix c V)

ElError ElCholeskyModDist c(ElUpperOrLower uplo, ElDistMatrix c T, float alpha, ElD-istMatrix c V)

Double-precision complexElError ElCholeskyMod z(ElUpperOrLower uplo, ElMatrix z T, double alpha, ElMa-

trix z V)ElError ElCholeskyModDist z(ElUpperOrLower uplo, ElDistMatrix z T, double alpha, El-

DistMatrix z V)

References

C++11 implementation

C++11 subroutines

C++11 test driver

5.2.2 LDL factorization

Dense LDL

Pivoted dense LDL

The following routines return a pivoted LDL factorization, where the vector p contains thecolumn indices of the nonzero entries of the permutation matrix P such that PAPT equalseither LDLT or LDLH, where D is quasi-diagonal. The Bunch-Kaufman pivoting rules areused within a higher-performance blocked algorithm, whereas the Bunch-Parlett strategy usesan unblocked, but typically more accurate, algorithm.

Factorization

5.2. Factorizations 259

Page 264: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python APILDL(A[, conjugate=True[, pivType=BUNCH KAUFMAN A]])

Parameters

• A – The (sequential or distributed) dense input/output matrix

• conjugate – (optional) boolean for whether to perform LDLT or LDLH

• pivType – (optional) the preferred pivoting strategy

Return type Nothing is returned if pivType is LDL WITHOUT PIVOTING , but,otherwise, the subdiagonal of D, dSub, and the permutation vector, p, arereturned

The following Python pseudo-enum contains the list of allowable pivoting approaches fordense LDL factorization:

BUNCH KAUFMAN A

Hardcoded to the value 0

BUNCH KAUFMAN C

Not yet supported (and hardcoded to the value 1)

BUNCH KAUFMAN D

Hardcoded to the value 2

BUNCH KAUFMAN BOUNDED

Not yet supported (and hardcoded to the value 3)

BUNCH PARLETT

Hardcoded to the value 4

LDL WITHOUT PIVOTING

Hardcoded to the value 5

C++ APIenum LDLPivotType

For specifying the symmetric pivoting strategy. The current (not yet all supported) op-tions include:

enumerator BUNCH KAUFMAN A

enumerator BUNCH KAUFMAN C

Not yet supported

enumerator BUNCH KAUFMAN D

enumerator BUNCH KAUFMAN BOUNDED

Not yet supported

enumerator BUNCH PARLETT

enumerator LDL WITHOUT PIVOTING

Real LDLPivotConstant<Real>(LDLPivotType pivotType)Maps various LDL pivotings schemes to their optimal threshold constant.

class LDLPivotCtrl<Real>

260 Chapter 5. LAPACK-like linear algebra

Page 265: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

LDLPivotType pivotTypeThe type of pivoting to perform (by default, BUNCH KAUFMAN A)

Real gammaPivot tolerance (by default, set to LDLPivotConstant<Real>(pivotType))

LDLPivotCtrl(LDLPivotType piv = BUNCH KAUFMAN A)

class LDLPivot

Int nbWhether the pivot is 1x1 or 2x2.

Int from[2]The source indices of the row or rows to swap with for the 1x1 or 2x2 pivot.

void LDL(Matrix<F> &A, Matrix<F> &dSub, Matrix<int> &p, bool conjugate = false,const LDLPivotCtrl<Base<F>> &ctrl = LDLPivotCtrl<Base<F>>())

void LDL(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &dSub, AbstractDistMa-trix<int> &p, bool conjugate = false, const LDLPivotCtrl<Base<F>> &ctrl =LDLPivotCtrl<Base<F>>())

C APIElLDLPivotType

An enum for specifying the symmetric pivoting strategy. The current (not yet all sup-ported) options include:

•EL BUNCH KAUFMAN A

•EL BUNCH KAUFMAN C (not yet supported)

•EL BUNCH KAUFMAN D

•EL BUNCH KAUFMAN BOUNDED (not yet supported)

•EL BUNCH PARLETT

ElLDLPivotCtrl s

ElLDLPivotType pivotType

float gamma

ElLDLPivotCtrl d

ElLDLPivotType pivotType

double gamma

ElLDLPivot

Int nbWhether the pivot is 1x1 or 2x2.

Int from[2]

The source indices of the row or rows to swap with for the 1x1 or 2x2 pivot.

5.2. Factorizations 261

Page 266: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLDLPiv s(ElMatrix s A, ElMatrix s dSub, ElMatrix i p)

ElError ElLDLPiv d(ElMatrix d A, ElMatrix d dSub, ElMatrix i p)

ElError ElLDLPiv c(ElMatrix c A, ElMatrix c dSub, ElMatrix i p, bool conjugate)

ElError ElLDLPiv z(ElMatrix z A, ElMatrix z dSub, ElMatrix i p, bool conjugate)

ElError ElLDLPivDist s(ElDistMatrix s A, ElDistMatrix s dSub, ElDistMatrix i p)

ElError ElLDLPivDist d(ElDistMatrix d A, ElDistMatrix d dSub, ElDistMatrix i p)

ElError ElLDLPivDist c(ElDistMatrix c A, ElDistMatrix c dSub, ElDistMatrix i p,bool conjugate)

ElError ElLDLPivDist z(ElDistMatrix z A, ElDistMatrix z dSub, ElDistMatrix i p,bool conjugate)

References C++11 implementation

C++11 subroutines

C++11 header

C99 wrapper

C99 header

Python wrapper

C++11 test driver

C++11 example driver

Solve after factorization

Python APISolveAfterLDLPiv(A, dSub, p, B[, conjugate=True])

Parameters

• A – The factored dense matrix

• dSub – The vector containing the subdiagonal of D

• p – The integer permutation vector

• B – The right-hand sides to be solved against (in-place)

• conjugate – (optional) If an LDLH factorization was performed

C++ APIvoid ldl::SolveAfter(const Matrix<F> &A, const Matrix<F> &dSub, const Ma-

trix<int> &p, Matrix<F> &B, bool conjugated = false)void ldl::SolveAfter(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F>

&dSub, const AbstractDistMatrix<int> &p, AbstractDistMa-trix<F> &B, bool conjugated = false)

262 Chapter 5. LAPACK-like linear algebra

Page 267: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C APIElError ElSolveAfterLDLPiv s(ElConstMatrix s A, ElConstMatrix s dSub, ElConstMa-

trix i p, ElMatrix s B)ElError ElSolveAfterLDLPiv d(ElConstMatrix d A, ElConstMatrix d dSub, ElConstMa-

trix i p, ElMatrix d B)

ElError ElSolveAfterLDLPiv c(ElConstMatrix c A, ElConstMatrix c dSub, ElConstMa-trix i p, ElMatrix c B, bool conjugate)

ElError ElSolveAfterLDLPiv z(ElConstMatrix z A, ElConstMatrix z dSub, ElConstMa-trix i p, ElMatrix z B, bool conjugate)

ElError ElSolveAfterLDLPivDist s(ElConstDistMatrix s A, ElConstDistMatrix s dSub,ElConstDistMatrix i p, ElDistMatrix s B)

ElError ElSolveAfterLDLPivDist d(ElConstDistMatrix d A, ElConstDistMatrix d dSub,ElConstDistMatrix i p, ElDistMatrix d B)

ElError ElSolveAfterLDLPivDist c(ElConstDistMatrix c A, ElConstDistMatrix c dSub,ElConstDistMatrix i p, ElDistMatrix c B, bool con-jugate)

ElError ElSolveAfterLDLPivDist z(ElConstDistMatrix z A, ElConstDistMatrix z dSub,ElConstDistMatrix i p, ElDistMatrix z B, bool con-jugate)

References C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

C++11 test driver

C++11 example driver

Multiply after factorization

Python APIMultiplyAfterLDLPiv(A, dSub, p, B[, conjugate=True])

Parameters

• A – The factored dense matrix

• dSub – The vector containing the subdiagonal of D

• p – The integer permutation vector

• B – The right-hand sides to be multiplied (in-place)

• conjugate – (optional) If an LDLH factorization was performed

5.2. Factorizations 263

Page 268: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ APIvoid ldl::MultiplyAfter(const Matrix<F> &A, const Matrix<F> &dSub, const Ma-

trix<int> &p, Matrix<F> &B, bool conjugated = false)void ldl::MultiplyAfter(const AbstractDistMatrix<F> &A, const AbstractDistMa-

trix<F> &dSub, const AbstractDistMatrix<int> &p, Abstract-DistMatrix<F> &B, bool conjugated = false)

C APIElError ElMultiplyAfterLDLPiv s(ElConstMatrix s A, ElConstMatrix s dSub, ElConst-

Matrix i p, ElMatrix s B)ElError ElMultiplyAfterLDLPiv d(ElConstMatrix d A, ElConstMatrix d dSub, ElConst-

Matrix i p, ElMatrix d B)

ElError ElMultiplyAfterLDLPiv c(ElConstMatrix c A, ElConstMatrix c dSub, ElConst-Matrix i p, ElMatrix c B, bool conjugate)

ElError ElMultiplyAfterLDLPiv z(ElConstMatrix z A, ElConstMatrix z dSub, ElConst-Matrix i p, ElMatrix z B, bool conjugate)

ElError ElMultiplyAfterLDLPivDist s(ElConstDistMatrix s A, ElConstDistMa-trix s dSub, ElConstDistMatrix i p, ElDist-Matrix s B)

ElError ElMultiplyAfterLDLPivDist d(ElConstDistMatrix d A, ElConstDistMa-trix d dSub, ElConstDistMatrix i p, ElDistMa-trix d B)

ElError ElMultiplyAfterLDLPivDist c(ElConstDistMatrix c A, ElConstDistMa-trix c dSub, ElConstDistMatrix i p, ElDist-Matrix c B, bool conjugate)

ElError ElMultiplyAfterLDLPivDist z(ElConstDistMatrix z A, ElConstDistMa-trix z dSub, ElConstDistMatrix i p, ElDistMa-trix z B, bool conjugate)

References C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

C++11 test driver

C++11 example driver

Inertia after factorization

Python APIInertiaAfterLDL(d, dSub)

Parameters

• d – A vector containing the main diagonal of D

264 Chapter 5. LAPACK-like linear algebra

Page 269: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

• dSub – A vector containing the subdiagonal of D

Return type The resulting InertiaType instance

C++ APIInertiaType ldl::Inertia(const Matrix<Base<F>> &d, const Matrix<F> &dSub)InertiaType ldl::Inertia(const AbstractDistMatrix<Base<F>> &d, const AbstractDist-

Matrix<F> &dSub)

C APIElError ElInertiaAfterLDL s(ElConstMatrix s d, ElConstMatrix s dSub, ElInerti-

aType* inertia)ElError ElInertiaAfterLDL d(ElConstMatrix d d, ElConstMatrix d dSub, ElInerti-

aType* inertia)

ElError ElInertiaAfterLDL c(ElConstMatrix s d, ElConstMatrix c dSub, ElInerti-aType* inertia)

ElError ElInertiaAfterLDL z(ElConstMatrix d d, ElConstMatrix z dSub, ElInerti-aType* inertia)

ElError ElInertiaAfterLDLDist s(ElConstDistMatrix s d, ElConstDistMatrix s dSub,ElInertiaType* inertia)

ElError ElInertiaAfterLDLDist d(ElConstDistMatrix d d, ElConstDistMatrix d dSub,ElInertiaType* inertia)

ElError ElInertiaAfterLDLDist c(ElConstDistMatrix s d, ElConstDistMatrix c dSub,ElInertiaType* inertia)

ElError ElInertiaAfterLDLDist z(ElConstDistMatrix d d, ElConstDistMatrix z dSub,ElInertiaType* inertia)

References C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

References C++11 implementation

C++11 test driver

C++11 example driver

Unpivoted dense LDL

Though Cholesky factorizations are ideal for Hermitian Positive-Definite matrices, unpivotedLDLT and LDLH factorizations are frequently used for significantly larger classes of matrices,with the most notable example being Symmetric Quasidefinite matrices, which were intro-duced by [Vanderbei1995] and subsequently analyzed as a simple rescaling of a nonsymmetric

5.2. Factorizations 265

Page 270: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

positive-definite matrix in [GSS1996]. While the stability properties of unpivoted LDLH fac-torizations of dense quasidefinite matrices are of intrinsic interest, there are significantly morepractical applications for sparse matrices, where dynamic pivoting incurs typically substan-tially increases both the memory requirements and operation count of a factorization.

Factorization Upon successful completion of the factorization, a lower-triangular (with unitdiagonal) L and diagonal matrix D, such that A = LDLH or A = LDLT, will be returned in thelower triangle of A. If a zero pivot is attempted, then a ZeroPivotException will be thrown.

Python API Elemental’s Python interface to unpivoted dense LDL factorizations canbe called as a special case of the pivoted interface, LDL() by specifying pivType toLDL WITHOUT PIVOTING .

C++ APIvoid LDLT(Matrix<F> &A)

void LDLT(AbstractDistMatrix<F> &A)

void LDLH(Matrix<F> &A)

void LDLH(AbstractDistMatrix<F> &A)

C APIElError ElLDLT s(ElMatrix s A)

ElError ElLDLT d(ElMatrix d A)

ElError ElLDLT c(ElMatrix c A)

ElError ElLDLT z(ElMatrix z A)

ElError ElLDLTDist s(ElDistMatrix s A)

ElError ElLDLTDist d(ElDistMatrix d A)

ElError ElLDLTDist c(ElDistMatrix c A)

ElError ElLDLTDist z(ElDistMatrix z A)

ElError ElLDLH c(ElMatrix c A)

ElError ElLDLH z(ElMatrix z A)

ElError ElLDLHDist c(ElDistMatrix c A)

ElError ElLDLHDist z(ElDistMatrix z A)

References C++11 implementation

C++11 header

C++11 test driver

C++11 example driver

C99 wrapper

C99 header

266 Chapter 5. LAPACK-like linear algebra

Page 271: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python wrapper

Solve after factorization

Python APISolveAfterLDL(A, B[, conjugate=True])

Parameters

• A – Factored dense matrix

• B – Matrix of right-hand sides to solved against (in-place)

• conjugate – (optional) If an LDLH factorization was performed

C++ APIvoid ldl::SolveAfter(const Matrix<F> &A, Matrix<F> &B, bool conjugated = false)void ldl::SolveAfter(const AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B,

bool conjugated = false)

C APIElError ElSolveAfterLDL s(ElConstMatrix s A, ElMatrix s B)ElError ElSolveAfterLDL d(ElConstMatrix d A, ElMatrix d B)

ElError ElSolveAfterLDL c(ElConstMatrix c A, ElMatrix c B, bool conjugate)

ElError ElSolveAfterLDL z(ElConstMatrix z A, ElMatrix z B, bool conjugate)

ElError ElSolveAfterLDLDist s(ElConstDistMatrix s A, ElDistMatrix s B)

ElError ElSolveAfterLDLDist d(ElConstDistMatrix d A, ElDistMatrix d B)

ElError ElSolveAfterLDLDist c(ElConstDistMatrix c A, ElDistMatrix c B, bool conju-gate)

ElError ElSolveAfterLDLDist z(ElConstDistMatrix z A, ElDistMatrix z B, bool conju-gate)

References C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

Multiply after factorization

5.2. Factorizations 267

Page 272: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python APIMultiplyAfterLDL(A, B[, conjugate=True])

Parameters

• A – Factored dense matrix

• B – Matrix of right-hand sides to multiplied (in-place)

• conjugate – (optional) If an LDLH factorization was performed

C++ APIvoid ldl::MultiplyAfter(const Matrix<F> &A, Matrix<F> &B, bool conjugated =

false)void ldl::MultiplyAfter(const AbstractDistMatrix<F> &A, AbstractDistMatrix<F>

&B, bool conjugated = false)

C APIElError ElMultiplyAfterLDL s(ElConstMatrix s A, ElMatrix s B)ElError ElMultiplyAfterLDL d(ElConstMatrix d A, ElMatrix d B)

ElError ElMultiplyAfterLDL c(ElConstMatrix c A, ElMatrix c B, bool conjugate)

ElError ElMultiplyAfterLDL z(ElConstMatrix z A, ElMatrix z B, bool conjugate)

ElError ElMultiplyAfterLDLDist s(ElConstDistMatrix s A, ElDistMatrix s B)

ElError ElMultiplyAfterLDLDist d(ElConstDistMatrix d A, ElDistMatrix d B)

ElError ElMultiplyAfterLDLDist c(ElConstDistMatrix c A, ElDistMatrix c B, bool con-jugate)

ElError ElMultiplyAfterLDLDist z(ElConstDistMatrix z A, ElDistMatrix z B, bool con-jugate)

References C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

References C++11 implementation

C++11 subroutines

C++11 header

C99 wrappers

C99 header

Python wrappers

C++11 test driver

C++11 example driver

268 Chapter 5. LAPACK-like linear algebra

Page 273: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Sparse LDL

TODO

5.2.3 LU factorization

Implementation

Subroutines

Test driver

Example driver

Partial pivoting

Since LU factorization without pivoting is known to be unstable for general matrices, it isstandard practice to pivot the rows of A during the factorization (this is called partial pivotingsince the columns are not also pivoted). An LU factorization with partial pivoting thereforecomputes P, L, and U such that PA = LU, where L and U are as described above and P is apermutation matrix.

Overwrites the matrix A with the LU decomposition of PA, where P is represented by thepermutation vector p, which consists of the column indices of the nonzero entry in each row ofP.

Factorization

C++ APIvoid LU(Matrix<F> &A, Matrix<int> &p)void LU(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &p)

C APIElError ElLUPartialPiv s(ElMatrix s A, ElMatrix i p)ElError ElLUPartialPiv d(ElMatrix d A, ElMatrix i p)

ElError ElLUPartialPiv c(ElMatrix c A, ElMatrix i p)

ElError ElLUPartialPiv z(ElMatrix z A, ElMatrix i p)

ElError ElLUPartialPivDist s(ElDistMatrix s A, ElDistMatrix i p)

ElError ElLUPartialPivDist d(ElDistMatrix d A, ElDistMatrix i p)

ElError ElLUPartialPivDist c(ElDistMatrix c A, ElDistMatrix i p)

ElError ElLUPartialPivDist z(ElDistMatrix z A, ElDistMatrix i p)

Solving linear systems with the factorization

C++ APIvoid lu::SolveAfter(Orientation orientation, const Matrix<F> &A, const Matrix<int>

&p, Matrix<F> &B)

5.2. Factorizations 269

Page 274: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void lu::SolveAfter(Orientation orientation, const AbstractDistMatrix<F> &A, constAbstractDistMatrix<int> &p, AbstractDistMatrix<F> &B)

C APIElError ElSolveAfterLUPartialPiv s(ElOrientation orientation, ElConstMatrix s A, El-

ConstMatrix i p, ElMatrix s B)ElError ElSolveAfterLUPartialPiv d(ElOrientation orientation, ElConstMatrix d A, El-

ConstMatrix i p, ElMatrix d B)

ElError ElSolveAfterLUPartialPiv c(ElOrientation orientation, ElConstMatrix c A, El-ConstMatrix i p, ElMatrix c B)

ElError ElSolveAfterLUPartialPiv z(ElOrientation orientation, ElConstMatrix z A, El-ConstMatrix i p, ElMatrix z B)

ElError ElSolveAfterLUPartialPivDist s(ElOrientation orientation, ElConstDistMa-trix s A, ElConstDistMatrix i p, ElDistMa-trix s B)

ElError ElSolveAfterLUPartialPivDist d(ElOrientation orientation, ElConstDistMa-trix d A, ElConstDistMatrix i p, ElDistMa-trix d B)

ElError ElSolveAfterLUPartialPivDist c(ElOrientation orientation, ElConstDistMa-trix c A, ElConstDistMatrix i p, ElDistMa-trix c B)

ElError ElSolveAfterLUPartialPivDist z(ElOrientation orientation, ElConstDistMa-trix z A, ElConstDistMatrix i p, ElDistMa-trix z B)

Full pivoting

Overwrites the matrix A with the LU decomposition of PAQT, where P and Q are representedby the permutation vectors p and q, which consist of the column indices of the nonzero entryin each row of P and Q, respectively.

Factorization

C++ APIvoid LU(Matrix<F> &A, Matrix<int> &p, Matrix<int> &q)void LU(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &p, AbstractDistMatrix<F>

&q)

C APIElError ElLUFullPiv s(ElMatrix s A, ElMatrix i p, ElMatrix i q)ElError ElLUFullPiv d(ElMatrix d A, ElMatrix i p, ElMatrix i q)

ElError ElLUFullPiv c(ElMatrix c A, ElMatrix i p, ElMatrix i q)

ElError ElLUFullPiv z(ElMatrix z A, ElMatrix i p, ElMatrix i q)

ElError ElLUFullPivDist s(ElDistMatrix s A, ElDistMatrix i p, ElDistMatrix i q)

ElError ElLUFullPivDist d(ElDistMatrix d A, ElDistMatrix i p, ElDistMatrix i q)

270 Chapter 5. LAPACK-like linear algebra

Page 275: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLUFullPivDist c(ElDistMatrix c A, ElDistMatrix i p, ElDistMatrix i q)

ElError ElLUFullPivDist z(ElDistMatrix z A, ElDistMatrix i p, ElDistMatrix i q)

Solving linear systems with the factorization

C++ APIvoid lu::SolveAfter(Orientation orientation, const Matrix<F> &A, const Matrix<int>

&p, const Matrix<int> &q, Matrix<F> &B)void lu::SolveAfter(Orientation orientation, const AbstractDistMatrix<F> &A, const

AbstractDistMatrix<int> &p, const AbstractDistMatrix<int> &q,AbstractDistMatrix<F> &B)

C APIElError ElSolveAfterLUFullPiv s(ElOrientation orientation, ElConstMatrix s A, ElCon-

stMatrix i p, ElConstMatrix i q, ElMatrix s B)ElError ElSolveAfterLUFullPiv d(ElOrientation orientation, ElConstMatrix d A, ElCon-

stMatrix i p, ElConstMatrix i q, ElMatrix d B)

ElError ElSolveAfterLUFullPiv c(ElOrientation orientation, ElConstMatrix c A, ElCon-stMatrix i p, ElConstMatrix i q, ElMatrix c B)

ElError ElSolveAfterLUFullPiv z(ElOrientation orientation, ElConstMatrix z A, ElCon-stMatrix i p, ElConstMatrix i q, ElMatrix z B)

ElError ElSolveAfterLUFullPivDist s(ElOrientation orientation, ElConstDistMa-trix s A, ElConstDistMatrix i p, ElConstDistMa-trix i q, ElDistMatrix s B)

ElError ElSolveAfterLUFullPivDist d(ElOrientation orientation, ElConstDistMa-trix d A, ElConstDistMatrix i p, ElConstDist-Matrix i q, ElDistMatrix d B)

ElError ElSolveAfterLUFullPivDist c(ElOrientation orientation, ElConstDistMa-trix c A, ElConstDistMatrix i p, ElConstDist-Matrix i q, ElDistMatrix c B)

ElError ElSolveAfterLUFullPivDist z(ElOrientation orientation, ElConstDistMa-trix z A, ElConstDistMatrix i p, ElConstDist-Matrix i q, ElDistMatrix z B)

No pivoting

Given A ∈ Fm×n, an LU factorization (without pivoting) attempts to find a unit lower-trapezoidal L ∈ Fm×min(m,n) and upper-trapezoidal U ∈ Fmin(m,n)×n such that A = LU. SinceL is required to have its diaganal entries set to one: the upper portion of A can be overwrittenwith U, and the strictly lower portion of A can be overwritten with the strictly lower portionof L. If a numerically zero diagonal entry of U is created, then a SingularMatrixException

will be thrown.

Note: It might be appropriate to switch this routine to a ZeroPivotException, as it is strangeto refer to non-square matrices as singular.

5.2. Factorizations 271

Page 276: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Factorization

The following routines overwrite A with its LU decomposition.

C++ APIvoid LU(Matrix<F> &A)

void LU(AbstractDistMatrix<F> &A)

C APIElError ElLU s(ElMatrix s A)

ElError ElLU d(ElMatrix d A)

ElError ElLU c(ElMatrix c A)

ElError ElLU z(ElMatrix z A)

ElError ElLUDist s(ElDistMatrix s A)

ElError ElLUDist d(ElDistMatrix d A)

ElError ElLUDist c(ElDistMatrix c A)

ElError ElLUDist z(ElDistMatrix z A)

Solving linear systems with the factorization

C++ APIvoid lu::SolveAfter(Orientation orientation, const Matrix<F> &A, Matrix<F> &B)void lu::SolveAfter(Orientation orientation, const AbstractDistMatrix<F> &A, Abstract-

DistMatrix<F> &B)

C APIElError ElSolveAfterLU s(ElOrientation orientation, ElConstMatrix s A, ElMatrix s B)ElError ElSolveAfterLU d(ElOrientation orientation, ElConstMatrix d A, ElMatrix d B)

ElError ElSolveAfterLU c(ElOrientation orientation, ElConstMatrix c A, ElMatrix c B)

ElError ElSolveAfterLU z(ElOrientation orientation, ElConstMatrix z A, ElMatrix z B)

ElError ElSolveAfterLUDist s(ElOrientation orientation, ElConstDistMatrix s A, ElDist-Matrix s B)

ElError ElSolveAfterLUDist d(ElOrientation orientation, ElConstDistMatrix d A, ElDist-Matrix d B)

ElError ElSolveAfterLUDist c(ElOrientation orientation, ElConstDistMatrix c A, ElDist-Matrix c B)

ElError ElSolveAfterLUDist z(ElOrientation orientation, ElConstDistMatrix z A, ElDist-Matrix z B)

272 Chapter 5. LAPACK-like linear algebra

Page 277: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Rank-one modification to a factorization

Modify an existing LU factorization, A = PT LU, to incorporate the rank-one update A + uvT

or A + uvH. This algorithm only requires a quadratic number of operations.

Note: The current implementation has only been tested for square matrices.

C++ API

void LUMod(Matrix<F> &A, Matrix<int> &p, const Matrix<F> &u, const Matrix<F>&v, bool conjugate = true, Base<F> tau = 0.1)

void LUMod(AbstractDistMatrix<F> &A, AbstractDistMatrix<int> &p, const AbstractDist-Matrix<F> &u, const AbstractDistMatrix<F> &v, bool conjugate = true,Base<F> tau = 0.1)

C API

ElError ElLUMod s(ElMatrix s A, ElMatrix i p, ElConstMatrix s u, ElConstMatrix s v,float tau)

ElError ElLUMod d(ElMatrix d A, ElMatrix i p, ElConstMatrix d u, ElConstMatrix d v,double tau)

ElError ElLUMod c(ElMatrix c A, ElMatrix i p, ElConstMatrix c u, ElConstMatrix c v,float tau)

ElError ElLUMod z(ElMatrix z A, ElMatrix i p, ElConstMatrix z u, ElConstMatrix z v,double tau)

ElError ElLUModDist s(ElDistMatrix s A, ElDistMatrix i p, ElConstDistMatrix s u, El-ConstDistMatrix s v, float tau)

ElError ElLUModDist d(ElDistMatrix d A, ElDistMatrix i p, ElConstDistMatrix d u, El-ConstDistMatrix d v, double tau)

ElError ElLUModDist c(ElDistMatrix c A, ElDistMatrix i p, ElConstDistMatrix c u, El-ConstDistMatrix c v, float tau)

ElError ElLUModDist z(ElDistMatrix z A, ElDistMatrix i p, ElConstDistMatrix z u, El-ConstDistMatrix z v, double tau)

5.2.4 LQ factorization

Implementation

Subroutines

Test driver

Given A ∈ Fm×n, an LQ factorization typically computes an implicit unitary matrix Q ∈ Fn×n

such that L ≡ AQH is lower trapezoidal. One can then form the thin factors L ∈ Fm×min(m,n)

and Q ∈ Fmin(m,n)×n by setting L and Q to first min(m, n) columns and rows of L and Q,respectively. Upon completion L is stored in the lower trapezoid of A and the Householderreflectors (and preceding unitary diagonal matrix forcing L to have a positive diagonal, definedby the vector d) representing Q are stored within the rows of the strictly upper trapezoid.

5.2. Factorizations 273

Page 278: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Factorization

C++ API

void LQ(Matrix<F> &A, Matrix<F> &t, Matrix<Base<F>> &d)

void LQ(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &t, AbstractDistMa-trix<Base<F>> &d)

Overwrite the matrix A with L and the Householder reflectors representing Q. The scal-ings for the Householder reflectors are stored in the vector t and the diagonal matrixwhich forces L to be positive in d.

void lq::Explicit(Matrix<F> &L, Matrix<F> &A)

void lq::Explicit(AbstractDistMatrix<F> &L, AbstractDistMatrix<F> &A)

Overwrite A with Q and return L.

void lq::ExplicitTriang(Matrix<F> &A)

void lq::ExplicitTriang(AbstractDistMatrix<F> &A)

Overwrite A with the triangular factor, L.

void lq::ExplicitUnitary(Matrix<F> &A)

void lq::ExplicitUnitary(AbstractDistMatrix<F> &A)

Overwrite A with Q.

C API

ElError ElLQ s(ElMatrix s A, ElMatrix s t, ElMatrix s d)

ElError ElLQ d(ElMatrix d A, ElMatrix d t, ElMatrix d d)

ElError ElLQ c(ElMatrix c A, ElMatrix c t, ElMatrix s d)

ElError ElLQ z(ElMatrix z A, ElMatrix z t, ElMatrix d d)

ElError ElLQDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d)

ElError ElLQDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d)

ElError ElLQDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d)

ElError ElLQDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d)Overwrite the matrix A with L and the Householder reflectors representing Q. The scal-ings for the Householder reflectors are stored in the vector t and the diagonal matrixwhich forces L to be positive in d.

ElError ElLQExplicit s(ElMatrix s L, ElMatrix s A)

ElError ElLQExplicit d(ElMatrix d L, ElMatrix d A)

ElError ElLQExplicit c(ElMatrix c L, ElMatrix c A)

ElError ElLQExplicit z(ElMatrix z L, ElMatrix z A)

ElError ElLQExplicitDist s(ElDistMatrix s L, ElDistMatrix s A)

ElError ElLQExplicitDist d(ElDistMatrix d L, ElDistMatrix d A)

ElError ElLQExplicitDist c(ElDistMatrix c L, ElDistMatrix c A)

274 Chapter 5. LAPACK-like linear algebra

Page 279: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLQExplicitDist z(ElDistMatrix z L, ElDistMatrix z A)

Overwrite A with Q and return L.

ElError ElLQExplicitTriang s(ElMatrix s A)

ElError ElLQExplicitTriang d(ElMatrix d A)

ElError ElLQExplicitTriang c(ElMatrix c A)

ElError ElLQExplicitTriang z(ElMatrix z A)

ElError ElLQExplicitTriangDist s(ElDistMatrix s A)

ElError ElLQExplicitTriangDist d(ElDistMatrix d A)

ElError ElLQExplicitTriangDist c(ElDistMatrix c A)

ElError ElLQExplicitTriangDist z(ElDistMatrix z A)

Ovewrite A with the triangular factor, L.

ElError ElLQExplicitUnitary s(ElMatrix s A)

ElError ElLQExplicitUnitary d(ElMatrix d A)

ElError ElLQExplicitUnitary c(ElMatrix c A)

ElError ElLQExplicitUnitary z(ElMatrix z A)

ElError ElLQExplicitUnitaryDist s(ElDistMatrix s A)

ElError ElLQExplicitUnitaryDist d(ElDistMatrix d A)

ElError ElLQExplicitUnitaryDist c(ElDistMatrix c A)

ElError ElLQExplicitUnitaryDist z(ElDistMatrix z A)

Overwrite A with Q.

Applying the factored matrix

The following routines apply the implicitly-defined Q (or its adjoint) stored within A, t, and dfrom either the left or the right to B.

C++ API

void lq::ApplyQ(LeftOrRight side, Orientation orientation, const Matrix<F> &A, constMatrix<F> &t, const Matrix<Base<F>> &d, Matrix<F> &B)

void lq::ApplyQ(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<F> &A, const AbstractDistMatrix<F> &t, const AbstractDist-Matrix<Base<F>> &d, AbstractDistMatrix<F> &B)

C API

ElError ElApplyQAfterLQ s(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix s A, ElConstMatrix s t, ElConstMatrix s d, ElMa-trix s B)

5.2. Factorizations 275

Page 280: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElApplyQAfterLQ d(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix d A, ElConstMatrix d t, ElConstMatrix d d, ElMa-trix d B)

ElError ElApplyQAfterLQ c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c A, ElConstMatrix c t, ElConstMatrix s d, ElMa-trix c B)

ElError ElApplyQAfterLQ z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElConstMatrix d d, ElMa-trix z B)

ElError ElApplyQAfterLQDist s(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix s A, ElConstDistMatrix s t, ElConstDistMa-trix s d, ElDistMatrix s B)

ElError ElApplyQAfterLQDist d(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix d A, ElConstDistMatrix d t, ElConstDist-Matrix d d, ElDistMatrix d B)

ElError ElApplyQAfterLQDist c(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix c A, ElConstDistMatrix c t, ElConstDistMa-trix s d, ElDistMatrix c B)

ElError ElApplyQAfterLQDist z(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix z A, ElConstDistMatrix z t, ElConstDist-Matrix d d, ElDistMatrix z B)

Solving against the factored matrix

The following routines solve a set of linear systems using an existing packed LQ factorizationgiven by A and the vectors t and d. B is the matrix of input vectors and X is the matrix ofsolutions.

C++ API

void lq::SolveAfter(Orientation orientation, const Matrix<F> &A, const Matrix<F> &t,const Matrix<Base<F>> &d, const Matrix<F> &B, Matrix<F>&X)

void lq::SolveAfter(Orientation orientation, const AbstractDistMatrix<F> &A, constAbstractDistMatrix<F> &t, const AbstractDistMatrix<Base<F>>&d, const AbstractDistMatrix<F> &B, AbstractDistMatrix<F>&X)

C API

ElError ElSolveAfterLQ s(ElOrientation orientation, ElConstMatrix s A, ElConstMa-trix s t, ElConstMatrix s d, ElConstMatrix s B, ElMatrix s X)

ElError ElSolveAfterLQ d(ElOrientation orientation, ElConstMatrix d A, ElConstMa-trix d t, ElConstMatrix d d, ElConstMatrix d B, ElMa-trix d X)

ElError ElSolveAfterLQ c(ElOrientation orientation, ElConstMatrix c A, ElConstMa-trix c t, ElConstMatrix s d, ElConstMatrix c B, ElMatrix c X)

276 Chapter 5. LAPACK-like linear algebra

Page 281: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSolveAfterLQ z(ElOrientation orientation, ElConstMatrix z A, ElConstMa-trix z t, ElConstMatrix d d, ElConstMatrix z B, ElMatrix z X)

ElError ElSolveAfterLQDist s(ElOrientation orientation, ElConstDistMatrix s A, ElCon-stDistMatrix s t, ElConstDistMatrix s d, ElConstDistMa-trix s B, ElDistMatrix s X)

ElError ElSolveAfterLQDist d(ElOrientation orientation, ElConstDistMatrix d A, ElCon-stDistMatrix d t, ElConstDistMatrix d d, ElConstDist-Matrix d B, ElDistMatrix d X)

ElError ElSolveAfterLQDist c(ElOrientation orientation, ElConstDistMatrix c A, ElCon-stDistMatrix c t, ElConstDistMatrix s d, ElConstDistMa-trix c B, ElDistMatrix c X)

ElError ElSolveAfterLQDist z(ElOrientation orientation, ElConstDistMatrix z A, ElCon-stDistMatrix z t, ElConstDistMatrix d d, ElConstDist-Matrix z B, ElDistMatrix z X)

5.2.5 QR factorization

Implementation

Subroutines

Test driver

Example driver

Given A ∈ Fm×n, a QR factorization typically computes an implicit unitary matrix Q ∈ Fm×m

such that R ≡ QH A is upper trapezoidal. One can then form the thin factors Q ∈ Fm×min(m,n)

and R ∈ Fmin(m,n)×n by setting Q and R to first min(m, n) columns and rows of Q and R,respectively. Upon completion R is stored in the upper trapezoid of A and the Householderreflectors representing Q are stored within the columns of the strictly lower trapezoid (thisunitary matrix is scaled from the right by a unitary diagonal matrix with entries given by d sothat R has a positive diagonal).

Factorization

C++ API

void QR(Matrix<F> &A, Matrix<F> &t, Matrix<Base<F>> &d)

void QR(ElementalMatrix<F> &A, ElementalMatrix<F> &t, ElementalMatrix<Base<F>>&d)

Overwrite the matrix A with both R and the Householder reflectors (and subsequentunitary diagonal matrix defined by the vector, d) representing Q. The scalings for theHouseholder reflectors are stored in the vector t.

void QR(Matrix<F> &A, Matrix<F> &t, Matrix<Base<F>> &d, Matrix<int> &p, constQRCtrl<Base<F>> &ctrl = QRCtrl<Base<F>>())

void QR(ElementalMatrix<F> &A, ElementalMatrix<F> &t, ElementalMatrix<Base<F>>&d, ElementalMatrix<int> &p, const QRCtrl<Base<F>> &ctrl = QRC-trl<Base<F>>())

Overwrite A with both the R and (scaled) Householder reflectors from a column-pivoted

5.2. Factorizations 277

Page 282: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

QR factorization and additionally return the permutation vector, p.

void qr::ExplicitTriang(Matrix<F> &A, const QRCtrl<Base<F>> &ctrl = QRC-trl<Base<F>>())

void qr::ExplicitTriang(ElementalMatrix<F> &A, const QRCtrl<Base<F>> &ctrl =QRCtrl<Base<F>>())

Overwrite A with R.

void qr::ExplicitUnitary(Matrix<F> &A, bool thinQ = true, const QRC-trl<Base<F>> &ctrl = QRCtrl<Base<F>>())

void qr::ExplicitUnitary(ElementalMatrix<F> &A, bool thinQ = true, const QRC-trl<Base<F>> &ctrl = QRCtrl<Base<F>>())

Overwrite A with the orthogonal matrix from its QR factorization (with or without col-umn pivoting).

void qr::Explicit(Matrix<F> &A, Matrix<F> &R, bool thinQ = true, const QRC-trl<Base<F>> &ctrl = QRCtrl<Base<F>>())

void qr::Explicit(ElementalMatrix<F> &A, ElementalMatrix<F> &R, bool thinQ =true, const QRCtrl<Base<F>> &ctrl = QRCtrl<Base<F>>())

Explicitly return both Q and R from the QR factorization.

void qr::Explicit(Matrix<F> &A, Matrix<F> &R, Matrix<Int> &P, bool thinQ = true,const QRCtrl<Base<F>> &ctrl = QRCtrl<Base<F>>())

void qr::Explicit(ElementalMatrix<F> &A, ElementalMatrix<F> &R, ElementalMa-trix<int> &P, bool thinQ = true, const QRCtrl<Base<F>> &ctrl =QRCtrl<Base<F>>())

Return representations of all matrices of the pivoted QR factorization. Note that columnpivoting is performed regardless of the value of qrCtrl.colPiv.

void qr::Cholesky(Matrix<F> &A, Matrix<F> &R)

void qr::Cholesky(ElementalMatrix<F> &A, ElementalMatrix<F> &R)Attempt to perform a QR factorization of a tall-skinny matrix using Cholesky factoriza-tion.

qr::TreeData<F> qr::TS(const ElementalMatrix<F> &A)

Forms an implicit tall-skinny QR decomposition.

void qr::ExplicitTS(ElementalMatrix<F> &A, ElementalMatrix<F> &R)Forms an explicit QR decomposition using a tall-skinny algorithm: A is overwritten withQ.

DistMatrix<F, STAR, STAR> qr::ts::FormR(const ElementalMatrix<F> &A, constqr::TreeData<F> &treeData)

Return the R from the QR decomposition.

void qr::ts::FormQ(ElementalMatrix<F> &A, qr::TreeData<F> &treeData)Overwrite A with the Q from the QR decomposition.

type QRCtrl<Real>

bool colPiv

bool boundRank

Int maxRank

278 Chapter 5. LAPACK-like linear algebra

Page 283: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool adaptive

Real tol

bool alwaysRecomputeNorms

QRCtrl()

Initializes colPiv=false, boundRank=false, maxRank=0, adaptive=false, tol=0,and alwaysRecomputeNorms=false.

type TreeData<F>

Matrix<F> QR0

Initial QR factorization

Matrix<F> t0

Phases from initial QR factorization

Matrix<Base<F>> d0

Signature (-1,+1) which scales the Householder matrix from the right.

std::vector<Matrix<F>> QRList

Factorizations within reduction tree

std::vector<Matrix<F>> tList

Phases within reduction tree

std::vector<Matrix<Base<F>>> dList

Signatures within reduction tree

C API

ElError ElQR s(ElMatrix s A, ElMatrix s t, ElMatrix s d)

ElError ElQR d(ElMatrix d A, ElMatrix d t, ElMatrix d d)

ElError ElQR c(ElMatrix c A, ElMatrix c t, ElMatrix s d)

ElError ElQR z(ElMatrix z A, ElMatrix z t, ElMatrix d d)

ElError ElQRDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d)

ElError ElQRDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d)

ElError ElQRDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d)

ElError ElQRDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d)Return the packed QR factorization.

ElError ElQRColPiv s(ElMatrix s A, ElMatrix s t, ElMatrix s d, ElMatrix i p)

ElError ElQRColPiv d(ElMatrix d A, ElMatrix d t, ElMatrix d d, ElMatrix i p)

ElError ElQRColPiv c(ElMatrix c A, ElMatrix c t, ElMatrix s d, ElMatrix i p)

ElError ElQRColPiv z(ElMatrix z A, ElMatrix z t, ElMatrix d d, ElMatrix i p)

ElError ElQRColPivDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d, ElDist-Matrix i p)

5.2. Factorizations 279

Page 284: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElQRColPivDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d, ElDist-Matrix i p)

ElError ElQRColPivDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d, ElDist-Matrix i p)

ElError ElQRColPivDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d, ElDist-Matrix i p)

Return the packed pivoted QR factorization.

ElError ElQRColPivX s(ElMatrix s A, ElMatrix s t, ElMatrix s d, ElMatrix i p, ElQRC-trl s ctrl)

ElError ElQRColPivX d(ElMatrix d A, ElMatrix d t, ElMatrix d d, ElMatrix i p, ElQRC-trl d ctrl)

ElError ElQRColPivX c(ElMatrix c A, ElMatrix c t, ElMatrix s d, ElMatrix i p, ElQRC-trl s ctrl)

ElError ElQRColPivX z(ElMatrix z A, ElMatrix z t, ElMatrix d d, ElMatrix i p, ElQRC-trl d ctrl)

ElError ElQRColPivXDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d, ElDist-Matrix i p, ElQRCtrl s ctrl)

ElError ElQRColPivXDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d, ElD-istMatrix i p, ElQRCtrl d ctrl)

ElError ElQRColPivXDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d, ElDist-Matrix i p, ElQRCtrl s ctrl)

ElError ElQRColPivXDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d, ElD-istMatrix i p, ElQRCtrl d ctrl)

Return the packed QR factorization (expert version).

ElError ElQRExplicit s(ElMatrix s A, ElMatrix s R)

ElError ElQRExplicit d(ElMatrix d A, ElMatrix d R)

ElError ElQRExplicit c(ElMatrix c A, ElMatrix c R)

ElError ElQRExplicit z(ElMatrix z A, ElMatrix z R)

ElError ElQRExplicitDist s(ElDistMatrix s A, ElDistMatrix s R)

ElError ElQRExplicitDist d(ElDistMatrix d A, ElDistMatrix d R)

ElError ElQRExplicitDist c(ElDistMatrix c A, ElDistMatrix c R)

ElError ElQRExplicitDist z(ElDistMatrix z A, ElDistMatrix z R)Return the explicit QR factorization (replace A with Q and return R).

ElError ElQRExplicitColPiv s(ElMatrix s A, ElMatrix s R, ElMatrix i P)

ElError ElQRExplicitColPiv d(ElMatrix d A, ElMatrix d R, ElMatrix i P)

ElError ElQRExplicitColPiv c(ElMatrix c A, ElMatrix c R, ElMatrix i P)

ElError ElQRExplicitColPiv z(ElMatrix z A, ElMatrix z R, ElMatrix i P)

ElError ElQRExplicitColPivDist s(ElDistMatrix s A, ElDistMatrix s R, ElDistMa-trix i P)

ElError ElQRExplicitColPivDist d(ElDistMatrix d A, ElDistMatrix d R, ElDistMa-trix i P)

280 Chapter 5. LAPACK-like linear algebra

Page 285: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElQRExplicitColPivDist c(ElDistMatrix c A, ElDistMatrix c R, ElDistMa-trix i P)

ElError ElQRExplicitColPivDist z(ElDistMatrix z A, ElDistMatrix z R, ElDistMa-trix i P)

Return the explicit QR factorization with column pivoting (replace A with Q and returnR and P).

ElError ElQRExplicitTriang s(ElMatrix s A)

ElError ElQRExplicitTriang d(ElMatrix d A)

ElError ElQRExplicitTriang c(ElMatrix c A)

ElError ElQRExplicitTriang z(ElMatrix z A)

ElError ElQRExplicitTriangDist s(ElDistMatrix s A)

ElError ElQRExplicitTriangDist d(ElDistMatrix d A)

ElError ElQRExplicitTriangDist c(ElDistMatrix c A)

ElError ElQRExplicitTriangDist z(ElDistMatrix z A)

Return the triangular factor from QR with no pivoting

Note: An expert wrapper which supports column-pivoting is needed.

ElError ElQRExplicitUnitary s(ElMatrix s A)

ElError ElQRExplicitUnitary d(ElMatrix d A)

ElError ElQRExplicitUnitary c(ElMatrix c A)

ElError ElQRExplicitUnitary z(ElMatrix z A)

ElError ElQRExplicitUnitaryDist s(ElDistMatrix s A)

ElError ElQRExplicitUnitaryDist d(ElDistMatrix d A)

ElError ElQRExplicitUnitaryDist c(ElDistMatrix c A)

ElError ElQRExplicitUnitaryDist z(ElDistMatrix z A)

Return the unitary factor from QR with no pivoting

Note: An expert wrapper which supports column-pivoting is needed.

ElError ElCholeskyQR s(ElMatrix s A, ElMatrix s R)

ElError ElCholeskyQR d(ElMatrix d A, ElMatrix d R)

ElError ElCholeskyQR c(ElMatrix c A, ElMatrix c R)

ElError ElCholeskyQR z(ElMatrix z A, ElMatrix z R)

ElError ElCholeskyQRDist s(ElDistMatrix s A, ElDistMatrix s R)

ElError ElCholeskyQRDist d(ElDistMatrix d A, ElDistMatrix d R)

ElError ElCholeskyQRDist c(ElDistMatrix c A, ElDistMatrix c R)

ElError ElCholeskyQRDist z(ElDistMatrix z A, ElDistMatrix z R)Attempt to perform a Cholesky-based QR factorization of a tall-skinny matrix.

5.2. Factorizations 281

Page 286: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Apply the factorization to vectors

Applies the implicitly-defined Q (or its adjoint) stored within A, t, and d from either the left orthe right to B.

C++ API

void qr::ApplyQ(LeftOrRight side, Orientation orientation, const Matrix<F> &A, constMatrix<F> &t, const Matrix<Base<F>> &d, Matrix<F> &B)

void qr::ApplyQ(LeftOrRight side, Orientation orientation, const ElementalMatrix<F> &A,const ElementalMatrix<F> &t, const ElementalMatrix<Base<F>> &d,ElementalMatrix<F> &B)

C API

ElError ElApplyQAfterQR s(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix s A, ElConstMatrix s t, ElConstMatrix s d, ElMa-trix s B)

ElError ElApplyQAfterQR d(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix d A, ElConstMatrix d t, ElConstMatrix d d, ElMa-trix d B)

ElError ElApplyQAfterQR c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c A, ElConstMatrix c t, ElConstMatrix s d, ElMa-trix c B)

ElError ElApplyQAfterQR z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElConstMatrix d d, ElMa-trix z B)

ElError ElApplyQAfterQRDist s(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix s A, ElConstDistMatrix s t, ElConstDistMa-trix s d, ElDistMatrix s B)

ElError ElApplyQAfterQRDist d(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix d A, ElConstDistMatrix d t, ElConstDist-Matrix d d, ElDistMatrix d B)

ElError ElApplyQAfterQRDist c(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix c A, ElConstDistMatrix c t, ElConstDistMa-trix s d, ElDistMatrix c B)

ElError ElApplyQAfterQRDist z(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix z A, ElConstDistMatrix z t, ElConstDist-Matrix d d, ElDistMatrix z B)

Solve linear systems with the factorization

Solves a set of linear systems using an existing packed QR factorization given by A and thevectors t and d. B is the matrix of input vectors and X is the matrix of solutions.

282 Chapter 5. LAPACK-like linear algebra

Page 287: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void qr::SolveAfter(Orientation orientation, const Matrix<F> &A, const Matrix<F> &t,const Matrix<Base<F>> &d, const Matrix<F> &B, Matrix<F>&X)

void qr::SolveAfter(Orientation orientation, const ElementalMatrix<F> &A, const El-ementalMatrix<F> &t, const ElementalMatrix<Base<F>> &d,const ElementalMatrix<F> &B, ElementalMatrix<F> &X)

C API

ElError ElSolveAfterQR s(ElOrientation orientation, ElConstMatrix s A, ElConstMa-trix s t, ElConstMatrix s d, ElConstMatrix s B, ElMatrix s X)

ElError ElSolveAfterQR d(ElOrientation orientation, ElConstMatrix d A, ElConstMa-trix d t, ElConstMatrix d d, ElConstMatrix d B, ElMa-trix d X)

ElError ElSolveAfterQR c(ElOrientation orientation, ElConstMatrix c A, ElConstMa-trix c t, ElConstMatrix s d, ElConstMatrix c B, ElMatrix c X)

ElError ElSolveAfterQR z(ElOrientation orientation, ElConstMatrix z A, ElConstMa-trix z t, ElConstMatrix d d, ElConstMatrix z B, ElMatrix z X)

ElError ElSolveAfterQRDist s(ElOrientation orientation, ElConstDistMatrix s A, ElCon-stDistMatrix s t, ElConstDistMatrix s d, ElConstDistMa-trix s B, ElDistMatrix s X)

ElError ElSolveAfterQRDist d(ElOrientation orientation, ElConstDistMatrix d A, ElCon-stDistMatrix d t, ElConstDistMatrix d d, ElConstDist-Matrix d B, ElDistMatrix d X)

ElError ElSolveAfterQRDist c(ElOrientation orientation, ElConstDistMatrix c A, ElCon-stDistMatrix c t, ElConstDistMatrix s d, ElConstDistMa-trix c B, ElDistMatrix c X)

ElError ElSolveAfterQRDist z(ElOrientation orientation, ElConstDistMatrix z A, ElCon-stDistMatrix z t, ElConstDistMatrix d d, ElConstDist-Matrix z B, ElDistMatrix z X)

5.2.6 RQ factorization

Implementation

Subroutines

Test driver

Just like an LQ factorization, but the orthogonalization process starts from the bottom row andproduces a much sparser triangular factor when the matrix is wider than it is tall.

5.2. Factorizations 283

Page 288: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Factorization

C++ API

void RQ(Matrix<F> &A, Matrix<F> &t, Matrix<Base<F>> &d)

void RQ(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &t, AbstractDistMa-trix<Base<F>> &d)

Overwrite the matrix A with R and the Householder reflectors representing Q. The scal-ings for the Householder reflectors are stored in the vector t and the unitary diagonalmatrix which forces R to be positive is defined by the vector d.

void rq::ExplicitTriang(Matrix<F> &A)

void rq::ExplicitTriang(AbstractDistMatrix<F> &A)

Overwrite A with the triangular factor, R.

C API

ElError ElRQ s(ElMatrix s A, ElMatrix s t, ElMatrix s d)

ElError ElRQ d(ElMatrix d A, ElMatrix d t, ElMatrix d d)

ElError ElRQ c(ElMatrix c A, ElMatrix c t, ElMatrix s d)

ElError ElRQ z(ElMatrix z A, ElMatrix z t, ElMatrix d d)

ElError ElRQDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d)

ElError ElRQDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d)

ElError ElRQDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d)

ElError ElRQDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d)Overwrite the matrix A with R and the Householder reflectors representing Q. The scal-ings for the Householder reflectors are stored in the vector t and the unitary diagonalmatrix which forces R to be positive is defined by the vector d.

ElError ElRQExplicitTriang s(ElMatrix s A)

ElError ElRQExplicitTriang d(ElMatrix d A)

ElError ElRQExplicitTriang c(ElMatrix c A)

ElError ElRQExplicitTriang z(ElMatrix z A)

Overwrite A with the triangular factor, R.

Apply the factored matrix

C++ API

void rq::ApplyQ(LeftOrRight side, Orientation orientation, const Matrix<F> &A, constMatrix<F> &t, const Matrix<Base<F>> &d, Matrix<F> &B)

284 Chapter 5. LAPACK-like linear algebra

Page 289: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void rq::ApplyQ(LeftOrRight side, Orientation orientation, const AbstractDistMa-trix<F> &A, const AbstractDistMatrix<F> &t, const AbstractDist-Matrix<Base<F>> &d, AbstractDistMatrix<F> &B)

Applies the implicitly-defined Q (or its adjoint) stored within A, t, and d from either theleft or the right to B.

C API

ElError ElApplyQAfterRQ s(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix s A, ElConstMatrix s t, ElConstMatrix s d, ElMa-trix s B)

ElError ElApplyQAfterRQ d(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix d A, ElConstMatrix d t, ElConstMatrix d d, ElMa-trix d B)

ElError ElApplyQAfterRQ c(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix c A, ElConstMatrix c t, ElConstMatrix s d, ElMa-trix c B)

ElError ElApplyQAfterRQ z(ElLeftOrRight side, ElOrientation orientation, ElConstMa-trix z A, ElConstMatrix z t, ElConstMatrix d d, ElMa-trix z B)

ElError ElApplyQAfterRQDist s(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix s A, ElConstDistMatrix s t, ElConstDistMa-trix s d, ElDistMatrix s B)

ElError ElApplyQAfterRQDist d(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix d A, ElConstDistMatrix d t, ElConstDist-Matrix d d, ElDistMatrix d B)

ElError ElApplyQAfterRQDist c(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix c A, ElConstDistMatrix c t, ElConstDistMa-trix s d, ElDistMatrix c B)

ElError ElApplyQAfterRQDist z(ElLeftOrRight side, ElOrientation orientation, ElConst-DistMatrix z A, ElConstDistMatrix z t, ElConstDist-Matrix d d, ElDistMatrix z B)

Solve linear systems with the factored matrix

C++ API

void rq::SolveAfter(Orientation orientation, const Matrix<F> &A, const Matrix<F> &t,const Matrix<Base<F>> &d, const Matrix<F> &B, Matrix<F>&X)

void rq::SolveAfter(Orientation orientation, const AbstractDistMatrix<F> &A, constAbstractDistMatrix<F> &t, const AbstractDistMatrix<Base<F>>&d, const AbstractDistMatrix<F> &B, AbstractDistMatrix<F>&X)

Solves a set of linear systems using an existing packed RQ factorization given by A andthe vectors t and d. B is the matrix of input vectors and X is the matrix of solutions.

5.2. Factorizations 285

Page 290: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElSolveAfterRQ s(ElOrientation orientation, ElConstMatrix s A, ElConstMa-trix s t, ElConstMatrix s d, ElConstMatrix s B, ElMatrix s X)

ElError ElSolveAfterRQ d(ElOrientation orientation, ElConstMatrix d A, ElConstMa-trix d t, ElConstMatrix d d, ElConstMatrix d B, ElMa-trix d X)

ElError ElSolveAfterRQ c(ElOrientation orientation, ElConstMatrix c A, ElConstMa-trix c t, ElConstMatrix s d, ElConstMatrix c B, ElMatrix c X)

ElError ElSolveAfterRQ z(ElOrientation orientation, ElConstMatrix z A, ElConstMa-trix z t, ElConstMatrix d d, ElConstMatrix z B, ElMatrix z X)

ElError ElSolveAfterRQDist s(ElOrientation orientation, ElConstDistMatrix s A, ElCon-stDistMatrix s t, ElConstDistMatrix s d, ElConstDistMa-trix s B, ElDistMatrix s X)

ElError ElSolveAfterRQDist d(ElOrientation orientation, ElConstDistMatrix d A, ElCon-stDistMatrix d t, ElConstDistMatrix d d, ElConstDist-Matrix d B, ElDistMatrix d X)

ElError ElSolveAfterRQDist c(ElOrientation orientation, ElConstDistMatrix c A, ElCon-stDistMatrix c t, ElConstDistMatrix s d, ElConstDistMa-trix c B, ElDistMatrix c X)

ElError ElSolveAfterRQDist z(ElOrientation orientation, ElConstDistMatrix z A, ElCon-stDistMatrix z t, ElConstDistMatrix d d, ElConstDist-Matrix z B, ElDistMatrix z X)

5.2.7 Generalized QR factorization

The generalized QR factorization of a pair of matrices (A, B) is analogous to a QR factorization ofB−1 A but does not require that B is square or invertible: unitary matrices Q and Z, and (right)upper-triangular matrices R and T, are computed such that

A = QR

and

B = QTZ.

Thus, if B was square and invertible, then the QR factorization of B−1A would be given byZH(T−1R).

Python API

The style of factorization is encoded within a pseudo-enum which takes on one of four values:

GQR IMPLICIT=0

Form the implicit, packed factorization

GQR EXPLICIT=1

Explicitly return the individual factors (not yet supported)

GQR EXPLICIT TRIANG=2

Explicitly return the triangular factors, R and T

286 Chapter 5. LAPACK-like linear algebra

Page 291: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

GQR EXPLICIT UNITARY=3

Explicitly return the unitary factors, Q and Z (not yet supported)

GQR(A, B[, factType=GQR IMPLICIT ])Parameters

• A –

• B –

• factType – (optional)

Return type If factType is GQR IMPLICIT, (tA, dA, tB, db), ...

C++ API

void GQR(Matrix<F> &A, Matrix<F> &tA, Matrix<Base<F>> &dA, Matrix<F> &B, Ma-trix<F> &tB, Matrix<Base<F>> &dB)

void GQR(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &tA, AbstractDistMa-trix<Base<F>> &dA, AbstractDistMatrix<F> &B, AbstractDistMatrix<F> &tB,AbstractDistMatrix<Base<F>> &dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

void gqr::ExplicitTriang(Matrix<F> &A, Matrix<F> &B)

void gqr::ExplicitTriang(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B)Overwrite A with R and B with T.

C API

Single-precision

ElError ElGQR s(ElMatrix s A, ElMatrix s tA, ElMatrix s dA, ElMatrix s B, ElMatrix s tB,ElMatrix s dB)

ElError ElGQRDist s(ElDistMatrix s A, ElDistMatrix s tA, ElDistMatrix s dA, ElDistMa-trix s B, ElDistMatrix s tB, ElDistMatrix s dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

ElError ElGQRExplicitTriang s(ElMatrix s A, ElMatrix s B)

ElError ElGQRExplicitTriangDist s(ElDistMatrix s A, ElDistMatrix s B)Overwrite A with R and B with T.

Double-precision

ElError ElGQR d(ElMatrix d A, ElMatrix d tA, ElMatrix d dA, ElMatrix d B, ElMa-trix d tB, ElMatrix d dB)

5.2. Factorizations 287

Page 292: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGQRDist d(ElDistMatrix d A, ElDistMatrix d tA, ElDistMatrix d dA, ElDistMa-trix d B, ElDistMatrix d tB, ElDistMatrix d dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

ElError ElGQRExplicitTriang d(ElMatrix d A, ElMatrix d B)

ElError ElGQRExplicitTriangDist d(ElDistMatrix d A, ElDistMatrix d B)Overwrite A with R and B with T.

Single-precision complex

ElError ElGQR c(ElMatrix c A, ElMatrix c tA, ElMatrix s dA, ElMatrix c B, ElMatrix c tB,ElMatrix s dB)

ElError ElGQRDist c(ElDistMatrix c A, ElDistMatrix c tA, ElDistMatrix s dA, ElDistMa-trix c B, ElDistMatrix c tB, ElDistMatrix s dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

ElError ElGQRExplicitTriang c(ElMatrix c A, ElMatrix c B)

ElError ElGQRExplicitTriangDist c(ElDistMatrix c A, ElDistMatrix c B)Overwrite A with R and B with T.

Double-precision complex

ElError ElGQR z(ElMatrix z A, ElMatrix z tA, ElMatrix d dA, ElMatrix z B, ElMatrix z tB,ElMatrix d dB)

ElError ElGQRDist z(ElDistMatrix z A, ElDistMatrix z tA, ElDistMatrix d dA, ElDistMa-trix z B, ElDistMatrix z tB, ElDistMatrix d dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

ElError ElGQRExplicitTriang z(ElMatrix z A, ElMatrix z B)

ElError ElGQRExplicitTriangDist z(ElDistMatrix z A, ElDistMatrix z B)Overwrite A with R and B with T

References

C++11 implementation

C++11 header

C99 wrappers

C99 header

Python wrappers

288 Chapter 5. LAPACK-like linear algebra

Page 293: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.2.8 Generalized RQ factorization

Implementation

The generalized RQ factorization of a pair of matrices (A, B) is analogous to an RQ factorizationof AB−1 but does not require that B is square or invertible: unitary matrices Q and Z, and(right) upper-triangular matrices R and T, are computed such that

A = RQ

and

B = ZTQ.

Thus, is B was square and invertible, then the RQ factorization of AB−1 would be given by(RT−1)ZH.

C++ API

void GRQ(Matrix<F> &A, Matrix<F> &tA, Matrix<Base<F>> &dA, Matrix<F> &B, Ma-trix<F> &tB, Matrix<Base<F>> &dB)

void GRQ(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &tA, AbstractDistMa-trix<Base<F>> &dA, AbstractDistMatrix<F> &B, AbstractDistMatrix<F> &tB,AbstractDistMatrix<Base<F>> &dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

void grq::ExplicitTriang(Matrix<F> &A, Matrix<F> &B)

void grq::ExplicitTriang(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B)Overwrite A with R and B with T.

C API

ElError ElGRQ s(ElMatrix s A, ElMatrix s tA, ElMatrix s dA, ElMatrix s B, ElMatrix s tB,ElMatrix s dB)

ElError ElGRQ d(ElMatrix d A, ElMatrix d tA, ElMatrix d dA, ElMatrix d B, ElMa-trix d tB, ElMatrix d dB)

ElError ElGRQ c(ElMatrix c A, ElMatrix c tA, ElMatrix s dA, ElMatrix c B, ElMatrix c tB,ElMatrix s dB)

ElError ElGRQ z(ElMatrix z A, ElMatrix z tA, ElMatrix d dA, ElMatrix z B, ElMatrix z tB,ElMatrix d dB)

ElError ElGRQDist s(ElDistMatrix s A, ElDistMatrix s tA, ElDistMatrix s dA, ElDistMa-trix s B, ElDistMatrix s tB, ElDistMatrix s dB)

ElError ElGRQDist d(ElDistMatrix d A, ElDistMatrix d tA, ElDistMatrix d dA, ElDistMa-trix d B, ElDistMatrix d tB, ElDistMatrix d dB)

ElError ElGRQDist c(ElDistMatrix c A, ElDistMatrix c tA, ElDistMatrix s dA, ElDistMa-trix c B, ElDistMatrix c tB, ElDistMatrix s dB)

5.2. Factorizations 289

Page 294: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGRQDist z(ElDistMatrix z A, ElDistMatrix z tA, ElDistMatrix d dA, ElDistMa-trix z B, ElDistMatrix z tB, ElDistMatrix d dB)

Overwrite A with both R and the (scaled) Householder vectors which, along with thescalings tA and sign changes dA, define Q. Likewise, B is overwritten with both T andthe (scaled) Householder vectors which define Z.

ElError ElGRQExplicitTriang s(ElMatrix s A, ElMatrix s B)

ElError ElGRQExplicitTriang d(ElMatrix d A, ElMatrix d B)

ElError ElGRQExplicitTriang c(ElMatrix c A, ElMatrix c B)

ElError ElGRQExplicitTriang z(ElMatrix z A, ElMatrix z B)

ElError ElGRQExplicitTriangDist s(ElDistMatrix s A, ElDistMatrix s B)

ElError ElGRQExplicitTriangDist d(ElDistMatrix d A, ElDistMatrix d B)

ElError ElGRQExplicitTriangDist c(ElDistMatrix c A, ElDistMatrix c B)

ElError ElGRQExplicitTriangDist z(ElDistMatrix z A, ElDistMatrix z B)Overwrite A with R and B with T.

5.2.9 Interpolative Decomposition (ID)

Implementation

Example driver

Interpolative Decompositions (ID’s) are closely related to pivoted QR factorizations and areuseful for representing (approximately) low-rank matrices in terms of linear combinations ofa few of their columns, i.e.,

AP = A(

I Z)

,

where P is a permutation matrix, A is a small set of columns of A, and Z is an interpolationmatrix responsible for representing the remaining columns in terms of the selected columns ofA.

The following routines use column-pivoted QR factorizations to return an Interpolative De-composition.

C++ API

void ID(const Matrix<F> &A, Matrix<int> &p, Matrix<F> &Z, const QRC-trl<Base<F>> ctrl = QRCtrl<Base<F>>())

void ID(const AbstractDistMatrix<F> &A, AbstractDistMatrix<int> &p, AbstractDistMa-trix<F> &Z, const QRCtrl<Base<F>> ctrl = QRCtrl<Base<F>>())

The matrix A is not modified.

void ID(Matrix<F> &A, Matrix<int> &p, Matrix<F> &Z, const QRCtrl<Base<F>> ctrl= QRCtrl<Base<F>>(), bool canOverwrite = false)

void ID(AbstractDistMatrix<F> &A, AbstractDistMatrix<int> &p, AbstractDistMa-trix<F> &Z, const QRCtrl<Base<F>> ctrl = QRCtrl<Base<F>>(), boolcanOverwrite = false)

The matrix A is optionally allowed to be modified.

290 Chapter 5. LAPACK-like linear algebra

Page 295: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElID s(ElMatrix s A, ElMatrix i p, ElMatrix s Z, ElQRCtrl s ctrl, bool canOver-write)

ElError ElID d(ElMatrix d A, ElMatrix i p, ElMatrix d Z, ElQRCtrl d ctrl, bool canOver-write)

ElError ElID c(ElMatrix c A, ElMatrix i p, ElMatrix c Z, ElQRCtrl s ctrl, bool canOver-write)

ElError ElID z(ElMatrix z A, ElMatrix i p, ElMatrix z Z, ElQRCtrl d ctrl, bool canOver-write)

ElError ElIDDist s(ElDistMatrix s A, ElDistMatrix i p, ElDistMatrix s Z, ElQRCtrl s ctrl,bool canOverwrite)

ElError ElIDDist d(ElDistMatrix d A, ElDistMatrix i p, ElDistMatrix d Z, ElQRC-trl d ctrl, bool canOverwrite)

ElError ElIDDist c(ElDistMatrix c A, ElDistMatrix i p, ElDistMatrix c Z, ElQRCtrl s ctrl,bool canOverwrite)

ElError ElIDDist z(ElDistMatrix z A, ElDistMatrix i p, ElDistMatrix z Z, ElQRC-trl d ctrl, bool canOverwrite)

The matrix A is optionally allowed to be modified.

5.2.10 Skeleton decomposition

Implementation

Example driver

Skeleton decompositions are essentially two-sided interpolative decompositions, but the ter-minology is unfortunately extremely contested. We follow the convention that a skeleton de-composition is an approximation

A ≈ ACZAR,

where AC is a (small) selection of columns of A, AR is a (small) selection of rows of A, and Z isa (small) square matrix. When Z is allowed to be rectangular, it is more common to call this aCUR decomposition.

Note that the following routines do not directly return AR and AC; the permutation matriceswhich implicitly define them are returned instead.

C++ API

void Skeleton(const Matrix<F> &A, Matrix<int> &pR, Matrix<int> &pC, Matrix<F>&Z, const QRCtrl<Base<F>> ctrl = QRCtrl<Base<F>>())

void Skeleton(const AbstractDistMatrix<F> &A, AbstractDistMatrix<int> &pR, Ab-stractDistMatrix<int> &pC, const QRCtrl<Base<F>> ctrl = QRC-trl<Base<F>>())

5.2. Factorizations 291

Page 296: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElSkeleton s(ElConstMatrix s A, ElMatrix i pR, ElMatrix i pC, ElMatrix s Z,ElQRCtrl s ctrl)

ElError ElSkeleton d(ElConstMatrix d A, ElMatrix i pR, ElMatrix i pC, ElMatrix d Z,ElQRCtrl d ctrl)

ElError ElSkeleton c(ElConstMatrix c A, ElMatrix i pR, ElMatrix i pC, ElMatrix c Z,ElQRCtrl s ctrl)

ElError ElSkeleton z(ElConstMatrix z A, ElMatrix i pR, ElMatrix i pC, ElMatrix z Z,ElQRCtrl d ctrl)

ElError ElSkeletonDist s(ElConstDistMatrix s A, ElDistMatrix i pR, ElDistMatrix i pC,ElDistMatrix s Z, ElQRCtrl s ctrl)

ElError ElSkeletonDist d(ElConstDistMatrix d A, ElDistMatrix i pR, ElDistMatrix i pC,ElDistMatrix d Z, ElQRCtrl d ctrl)

ElError ElSkeletonDist c(ElConstDistMatrix c A, ElDistMatrix i pR, ElDistMatrix i pC,ElDistMatrix c Z, ElQRCtrl s ctrl)

ElError ElSkeletonDist z(ElConstDistMatrix z A, ElDistMatrix i pR, ElDistMatrix i pC,ElDistMatrix z Z, ElQRCtrl d ctrl)

5.2.11 References

C++ Header

C Header

Python wrapper

5.3 Spectral analysis

5.3.1 Hermitian tridiagonal eigensolvers

Elemental provides a collection of routines, primarily based upon the [MRRR] algorithm, forboth full and partial solutions of the Hermitian eigenvalue problem

TZ = ZΛ,

where T is a given Hermitian tridiagonal matrix, and unitary Z and real diagonal Λ are sought.

Note that the tridiagonal matrix is defined via its real main diagonal, d, and (possibly complex)subdiagonal, dSub.

Computing eigenvalues

Compute the set of eigenvalues of the Hermitian tridiagonal matrix T determined by the subsetstructure (the default is to compute all eigenvalues).

292 Chapter 5. LAPACK-like linear algebra

Page 297: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void HermitianTridiagEig(Matrix<Base<F>> &d, Matrix<F> &dSub, Ma-trix<Base<F>> &w, SortType sort = ASCENDING, constHermitianEigSubset<Base<F>> subset = HermitianEigSub-set<Base<F>>())

void HermitianTridiagEig(const AbstractDistMatrix<Base<F>> &d, const Abstract-DistMatrix<F> &dSub, AbstractDistMatrix<Base<F>>&w, SortType sort = ASCENDING, const Hermi-tianEigSubset<Base<F>> subset = HermitianEigSub-set<Base<F>>())

C API

ElError ElHermitianTridiagEig s(ElMatrix s d, ElMatrix s dSub, ElMatrix s w, ElSort-Type sort)

ElError ElHermitianTridiagEig d(ElMatrix d d, ElMatrix d dSub, ElMatrix d w, ElSort-Type sort)

ElError ElHermitianTridiagEig c(ElMatrix s d, ElMatrix c dSub, ElMatrix s w, ElSort-Type sort)

ElError ElHermitianTridiagEig z(ElMatrix d d, ElMatrix z dSub, ElMatrix d w, ElSort-Type sort)

ElError ElHermitianTridiagEigDist s(ElConstDistMatrix s d, ElConstDistMa-trix s dSub, ElDistMatrix s w, ElSortType sort)

ElError ElHermitianTridiagEigDist d(ElConstDistMatrix d d, ElConstDistMa-trix d dSub, ElDistMatrix d w, ElSortType sort)

ElError ElHermitianTridiagEigDist c(ElConstDistMatrix s d, ElConstDistMa-trix c dSub, ElDistMatrix s w, ElSortType sort)

ElError ElHermitianTridiagEigDist z(ElConstDistMatrix d d, ElConstDistMa-trix z dSub, ElDistMatrix d w, ElSortType sort)

Return the full set of eigenvalues

ElError ElHermitianTridiagEigPartial s(ElMatrix s d, ElMatrix s dSub, ElMatrix s w,ElSortType sort, ElHermitianEigSubset s sub-set)

ElError ElHermitianTridiagEigPartial d(ElMatrix d d, ElMatrix d dSub, El-Matrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianTridiagEigPartial c(ElMatrix s d, ElMatrix c dSub, ElMatrix s w,ElSortType sort, ElHermitianEigSubset s sub-set)

ElError ElHermitianTridiagEigPartial z(ElMatrix d d, ElMatrix z dSub, ElMa-trix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

5.3. Spectral analysis 293

Page 298: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianTridiagEigPartialDist s(ElConstDistMatrix s d, ElConstDistMa-trix s dSub, ElDistMatrix s w, ElSort-Type sort, ElHermitianEigSubset s sub-set)

ElError ElHermitianTridiagEigPartialDist d(ElConstDistMatrix d d, ElConstDist-Matrix d dSub, ElDistMatrix d w,ElSortType sort, ElHermitianEigSub-set d subset)

ElError ElHermitianTridiagEigPartialDist c(ElConstDistMatrix s d, ElConstDistMa-trix c dSub, ElDistMatrix s w, ElSort-Type sort, ElHermitianEigSubset s sub-set)

ElError ElHermitianTridiagEigPartialDist z(ElConstDistMatrix d d, ElConstDist-Matrix z dSub, ElDistMatrix d w,ElSortType sort, ElHermitianEigSub-set d subset)

Return a subset of the eigenvalues

Computing eigenpairs

Compute the set of eigenpairs of the Hermitian tridiagonal matrix T determined by the subsetstructure (the default is to compute all eigenpairs) via PMRRR.

C++ API

void HermitianTridiagEig(Matrix<Base<F>> &d, Matrix<F> &dSub, Ma-trix<Base<F>> &w, Matrix<F> &Z, SortType sort =ASCENDING, const HermitianEigSubset<Base<F>> subset= HermitianEigSubset<Base<F>>())

void HermitianTridiagEig(const AbstractDistMatrix<Base<F>> &d, const Abstract-DistMatrix<F> &dSub, AbstractDistMatrix<Base<F>> &w,AbstractDistMatrix<F> &Z, SortType sort = ASCEND-ING, const HermitianEigSubset<Base<F>> subset = Hermi-tianEigSubset<Base<F>>())

C API

ElError ElHermitianTridiagEigPair s(ElMatrix s d, ElMatrix s dSub, ElMatrix s w, El-Matrix s Z, ElSortType sort)

ElError ElHermitianTridiagEigPair d(ElMatrix d d, ElMatrix d dSub, ElMatrix d w,ElMatrix d Z, ElSortType sort)

ElError ElHermitianTridiagEigPair c(ElMatrix s d, ElMatrix c dSub, ElMatrix s w, El-Matrix c Z, ElSortType sort)

ElError ElHermitianTridiagEigPair z(ElMatrix d d, ElMatrix z dSub, ElMatrix d w, El-Matrix z Z, ElSortType sort)

294 Chapter 5. LAPACK-like linear algebra

Page 299: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianTridiagEigPairDist s(ElConstDistMatrix s d, ElConstDistMa-trix s dSub, ElDistMatrix s w, ElDistMa-trix s Z, ElSortType sort)

ElError ElHermitianTridiagEigPairDist d(ElConstDistMatrix d d, ElConstDistMa-trix d dSub, ElDistMatrix d w, ElDistMa-trix d Z, ElSortType sort)

ElError ElHermitianTridiagEigPairDist c(ElConstDistMatrix s d, ElConstDistMa-trix c dSub, ElDistMatrix s w, ElDistMa-trix c Z, ElSortType sort)

ElError ElHermitianTridiagEigPairDist z(ElConstDistMatrix d d, ElConstDistMa-trix z dSub, ElDistMatrix d w, ElDistMa-trix z Z, ElSortType sort)

Return the full set of eigenvalues

ElError ElHermitianTridiagEigPairPartial s(ElMatrix s d, ElMatrix s dSub, ElMa-trix s w, ElMatrix s Z, ElSortType sort,ElHermitianEigSubset s subset)

ElError ElHermitianTridiagEigPairPartial d(ElMatrix d d, ElMatrix d dSub, ElMa-trix d w, ElMatrix d Z, ElSortType sort,ElHermitianEigSubset d subset)

ElError ElHermitianTridiagEigPairPartial c(ElMatrix s d, ElMatrix c dSub, ElMa-trix s w, ElMatrix c Z, ElSortType sort,ElHermitianEigSubset s subset)

ElError ElHermitianTridiagEigPairPartial z(ElMatrix d d, ElMatrix z dSub, ElMa-trix d w, ElMatrix z Z, ElSortType sort,ElHermitianEigSubset d subset)

ElError ElHermitianTridiagEigPairPartialDist s(ElConstDistMatrix s d, ElCon-stDistMatrix s dSub, ElDistMa-trix s w, ElDistMatrix s Z, ElSort-Type sort, ElHermitianEigSub-set s subset)

ElError ElHermitianTridiagEigPairPartialDist d(ElConstDistMatrix d d, ElCon-stDistMatrix d dSub, ElDistMa-trix d w, ElDistMatrix d Z, El-SortType sort, ElHermitianEigSub-set d subset)

ElError ElHermitianTridiagEigPairPartialDist c(ElConstDistMatrix s d, ElCon-stDistMatrix c dSub, ElDistMa-trix s w, ElDistMatrix c Z, ElSort-Type sort, ElHermitianEigSub-set s subset)

ElError ElHermitianTridiagEigPairPartialDist z(ElConstDistMatrix d d, ElCon-stDistMatrix z dSub, ElDistMa-trix d w, ElDistMatrix z Z, El-SortType sort, ElHermitianEigSub-set d subset)

Return a subset of the eigenvalues

5.3. Spectral analysis 295

Page 300: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Subset computation

The HermitianEigSubset<Real> structure is used to control subset computation, and, whennot explicitly manipulated, defaults to a request for the entire set of eigenvalues or eigenpairs.

C++ API

type HermitianEigSubset<Real>

bool indexSubset

Int lowerIndex

Int upperIndexIf indexSubset is true, then the eigenvalues/pairs with indices (inclusively) betweenlowerIndex and upperIndex will be found.

bool rangeSubset

Real lowerBound

Real upperBoundAlternatively, if rangeSubset is true, then the eigenvalues/pairs within the numericalrange (lowerBound, upperBound] will be found.

type HermitianEigSubset<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

C API

HermitianEigSubset s

bool indexSubset

Int lowerIndex

Int upperIndexIf indexSubset is true, then the eigenvalues/pairs with indices (inclusively) betweenlowerIndex and upperIndex will be found.

bool rangeSubset

float lowerBound

float upperBoundAlternatively, if rangeSubset is true, then the eigenvalues/pairs within the numericalrange (lowerBound, upperBound] will be found.

HermitianEigSubset d

bool indexSubset

Int lowerIndex

296 Chapter 5. LAPACK-like linear algebra

Page 301: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int upperIndexIf indexSubset is true, then the eigenvalues/pairs with indices (inclusively) betweenlowerIndex and upperIndex will be found.

bool rangeSubset

double lowerBound

double upperBound

Alternatively, if rangeSubset is true, then the eigenvalues/pairs within the numericalrange (lowerBound, upperBound] will be found.

References

Implementation

5.3.2 Hermitian eigensolvers

Implementation

Test driver

Example driver

Elemental provides a collection of routines for both full and partial solutions of the Hermitianeigenvalue problem

AZ = ZΛ,

where A is the given Hermitian matrix, and unitary Z and real diagonal Λ are sought.

Computing eigenvalues

Compute the set of eigenvalues of the Hermitian matrix A determined by the subset structure(the default is to compute all eigenvalues). By default, Elemental is used to transform theproblem to and from real symmetric tridiagonal form and PMRRR is used to solve the tridiag-onal EVP. Alternatively, the ctrl structure may be altered to request the usage of a (prototype)Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void HermitianEig(UpperOrLower uplo, Matrix<F> &A, Matrix<Base<F>> &w, Sort-Type sort = ASCENDING, const HermitianEigSubset<Base<F>>subset = HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> ctrl = HermitianEigCtrl<Base<F>>())

void HermitianEig(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDist-Matrix<Base<F>> &w, SortType sort = ASCENDING, constHermitianEigSubset<Base<F>> subset = HermitianEigSub-set<Base<F>>(), const HermitianEigCtrl<Base<F>> ctrl =HermitianEigCtrl<Base<F>>())

5.3. Spectral analysis 297

Page 302: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElHermitianEig s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s w, ElSort-Type sort)

ElError ElHermitianEig d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d w, ElSort-Type sort)

ElError ElHermitianEig c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix s w, ElSort-Type sort)

ElError ElHermitianEig z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix d w, ElSort-Type sort)

ElError ElHermitianEigDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMa-trix s w, ElSortType sort)

ElError ElHermitianEigDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDistMa-trix d w, ElSortType sort)

ElError ElHermitianEigDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMa-trix s w, ElSortType sort)

ElError ElHermitianEigDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMa-trix d w, ElSortType sort)

Return the full set of eigenvalues

TODO: An expert interface which used HermitianEigCtrl

ElError ElHermitianEigPartial s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s w, El-SortType sort, ElHermitianEigSubset s subset)

ElError ElHermitianEigPartial d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d w,ElSortType sort, ElHermitianEigSubset d subset)

ElError ElHermitianEigPartial c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix s w, El-SortType sort, ElHermitianEigSubset s subset)

ElError ElHermitianEigPartial z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix d w, El-SortType sort, ElHermitianEigSubset d subset)

ElError ElHermitianEigPartialDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDist-Matrix s w, ElSortType sort, ElHermitianEigSub-set s subset)

ElError ElHermitianEigPartialDist d(ElUpperOrLower uplo, ElDistMatrix d A, El-DistMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianEigPartialDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDist-Matrix s w, ElSortType sort, ElHermitianEigSub-set s subset)

ElError ElHermitianEigPartialDist z(ElUpperOrLower uplo, ElDistMatrix z A, El-DistMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

Return a subset of the eigenvalues

298 Chapter 5. LAPACK-like linear algebra

Page 303: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Computing eigenpairs

Compute the set of eigenpairs of the Hermitian matrix A determined by the subset structure(the default is to compute all eigenpairs). By default, Elemental is used to transform the prob-lem to and from real symmetric tridiagonal form and PMRRR is used to solve the tridiagonalEVP. Alternatively, the ctrl structure may be altered to request and tune the usage of a (proto-type) Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void HermitianEig(UpperOrLower uplo, Matrix<F> &A, Matrix<Base<F>> &w, Ma-trix<F> &Z, SortType sort = ASCENDING, const HermitianEigSub-set<Base<F>> subset = HermitianEigSubset<Base<F>>(),const HermitianEigCtrl<Base<F>> ctrl = HermitianEigC-trl<Base<F>>())

void HermitianEig(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<Base<F>> &w, AbstractDistMatrix<F> &Z, SortType sort =ASCENDING, const HermitianEigSubset<Base<F>> subset = Her-mitianEigSubset<Base<F>>(), const HermitianEigCtrl<Base<F>>ctrl = HermitianEigCtrl<Base<F>>())

C API

ElError ElHermitianEigPair s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s w, ElMa-trix s Z, ElSortType sort)

ElError ElHermitianEigPair d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d w, ElMa-trix d Z, ElSortType sort)

ElError ElHermitianEigPair c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix s w, ElMa-trix c Z, ElSortType sort)

ElError ElHermitianEigPair z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix d w, ElMa-trix z Z, ElSortType sort)

ElError ElHermitianEigPairDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMa-trix s w, ElDistMatrix s Z, ElSortType sort)

ElError ElHermitianEigPairDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDistMa-trix d w, ElDistMatrix d Z, ElSortType sort)

ElError ElHermitianEigPairDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMa-trix s w, ElDistMatrix c Z, ElSortType sort)

ElError ElHermitianEigPairDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMa-trix d w, ElDistMatrix z Z, ElSortType sort)

Return the full eigenvalue decomposition.

TODO: An expert interface which used HermitianEigCtrl

5.3. Spectral analysis 299

Page 304: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianEigPairPartial s(ElUpperOrLower uplo, ElMatrix s A, ElMa-trix s w, ElMatrix s Z, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianEigPairPartial d(ElUpperOrLower uplo, ElMatrix d A, ElMa-trix d w, ElMatrix d Z, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianEigPairPartial c(ElUpperOrLower uplo, ElMatrix c A, ElMa-trix s w, ElMatrix c Z, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianEigPairPartial z(ElUpperOrLower uplo, ElMatrix z A, ElMa-trix d w, ElMatrix z Z, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianEigPairPartialDist s(ElUpperOrLower uplo, ElDistMatrix s A, El-DistMatrix s w, ElDistMatrix s Z, ElSort-Type sort, ElHermitianEigSubset s subset)

ElError ElHermitianEigPairPartialDist d(ElUpperOrLower uplo, ElDistMatrix d A, El-DistMatrix d w, ElDistMatrix d Z, ElSort-Type sort, ElHermitianEigSubset d subset)

ElError ElHermitianEigPairPartialDist c(ElUpperOrLower uplo, ElDistMatrix c A, El-DistMatrix s w, ElDistMatrix c Z, ElSort-Type sort, ElHermitianEigSubset s subset)

ElError ElHermitianEigPairPartialDist z(ElUpperOrLower uplo, ElDistMatrix z A, El-DistMatrix d w, ElDistMatrix z Z, ElSort-Type sort, ElHermitianEigSubset d subset)

Return a subset of the eigenpairs

Algorithmic options

The default approach starts with Householder tridiagonalization (ala HermitianTridiag() )and then calls Matthias Petschow and Paolo Bientinesi’s PMRRR for the tridiagonal eigenvalueproblem.

However, it is also possible to use a (prototype) Spectral Divide and Conquer algorithm (see,for example, Stable and efficient spectral divide and conquer algorithms for the symmetric eigenvalueproblem, Nakatsukasa et al., and Fast linear algebra is stable, Demmel et al.). In order to do so, theHermitianEigCtrl<Real> structure should be modified so that useSDC is true. The SpectralDivide and Conquer algorithm (if selected) is controlled via the HermitianSDCCtrl<Real>member structure.

C++ API

type HermitianEigCtrl<Real>

HermitianTridiagCtrl tridiagCtrl

HermitianSDCCtrl<Real> sdcCtrl

bool useSDC

300 Chapter 5. LAPACK-like linear algebra

Page 305: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

HermitianEigCtrl()

Initializes tridiagCtrl and sdcCtrl to their defaults and sets useSDC to false.

type HermitianEigCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

type HermitianSDCCtrl<Real>

Int cutoff

Int maxInnerIts

Int maxOuterIts

Real tol

Real spreadFactor

bool random

bool progress

HermitianSDCCtrl()

Defaults to using a sequential Schur decomposition for problems of size 256 orsmaller (cutoff=256), a maximum of two random rank-revealing attempts per spec-tral split trials (maxInnerIts=2), and a maximum of ten trial spectral split trialsbefore failure (maxOuterIts=10). The tolerance for accepting a split is kept at itsdefault (via tol=0), the relative spreading factor for perturbing the estimate of theprojected spectral median is set to :1e-6 (spreadFactor=1e-6), and progress is notdisplayed by default (progress=false).

type HermitianSDCCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

C API

HermitianEigCtrl s

ElHermitianTridiagCtrl tridiagCtrl

ElHermitianSDCCtrl s sdcCtrl

bool useSDC

HermitianEigCtrl d

ElHermitianTridiagCtrl tridiagCtrl

ElHermitianSDCCtrl d sdcCtrl

bool useSDC

void ElHermitianEigCtrlDefault s(ElHermitianEigCtrl s* ctrl)

void ElHermitianEigCtrlDefault d(ElHermitianEigCtrl d* ctrl)Initializes tridiagCtrl and sdcCtrl to their defaults and sets useSDC to false.

5.3. Spectral analysis 301

Page 306: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHermitianSDCCtrl s

ElInt cutoff

ElInt maxInnerIts

ElInt maxOuterIts

float tol

float spreadFactor

bool random

bool progress

ElHermitianSDCCtrl d

ElInt cutoff

ElInt maxInnerIts

ElInt maxOuterIts

double tol

double spreadFactor

bool random

bool progress

ElHermitianSDCCtrlDefault s(ElHermitianSDCCtrl s* ctrl)

ElHermitianSDCCtrlDefault d(ElHermitianSDCCtrl d* ctrl)Defaults to using a sequential Schur decomposition for problems of size 256 or smaller(cutoff=256), a maximum of two random rank-revealing attempts per spectral splittrials (maxInnerIts=2), and a maximum of ten trial spectral split trials before failure(maxOuterIts=10). The tolerance for accepting a split is kept at its default (via tol=0),the relative spreading factor for perturbing the estimate of the projected spectral me-dian is set to :1e-6 (spreadFactor=1e-6), and progress is not displayed by default(progress=false).

5.3.3 Skew-Hermitian eigensolvers

Implementation

Essentially identical to the Hermitian eigensolver, HermitianEig() ; for any skew-Hermitianmatrix G, iG is Hermitian, as

(iG)H = −iGH = iG.

This fact implies a fast method for solving skew-Hermitian eigenvalue problems:

1. Form iG in O(n2) work (switching to complex arithmetic in the real case)

2. Run a Hermitian eigensolve on iG, yielding iG = ZΛZH.

3. Recognize that G = Z(−iΛ)ZH provides an EVD of G.

Please see the HermitianEig() documentation for more details.

302 Chapter 5. LAPACK-like linear algebra

Page 307: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Computing eigenvalues

The following routines compute the imaginary components of the eigenvalues of the skew-Hermitian matrix G determined by the subset structure (the default is to compute all eigenval-ues). By default, Elemental is used to transform the problem to and from real symmetric tridi-agonal form and PMRRR is used to solve the tridiagonal EVP. Alternatively, the ctrl structuremay be altered to request the usage of a (prototype) Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void SkewHermitianEig(UpperOrLower uplo, Matrix<F> &G, Matrix<Base<F>>&w, SortType sort = ASCENDING, const HermitianEigSub-set<Base<F>> &subset = HermitianEigSubset<Base<F>>(),const HermitianEigCtrl<Base<F>> &ctrl = HermitianEigC-trl<Base<F>>())

void SkewHermitianEig(UpperOrLower uplo, AbstractDistMatrix<F> &G, AbstractDist-Matrix<Base<F>> &w, SortType sort = ASCENDING, constHermitianEigSubset<Base<F>> &subset = HermitianEigSub-set<Base<F>>(), const HermitianEigCtrl<Base<F>> &ctrl =HermitianEigCtrl<Base<F>>())

C API

ElError ElSkewHermitianEig s(ElUpperOrLower uplo, ElMatrix s G, ElMatrix s w, ElSort-Type sort)

ElError ElSkewHermitianEig d(ElUpperOrLower uplo, ElMatrix d G, ElMatrix d w, El-SortType sort)

ElError ElSkewHermitianEig c(ElUpperOrLower uplo, ElMatrix c G, ElMatrix s w, ElSort-Type sort)

ElError ElSkewHermitianEig z(ElUpperOrLower uplo, ElMatrix z G, ElMatrix d w, El-SortType sort)

ElError ElSkewHermitianEigDist s(ElUpperOrLower uplo, ElDistMatrix s G, ElDistMa-trix s w, ElSortType sort)

ElError ElSkewHermitianEigDist d(ElUpperOrLower uplo, ElDistMatrix d G, ElDistMa-trix d w, ElSortType sort)

ElError ElSkewHermitianEigDist c(ElUpperOrLower uplo, ElDistMatrix c G, ElDistMa-trix s w, ElSortType sort)

ElError ElSkewHermitianEigDist z(ElUpperOrLower uplo, ElDistMatrix z G, ElDistMa-trix d w, ElSortType sort)

ElError ElSkewHermitianEigPartial s(ElUpperOrLower uplo, ElMatrix s G, ElMa-trix s w, ElSortType sort, ElHermitianEigSub-set s subset)

5.3. Spectral analysis 303

Page 308: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSkewHermitianEigPartial d(ElUpperOrLower uplo, ElMatrix d G, ElMa-trix d w, ElSortType sort, ElHermitianEigSub-set d subset)

ElError ElSkewHermitianEigPartial c(ElUpperOrLower uplo, ElMatrix c G, ElMa-trix s w, ElSortType sort, ElHermitianEigSub-set s subset)

ElError ElSkewHermitianEigPartial z(ElUpperOrLower uplo, ElMatrix z G, ElMa-trix d w, ElSortType sort, ElHermitianEigSub-set d subset)

ElError ElSkewHermitianEigPartialDist s(ElUpperOrLower uplo, ElDistMatrix s G, El-DistMatrix s w, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElSkewHermitianEigPartialDist d(ElUpperOrLower uplo, ElDistMatrix d G, El-DistMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElSkewHermitianEigPartialDist c(ElUpperOrLower uplo, ElDistMatrix c G, El-DistMatrix s w, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElSkewHermitianEigPartialDist z(ElUpperOrLower uplo, ElDistMatrix z G, El-DistMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

Computing eigenpairs

The following routines compute the set of eigenpairs (note that only the imaginary compo-nents of the eigenvalues are returned) of the skew-Hermitian matrix G determined by thesubset structure (the default is to compute all eigenpairs). By default, Elemental is used totransform the problem to and from real symmetric tridiagonal form and PMRRR is used tosolve the tridiagonal EVP. Alternatively, the ctrl structure may be altered to request the usageof a (prototype) Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void SkewHermitianEig(UpperOrLower uplo, Matrix<F> &G, Matrix<Base<F>>&w, Matrix<Complex<Base<F>>> &Z, SortType sort = AS-CENDING, const HermitianEigSubset<Base<F>> &subset= HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> &ctrl = HermitianEigCtrl<Base<F>>())

void SkewHermitianEig(UpperOrLower uplo, AbstractDistMatrix<F> &G, Ab-stractDistMatrix<Base<F>> &w, AbstractDistMa-trix<Complex<Base<F>>> &Z, SortType sort = ASCEND-ING, const HermitianEigSubset<Base<F>> &subset =HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> &ctrl = HermitianEigCtrl<Base<F>>())

304 Chapter 5. LAPACK-like linear algebra

Page 309: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElSkewHermitianEigPair s(ElUpperOrLower uplo, ElMatrix s G, ElMatrix s w,ElMatrix c Z, ElSortType sort)

ElError ElSkewHermitianEigPair d(ElUpperOrLower uplo, ElMatrix d G, ElMatrix d w,ElMatrix z Z, ElSortType sort)

ElError ElSkewHermitianEigPair c(ElUpperOrLower uplo, ElMatrix c G, ElMatrix s w,ElMatrix c Z, ElSortType sort)

ElError ElSkewHermitianEigPair z(ElUpperOrLower uplo, ElMatrix z G, ElMatrix d w,ElMatrix z Z, ElSortType sort)

ElError ElSkewHermitianEigPairDist s(ElUpperOrLower uplo, ElDistMatrix s G, ElDist-Matrix s w, ElDistMatrix c Z, ElSortType sort)

ElError ElSkewHermitianEigPairDist d(ElUpperOrLower uplo, ElDistMatrix d G, El-DistMatrix d w, ElDistMatrix z Z, ElSort-Type sort)

ElError ElSkewHermitianEigPairDist c(ElUpperOrLower uplo, ElDistMatrix c G, ElDist-Matrix s w, ElDistMatrix c Z, ElSortType sort)

ElError ElSkewHermitianEigPairDist z(ElUpperOrLower uplo, ElDistMatrix z G, El-DistMatrix d w, ElDistMatrix z Z, ElSort-Type sort)

ElError ElSkewHermitianEigPairPartial s(ElUpperOrLower uplo, ElMatrix s G, ElMa-trix s w, ElMatrix c Z, ElSortType sort, El-HermitianEigSubset s subset)

ElError ElSkewHermitianEigPairPartial d(ElUpperOrLower uplo, ElMatrix d G, ElMa-trix d w, ElMatrix z Z, ElSortType sort, El-HermitianEigSubset d subset)

ElError ElSkewHermitianEigPairPartial c(ElUpperOrLower uplo, ElMatrix c G, ElMa-trix s w, ElMatrix c Z, ElSortType sort, El-HermitianEigSubset s subset)

ElError ElSkewHermitianEigPairPartial z(ElUpperOrLower uplo, ElMatrix z G, ElMa-trix d w, ElMatrix z Z, ElSortType sort, El-HermitianEigSubset d subset)

ElError ElSkewHermitianEigPairPartialDist s(ElUpperOrLower uplo, ElDistMa-trix s G, ElDistMatrix s w, ElDist-Matrix c Z, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElSkewHermitianEigPairPartialDist d(ElUpperOrLower uplo, ElDistMa-trix d G, ElDistMatrix d w, El-DistMatrix z Z, ElSortType sort,ElHermitianEigSubset d subset)

ElError ElSkewHermitianEigPairPartialDist c(ElUpperOrLower uplo, ElDistMa-trix c G, ElDistMatrix s w, ElDist-Matrix c Z, ElSortType sort, ElHermi-tianEigSubset s subset)

5.3. Spectral analysis 305

Page 310: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSkewHermitianEigPairPartialDist z(ElUpperOrLower uplo, ElDistMa-trix z G, ElDistMatrix d w, El-DistMatrix z Z, ElSortType sort,ElHermitianEigSubset d subset)

5.3.4 Hermitian generalized-definite eigensolvers

The following Hermitian generalized-definite eigenvalue problems frequently appear, whereboth A and B are Hermitian, and B is additionally positive-definite.

enum Pencil

enumerator ABX

ABx = λx

enumerator BAX

BAx = λx

enumerator AXBX

Ax = Bxλ

Implementation

Test driver

Computing eigenvalues

Compute the set of eigenvalues of the Hermitian-definite matrix pencil determined by thesubset structure (the default is to compute all eigenvalues). By default, Elemental is used totransform the problem to and from real symmetric tridiagonal form and PMRRR is used tosolve the tridiagonal EVP. Alternatively, the ctrl structure may be altered to request the usageof a (prototype) Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void HermitianGenDefEig(Pencil pencil, UpperOrLower uplo, Matrix<F> &A, Ma-trix<F> &B, Matrix<Base<F>> &w, SortType sort =ASCENDING, const HermitianEigSubset<Base<F>> subset= HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> ctrl = HermitianEigCtrl<Base<F>>())

void HermitianGenDefEig(Pencil pencil, UpperOrLower uplo, AbstractDistMatrix<F> &A,AbstractDistMatrix<F> &B, AbstractDistMatrix<Base<F>>&w, SortType sort = ASCENDING, const HermitianEigSub-set<Base<F>> subset = HermitianEigSubset<Base<F>>(),const HermitianEigCtrl<Base<F>> ctrl = HermitianEigC-trl<Base<F>>())

306 Chapter 5. LAPACK-like linear algebra

Page 311: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElHermitianGenDefEig s(ElPencil pencil, ElUpperOrLower uplo, ElMatrix s A, El-Matrix s B, ElMatrix s w, ElSortType sort)

ElError ElHermitianGenDefEig d(ElPencil pencil, ElUpperOrLower uplo, ElMatrix d A,ElMatrix d B, ElMatrix d w, ElSortType sort)

ElError ElHermitianGenDefEig c(ElPencil pencil, ElUpperOrLower uplo, ElMatrix c A, El-Matrix c B, ElMatrix s w, ElSortType sort)

ElError ElHermitianGenDefEig z(ElPencil pencil, ElUpperOrLower uplo, ElMatrix z A, El-Matrix z B, ElMatrix d w, ElSortType sort)

ElError ElHermitianGenDefEigDist s(ElPencil pencil, ElUpperOrLower uplo, ElDistMa-trix s A, ElDistMatrix s B, ElDistMatrix s w, El-SortType sort)

ElError ElHermitianGenDefEigDist d(ElPencil pencil, ElUpperOrLower uplo, ElDistMa-trix d A, ElDistMatrix d B, ElDistMatrix d w, El-SortType sort)

ElError ElHermitianGenDefEigDist c(ElPencil pencil, ElUpperOrLower uplo, ElDistMa-trix c A, ElDistMatrix c B, ElDistMatrix s w, El-SortType sort)

ElError ElHermitianGenDefEigDist z(ElPencil pencil, ElUpperOrLower uplo, ElDistMa-trix z A, ElDistMatrix z B, ElDistMatrix d w, El-SortType sort)

ElError ElHermitianGenDefEigPartial s(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix s A, ElMatrix s B, ElMatrix s w, ElSort-Type sort, ElHermitianEigSubset s subset)

ElError ElHermitianGenDefEigPartial d(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix d A, ElMatrix d B, ElMatrix d w, ElSort-Type sort, ElHermitianEigSubset d subset)

ElError ElHermitianGenDefEigPartial c(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix c A, ElMatrix c B, ElMatrix s w, ElMa-trix c Z, ElSortType sort, ElHermitianEigSub-set s subset)

ElError ElHermitianGenDefEigPartial z(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix z A, ElMatrix z B, ElMatrix d w, Sort-Type sort, ElHermitianEigSubset d subset)

ElError ElHermitianGenDefEigPartialDist s(ElPencil pencil, ElUpperOrLower uplo, El-DistMatrix s A, ElDistMatrix s B, ElD-istMatrix s w, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianGenDefEigPartialDist d(ElPencil pencil, ElUpperOrLower uplo, El-DistMatrix d A, ElDistMatrix d B, ElD-istMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

5.3. Spectral analysis 307

Page 312: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianGenDefEigPartialDist c(ElPencil pencil, ElUpperOrLower uplo, El-DistMatrix c A, ElDistMatrix c B, ElD-istMatrix s w, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianGenDefEigPartialDist z(ElPencil pencil, ElUpperOrLower uplo, El-DistMatrix z A, ElDistMatrix z B, ElD-istMatrix d w, ElSortType sort, ElHermi-tianEigSubset d subset)

Computing eigenpairs

Compute the set of eigenpairs of the Hermitian-definite matrix pencil determined by the subsetstructure (the default is to compute all eigenpairs). By default, Elemental is used to transformthe problem to and from real symmetric tridiagonal form and PMRRR is used to solve the tridi-agonal EVP. Alternatively, the ctrl structure may be altered to request the usage of a (prototype)Spectral Divide and Conquer algorithm.

Note: Strict subset computation is not currently supported with Spectral Divide and Conquer.

C++ API

void HermitianGenDefEig(Pencil pencil, UpperOrLower uplo, Matrix<F> &A, Matrix<F>&B, Matrix<Base<F>> &w, Matrix<F> &Z, SortType sort= ASCENDING, const HermitianEigSubset<Base<F>> subset= HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> ctrl = HermitianEigCtrl<Base<F>>())

void HermitianGenDefEig(Pencil pencil, UpperOrLower uplo, AbstractDistMatrix<F> &A,AbstractDistMatrix<F> &B, AbstractDistMatrix<Base<F>>&w, AbstractDistMatrix<F> &Z, SortType sort = AS-CENDING, const HermitianEigSubset<Base<F>> subset= HermitianEigSubset<Base<F>>(), const HermitianEigC-trl<Base<F>> ctrl = HermitianEigCtrl<Base<F>>())

C API

ElError ElHermitianGenDefEigPair s(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix s A, ElMatrix s B, ElMatrix s w, ElMatrix s Z,ElSortType sort)

ElError ElHermitianGenDefEigPair d(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix d A, ElMatrix d B, ElMatrix d w, ElMa-trix d Z, ElSortType sort)

ElError ElHermitianGenDefEigPair c(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix c A, ElMatrix c B, ElMatrix s w, ElMatrix c Z,ElSortType sort)

ElError ElHermitianGenDefEigPair z(ElPencil pencil, ElUpperOrLower uplo, ElMa-trix z A, ElMatrix z B, ElMatrix d w, ElMa-trix z Z, ElSortType sort)

308 Chapter 5. LAPACK-like linear algebra

Page 313: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianGenDefEigPairDist s(ElPencil pencil, ElUpperOrLower uplo, ElD-istMatrix s A, ElDistMatrix s B, ElDistMa-trix s w, ElDistMatrix s Z, ElSortType sort)

ElError ElHermitianGenDefEigPairDist d(ElPencil pencil, ElUpperOrLower uplo, ElD-istMatrix d A, ElDistMatrix d B, ElDistMa-trix d w, ElDistMatrix d Z, ElSortType sort)

ElError ElHermitianGenDefEigPairDist c(ElPencil pencil, ElUpperOrLower uplo, ElD-istMatrix c A, ElDistMatrix c B, ElDistMa-trix s w, ElDistMatrix c Z, ElSortType sort)

ElError ElHermitianGenDefEigPairDist z(ElPencil pencil, ElUpperOrLower uplo, ElD-istMatrix z A, ElDistMatrix z B, ElDistMa-trix d w, ElDistMatrix z Z, ElSortType sort)

ElError ElHermitianGenDefEigPairPartial s(ElPencil pencil, ElUpperOrLower uplo, El-Matrix s A, ElMatrix s B, ElMatrix s w,ElMatrix s Z, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianGenDefEigPairPartial d(ElPencil pencil, ElUpperOrLower uplo, El-Matrix d A, ElMatrix d B, ElMatrix d w,ElMatrix d Z, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianGenDefEigPairPartial c(ElPencil pencil, ElUpperOrLower uplo, El-Matrix c A, ElMatrix c B, ElMatrix s w,ElMatrix c Z, ElSortType sort, ElHermi-tianEigSubset s subset)

ElError ElHermitianGenDefEigPairPartial z(ElPencil pencil, ElUpperOrLower uplo, El-Matrix z A, ElMatrix z B, ElMatrix d w,ElMatrix z Z, ElSortType sort, ElHermi-tianEigSubset d subset)

ElError ElHermitianGenDefEigPairPartialDist s(ElPencil pencil, ElUpperOr-Lower uplo, ElDistMatrix s A,ElDistMatrix s B, ElDistMatrix s w,ElDistMatrix s Z, ElSortType sort,ElHermitianEigSubset s subset)

ElError ElHermitianGenDefEigPairPartialDist d(ElPencil pencil, ElUpperOr-Lower uplo, ElDistMatrix d A, El-DistMatrix d B, ElDistMatrix d w,ElDistMatrix d Z, ElSortType sort,ElHermitianEigSubset d subset)

ElError ElHermitianGenDefEigPairPartialDist c(ElPencil pencil, ElUpperOr-Lower uplo, ElDistMatrix c A,ElDistMatrix c B, ElDistMatrix s w,ElDistMatrix c Z, ElSortType sort,ElHermitianEigSubset s subset)

5.3. Spectral analysis 309

Page 314: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianGenDefEigPairPartialDist z(ElPencil pencil, ElUpperOr-Lower uplo, ElDistMatrix z A,ElDistMatrix z B, ElDistMatrix d w,ElDistMatrix z Z, ElSortType sort,ElHermitianEigSubset d subset)

5.3.5 Hermitian SVD

Suppose that A is Hermitian, with a spectral decomposition

A = VΛVH.

Then an SVD of A can easily be computed as

A = U|Λ|VH,

where the columns of U equal the columns of V, modulo sign flips introduced by negativeeigenvalues.

Computing singular values

The following routines return the singular values of A in s. Note that the appropriate triangleof A is overwritten during computation.

C++ API

void HermitianSVD(UpperOrLower uplo, Matrix<F> &A, Matrix<Base<F>> &s)

void HermitianSVD(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<Base<F>> &s)

C API

ElError ElHermitianSingularValues s(ElUpperOrLower uplo, ElMatrix s A, ElMa-trix s s)

ElError ElHermitianSingularValues d(ElUpperOrLower uplo, ElMatrix d A, ElMa-trix d s)

ElError ElHermitianSingularValues c(ElUpperOrLower uplo, ElMatrix c A, ElMa-trix s s)

ElError ElHermitianSingularValues z(ElUpperOrLower uplo, ElMatrix z A, ElMa-trix d s)

ElError ElHermitianSingularValuesDist s(ElUpperOrLower uplo, ElDistMatrix s A, El-DistMatrix s s)

ElError ElHermitianSingularValuesDist d(ElUpperOrLower uplo, ElDistMatrix d A, El-DistMatrix d s)

ElError ElHermitianSingularValuesDist c(ElUpperOrLower uplo, ElDistMatrix c A, El-DistMatrix s s)

ElError ElHermitianSingularValuesDist z(ElUpperOrLower uplo, ElDistMatrix z A, El-DistMatrix d s)

310 Chapter 5. LAPACK-like linear algebra

Page 315: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Computing Singular Value Decompositions

The following routines return a vector of singular values, s, and the left and right singularvector matrices, U and V, such that A = Udiag(s)VH.

C++ API

void HermitianSVD(UpperOrLower uplo, Matrix<F> &A, Matrix<Base<F>> &s, Ma-trix<F> &U, Matrix<F> &V)

void HermitianSVD(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<Base<F>> &s, AbstractDistMatrix<F> &U, AbstractDistMa-trix<F> &V)

C API

ElError ElHermitianSVD s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s s, ElMa-trix s U, ElMatrix s V)

ElError ElHermitianSVD d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d s, ElMa-trix d U, ElMatrix d V)

ElError ElHermitianSVD c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix s s, ElMa-trix c U, ElMatrix c V)

ElError ElHermitianSVD z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix d s, ElMa-trix z U, ElMatrix z V)

ElError ElHermitianSVDDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDistMa-trix s s, ElDistMatrix s U, ElDistMatrix s V)

ElError ElHermitianSVDDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDistMa-trix d s, ElDistMatrix d U, ElDistMatrix d V)

ElError ElHermitianSVDDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDistMa-trix s s, ElDistMatrix c U, ElDistMatrix c V)

ElError ElHermitianSVDDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDistMa-trix d s, ElDistMatrix z U, ElDistMatrix z V)

5.3.6 SVD

Given an m × n matrix A, a Singular Value Decomposition is a triplet (U, Σ, V) such that

A = UΣVH,

where UHU = I, VHV = I, and Σ is diagonal with non-negative entries. The columns of Uare called left singular vectors, the columns of V are called right singular vectors, and the firstmin(m, n) diagonal entries of Σ are called singular values.

The above constraints allow for a number of different configurations:

1. A full SVD requires a square, m × m U, a square, n × n, V, and an m × n Σ.

2. A thin SVD only involves an m × min(m, n) U, an min(m, n)× n V, and a min(m, n)×min(m, n) Σ.

5.3. Spectral analysis 311

Page 316: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

3. A compact SVD only keeps the singular triplets corresponding to nonzero singular values,and so its size is bounded by that of the thin SVD.

4. A thresholded SVD only keeps the singular triplets with singular values which are suffi-ciently large. Thus, compact SVDs are a special case of thresholded SVDs.

Elemental currently provides support for thin and thresholded SVDs as well as allowing foronly the singular values to be computed.

Implementation

Subroutines

Computing singular values

The following routines form the singular values of A in s. Note that A is overwritten in orderto compute the singular values.

C++ API

void SVD(Matrix<F> &A, Matrix<Base<F>> &s)

void SVD(AbstractDistMatrix<F> &A, AbstractDistMatrix<Base<F>> &s, const SVDC-trl<Base<F>> &ctrl = SVDCtrl<Base<F>>())

C API

ElSingularValues s(ElMatrix s A, ElMatrix s s)

ElSingularValues d(ElMatrix d A, ElMatrix d s)

ElSingularValues c(ElMatrix c A, ElMatrix s s)

ElSingularValues z(ElMatrix z A, ElMatrix d s)

ElSingularValuesDist s(ElDistMatrix s A, ElDistMatrix s s)

ElSingularValuesDist d(ElDistMatrix d A, ElDistMatrix d s)

ElSingularValuesDist c(ElDistMatrix c A, ElDistMatrix s s)

ElSingularValuesDist z(ElDistMatrix z A, ElDistMatrix d s)

TODO: Expert interfaces

Computing Singular Value Decompositions

The following routines overwrite A with U, s with the diagonal entries of Σ, and V with V.

C++ API

void SVD(Matrix<F> &A, Matrix<Base<F>> &s, Matrix<F> &V, const SVDC-trl<Base<F>> &ctrl = SVDCtrl<Base<F>>())

312 Chapter 5. LAPACK-like linear algebra

Page 317: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void SVD(AbstractDistMatrix<F> &A, AbstractDistMatrix<Base<F>> &s, AbstractDist-Matrix<F> &V, const SVDCtrl<Base<F>> &ctrl = SVDCtrl<Base<F>>())

C API

ElError ElSVD s(ElMatrix s A, ElMatrix s s, ElMatrix s V)

ElError ElSVD d(ElMatrix d A, ElMatrix d s, ElMatrix d V)

ElError ElSVD c(ElMatrix c A, ElMatrix s s, ElMatrix c V)

ElError ElSVD z(ElMatrix z A, ElMatrix d s, ElMatrix z V)

ElError ElSVDDist s(ElDistMatrix s A, ElDistMatrix s s, ElDistMatrix s V)

ElError ElSVDDist d(ElDistMatrix d A, ElDistMatrix d s, ElDistMatrix d V)

ElError ElSVDDist c(ElDistMatrix c A, ElDistMatrix s s, ElDistMatrix c V)

ElError ElSVDDist z(ElDistMatrix z A, ElDistMatrix d s, ElDistMatrix z V)

TODO: Expert interfaces

Control structures

C++ API

type SVDCtrl<Real>

bool seqQRWhether or not sequential implementations should use the QR algorithm insteadof a Divide and Conquer when computing singular vectors. When only singularvalues are requested, a bidiagonal DQDS algorithms is always run.

double valChanRatio

The minimum height/width ratio before preprocessing with a QR decompositionwhen only computing singular values.

double fullChanRatio

The minimum height/width ratio before preprocessing with a QR decompositionwhen computing a full SVD.

bool thresholdedIf the sufficiently small singular triplets should be thrown away. When thresholded,a cross-product algorithm is used. This is often advantageous since tridiagonaleigensolvers tend to have faster parallel implementations than bidiagonal SVD’s.

bool relativeIf the tolerance should be relative to the largest singular value.

Real tolThe numerical tolerance for the thresholding. If this value is kept at zero, then avalue is automatically chosen based upon the matrix.

5.3. Spectral analysis 313

Page 318: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

SVDCtrl()

Sets seqQR=false, valChanRatio=1.2, fullChanRatio=1.5, thresholded=false,relative=true, and tol=0.

type SVDCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

C API

ElSVDCtrl s

bool seqQR

double valChanRatio

double fullChanRatio

bool thresholded

bool relative

float tol

ElSVDCtrl d

bool seqQR

double valChanRatio

double fullChanRatio

bool thresholded

bool relative

double tol

ElError ElSVDCtrlDefault s(ElSVDCtrl s* ctrl)

ElError ElSVDCtrlDefault d(ElSVDCtrl d* ctrl)Initialize the default values for the control structure (seqQR=false, valChanRatio=1.2,fullChanRatio=1.5, thresholded=false, relative=true, and tol=0)

5.3.7 Polar decomposition

Every matrix A can be written as A = QP, where Q is unitary and P is Hermitian and positivesemi-definite. This is known as the polar decomposition of A and can be constructed as Q :=UVH and P := VΣVH, where A = UΣVH is the SVD of A. Alternatively, it can be computedthrough (a dynamically-weighted) Halley iteration.

Implementation

SVD approach

QWDH approach

void Polar(Matrix<F> &A, const PolarCtrl &ctrl = PolarCtrl())

314 Chapter 5. LAPACK-like linear algebra

Page 319: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Polar(AbstractDistMatrix<F> &A, const PolarCtrl &ctrl = PolarCtrl())

void Polar(Matrix<F> &A, Matrix<F> &P, const PolarCtrl &ctrl = PolarCtrl())

void Polar(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &P, const PolarCtrl &ctrl= PolarCtrl())

Compute the polar decomposition of A, A = QP, returning Q within A and P within P.The current implementation first computes the SVD.

void HermitianPolar(UpperOrLower uplo, Matrix<F> &A, const PolarCtrl &ctrl = Po-larCtrl())

void HermitianPolar(UpperOrLower uplo, AbstractDistMatrix<F> &A, const PolarCtrl&ctrl = PolarCtrl())

void HermitianPolar(UpperOrLower uplo, Matrix<F> &A, Matrix<F> &P, const PolarC-trl &ctrl = PolarCtrl())

void HermitianPolar(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<F> &P, const PolarCtrl &ctrl = PolarCtrl())

Compute the polar decomposition through a Hermitian EVD. Since this is equivalent toa Hermitian sign decomposition (if sgn(0) is set to 1), these routines are equivalent toHermitianSign.

Algorithmic options

By default, an SVD-based algorithm is used, but an approach based upon a QR-based Dynam-ically Weighted Halley (QDWH) iteration can be manually chosen.

type PolarCtrl

bool qdwhWhether or not to use QDWH (the default is no)

bool colPivWhether or not QDWH should use column pivoting in its QR factorizations (thedefault is no)

Int maxItsThe maximum number of iterations of QDWH (the default is 20, but typically nomore than 6 or 7 will be performed)

mutable Int numItsThe number of iterations of QDWH performed in the last call

5.3.8 Schur decomposition

Elemental contains a native prototype implementation of a spectral divide and conquer schemefor the Schur decomposition, but it is not yet robust enough to handle general matrices. Forlocal matrices, Elemental defaults to calling LAPACK’s Hessenberg QR algorithm (with Ag-gressive Early Deflation); if support for ScaLAPACK was detected during configuration, Ele-mental defaults to ScaLAPACK’s Hessenberg QR algorithm (without deflation), otherwise theSpectral Divide and Conquer approach is attempted.

Implementation

5.3. Spectral analysis 315

Page 320: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Schur(Matrix<F> &A, Matrix<Complex<Base<F>>> &w, bool fullTriangle = false,const SchurCtrl<Base<F>> ctrl = SchurCtrl<Base<F>>())

void Schur(AbstractDistMatrix<F> &A, AbstractDistMatrix<Complex<Base<F>>>&w, bool fullTriangle = false, const SchurCtrl<Base<F>> ctrl =SchurCtrl<Base<F>>())

void Schur(Matrix<F> &A, Matrix<Complex<Base<F>>> &w, Matrix<F>&Q, bool fullTriangle = true, const SchurCtrl<Base<F>> ctrl =SchurCtrl<Base<F>>())

void Schur(AbstractDistMatrix<F> &A, AbstractDistMatrix<Complex<Base<F>>>&w, AbstractDistMatrix<F> &Q, bool fullTriangle = true, constSchurCtrl<Base<F>> ctrl = SchurCtrl<Base<F>>())

Algorithmic options

By default, Hessenberg QR algorithms are used if possible (in the distributed-memory case,ScaLAPACK must have been detected), and, in addition to being able to configure the Hes-senberg QR algorithm options, it is also possible to force the usage of a Spectral Divide andConquer algorithm.

type SchurCtrl<Real>

bool useSDCWhether or not to use Spectral Divide and Conquer

HessQRCtrl qrCtrlThe control structure for the Hessenberg QR algorithm

SDCCtrl<Real> sdcCtrl

The control structure for the Spectral Divide and Conquer algorithm

type SchurCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

TODO: Reference to the distributed Hessenberg QR work of Granat, Kagstrom, Kressner, et al.

type HessQRCtrl

bool distAEDWhether or not Aggressive Early Deflation should be attempted for distributed ma-trices (due to existing bugs in the ScaLAPACK implementation, by default, no)

Int blockHeight

Int blockWidthThe distribution block height and width for the Hessenberg QR algorithm

The primary reference for the current Spectral Divide and Conquer approachh is Fast linearalgebra is stable, Demmel et al. While the current implementation requires multiple algorithmicimprovements in order to achieve stability, for example, better Mobius transformation selec-tion, it often succeeds on random matrices.

SDC header file

316 Chapter 5. LAPACK-like linear algebra

Page 321: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

type SDCCtrl<Real>

Int cutoff

Int maxInnerIts

Int maxOuterIts

Real tol

Real spreadFactor

bool random

bool progress

type SDCCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

Quasi-triangular manipulation

void schur::QuasiTriangEig(const Matrix<F> &U, Matrix<Complex<Base<F>>>&w)

void schur::QuasiTriangEig(const AbstractDistMatrix<F> &U, AbstractDistMa-trix<Complex<Base<F>>> &w)

Return the eigenvalues of the upper quasi-triangular matrix U in the vector w.

Matrix<Complex<Base<F>>> schur::QuasiTriangEig(const Matrix<F> &U)

DistMatrix<Complex<Base<F>>, VR, STAR> schur::QuasiTriangEig(const Abstract-DistMatrix<F>&U)

Return the eigenvalues of the upper quasi-triangular matrix U.

void schur::QuasiTriangEig(const Matrix<F> &dMain, const Matrix<F> &dSub,const Matrix<F> &dSup, Matrix<Complex<Base<F>>>&w)

The underlying computation routine for computing the eigenvalues of quasi-triangularmatrices. The vectors dMain, dSub, and dSup should respectively contain the main, sub,and super-diagonals of the upper quasi-triangular matrix.

void schur::RealToComplex(const Matrix<Real> &UQuasi, Matrix<Complex<Real>>&U)

void schur::RealToComplex(const AbstractDistMatrix<Real> &UQuasi, AbstractDist-Matrix<Complex<Real>> &U)

Rotate a real upper quasi-triangular matrix into a complex upper triangular matrix.

void schur::CheckRealSchur(const Matrix<Real> &U, bool standardForm = false)

void schur::CheckRealSchur(const AbstractDistMatrix<Real> &U, bool standardForm= false)

Check whether or not the largest diagonal blocks of the upper quasi-triangular matrixare at most 2 × 2 and, optionally, check if the 2 × 2 diagonal blocks are in standard form(if so, their diagonal must be constant and the product of the off-diagonal entries shouldbe negative).

5.3. Spectral analysis 317

Page 322: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.3.9 Specialized eigensolvers

Unitary eigensolver

Not yet written, will likely be based on Ming Gu’s unitary Divide and Conquer algorithm forunitary Hessenberg matrices. In the mean time, Schur() should be used.

Normal eigensolver

Not yet written, will likely be based on Angelika Bunse-Gerstner et al.’s Jacobi-like methodfor simultaneous diagonalization of the commuting Hermitian and skew-Hermitian portionsof the matrix. In the mean time, Schur() should be used.

5.3.10 Pseudospectra

The p-norm ε-pseudospectrum of a square matrix A is the set of all shifts ξ ∈ C such that theinverse of A − ξ I is sufficiently large (greater than 1/ε) in the p-norm:

ℒpε (A) = ξ ∈ C : ‖(A − ξ I)−1‖p >

1ε,

with the convention that ‖(A − ξ I)−1‖p = +∞ if the resolvent, (A − ξ I)−1, does not exist. Inthe most common case, where p = 2, the definition of the ε-pseudospectrum reduces to

ℒ2ε(A) = ξ ∈ C : σmin(A − ξ I) < ε.

Elemental currently supports two methods for computing two-norm pseudospectra: the firstis a high-performance improvement of the triangularization followed by inverse iteration ap-proach of [VanLoan1984] and [Lui1997]. In particular, Elemental begins by computing the Schurdecomposition of the given matrix, which preserves the (two-norm) ε-pseudospectrum, up toround-off error, and then simultaneously performs many Implicitly Restarted Arnoldi (IRA)iterations with the inverse normal matrix for each shift in a manner which communicates nomore data than a standard triangular solve with many right-hand sides (with vectors deflatedimmediately after convergence).

The second approach is quite similar and, instead of reducing to triangular form, reduces toHessenberg form and performs multi-shift triangular solves in a manner similar to [Henry1994]and [BDP1996]. This algorithm is not yet performance-tuned in Elemental, but could perhapsbe preferred in situations where a Schur decomposition is infeasible.

Elemental also supports proof-of-concept implementations of high-performance one-norm pseudospectra which are based upon the Hager-Higham algorithm ([Hager1984],[Higham1988], and [Higham1990]) for black-box one-norm estimation, but the blocked variantof [HighamTisseur2006] provides qualitatively superior results.

Please see [TrefethenEmbree2009] or [Trefethen1999] for comprehensive histories of the computa-tion of pseudospectra.

Spectral portrait

The following routines return the norms of the shifted inverses over an automatically-determined2D window in the complex plane (in the matrix invNormMap) with the specified x and y res-olutions. The returned integer matrix corresponds to the number of iterations required forconvergence at each shift in the 2D grid.

318 Chapter 5. LAPACK-like linear algebra

Page 323: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

SpectralPortrait(A[, realSize=100, imagSize=100, ctrl=None])

C++ API

Matrix<int> SpectralPortrait(const Matrix<F> &A, Matrix<Base<F>> &in-vNormMap, Int realSize, Int imagSize, PseudospecC-trl<Base<F>> psCtrl = PseudospecCtrl<Base<F>>())

DistMatrix<int> SpectralPortrait(const AbstractDistMatrix<F> &A, AbstractDistMa-trix<Base<F>> &invNormMap, Int realSize, IntimagSize, PseudospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

Matrix<int> TriangularSpectralPortrait(const Matrix<F> &U, Matrix<Base<F>>&invNormMap, Int realSize, Int imagSize,PseudospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

DistMatrix<int> TriangularSpectralPortrait(const AbstractDistMatrix<F> &U, Ab-stractDistMatrix<Base<F>> &invNor-mMap, Int realSize, Int imagSize, Pseu-dospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

Matrix<int> QuasiTriangularSpectralPortrait(const Matrix<Real> &U, Ma-trix<Real> &invNormMap, IntrealSize, Int imagSize, PseudospecC-trl<Real> psCtrl = PseudospecC-trl<Real>())

DistMatrix<int> QuasiTriangularSpectralPortrait(const AbstractDistMatrix<Real>&U, AbstractDistMatrix<Real>&invNormMap, Int realSize,Int imagSize, PseudospecC-trl<Real> psCtrl = Pseudospec-Ctrl<Real>())

Matrix<int> HessenbergSpectralPortrait(const Matrix<F> &H, Matrix<Base<F>>&invNormMap, Int realSize, Int imagSize,PseudospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

DistMatrix<int> HessenbergSpectralPortrait(const AbstractDistMatrix<F> &H, Ab-stractDistMatrix<Base<F>> &invNor-mMap, Int realSize, Int imagSize, Pseu-dospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

C API

Single-precision

5.3. Spectral analysis 319

Page 324: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSpectralPortrait s(ElConstMatrix s A, ElMatrix s invNormMap, ElInt real-Size, ElInt imagSize)

ElError ElSpectralPortraitDist s(ElConstDistMatrix s A, ElDistMatrix s invNor-mMap, ElInt realSize, ElInt imagSize)

ElError ElSpectralPortraitX s(ElConstMatrix s A, ElMatrix s invNormMap, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl s ctrl)

ElError ElSpectralPortraitXDist s(ElConstDistMatrix s A, ElDistMatrix s invNor-mMap, ElInt realSize, ElInt imagSize, ElPseudospec-Ctrl s ctrl)

Double-precisionElError ElSpectralPortrait d(ElConstMatrix d A, ElMatrix d invNormMap, ElInt real-

Size, ElInt imagSize)ElError ElSpectralPortraitDist d(ElConstDistMatrix d A, ElDistMatrix d invNor-

mMap, ElInt realSize, ElInt imagSize)

ElError ElSpectralPortraitX d(ElConstMatrix d A, ElMatrix d invNormMap, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl d ctrl)

ElError ElSpectralPortraitXDist d(ElConstDistMatrix d A, ElDistMatrix d invNor-mMap, ElInt realSize, ElInt imagSize, ElPseudospec-Ctrl d ctrl)

Single-precision complexElError ElSpectralPortrait c(ElConstMatrix c A, ElMatrix c invNormMap, ElInt real-

Size, ElInt imagSize)ElError ElSpectralPortraitDist c(ElConstDistMatrix c A, ElDistMatrix c invNor-

mMap, ElInt realSize, ElInt imagSize)

ElError ElSpectralPortraitX c(ElConstMatrix c A, ElMatrix c invNormMap, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl s ctrl)

ElError ElSpectralPortraitXDist c(ElConstDistMatrix c A, ElDistMatrix c invNor-mMap, ElInt realSize, ElInt imagSize, ElPseudospec-Ctrl s ctrl)

Double-precision complexElError ElSpectralPortrait z(ElConstMatrix z A, ElMatrix z invNormMap, ElInt real-

Size, ElInt imagSize)ElError ElSpectralPortraitDist z(ElConstDistMatrix z A, ElDistMatrix z invNor-

mMap, ElInt realSize, ElInt imagSize)

ElError ElSpectralPortraitX z(ElConstMatrix z A, ElMatrix z invNormMap, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl d ctrl)

ElError ElSpectralPortraitXDist z(ElConstDistMatrix z A, ElDistMatrix z invNor-mMap, ElInt realSize, ElInt imagSize, ElPseudospec-Ctrl d ctrl)

Spectral window

The following routines return the norms of the shifted inverses over a user-specified 2D windowin the complex plane (in the matrix invNormMap) with the specified x and y resolutions. The

320 Chapter 5. LAPACK-like linear algebra

Page 325: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

returned integer matrix corresponds to the number of iterations required for convergence ateach shift in the 2D grid.

Python API

SpectralWindow(A[, center=0, realWidth=1, imagWidth=1, realSize=100, imagSize=100,ctrl=None])

C++ API

Matrix<int> SpectralWindow(const Matrix<F> &A, Matrix<Base<F>> &invNor-mMap, Complex<Base<F>> center, Base<F> realWidth,Base<F> imagWidth, Int realSize, Int imagSize, Pseudospec-Ctrl<Base<F>> psCtrl = PseudospecCtrl<Base<F>>())

DistMatrix<int> SpectralWindow(const AbstractDistMatrix<F> &A, AbstractDistMa-trix<Base<F>> &invNormMap, Complex<Base<F>>center, Base<F> realWidth, Base<F> imagWidth, Int re-alSize, Int imagSize, PseudospecCtrl<Base<F>> psCtrl= PseudospecCtrl<Base<F>>())

Matrix<int> TriangularSpectralWindow(const Matrix<F> &U, Matrix<Base<F>>&invNormMap, Complex<Base<F>> center,Base<F> realWidth, Base<F> imagWidth,Int realSize, Int imagSize, PseudospecC-trl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

DistMatrix<int> TriangularSpectralWindow(const AbstractDistMatrix<F> &U,AbstractDistMatrix<Base<F>> &in-vNormMap, Complex<Base<F>> center,Base<F> realWidth, Base<F> imagWidth,Int realSize, Int imagSize, PseudospecC-trl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

Matrix<int> QuasiTriangularSpectralWindow(const Matrix<Real> &U, Ma-trix<Real> &invNormMap, Com-plex<Real> center, Real realWidth,Real imagWidth, Int realSize, Int imag-Size, PseudospecCtrl<Real> psCtrl =PseudospecCtrl<Real>())

DistMatrix<int> QuasiTriangularSpectralWindow(const AbstractDistMatrix<Real>&U, AbstractDistMatrix<Real>&invNormMap, Complex<Real>center, Real realWidth, Real imag-Width, Int realSize, Int imagSize,PseudospecCtrl<Real> psCtrl =PseudospecCtrl<Real>())

5.3. Spectral analysis 321

Page 326: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Matrix<int> HessenbergSpectralWindow(const Matrix<F> &H, Matrix<Base<F>>&invNormMap, Complex<Base<F>> center,Base<F> realWidth, Base<F> imagWidth,Int realSize, Int imagSize, PseudospecC-trl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

DistMatrix<int> HessenbergSpectralWindow(const AbstractDistMatrix<F> &H,AbstractDistMatrix<Base<F>> &in-vNormMap, Complex<Base<F>> center,Base<F> realWidth, Base<F> imagWidth,Int realSize, Int imagSize, PseudospecC-trl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

C API

Single-precisionElError ElSpectralWindow s(ElConstMatrix s A, ElMatrix s invNormMap, com-

plex float center, float realWidth, float imagWidth, ElInt real-Size, ElInt imagSize)

ElError ElSpectralWindowDist s(ElConstDistMatrix s A, ElDistMatrix s invNormMap,complex float center, float realWidth, float imagWidth,ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowX s(ElConstMatrix s A, ElMatrix s invNormMap, com-plex float center, float realWidth, float imagWidth, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl s ctrl)

ElError ElSpectralWindowXDist s(ElConstDistMatrix s A, ElDistMatrix s invNormMap,complex float center, float realWidth, float imagWidth,ElInt realSize, ElInt imagSize, ElPseudospecCtrl s ctrl)

Double-precisionElError ElSpectralWindow d(ElConstMatrix d A, ElMatrix d invNormMap, com-

plex double center, double realWidth, double imagWidth,ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowDist d(ElConstDistMatrix d A, ElDistMatrix d invNormMap,complex double center, double realWidth, double imag-Width, ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowX d(ElConstMatrix d A, ElMatrix d invNormMap, com-plex double center, double realWidth, double imagWidth,ElInt realSize, ElInt imagSize, ElPseudospecCtrl d ctrl)

ElError ElSpectralWindowXDist d(ElConstDistMatrix d A, ElDistMatrix d invNor-mMap, complex double center, double realWidth,double imagWidth, ElInt realSize, ElInt imagSize,ElPseudospecCtrl d ctrl)

Single-precision complex

322 Chapter 5. LAPACK-like linear algebra

Page 327: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSpectralWindow c(ElConstMatrix c A, ElMatrix c invNormMap, com-plex float center, float realWidth, float imagWidth, ElInt real-Size, ElInt imagSize)

ElError ElSpectralWindowDist c(ElConstDistMatrix c A, ElDistMatrix c invNormMap,complex float center, float realWidth, float imagWidth,ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowX c(ElConstMatrix c A, ElMatrix c invNormMap, com-plex float center, float realWidth, float imagWidth, ElInt real-Size, ElInt imagSize, ElPseudospecCtrl s ctrl)

ElError ElSpectralWindowXDist c(ElConstDistMatrix c A, ElDistMatrix c invNormMap,complex float center, float realWidth, float imagWidth,ElInt realSize, ElInt imagSize, ElPseudospecCtrl s ctrl)

Double-precision complexElError ElSpectralWindow z(ElConstMatrix z A, ElMatrix z invNormMap, com-

plex double center, double realWidth, double imagWidth,ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowDist z(ElConstDistMatrix z A, ElDistMatrix z invNormMap,complex double center, double realWidth, double imag-Width, ElInt realSize, ElInt imagSize)

ElError ElSpectralWindowX z(ElConstMatrix z A, ElMatrix z invNormMap, com-plex double center, double realWidth, double imagWidth,ElInt realSize, ElInt imagSize, ElPseudospecCtrl d ctrl)

ElError ElSpectralWindowXDist z(ElConstDistMatrix z A, ElDistMatrix z invNor-mMap, complex double center, double realWidth,double imagWidth, ElInt realSize, ElInt imagSize,ElPseudospecCtrl d ctrl)

Spectral cloud

The following routines return the norms of the shifted inverses in the vector invNorms for agiven set of shifts. The returned integer vector is a list of the number of iterations required forconvergence of each shift.

Python API

SpectralCloud(A, shifts[, ctrl=None])

C++ API

Matrix<int> SpectralCloud(const Matrix<F> &A, const Ma-trix<Complex<Base<F>>> &shifts, Matrix<Base<F>>&invNorms, PseudospecCtrl<Base<F>> psCtrl = Pseu-dospecCtrl<Base<F>>())

5.3. Spectral analysis 323

Page 328: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<int, VR, STAR> SpectralCloud(const AbstractDistMatrix<F> &A, constAbstractDistMatrix<Complex<Base<F>>>&shifts, AbstractDistMatrix<Base<F>>&invNorms, PseudospecCtrl<Base<F>>psCtrl = PseudospecCtrl<Base<F>>())

Matrix<int> TriangularSpectralCloud(const Matrix<F> &U, const Ma-trix<Complex<Base<F>>> &shifts, Ma-trix<Base<F>> &invNorms, Pseudospec-Ctrl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

DistMatrix<int, VR, STAR> TriangularSpectralCloud(const AbstractDistMatrix<F>&U, const AbstractDistMa-trix<Complex<Base<F>>>&shifts, AbstractDistMa-trix<Base<F>> &invNorms,PseudospecCtrl<Base<F>>psCtrl = PseudospecC-trl<Base<F>>())

DistMatrix<int, VR, STAR> QuasiTriangularSpectralCloud(const AbstractDist-Matrix<Real> &U,const AbstractDistMa-trix<Complex<Real>>&shifts, AbstractDistMa-trix<Real> &invNorms,PseudospecCtrl<Real>psCtrl = PseudospecC-trl<Real>())

Matrix<int> HessenbergSpectralCloud(const Matrix<F> &H, const Ma-trix<Complex<Base<F>>> &shifts, Ma-trix<Base<F>> &invNorms, Pseudospec-Ctrl<Base<F>> psCtrl = PseudospecC-trl<Base<F>>())

DistMatrix<int, VR, STAR> HessenbergSpectralCloud(const AbstractDistMatrix<F>&H, const AbstractDistMa-trix<Complex<Base<F>>>&shifts, AbstractDistMa-trix<Base<F>> &invNorms,PseudospecCtrl<Base<F>>psCtrl = PseudospecC-trl<Base<F>>())

C API

Single-precisionElError ElSpectralCloud s(ElConstMatrix s A, ElConstMatrix c shifts, ElMatrix s in-

vNormMap)ElError ElSpectralCloudDist s(ElConstDistMatrix s A, ElConstDistMatrix c shifts, El-

DistMatrix s invNormMap)

324 Chapter 5. LAPACK-like linear algebra

Page 329: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSpectralCloudX s(ElConstMatrix s A, ElConstMatrix c shifts, ElMatrix s in-vNormMap, ElPseudospecCtrl s ctrl)

ElError ElSpectralCloudXDist s(ElConstDistMatrix s A, ElConstDistMatrix c shifts, El-DistMatrix s invNormMap, ElPseudospecCtrl s ctrl)

Double-precisionElError ElSpectralCloud d(ElConstMatrix d A, ElConstMatrix z shifts, ElMatrix d in-

vNormMap)ElError ElSpectralCloudDist d(ElConstDistMatrix d A, ElConstDistMatrix z shifts, El-

DistMatrix d invNormMap)

ElError ElSpectralCloudX d(ElConstMatrix d A, ElConstMatrix z shifts, ElMatrix d in-vNormMap, ElPseudospecCtrl d ctrl)

ElError ElSpectralCloudXDist d(ElConstDistMatrix d A, ElConstDistMatrix z shifts,ElDistMatrix d invNormMap, ElPseudospecCtrl d ctrl)

Single-precision complexElError ElSpectralCloud c(ElConstMatrix c A, ElConstMatrix c shifts, ElMatrix s in-

vNormMap)ElError ElSpectralCloudDist c(ElConstDistMatrix c A, ElConstDistMatrix c shifts, El-

DistMatrix s invNormMap)

ElError ElSpectralCloudX c(ElConstMatrix c A, ElConstMatrix c shifts, ElMatrix s in-vNormMap, ElPseudospecCtrl s ctrl)

ElError ElSpectralCloudXDist c(ElConstDistMatrix c A, ElConstDistMatrix c shifts, El-DistMatrix s invNormMap, ElPseudospecCtrl s ctrl)

Double-precision complexElError ElSpectralCloud z(ElConstMatrix z A, ElConstMatrix z shifts, ElMatrix d in-

vNormMap)ElError ElSpectralCloudDist z(ElConstDistMatrix z A, ElConstDistMatrix z shifts, El-

DistMatrix d invNormMap)

ElError ElSpectralCloudX z(ElConstMatrix z A, ElConstMatrix z shifts, ElMatrix d in-vNormMap, ElPseudospecCtrl d ctrl)

ElError ElSpectralCloudXDist z(ElConstDistMatrix z A, ElConstDistMatrix z shifts,ElDistMatrix d invNormMap, ElPseudospecCtrl d ctrl)

Control structures

Python API

TODO

C++ API

enum PseudospecNorm

5.3. Spectral analysis 325

Page 330: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

enumerator PS TWO NORM

Compute ξ ∈ C : ‖(A − ξ I)−1‖2 > 1ε

enumerator PS ONE NORM

Compute ξ ∈ C : ‖(A − ξ I)−1‖1 > 1ε

class SnapshotCtrl

Int realSize

Int imagSize

Int imgSaveFreq

Int numSaveFreq

Int imgDispFreqNegative if no snapshots should be saved/displayed, zero if only a final snapshotshould be saved/displayed, and equal to n > 0 if, in addition to a final snapshot,the partial results should be output roughly overy n iterations (there is no output inthe middle of Impliclty Restarted Arnoldi cycles).

Int imgSaveCount

Int numSaveCount

Int imgDispCount

std::string imgBase

std::string numBase

FileFormat imgFormat

FileFormat numFormat

SnapshotCtrl()

All counters and dimensions are initially zero, all save/display “frequencies” areset to -1 (no output), the basename strings are initialized to “ps”, the image formatto PNG, and the numerical format to ASCII MATLAB.

void ResetCounts()

Resets all counters to zero

void Iterate()

Increments all counters by one

class PseudospecCtrl<Real>

bool forceComplexSchur

bool forceComplexPs

SchurCtrl<Real> schurCtrl

Int maxIts

Real tol

bool deflate

bool arnoldi

326 Chapter 5. LAPACK-like linear algebra

Page 331: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int basisSize

bool reorthog

bool progress

SnapshotCtrl snapCtrl

class PseudospecCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex type F.

C API

ElSnapshotCtrl

ElInt realSize

ElInt imagSize

ElInt imgSaveFreq

ElInt numSaveFreq

ElInt imgDispFreqNegative if no snapshots should be saved/displayed, zero if only a final snapshotshould be saved/displayed, and equal to n > 0 if, in addition to a final snapshot,the partial results should be output roughly overy n iterations (there is no output inthe middle of Impliclty Restarted Arnoldi cycles).

ElInt imgSaveCount

ElInt numSaveCount

ElInt imgDispCount

const char* imgBase

const char* numBase

ElFileFormat imgFormat

ElFileFormat numFormat

ElError ElSnapshotCtrlDefault(ElSnapshotCtrl* ctrl)

ElError ElSnapshotCtrlDestroy(ElSnapshotCtrl* ctrl)

ElPseudospecCtrl s

bool forceComplexSchur

bool forceComplexPs

ElSchurCtrl s schurCtrl

ElInt maxIts

float tol

bool deflate

5.3. Spectral analysis 327

Page 332: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

bool arnoldi

ElInt basisSize

bool reorthog

bool progress

ElSnapshotCtrl snapCtrl

ElPseudospecCtrl d

bool forceComplexSchur

bool forceComplexPs

ElSchurCtrl s schurCtrl

ElInt maxIts

double tol

bool deflate

bool arnoldi

ElInt basisSize

bool reorthog

bool progress

ElSnapshotCtrl snapCtrl

ElError ElPseudospecCtrlDefault s(ElPseudospecCtrl s* ctrl)

ElError ElPseudospecCtrlDefault d(ElPseudospecCtrl d* ctrl)

ElError ElPseudospecCtrlDestroy s(ElPseudospecCtrl s* ctrl)

ElError ElPseudospecCtrlDestroy d(ElPseudospecCtrl d* ctrl)

References

C++ implementation

C++ pseudospectra example driver

C++ ChunkedPseudospectra example driver

C++ TriangularPseudospectra example driver

C++ ChunkedTriangularPseudospectra example driver

5.3.11 References

C++ Header

C Header

Python wrapper

328 Chapter 5. LAPACK-like linear algebra

Page 333: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.4 Matrix functions

C++ Header

C Header

5.4.1 Direct inversion

General

This routine computes the in-place inverse of a general fully-populated (invertible) matrix Aas

A−1 = U−1L−1P,

where PA = LU is the result of LU factorization with partial pivoting. The algorithm es-sentially factors A, inverts U in place, solves against L one block column at a time, and thenapplies the row pivots in reverse order to the columns of the result.

Python API

Inverse(A)

C++ API

void Inverse(Matrix<F> &A)

void Inverse(AbstractDistMatrix<F> &A)

C API

Single-precisionElError ElInverse s(ElMatrix s A)

ElError ElInverseDist s(ElDistMatrix s A)

Double-precisionElError ElInverse d(ElMatrix d A)

ElError ElInverseDist d(ElDistMatrix d A)

Single-precision complexElError ElInverse c(ElMatrix c A)

ElError ElInverseDist c(ElDistMatrix c A)

Double-precision complexElError ElInverse z(ElMatrix z A)

ElError ElInverseDist z(ElDistMatrix z A)

5.4. Matrix functions 329

Page 334: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Triangular

Inverts a (possibly unit-diagonal) triangular matrix in-place. If diag is set to UNIT, then A istreated as having ones on its diagonal.

Python API

TriangularInverse(uplo, diag, A)

C++ API

void TriangularInverse(UpperOrLower uplo, UnitOrNonUnit diag, Matrix<F> &A)

void TriangularInverse(UpperOrLower uplo, UnitOrNonUnit diag, AbstractDistMa-trix<F> &A)

C API

Single-precisionElError ElTriangularInverse s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMa-

trix s A)ElError ElTriangularInverseDist s(ElUpperOrLower uplo, ElUnitOrNonUnit diag, El-

Matrix s A)

Double-precisionElError ElTriangularInverse d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMa-

trix d A)ElError ElTriangularInverseDist d(ElUpperOrLower uplo, ElUnitOrNonUnit diag, El-

Matrix d A)

Single-precision complexElError ElTriangularInverse c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMa-

trix c A)ElError ElTriangularInverseDist c(ElUpperOrLower uplo, ElUnitOrNonUnit diag, El-

Matrix c A)

Double-precision complexElError ElTriangularInverse z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, ElMa-

trix z A)ElError ElTriangularInverseDist z(ElUpperOrLower uplo, ElUnitOrNonUnit diag, El-

Matrix z A)

Symmetric/Hermitian

Python API

SymmetricInverse(uplo, A, conjugate=False)

HermitianInverse(uplo, A)

330 Chapter 5. LAPACK-like linear algebra

Page 335: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void SymmetricInverse(UpperOrLower uplo, Matrix<F> &A, bool conjugate = false,LDLPivotType pivotType = BUNCH KAUFMAN A)

void SymmetricInverse(UpperOrLower uplo, AbstractDistMatrix<F> &A, bool conjugate= false, LDLPivotType pivotType = BUNCH KAUFMAN A)

Invert a symmetric or Hermitian matrix using a pivoted LDL factorization.

void HermitianInverse(UpperOrLower uplo, Matrix<F> &A, bool conjugate = false,LDLPivotType pivotType = BUNCH KAUFMAN A)

void HermitianInverse(UpperOrLower uplo, AbstractDistMatrix<F> &A, bool conjugate= false, LDLPivotType pivotType = BUNCH KAUFMAN A)

Invert a Hermitian matrix using a pivoted LDL factorization.

C API

Single-precisionElError ElSymmetricInverse s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElSymmetricInverseDist s(ElUpperOrLower uplo, ElDistMatrix s A)

Double-precisionElError ElSymmetricInverse d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElSymmetricInverseDist d(ElUpperOrLower uplo, ElDistMatrix d A)

Single-precision complexElError ElSymmetricInverse c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElSymmetricInverseDist c(ElUpperOrLower uplo, ElDistMatrix c A)

Invert a symmetric matrix using a pivoted LDLT factorization.

ElError ElHermitianInverse c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHermitianInverseDist c(ElUpperOrLower uplo, ElDistMatrix c A)

Invert a Hermitian matrix using a pivoted LDLH factorization.

Double-precision complexElError ElSymmetricInverse z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElSymmetricInverseDist z(ElUpperOrLower uplo, ElDistMatrix z A)

Invert a symmetric matrix using a pivoted LDLT factorization.

ElError ElHermitianInverse z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHermitianInverseDist z(ElUpperOrLower uplo, ElDistMatrix z A)

Invert a Hermitian matrix using a pivoted LDLH factorization.

Hermitian Positive-Definite

This routine uses a custom algorithm for computing the inverse of a Hermitian positive-definite matrix A as

A−1 = (LLH)−1 = L−H L−1,

5.4. Matrix functions 331

Page 336: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

where L is the lower Cholesky factor of A (the upper Cholesky factor is computed in the caseof upper-triangular storage). Rather than performing Cholesky factorization, triangular inver-sion, and then the Hermitian triangular outer product in sequence, this routine makes use ofthe single-sweep algorithm described in [BGvdG2008] (in particular, the variant 2 algorithmfrom Fig. 9).

If the matrix is found to not be HPD, then a NonHPDMatrixException is thrown.

Python API

HPDInverse(uplo, A)

C++ API

void HPDInverse(UpperOrLower uplo, Matrix<F> &A)

void HPDInverse(UpperOrLower uplo, AbstractDistMatrix<F> &A)

C API

Single-precisionElError ElHPDInverse s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHPDInverseDist s(ElUpperOrLower uplo, ElDistMatrix s A)

Double-precisionElError ElHPDInverse d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHPDInverseDist d(ElUpperOrLower uplo, ElDistMatrix d A)

Single-precision complexElError ElHPDInverse c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHPDInverseDist c(ElUpperOrLower uplo, ElDistMatrix c A)

Double-precision complexElError ElHPDInverse z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHPDInverseDist z(ElUpperOrLower uplo, ElDistMatrix z A)

5.4.2 Hermitian functions

Reform the matrix with the eigenvalues modified by a user-defined function. When the user-defined function is real-valued, the result will remain Hermitian, but when the function iscomplex-valued, the result is best characterized as normal.

When the user-defined function, say f , is analytic, we can say much more about the result: ifthe eigenvalue decomposition of the Hermitian matrix A is A = ZΛZH, then

f (A) = f (ZΛZH) = Z f (Λ)ZH.

Two important special cases are f (λ) = exp(λ) and f (λ) = exp(iλ), where the former resultsin a Hermitian matrix and the latter in a normal (in fact, unitary) matrix.

332 Chapter 5. LAPACK-like linear algebra

Page 337: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void HermitianFunction(UpperOrLower uplo, Matrix<F> &A, std::function<Real)Real> f

void HermitianFunction(UpperOrLower uplo, AbstractDistMatrix<F> &A,std::function<Real)Real

> f Modifies the eigenvalues of the passed-in Hermitian matrix by replacing each eigen-value λi with f (λi) ∈ R. See examples/lapack like/RealSymmetricFunction.cpp for anexample usage.

void HermitianFunction(UpperOrLower uplo, Matrix<Complex<Real>> &A,std::function<Complex<Real>)Real

> f

void HermitianFunction(UpperOrLower uplo, AbstractDistMatrix<Complex<Real>>&A, std::function<Complex<Real>)Real

> f Modifies the eigenvalues of the passed-in complex Hermitian ma-trix by replacing each eigenvalue λi with f (λi) ∈ C. See exam-ples/lapack like/ComplexHermitianFunction.cpp for an example usage.

TODO: A version of (complex) HermitianFunction which begins with a real matrix

C API

ElError ElRealHermitianFunction s(ElUpperOrLower uplo, ElMatrix s A, float(*func)(float))

ElError ElRealHermitianFunction d(ElUpperOrLower uplo, ElMatrix d A, double(*func)(double))

ElError ElRealHermitianFunction c(ElUpperOrLower uplo, ElMatrix c A, float(*func)(float))

ElError ElRealHermitianFunction z(ElUpperOrLower uplo, ElMatrix z A, double(*func)(double))

ElError ElRealHermitianFunctionDist s(ElUpperOrLower uplo, ElDistMatrix s A, float(*func)(float))

ElError ElRealHermitianFunctionDist d(ElUpperOrLower uplo, ElDistMatrix d A, dou-ble (*func)(double))

ElError ElRealHermitianFunctionDist c(ElUpperOrLower uplo, ElDistMatrix c A, float(*func)(float))

ElError ElRealHermitianFunctionDist z(ElUpperOrLower uplo, ElDistMatrix z A, dou-ble (*func)(double))

Modifies the eigenvalues of the passed-in Hermitian matrix by replacing each eigenvalueλi with f (λi) ∈ R.

ElError ElComplexHermitianFunction c(ElUpperOrLower uplo, ElMatrix c A, com-plex float (*func)(float))

ElError ElComplexHermitianFunction z(ElUpperOrLower uplo, ElMatrix z A, com-plex double (*func)(double))

ElError ElComplexHermitianFunctionDist c(ElUpperOrLower uplo, ElDistMatrix c A,complex float (*func)(float))

5.4. Matrix functions 333

Page 338: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElComplexHermitianFunctionDist z(ElUpperOrLower uplo, ElDistMatrix z A,complex double (*func)(double))

Modifies the eigenvalues of the passed-in complex Hermitian matrix by replacing eacheigenvalue λi with f (λi) ∈ C.

5.4.3 Pseudoinverse

General

Computes the pseudoinverse of a general matrix through computing its SVD, modifying thesingular values with the function

f (σ) =

1/σ, σ ≥ ε n ‖A‖20, otherwise

,

where ε is the relative machine precision, n is the height of A, and ‖A‖2 is the maximumsingular value. If a nonzero value for tolerance was specified, it is used instead of εn‖A‖2.

C++ API

void Pseudoinverse(Matrix<F> &A, Base<F> tolerance = 0)

void Pseudoinverse(AbstractDistMatrix<F> &A, Base<F> tolerance = 0)

C API

ElError ElPseudoinverse s(ElMatrix s A)

ElError ElPseudoinverse d(ElMatrix d A)

ElError ElPseudoinverse c(ElMatrix c A)

ElError ElPseudoinverse z(ElMatrix z A)

ElError ElPseudoinverseDist s(ElDistMatrix s A)

ElError ElPseudoinverseDist d(ElDistMatrix d A)

ElError ElPseudoinverseDist c(ElDistMatrix c A)

ElError ElPseudoinverseDist z(ElDistMatrix z A)

Hermitian

Computes the pseudoinverse of a Hermitian matrix through a customized version ofHermitianFunction() which used the eigenvalue mapping function

f (ω) =

1/ω, |ω| ≥ ε n ‖A‖2

0, otherwise,

where ε is the relative machine precision, n is the height of A, and ‖A‖2 can be computed as themaximum absolute value of the eigenvalues of A. If a nonzero value for tolerance is specified,it is used instead of εn‖A‖2.

334 Chapter 5. LAPACK-like linear algebra

Page 339: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void HermitianPseudoinverse(UpperOrLower uplo, Matrix<F> &A, Base<F> tolerance =0)

void HermitianPseudoinverse(UpperOrLower uplo, AbstractDistMatrix<F> &A,Base<F> tolerance = 0)

C API

ElError ElHermitianPseudoinverse s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHermitianPseudoinverse d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHermitianPseudoinverse c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHermitianPseudoinverse z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHermitianPseudoinverseDist s(ElUpperOrLower uplo, ElDistMatrix s A)

ElError ElHermitianPseudoinverseDist d(ElUpperOrLower uplo, ElDistMatrix d A)

ElError ElHermitianPseudoinverseDist c(ElUpperOrLower uplo, ElDistMatrix c A)

ElError ElHermitianPseudoinverseDist z(ElUpperOrLower uplo, ElDistMatrix z A)

5.4.4 Square root

A matrix B satisfying

B2 = A

is referred to as the square-root of the matrix A. Such a matrix can easily be seen to exist whenA is diagonalizable: if A = XΛX−1, then we may put

B = X√

ΛX−1,

where each eigenvalue λ = reiθ maps to√

λ =√

reiθ/2.

General

The current implementation for n × n matrices uses the Newton iteration

Xk+1 :=12(Xk + X−1

k A)

and convergence is determined to occur when

‖Xk+1 − Xk‖1 ≤ ‖Xk+1‖q+11 tol,

where the exponent q is typically one, and the relative tolerance, tol, defaults to nε, where εis the machine precision. Please see Nicholas J. Higham and Awad H. Al-Mohy’s ComputingMatrix Functions for more details.

5.4. Matrix functions 335

Page 340: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void SquareRoot(Matrix<F> &A, const SquareRootCtrl<Base<F>> ctrl = SquareRootC-trl<Base<F>>())

void SquareRoot(AbstractDistMatrix<F> &A, const SquareRootCtrl<Base<F>> ctrl =SquareRootCtrl<Base<F>>())

type SquareRootCtrl<Real>

Int maxItsThe maximum number of Newton iterations

Real tolThe relative tolerance for convergence of the Newton iteration

Real powerThe power of the one norm of the new iterate that should be used to scale the errorwhen checking for convergence

bool progressWhether or not to print convergence progress

SquareRootCtrl()

Sets maxIts=100, tol=0 (which signals that matrix-dependent value will be com-puted), power=1, and progress=false.

C API

ElError ElSquareRoot s(ElMatrix s A)

ElError ElSquareRoot d(ElMatrix d A)

ElError ElSquareRoot c(ElMatrix c A)

ElError ElSquareRoot z(ElMatrix z A)

ElError ElSquareRootDist s(ElDistMatrix s A)

ElError ElSquareRootDist d(ElDistMatrix d A)

ElError ElSquareRootDist c(ElDistMatrix c A)

ElError ElSquareRootDist z(ElDistMatrix z A)

TODO: Expert versions

Hermitian Positive Semi-Definite

Computes the Hermitian EVD, square-roots the eigenvalues, and then reforms the matrix. Ifany of the eigenvalues were sufficiently negative, a NonHPSDMatrixException is thrown.

C++ API

void HPSDSquareRoot(UpperOrLower uplo, Matrix<F> &A)

336 Chapter 5. LAPACK-like linear algebra

Page 341: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void HPSDSquareRoot(UpperOrLower uplo, AbstractDistMatrix<F> &A)

C API

ElError ElHPSDSquareRoot s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHPSDSquareRoot d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHPSDSquareRoot c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHPSDSquareRoot z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHPSDSquareRootDist s(ElUpperOrLower uplo, ElDistMatrix s A)

ElError ElHPSDSquareRootDist d(ElUpperOrLower uplo, ElDistMatrix d A)

ElError ElHPSDSquareRootDist c(ElUpperOrLower uplo, ElDistMatrix c A)

ElError ElHPSDSquareRootDist z(ElUpperOrLower uplo, ElDistMatrix z A)

TODO: HermitianSquareRoot

5.4.5 Sign

The matrix sign function can be written as

sgn(A) = A(A2)−1/2,

as long as A does not have any pure-imaginary eigenvalues.

General

The current implementation for n × n matrices makes use of a globally-convergent Newtoniteration with several scaling options. Each iteration takes the form

Xk+1 :=12(µkXk + µ−1

k X−1k ),

where µk is the scaling factor computed from Xk. Convergence is determined to occur when

‖Xk+1 − Xk‖1 ≤ ‖Xk+1‖q+11 tol,

where the exponent q is typically one, and the relative tolerance, tol, defaults to nε, where εis the machine precision. Please see Nicholas J. Higham and Awad H. Al-Mohy’s ComputingMatrix Functions for more details.

C++ API

void Sign(Matrix<F> &A, SignCtrl<Base<F>> signCtrl = SignCtrl<Base<F>>())

void Sign(AbstractDistMatrix<F> &A, SignCtrl<Base<F>> signCtrl = SignC-trl<Base<F>>())

Overwrite A with sgn(A)

void Sign(Matrix<F> &A, Matrix<F> &N, SignCtrl<Base<F>> signCtrl = SignC-trl<Base<F>>())

5.4. Matrix functions 337

Page 342: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Sign(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &N, SignCtrl<Base<F>>signCtrl = SignCtrl<Base<F>>())

Compute the polar decomposition A = SN, where S = sgn(A), overwriting A with S onexit

type SignScaling

An enum which can be set to one of

•SIGN SCALE NONE

•SIGN SCALE DET

•SIGN SCALE FROB

type SignCtrl<Real>

int maxIts

Real tol

Real power

SignScaling scaling

bool progress

type SignCtrl<Base<F>>A particular case where the datatype is the base of the potentially complex datatype F.

C API

ElError ElSign s(ElMatrix s A)

ElError ElSign d(ElMatrix d A)

ElError ElSign c(ElMatrix c A)

ElError ElSign z(ElMatrix z A)

ElError ElSignDist s(ElDistMatrix s A)

ElError ElSignDist d(ElDistMatrix d A)

ElError ElSignDist c(ElDistMatrix c A)

ElError ElSignDist z(ElDistMatrix z A)

Overwrite A with sgn(A)

ElError ElSignDecomp s(ElMatrix s A, ElMatrix s N)

ElError ElSignDecomp d(ElMatrix d A, ElMatrix d N)

ElError ElSignDecomp c(ElMatrix c A, ElMatrix c N)

ElError ElSignDecomp z(ElMatrix z A, ElMatrix z N)

ElError ElSignDecompDist s(ElDistMatrix s A, ElDistMatrix s N)

ElError ElSignDecompDist d(ElDistMatrix d A, ElDistMatrix d N)

ElError ElSignDecompDist c(ElDistMatrix c A, ElDistMatrix c N)

338 Chapter 5. LAPACK-like linear algebra

Page 343: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSignDecompDist z(ElDistMatrix z A, ElDistMatrix z N)

Compute the polar decomposition A = SN, where S = sgn(A), overwriting A with S onexit

TODO: Add an expert interface

ElSignCtrl s

ElInt maxIts

float tol

float power

ElSignScaling scaling

bool progress

ElSignCtrl d

ElInt maxIts

double tol

double power

ElSignScaling scaling

bool progress

ElSignScaling

An enum which can be set to one of

•EL SIGN SCALE NONE

•EL SIGN SCALE DET

•EL SIGN SCALE FROB

Hermitian

Compute the Hermitian EVD, replace the eigenvalues with their sign, and then reform thematrix. Optionally return the full decomposition, A = SN, where A is overwritten by S. Notethat this will also be a polar decomposition.

C++ API

void HermitianSign(UpperOrLower uplo, Matrix<F> &A)

void HermitianSign(UpperOrLower uplo, AbstractDistMatrix<F> &A)

Overwrite A with sgn(A)

void HermitianSign(UpperOrLower uplo, Matrix<F> &A, Matrix<F> &N)

void HermitianSign(UpperOrLower uplo, AbstractDistMatrix<F> &A, AbstractDistMa-trix<F> &N)

Compute the polar decomposition A = SN, where S = sgn(A), overwriting A with S onexit

5.4. Matrix functions 339

Page 344: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElHermitianSign s(ElUpperOrLower uplo, ElMatrix s A)

ElError ElHermitianSign d(ElUpperOrLower uplo, ElMatrix d A)

ElError ElHermitianSign c(ElUpperOrLower uplo, ElMatrix c A)

ElError ElHermitianSign z(ElUpperOrLower uplo, ElMatrix z A)

ElError ElHermitianSignDist s(ElUpperOrLower uplo, ElDistMatrix s A)

ElError ElHermitianSignDist d(ElUpperOrLower uplo, ElDistMatrix d A)

ElError ElHermitianSignDist c(ElUpperOrLower uplo, ElDistMatrix c A)

ElError ElHermitianSignDist z(ElUpperOrLower uplo, ElDistMatrix z A)

Overwrite A with sgn(A)

ElError ElHermitianSignDecomp s(ElUpperOrLower uplo, ElMatrix s A, ElMatrix s N)

ElError ElHermitianSignDecomp d(ElUpperOrLower uplo, ElMatrix d A, ElMatrix d N)

ElError ElHermitianSignDecomp c(ElUpperOrLower uplo, ElMatrix c A, ElMatrix c N)

ElError ElHermitianSignDecomp z(ElUpperOrLower uplo, ElMatrix z A, ElMatrix z N)

ElError ElHermitianSignDecompDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElDist-Matrix s N)

ElError ElHermitianSignDecompDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElDist-Matrix d N)

ElError ElHermitianSignDecompDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElDist-Matrix c N)

ElError ElHermitianSignDecompDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElDist-Matrix z N)

Compute the polar decomposition A = SN, where S = sgn(A), overwriting A with S onexit

5.5 Matrix properties

5.5.1 Condition number

Specialized interfaces

Frobenius-norm condition number

Header file

Implementation

C++ APIBase<F> FrobeniusCondition(const Matrix<F> &A)

Base<F> FrobeniusCondition(const AbstractDistMatrix<F> &A)

340 Chapter 5. LAPACK-like linear algebra

Page 345: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C APIElError ElFrobeniusCondition s(ElConstMatrix s A, float* cond)ElError ElFrobeniusCondition d(ElConstMatrix d A, double* cond)

ElError ElFrobeniusCondition c(ElConstMatrix c A, float* cond)

ElError ElFrobeniusCondition z(ElConstMatrix z A, double* cond)

ElError ElFrobeniusConditionDist s(ElConstDistMatrix s A, float* cond)

ElError ElFrobeniusConditionDist d(ElConstDistMatrix d A, double* cond)

ElError ElFrobeniusConditionDist c(ElConstDistMatrix c A, float* cond)

ElError ElFrobeniusConditionDist z(ElConstDistMatrix z A, double* cond)

Python APIFrobeniusCondition(A)

Infinity-norm condition number

Header file

Implementation

C++ APIBase<F> InfinityCondition(const Matrix<F> &A)

Base<F> InfinityCondition(const AbstractDistMatrix<F> &A)

C APIElError ElInfinityCondition s(ElConstMatrix s A, float* cond)ElError ElInfinityCondition d(ElConstMatrix d A, double* cond)

ElError ElInfinityCondition c(ElConstMatrix c A, float* cond)

ElError ElInfinityCondition z(ElConstMatrix z A, double* cond)

ElError ElInfinityConditionDist s(ElConstDistMatrix s A, float* cond)

ElError ElInfinityConditionDist d(ElConstDistMatrix d A, double* cond)

ElError ElInfinityConditionDist c(ElConstDistMatrix c A, float* cond)

ElError ElInfinityConditionDist z(ElConstDistMatrix z A, double* cond)

Python APIInfinityCondition(A)

Max-norm condition number

Header file

Implementation

Returns the condition number with respect to the entrywise maximum norm.

5.5. Matrix properties 341

Page 346: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ APIBase<F> MaxCondition(const Matrix<F> &A)

Base<F> MaxCondition(const AbstractDistMatrix<F> &A)

C APIElError ElMaxCondition s(ElConstMatrix s A, float* cond)ElError ElMaxCondition d(ElConstMatrix d A, double* cond)

ElError ElMaxCondition c(ElConstMatrix c A, float* cond)

ElError ElMaxCondition z(ElConstMatrix z A, double* cond)

ElError ElMaxConditionDist s(ElConstDistMatrix s A, float* cond)

ElError ElMaxConditionDist d(ElConstDistMatrix d A, double* cond)

ElError ElMaxConditionDist c(ElConstDistMatrix c A, float* cond)

ElError ElMaxConditionDist z(ElConstDistMatrix z A, double* cond)

Python APIMaxCondition(A)

One-norm condition number

Header file

Implementation

C++ APIBase<F> OneCondition(const Matrix<F> &A)

Base<F> OneCondition(const AbstractDistMatrix<F> &A)

C APIElError ElOneCondition s(ElConstMatrix s A, float* cond)ElError ElOneCondition d(ElConstMatrix d A, double* cond)

ElError ElOneCondition c(ElConstMatrix c A, float* cond)

ElError ElOneCondition z(ElConstMatrix z A, double* cond)

ElError ElOneConditionDist s(ElConstDistMatrix s A, float* cond)

ElError ElOneConditionDist d(ElConstDistMatrix d A, double* cond)

ElError ElOneConditionDist c(ElConstDistMatrix c A, float* cond)

ElError ElOneConditionDist z(ElConstDistMatrix z A, double* cond)

Python APIOneCondition(A)

342 Chapter 5. LAPACK-like linear algebra

Page 347: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Two-norm condition number

Header file

Implementation

C++ APIBase<F> TwoCondition(const Matrix<F> &A)

Base<F> TwoCondition(const AbstractDistMatrix<F> &A)

C APIElError ElTwoCondition s(ElConstMatrix s A, float* cond)ElError ElTwoCondition d(ElConstMatrix d A, double* cond)

ElError ElTwoCondition c(ElConstMatrix c A, float* cond)

ElError ElTwoCondition z(ElConstMatrix z A, double* cond)

ElError ElTwoConditionDist s(ElConstDistMatrix s A, float* cond)

ElError ElTwoConditionDist d(ElConstDistMatrix d A, double* cond)

ElError ElTwoConditionDist c(ElConstDistMatrix c A, float* cond)

ElError ElTwoConditionDist z(ElConstDistMatrix z A, double* cond)

Python APITwoCondition(A)

Vanilla interface

Header file

Implementation

The condition number of a matrix with respect to a particular norm is

κ(A) = ‖A‖‖A−1‖,

with the most common choice being the matrix two-norm.

C++ API

Base<F> Condition(const Matrix<F> &A, NormType type = TWO NORM)

Base<F> Condition(const AbstractDistMatrix<F> &A, NormType type = TWO NORM)

C API

ElError ElCondition s(ElConstMatrix s A, ElNormType normType, float* cond)

ElError ElCondition d(ElConstMatrix d A, ElNormType normType, double* cond)

ElError ElCondition c(ElConstMatrix c A, ElNormType normType, float* cond)

5.5. Matrix properties 343

Page 348: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElCondition z(ElConstMatrix z A, ElNormType normType, double* cond)

ElError ElConditionDist s(ElConstDistMatrix s A, ElNormType normType, float* cond)

ElError ElConditionDist d(ElConstDistMatrix d A, ElNormType normType, dou-ble* cond)

ElError ElConditionDist c(ElConstDistMatrix c A, ElNormType normType, float* cond)

ElError ElConditionDist z(ElConstDistMatrix z A, ElNormType normType, dou-ble* cond)

Python API

Condition(A, normType=FROBENIUS NORM)

5.5.2 Determinant

Though there are many different possible definitions of the determinant of a matrix A ∈ Fn×n,the simplest one is in terms of the product of the eigenvalues (including multiplicity):

det(A) =n−1

∏i=0

λi.

General

Since det(AB) = det(A)det(B), we can compute the determinant of an arbitrary matrix in𝒪(n3) work by computing its LU decomposition (with partial pivoting), PA = LU, recognizingthat det(P) = ±1 (the signature of the permutation), and computing

det(A) = det(P)det(L)det(U) = det(P)n−1

∏i=0

υi,i = ±n−1

∏i=0

υi,i,

where υi,i is the i’th diagonal entry of U.

Python API

TODO

C++ API

F Determinant(const Matrix<F> &A)

F Determinant(const AbstractDistMatrix<F> &A)

F Determinant(Matrix<F> &A, bool canOverwrite = false)

F Determinant(AbstractDistMatrix<F> &A, bool canOverwrite = false)Return the determinant of the (fully populated) square matrix A. Some of the variantsallow for overwriting the input matrix in order to avoid forming another temporary ma-trix.

344 Chapter 5. LAPACK-like linear algebra

Page 349: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

SafeProduct<F> SafeDeterminant(const Matrix<F> &A)

SafeProduct<F> SafeDeterminant(const AbstractDistMatrix<F> &A)

SafeProduct<F> SafeDeterminant(Matrix<F> &A, bool canOverwrite = false)

SafeProduct<F> SafeDeterminant(AbstractDistMatrix<F> &A, bool canOverwrite =false)

Return the determinant of the square matrix A in an expanded form which is less likelyto over/under-flow.

type SafeProduct<F>Represents the product of n values as ρ exp(κn), where |ρ| ≤ 1 and κ ∈ R.

F rho

For nonzero values, rho is the modulus and lies on the unit circle; in order to repre-sent a value that is precisely zero, rho is set to zero.

Base<F> kappa

kappa can be an arbitrary real number.

Int nThe number of values in the product.

C API

ElError ElDeterminant s(ElConstMatrix s A, float* det)

ElError ElDeterminant d(ElConstMatrix d A, double* det)

ElError ElDeterminant c(ElConstMatrix c A, complex float* det)

ElError ElDeterminant z(ElConstMatrix z A, complex double* det)

ElError ElDeterminantDist s(ElConstDistMatrix s A, float* det)

ElError ElDeterminantDist d(ElConstDistMatrix d A, double* det)

ElError ElDeterminantDist c(ElConstDistMatrix c A, complex float* det)

ElError ElDeterminantDist z(ElConstDistMatrix z A, complex double* det)Return the determinant of the (fully populated) square matrix A.

ElError ElSafeDeterminant s(ElConstMatrix s A, ElSafeProduct s* det)

ElError ElSafeDeterminant d(ElConstMatrix d A, ElSafeProduct d* det)

ElError ElSafeDeterminant c(ElConstMatrix c A, ElSafeProduct c* det)

ElError ElSafeDeterminant z(ElConstMatrix z A, ElSafeProduct z* det)

ElError ElSafeDeterminantDist s(ElConstDistMatrix s A, ElSafeProduct s* det)

ElError ElSafeDeterminantDist d(ElConstDistMatrix d A, ElSafeProduct d* det)

ElError ElSafeDeterminantDist c(ElConstDistMatrix c A, ElSafeProduct c* det)

ElError ElSafeDeterminantDist z(ElConstDistMatrix z A, ElSafeProduct z* det)Return the determinant of the (fully populated) square matrix A in an expanded formwhich helps prevent under/overflow.

5.5. Matrix properties 345

Page 350: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

HPD

A version of the above determinant specialized for Hermitian positive-definite matrices (whichwill therefore have all positive eigenvalues and a positive determinant).

Python API

TODO

C++ API

Base<F> HPDDeterminant(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HPDDeterminant(UpperOrLower uplo, const AbstractDistMatrix<F> &A)

Base<F> HPDDeterminant(UpperOrLower uplo, Matrix<F> &A, bool canOverwrite =false)

Base<F> HPDDeterminant(UpperOrLower uplo, AbstractDistMatrix<F> &A, boolcanOverwrite = false)

Return the determinant of the (fully populated) Hermitian positive-definite matrix A.Some of the variants allow for overwriting the input matrix in order to avoid forminganother temporary matrix.

SafeProduct<F> SafeHPDDeterminant(UpperOrLower uplo, const Matrix<F> &A)

SafeProduct<F> SafeHPDDeterminant(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

SafeProduct<F> SafeHPDDeterminant(UpperOrLower uplo, Matrix<F> &A, boolcanOverwrite = false)

SafeProduct<F> SafeHPDDeterminant(UpperOrLower uplo, AbstractDistMatrix<F> &A,bool canOverwrite = false)

Return the determinant of the Hermitian positive-definite matrix A in an expanded formwhich is less likely to over/under-flow.

C API

ElError ElHPDDeterminant s(ElUpperOrLower uplo, ElConstMatrix s A, float* det)

ElError ElHPDDeterminant d(ElUpperOrLower uplo, ElConstMatrix d A, double* det)

ElError ElHPDDeterminant c(ElUpperOrLower uplo, ElConstMatrix c A, float* det)

ElError ElHPDDeterminant z(ElUpperOrLower uplo, ElConstMatrix z A, double* det)

ElError ElHPDDeterminantDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* det)

ElError ElHPDDeterminantDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, dou-ble* det)

ElError ElHPDDeterminantDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* det)

346 Chapter 5. LAPACK-like linear algebra

Page 351: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHPDDeterminantDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* det)

Return the determinant of the (fully populated) Hermitian positive-definite matrix A.

ElError ElHPDSafeDeterminant s(ElUpperOrLower uplo, ElConstMatrix s A, ElSafeProd-uct s* det)

ElError ElHPDSafeDeterminant d(ElUpperOrLower uplo, ElConstMatrix d A, ElSafeProd-uct d* det)

ElError ElHPDSafeDeterminant c(ElUpperOrLower uplo, ElConstMatrix c A, ElSafeProd-uct s* det)

ElError ElHPDSafeDeterminant z(ElUpperOrLower uplo, ElConstMatrix z A, ElSafeProd-uct d* det)

ElError ElHPDSafeDeterminantDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, El-SafeProduct s* det)

ElError ElHPDSafeDeterminantDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, El-SafeProduct d* det)

ElError ElHPDSafeDeterminantDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, El-SafeProduct s* det)

ElError ElHPDSafeDeterminantDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, El-SafeProduct d* det)

Return the determinant of the Hermitian positive-definite matrix A in an expanded formwhich is less likely to over/under-flow.

References

C++11 implementation

C++11 subroutines

C++11 header

5.5.3 Inertia

The following routines return a triplet containing the number of positive, negative, and zeroeigenvalues of a Hermitian matrix by analyzing the quasi-diagonal matrix resulting from apivoted LDLH factorization.

Python API

Inertia(A[, uplo=LOWER[, pivType=BUNCH KAUFMAN A]])Parameters

• A – The (sequential or distributed) dense Hermitian matrix

• uplo – (optional) Which triangle of A to access

• pivType – (optional) The preferred pivoting strategy

Return type The resulting InertiaType instance

5.5. Matrix properties 347

Page 352: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

class InertiaType

Int numPositive

Int numNegative

Int numZeroThe basic eigenvalue structure of a Hermitian matrix (which can be quickly com-puted from the quasi-diagonal matrix produced by Bunch-Kaufman).

InertiaType Inertia(UpperOrLower uplo, Matrix<F> &A, LDLPivotType pivotType =BUNCH PARLETT)

InertiaType Inertia(UpperOrLower uplo, AbstractDistMatrix<F> &A, LDLPivotType pivot-Type = BUNCH PARLETT)

C API

ElInertiaType

ElInt numPositive

ElInt numNegative

ElInt numZero

ElError ElInertia s(ElUpperOrLower uplo, ElMatrix s A, ElInertiaType* inertia)

ElError ElInertia d(ElUpperOrLower uplo, ElMatrix d A, ElInertiaType* inertia)

ElError ElInertia c(ElUpperOrLower uplo, ElMatrix c A, ElInertiaType* inertia)

ElError ElInertia z(ElUpperOrLower uplo, ElMatrix z A, ElInertiaType* inertia)

ElError ElInertiaDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElInertiaType* inertia)

ElError ElInertiaDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElInertiaType* inertia)

ElError ElInertiaDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElInertiaType* inertia)

ElError ElInertiaDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElInertiaType* inertia)

References

C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

348 Chapter 5. LAPACK-like linear algebra

Page 353: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.5.4 Matrix norms

Specialized interfaces

Entrywise norms

Header file

Implementation

The following routines return the ℓp norm of the columns of A stacked into a single vector, i.e.,‖vec(A)‖p. Note that the Frobenius norm corresponds to the p = 2 case.

C++ APIBase<F> EntrywiseNorm(const Matrix<F> &A, Base<F> p = 1)Base<F> EntrywiseNorm(const AbstractDistMatrix<F> &A, Base<F> p = 1)

Base<F> EntrywiseNorm(const SparseMatrix<F> &A, Base<F> p = 1)

Base<F> EntrywiseNorm(const DistSparseMatrix<F> &A, Base<F> p = 1)

Base<F> EntrywiseNorm(const DistMultiVec<F> &A, Base<F> p = 1)

Base<F> SymmetricEntrywiseNorm(UpperOrLower uplo, const Matrix<F> &A, Base<F>p = 1)

Base<F> SymmetricEntrywiseNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> p = 1)

Base<F> SymmetricEntrywiseNorm(UpperOrLower uplo, const SparseMatrix<F> &A,Base<F> p = 1)

Base<F> SymmetricEntrywiseNorm(UpperOrLower uplo, const DistSparseMatrix<F>&A, Base<F> p = 1)

Base<F> HermitianEntrywiseNorm(UpperOrLower uplo, const Matrix<F> &A, Base<F>p = 1)

Base<F> HermitianEntrywiseNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> p = 1)

Base<F> HermitianEntrywiseNorm(UpperOrLower uplo, const SparseMatrix<F> &A,Base<F> p = 1)

Base<F> HermitianEntrywiseNorm(UpperOrLower uplo, const DistSparseMatrix<F>&A, Base<F> p = 1)

C APIElError ElEntrywiseNorm s(ElConstMatrix s A, float p, float* norm)

ElError ElEntrywiseNorm d(ElConstMatrix d A, double p, double* norm)

ElError ElEntrywiseNorm c(ElConstMatrix c A, float p, float* norm)

ElError ElEntrywiseNorm z(ElConstMatrix z A, double p, double* norm)

ElError ElEntrywiseNormDist s(ElConstDistMatrix s A, float p, float* norm)

ElError ElEntrywiseNormDist d(ElConstDistMatrix d A, double p, double* norm)

ElError ElEntrywiseNormDist c(ElConstDistMatrix c A, float p, float* norm)

5.5. Matrix properties 349

Page 354: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElEntrywiseNormDist z(ElConstDistMatrix z A, double p, double* norm)

ElError ElEntrywiseNormSparse s(ElConstSparseMatrix s A, float p, float* norm)

ElError ElEntrywiseNormSparse d(ElConstSparseMatrix d A, double p, double* norm)

ElError ElEntrywiseNormSparse c(ElConstSparseMatrix c A, float p, float* norm)

ElError ElEntrywiseNormSparse z(ElConstSparseMatrix z A, double p, double* norm)

ElError ElEntrywiseNormDistSparse s(ElConstDistSparseMatrix s A, float p,float* norm)

ElError ElEntrywiseNormDistSparse d(ElConstDistSparseMatrix d A, double p, dou-ble* norm)

ElError ElEntrywiseNormDistSparse c(ElConstDistSparseMatrix c A, float p,float* norm)

ElError ElEntrywiseNormDistSparse z(ElConstDistSparseMatrix z A, double p, dou-ble* norm)

ElError ElEntrywiseNormDistMultiVec s(ElConstDistMultiVec s A, float p, float* norm)

ElError ElEntrywiseNormDistMultiVec d(ElConstDistMultiVec d A, double p, dou-ble* norm)

ElError ElEntrywiseNormDistMultiVec c(ElConstDistMultiVec c A, float p, float* norm)

ElError ElEntrywiseNormDistMultiVec z(ElConstDistMultiVec z A, double p, dou-ble* norm)

ElError ElSymmetricEntrywiseNorm s(ElUpperOrLower uplo, ElConstMatrix s A, float p,float* norm)

ElError ElSymmetricEntrywiseNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble p, double* norm)

ElError ElSymmetricEntrywiseNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float p,float* norm)

ElError ElSymmetricEntrywiseNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble p, double* norm)

ElError ElSymmetricEntrywiseNormDist s(ElUpperOrLower uplo, ElConstDistMa-trix s A, float p, float* norm)

ElError ElSymmetricEntrywiseNormDist d(ElUpperOrLower uplo, ElConstDistMa-trix d A, double p, double* norm)

ElError ElSymmetricEntrywiseNormDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float p, float* norm)

ElError ElSymmetricEntrywiseNormDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double p, double* norm)

ElError ElSymmetricEntrywiseNormSparse s(ElUpperOrLower uplo, ElConstSparseMa-trix s A, float p, float* norm)

ElError ElSymmetricEntrywiseNormSparse d(ElUpperOrLower uplo, ElConstSparseMa-trix d A, double p, double* norm)

ElError ElSymmetricEntrywiseNormSparse c(ElUpperOrLower uplo, ElConstSparseMa-trix c A, float p, float* norm)

ElError ElSymmetricEntrywiseNormSparse z(ElUpperOrLower uplo, ElConstSparseMa-trix z A, double p, double* norm)

350 Chapter 5. LAPACK-like linear algebra

Page 355: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSymmetricEntrywiseNormDistSparse s(ElUpperOrLower uplo, ElConst-DistSparseMatrix s A, float p,float* norm)

ElError ElSymmetricEntrywiseNormDistSparse d(ElUpperOrLower uplo, ElConst-DistSparseMatrix d A, double p,double* norm)

ElError ElSymmetricEntrywiseNormDistSparse c(ElUpperOrLower uplo, ElConst-DistSparseMatrix c A, float p,float* norm)

ElError ElSymmetricEntrywiseNormDistSparse z(ElUpperOrLower uplo, ElConst-DistSparseMatrix z A, double p,double* norm)

ElError ElHermitianEntrywiseNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float p,float* norm)

ElError ElHermitianEntrywiseNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble p, double* norm)

ElError ElHermitianEntrywiseNormDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float p, float* norm)

ElError ElHermitianEntrywiseNormDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double p, double* norm)

ElError ElHermitianEntrywiseNormSparse c(ElUpperOrLower uplo, ElConstSparseMa-trix c A, float p, float* norm)

ElError ElHermitianEntrywiseNormSparse z(ElUpperOrLower uplo, ElConstSparseMa-trix z A, double p, double* norm)

ElError ElHermitianEntrywiseNormDistSparse c(ElUpperOrLower uplo, ElConst-DistSparseMatrix c A, float p,float* norm)

ElError ElHermitianEntrywiseNormDistSparse z(ElUpperOrLower uplo, ElConst-DistSparseMatrix z A, double p,double* norm)

Python APIEntrywiseNorm(A, p=1)HermitianEntrywiseNorm(A, p=1, uplo=LOWER)

SymmetricEntrywiseNorm(A, p=1, uplo=LOWER)

Frobenius norms

Header file

Implementation

The following routines return the ℓ2 norm of the singular values (the Schatten norm with p =2), which can be cheaply computed as the ℓ2 norm of vec(A).

5.5. Matrix properties 351

Page 356: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ APIBase<F> FrobeniusNorm(const Matrix<F> &A)

Base<F> FrobeniusNorm(const AbstractDistMatrix<F> &A)

Base<F> FrobeniusNorm(const SparseMatrix<F> &A)

Base<F> FrobeniusNorm(const DistSparseMatrix<F> &A)

Base<F> FrobeniusNorm(const DistMultiVec<F> &A)

Base<F> SymmetricFrobeniusNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> SymmetricFrobeniusNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

Base<F> SymmetricFrobeniusNorm(UpperOrLower uplo, const SparseMatrix<F> &A)

Base<F> SymmetricFrobeniusNorm(UpperOrLower uplo, const DistSparseMatrix<F>&A)

Base<F> HermitianFrobeniusNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HermitianFrobeniusNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

Base<F> HermitianFrobeniusNorm(UpperOrLower uplo, const SparseMatrix<F> &A)

Base<F> HermitianFrobeniusNorm(UpperOrLower uplo, const DistSparseMatrix<F>&A)

C APIElError ElFrobeniusNorm s(ElConstMatrix s A, float* norm)

ElError ElFrobeniusNorm d(ElConstMatrix d A, double* norm)

ElError ElFrobeniusNorm c(ElConstMatrix c A, float* norm)

ElError ElFrobeniusNorm z(ElConstMatrix z A, double* norm)

ElError ElFrobeniusNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElFrobeniusNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElFrobeniusNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElFrobeniusNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElFrobeniusNormSparse s(ElConstSparseMatrix s A, float* norm)

ElError ElFrobeniusNormSparse d(ElConstSparseMatrix d A, double* norm)

ElError ElFrobeniusNormSparse c(ElConstSparseMatrix c A, float* norm)

ElError ElFrobeniusNormSparse z(ElConstSparseMatrix z A, double* norm)

ElError ElFrobeniusNormDistSparse s(ElConstDistSparseMatrix s A, float* norm)

ElError ElFrobeniusNormDistSparse d(ElConstDistSparseMatrix d A, double* norm)

ElError ElFrobeniusNormDistSparse c(ElConstDistSparseMatrix c A, float* norm)

ElError ElFrobeniusNormDistSparse z(ElConstDistSparseMatrix z A, double* norm)

ElError ElFrobeniusNormDistMultiVec s(ElConstDistMultiVec s A, float* norm)

ElError ElFrobeniusNormDistMultiVec d(ElConstDistMultiVec d A, double* norm)

352 Chapter 5. LAPACK-like linear algebra

Page 357: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElFrobeniusNormDistMultiVec c(ElConstDistMultiVec c A, float* norm)

ElError ElFrobeniusNormDistMultiVec z(ElConstDistMultiVec z A, double* norm)

ElError ElSymmetricFrobeniusNorm s(ElUpperOrLower uplo, ElConstMatrix s A,float* norm)

ElError ElSymmetricFrobeniusNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricFrobeniusNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElSymmetricFrobeniusNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElSymmetricFrobeniusNormDist s(ElUpperOrLower uplo, ElConstDistMa-trix s A, float* norm)

ElError ElSymmetricFrobeniusNormDist d(ElUpperOrLower uplo, ElConstDistMa-trix d A, double* norm)

ElError ElSymmetricFrobeniusNormDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float* norm)

ElError ElSymmetricFrobeniusNormDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double* norm)

ElError ElHermitianFrobeniusNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElHermitianFrobeniusNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElHermitianFrobeniusNormDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float* norm)

ElError ElHermitianFrobeniusNormDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double* norm)

Python APIFrobeniusNorm(A)

HermitianFrobeniusNorm(A, uplo=LOWER)

SymmetricFrobeniusNorm(A, uplo=LOWER)

Ky-Fan norms

Header file

Implementation

The following routines compute the sum of the largest k singular values.

C++ APIBase<F> KyFanNorm(const Matrix<F> &A, Int k)Base<F> KyFanNorm(const AbstractDistMatrix<F> &A, Int k)

Base<F> SymmetricKyFanNorm(UpperOrLower uplo, const Matrix<F> &A, Int k)

5.5. Matrix properties 353

Page 358: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Base<F> SymmetricKyFanNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A,Int k)

Base<F> HermitianKyFanNorm(UpperOrLower uplo, const Matrix<F> &A, Int k)

Base<F> HermitianKyFanNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A,Int k)

C APIElError ElKyFanNorm s(ElConstMatrix s A, ElInt k, float* norm)

ElError ElKyFanNorm d(ElConstMatrix d A, ElInt k, double* norm)

ElError ElKyFanNorm c(ElConstMatrix c A, ElInt k, float* norm)

ElError ElKyFanNorm z(ElConstMatrix z A, ElInt k, double* norm)

ElError ElKyFanNormDist s(ElConstDistMatrix s A, ElInt k, float* norm)

ElError ElKyFanNormDist d(ElConstDistMatrix d A, ElInt k, double* norm)

ElError ElKyFanNormDist c(ElConstDistMatrix c A, ElInt k, float* norm)

ElError ElKyFanNormDist z(ElConstDistMatrix z A, ElInt k, double* norm)

ElError ElSymmetricKyFanNorm s(ElUpperOrLower uplo, ElConstMatrix s A, ElInt k,float* norm)

ElError ElSymmetricKyFanNorm d(ElUpperOrLower uplo, ElConstMatrix d A, ElInt k,double* norm)

ElError ElSymmetricKyFanNorm c(ElUpperOrLower uplo, ElConstMatrix c A, ElInt k,float* norm)

ElError ElSymmetricKyFanNorm z(ElUpperOrLower uplo, ElConstMatrix z A, ElInt k, dou-ble* norm)

ElError ElSymmetricKyFanNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,ElInt k, float* norm)

ElError ElSymmetricKyFanNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A,ElInt k, double* norm)

ElError ElSymmetricKyFanNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,ElInt k, float* norm)

ElError ElSymmetricKyFanNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,ElInt k, double* norm)

ElError ElHermitianKyFanNorm c(ElUpperOrLower uplo, ElConstMatrix c A, ElInt k,float* norm)

ElError ElHermitianKyFanNorm z(ElUpperOrLower uplo, ElConstMatrix z A, ElInt k, dou-ble* norm)

ElError ElHermitianKyFanNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,ElInt k, float* norm)

ElError ElHermitianKyFanNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,ElInt k, double* norm)

Python API TODO

354 Chapter 5. LAPACK-like linear algebra

Page 359: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Infinity norms

Header file

Implementation

The following routines compute the maximum ℓ1 norm of the rows of A. In the symmetric andHermitian cases, this is equivalent to the ‖ · ‖1 norm.

C++ APIBase<F> InfinityNorm(const Matrix<F> &A)

Base<F> InfinityNorm(const AbstractDistMatrix<F> &A)

Base<F> SymmetricInfinityNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> SymmetricInfinityNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

Base<F> HermitianInfinityNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HermitianInfinityNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

C APIElError ElInfinityNorm s(ElConstMatrix s A, float* norm)

ElError ElInfinityNorm d(ElConstMatrix d A, double* norm)

ElError ElInfinityNorm c(ElConstMatrix c A, float* norm)

ElError ElInfinityNorm z(ElConstMatrix z A, double* norm)

ElError ElInfinityNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElInfinityNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElInfinityNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElInfinityNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElSymmetricInfinityNorm s(ElUpperOrLower uplo, ElConstMatrix s A,float* norm)

ElError ElSymmetricInfinityNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricInfinityNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElSymmetricInfinityNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElSymmetricInfinityNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* norm)

ElError ElSymmetricInfinityNormDist d(ElUpperOrLower uplo, ElConstDistMa-trix d A, double* norm)

ElError ElSymmetricInfinityNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElSymmetricInfinityNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,double* norm)

5.5. Matrix properties 355

Page 360: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianInfinityNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElHermitianInfinityNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElHermitianInfinityNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElHermitianInfinityNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,double* norm)

Python APIInfinityNorm(A)

HermitianInfinityNorm(A, uplo=LOWER)

SymmetricInfinityNorm(A, uplo=LOWER)

Max norm

Header file

Implementation

The following routines compute the maximum absolute value of the matrix entries.

C++ APIBase<T> MaxNorm(const Matrix<T> &A)

Base<T> MaxNorm(const AbstractDistMatrix<T> &A)

Base<T> MaxNorm(const SparseMatrix<T> &A)

Base<T> MaxNorm(const DistSparseMatrix<T> &A)

Base<T> SymmetricMaxNorm(UpperOrLower uplo, const Matrix<T> &A)

Base<T> SymmetricMaxNorm(UpperOrLower uplo, const AbstractDistMatrix<T> &A)

Base<T> SymmetricMaxNorm(UpperOrLower uplo, const SparseMatrix<T> &A)

Base<T> SymmetricMaxNorm(UpperOrLower uplo, const DistSparseMatrix<T> &A)

Base<T> HermitianMaxNorm(UpperOrLower uplo, const Matrix<T> &A)

Base<T> HermitianMaxNorm(UpperOrLower uplo, const AbstractDistMatrix<T> &A)

Base<T> HermitianMaxNorm(UpperOrLower uplo, const SparseMatrix<T> &A)

Base<T> HermitianMaxNorm(UpperOrLower uplo, const DistSparseMatrix<T> &A)

C APIElError ElMaxNorm i(ElConstMatrix i A, ElInt* norm)

ElError ElMaxNorm s(ElConstMatrix s A, float* norm)

ElError ElMaxNorm d(ElConstMatrix d A, double* norm)

ElError ElMaxNorm c(ElConstMatrix c A, float* norm)

ElError ElMaxNorm z(ElConstMatrix z A, double* norm)

356 Chapter 5. LAPACK-like linear algebra

Page 361: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMaxNormDist i(ElConstDistMatrix i A, ElInt* norm)

ElError ElMaxNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElMaxNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElMaxNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElMaxNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElSymmetricMaxNorm i(ElUpperOrLower uplo, ElConstMatrix i A, ElInt* norm)

ElError ElSymmetricMaxNorm s(ElUpperOrLower uplo, ElConstMatrix s A, float* norm)

ElError ElSymmetricMaxNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricMaxNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

ElError ElSymmetricMaxNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

ElError ElSymmetricMaxNormDist i(ElUpperOrLower uplo, ElConstDistMatrix i A,ElInt* norm)

ElError ElSymmetricMaxNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* norm)

ElError ElSymmetricMaxNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, dou-ble* norm)

ElError ElSymmetricMaxNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElSymmetricMaxNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

ElError ElHermitianMaxNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

ElError ElHermitianMaxNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

ElError ElHermitianMaxNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElHermitianMaxNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

Python API TODO

Nuclear norms

Header file

Implementation

The following routines compute the sum of the singular values. This is equivalent to both theKyFan norm with k = n and the Schatten norm with p = 1. Note that the nuclear norm is dualto the two-norm, which is the Schatten norm with p = ∞.

5.5. Matrix properties 357

Page 362: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ APIBase<F> NuclearNorm(const Matrix<F> &A)

Base<F> NuclearNorm(const AbstractDistMatrix<F> &A)

Base<F> SymmetricNuclearNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> SymmetricNuclearNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

Base<F> HermitianNuclearNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HermitianNuclearNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A)

C APIElError ElNuclearNorm s(ElConstMatrix s A, float* norm)

ElError ElNuclearNorm d(ElConstMatrix d A, double* norm)

ElError ElNuclearNorm c(ElConstMatrix c A, float* norm)

ElError ElNuclearNorm z(ElConstMatrix z A, double* norm)

ElError ElNuclearNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElNuclearNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElNuclearNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElNuclearNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElSymmetricNuclearNorm s(ElUpperOrLower uplo, ElConstMatrix s A,float* norm)

ElError ElSymmetricNuclearNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricNuclearNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElSymmetricNuclearNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElSymmetricNuclearNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* norm)

ElError ElSymmetricNuclearNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A,double* norm)

ElError ElSymmetricNuclearNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElSymmetricNuclearNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,double* norm)

ElError ElHermitianNuclearNorm c(ElUpperOrLower uplo, ElConstMatrix c A,float* norm)

ElError ElHermitianNuclearNorm z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble* norm)

ElError ElHermitianNuclearNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElHermitianNuclearNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A,double* norm)

358 Chapter 5. LAPACK-like linear algebra

Page 363: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API TODO

One norms

Header file

Implementation

The following routines compute the maximum ℓ1 norm of the columns of A. In the symmetricand Hermitian cases, this is equivalent to the ‖ · ‖∞ norm.

C++ APIBase<F> OneNorm(const Matrix<F> &A)

Base<F> OneNorm(const AbstractDistMatrix<F> &A)

Base<F> SymmetricOneNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> SymmetricOneNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A)

Base<F> HermitianOneNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HermitianOneNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A)

C APIElError ElOneNorm s(ElConstMatrix s A, float* norm)

ElError ElOneNorm d(ElConstMatrix d A, double* norm)

ElError ElOneNorm c(ElConstMatrix c A, float* norm)

ElError ElOneNorm z(ElConstMatrix z A, double* norm)

ElError ElOneNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElOneNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElOneNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElOneNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElSymmetricOneNorm s(ElUpperOrLower uplo, ElConstMatrix s A, float* norm)

ElError ElSymmetricOneNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricOneNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

ElError ElSymmetricOneNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

ElError ElSymmetricOneNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* norm)

ElError ElSymmetricOneNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, dou-ble* norm)

ElError ElSymmetricOneNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElSymmetricOneNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

ElError ElHermitianOneNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

5.5. Matrix properties 359

Page 364: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianOneNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

ElError ElHermitianOneNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElHermitianOneNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

Python API TODO

Schatten norms

Header file

Implementations

The following routines compute the ℓp norm of the singular values.

C++ APIBase<F> SchattenNorm(const Matrix<F> &A, Base<F> p)Base<F> SchattenNorm(const AbstractDistMatrix<F> &A, Base<F> p)

Base<F> SymmetricSchattenNorm(UpperOrLower uplo, const Matrix<F> &A, Base<F>p)

Base<F> SymmetricSchattenNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> p)

Base<F> HermitianSchattenNorm(UpperOrLower uplo, const Matrix<F> &A, Base<F>p)

Base<F> HermitianSchattenNorm(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> p)

C APIElError ElSchattenNorm s(ElConstMatrix s A, float p, float* norm)

ElError ElSchattenNorm d(ElConstMatrix d A, double p, double* norm)

ElError ElSchattenNorm c(ElConstMatrix c A, float p, float* norm)

ElError ElSchattenNorm z(ElConstMatrix z A, double p, double* norm)

ElError ElSchattenNormDist s(ElConstDistMatrix s A, float p, float* norm)

ElError ElSchattenNormDist d(ElConstDistMatrix d A, double p, double* norm)

ElError ElSchattenNormDist c(ElConstDistMatrix c A, float p, float* norm)

ElError ElSchattenNormDist z(ElConstDistMatrix z A, double p, double* norm)

Python API TODO

360 Chapter 5. LAPACK-like linear algebra

Page 365: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Two norms

Header file

Implementation

The following routines compute the maximum singular value. This is equivalent to the KyFannorm with k equal to one and the Schatten norm with p = ∞.

C++ APIBase<F> TwoNorm(const Matrix<F> &A)

Base<F> TwoNorm(const AbstractDistMatrix<F> &A)

Base<F> SymmetricTwoNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> SymmetricTwoNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A)

Base<F> HermitianTwoNorm(UpperOrLower uplo, const Matrix<F> &A)

Base<F> HermitianTwoNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A)

C APIElError ElTwoNorm s(ElConstMatrix s A, float* norm)

ElError ElTwoNorm d(ElConstMatrix d A, double* norm)

ElError ElTwoNorm c(ElConstMatrix c A, float* norm)

ElError ElTwoNorm z(ElConstMatrix z A, double* norm)

ElError ElTwoNormDist s(ElConstDistMatrix s A, float* norm)

ElError ElTwoNormDist d(ElConstDistMatrix d A, double* norm)

ElError ElTwoNormDist c(ElConstDistMatrix c A, float* norm)

ElError ElTwoNormDist z(ElConstDistMatrix z A, double* norm)

ElError ElSymmetricTwoNorm s(ElUpperOrLower uplo, ElConstMatrix s A, float* norm)

ElError ElSymmetricTwoNorm d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble* norm)

ElError ElSymmetricTwoNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

ElError ElSymmetricTwoNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

ElError ElSymmetricTwoNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A,float* norm)

ElError ElSymmetricTwoNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, dou-ble* norm)

ElError ElSymmetricTwoNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElSymmetricTwoNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

ElError ElHermitianTwoNorm c(ElUpperOrLower uplo, ElConstMatrix c A, float* norm)

ElError ElHermitianTwoNorm z(ElUpperOrLower uplo, ElConstMatrix z A, double* norm)

5.5. Matrix properties 361

Page 366: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHermitianTwoNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A,float* norm)

ElError ElHermitianTwoNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, dou-ble* norm)

Python API TODO

Two-norm estimates

Header file

Implementation

The following routines return an estimate for the two-norm which should be accurate withina factor of n times the specified tolerance.

C++ APIBase<F> TwoNormEstimate(const Matrix<F> &A, Base<F> tol = 1e-6, Int maxIts = 1000)Base<F> TwoNormEstimate(const AbstractDistMatrix<F> &A, Base<F> tol = 1e-6, Int

maxIts = 1000)Base<F> SymmetricTwoNormEstimate(UpperOrLower uplo, const Matrix<F> &A,

Base<F> tol = 1e-6, Int maxIts = 1000)

Base<F> SymmetricTwoNormEstimate(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> tol = 1e-6, Int maxIts = 1000)

Base<F> HermitianTwoNormEstimate(UpperOrLower uplo, const Matrix<F> &A,Base<F> tol = 1e-6, Int maxIts = 1000)

Base<F> HermitianTwoNormEstimate(UpperOrLower uplo, const AbstractDistMatrix<F>&A, Base<F> tol = 1e-6, Int maxIts = 1000)

C APIElError ElTwoNormEstimate s(ElConstMatrix s A, float tol, ElInt maxIts)ElError ElTwoNormEstimate d(ElConstMatrix d A, double tol, ElInt maxIts)

ElError ElTwoNormEstimate c(ElConstMatrix c A, float tol, ElInt maxIts)

ElError ElTwoNormEstimate z(ElConstMatrix z A, double tol, ElInt maxIts)

ElError ElTwoNormEstimateDist s(ElConstDistMatrix s A, float tol, ElInt maxIts)

ElError ElTwoNormEstimateDist d(ElConstDistMatrix d A, double tol, ElInt maxIts)

ElError ElTwoNormEstimateDist c(ElConstDistMatrix c A, float tol, ElInt maxIts)

ElError ElTwoNormEstimateDist z(ElConstDistMatrix z A, double tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimate s(ElUpperOrLower uplo, ElConstMatrix s A,float tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimate d(ElUpperOrLower uplo, ElConstMatrix d A, dou-ble tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimate c(ElUpperOrLower uplo, ElConstMatrix c A,float tol, ElInt maxIts)

362 Chapter 5. LAPACK-like linear algebra

Page 367: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSymmetricTwoNormEstimate z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimateDist s(ElUpperOrLower uplo, ElConstDistMa-trix s A, float tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimateDist d(ElUpperOrLower uplo, ElConstDistMa-trix d A, double tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimateDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float tol, ElInt maxIts)

ElError ElSymmetricTwoNormEstimateDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double tol, ElInt maxIts)

ElError ElHermitianTwoNormEstimate c(ElUpperOrLower uplo, ElConstMatrix c A,float tol, ElInt maxIts)

ElError ElHermitianTwoNormEstimate z(ElUpperOrLower uplo, ElConstMatrix z A, dou-ble tol, ElInt maxIts)

ElError ElHermitianTwoNormEstimateDist c(ElUpperOrLower uplo, ElConstDistMa-trix c A, float tol, ElInt maxIts)

ElError ElHermitianTwoNormEstimateDist z(ElUpperOrLower uplo, ElConstDistMa-trix z A, double tol, ElInt maxIts)

Python API TODO

Zero norms

Header file

Implementation

The following routines return the number of nonzero entries in the matrix. This operation isoften casually referred to as the zero “norm”.

C++ APIInt ZeroNorm(const Matrix<T> &A)

Int ZeroNorm(const AbstractDistMatrix<T> &A)

C APIElError ElZeroNorm i(ElConstMatrix i, ElInt* numNonzero)ElError ElZeroNorm s(ElConstMatrix s, ElInt* numNonzero)

ElError ElZeroNorm d(ElConstMatrix d, ElInt* numNonzero)

ElError ElZeroNorm c(ElConstMatrix c, ElInt* numNonzero)

ElError ElZeroNorm z(ElConstMatrix z, ElInt* numNonzero)

ElError ElZeroNormDist i(ElConstDistMatrix i, ElInt* numNonzero)

ElError ElZeroNormDist s(ElConstDistMatrix s, ElInt* numNonzero)

ElError ElZeroNormDist d(ElConstDistMatrix d, ElInt* numNonzero)

ElError ElZeroNormDist c(ElConstDistMatrix c, ElInt* numNonzero)

5.5. Matrix properties 363

Page 368: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElZeroNormDist z(ElConstDistMatrix z, ElInt* numNonzero)

Python API TODO

Vanilla interface

Header file

Implementation

The following routines can return either ‖A‖1, ‖A‖∞, ‖A‖F (the Frobenius norm), the maxi-mum entrywise norm, ‖A‖2, or ‖A‖* (the nuclear/trace norm) of fully-populated matrices.

C++ API

Base<F> Norm(const Matrix<F> &A, NormType type = FROBENIUS NORM)

Base<F> Norm(const AbstractDistMatrix<F> &A, NormType type = FROBENIUS NORM)

Base<F> SymmetricNorm(UpperOrLower uplo, const Matrix<F> &A, NormType type =FROBENIUS NORM)

Base<F> SymmetricNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A, Norm-Type type = FROBENIUS NORM)

Base<F> HermitianNorm(UpperOrLower uplo, const Matrix<F> &A, NormType type =FROBENIUS NORM)

Base<F> HermitianNorm(UpperOrLower uplo, const AbstractDistMatrix<F> &A, Norm-Type type = FROBENIUS NORM)

C API

ElError ElNorm s(ElConstMatrix s A, ElNormType type, float* norm)

ElError ElNorm d(ElConstMatrix d A, ElNormType type, double* norm)

ElError ElNorm c(ElConstMatrix c A, ElNormType type, float* norm)

ElError ElNorm z(ElConstMatrix z A, ElNormType type, double* norm)

ElError ElNormDist s(ElConstDistMatrix s A, ElNormType type, float* norm)

ElError ElNormDist d(ElConstDistMatrix d A, ElNormType type, double* norm)

ElError ElNormDist c(ElConstDistMatrix c A, ElNormType type, float* norm)

ElError ElNormDist z(ElConstDistMatrix z A, ElNormType type, double* norm)

ElError ElSymmetricNorm s(ElUpperOrLower uplo, ElConstMatrix s A, ElNormType type,float* norm)

ElError ElSymmetricNorm d(ElUpperOrLower uplo, ElConstMatrix d A, ElNormType type,double* norm)

ElError ElSymmetricNorm c(ElUpperOrLower uplo, ElConstMatrix c A, ElNormType type,float* norm)

364 Chapter 5. LAPACK-like linear algebra

Page 369: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSymmetricNorm z(ElUpperOrLower uplo, ElConstMatrix z A, ElNormType type,double* norm)

ElError ElSymmetricNormDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElNorm-Type type, float* norm)

ElError ElSymmetricNormDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElNorm-Type type, double* norm)

ElError ElSymmetricNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElNorm-Type type, float* norm)

ElError ElSymmetricNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElNorm-Type type, double* norm)

ElError ElHermitianNorm c(ElUpperOrLower uplo, ElConstMatrix c A, ElNormType type,float* norm)

ElError ElHermitianNorm z(ElUpperOrLower uplo, ElConstMatrix z A, ElNormType type,double* norm)

ElError ElHermitianNormDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElNorm-Type type, float* norm)

ElError ElHermitianNormDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElNorm-Type type, double* norm)

Python API

Norm(A, normType=FROBENIUS NORM)

HermitianNorm(A, uplo=LOWER, normType=FROBENIUS NORM)

SymmetricNorm(A, conjugate=False, uplo=LOWER, normType=FROBENIUS NORM)

5.5.5 Trace

The two equally useful definitions of the trace of a square matrix A ∈ Fn×n are

tr(A) =n−1

∑i=0

A(i, i) =n−1

∑i=0

λi,

where λi is the i’th eigenvalue (counting multiplicity) of A.

Clearly the former equation is easier to compute, but the latter is an important characterization.

Python API

TODO

C++ API

T Trace(const Matrix<T> &A)

T Trace(const AbstractDistMatrix<T> &A)

5.5. Matrix properties 365

Page 370: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElTrace i(ElConstMatrix i A, ElInt* trace)

ElError ElTrace s(ElConstMatrix s A, float* trace)

ElError ElTrace d(ElConstMatrix d A, double* trace)

ElError ElTrace c(ElConstMatrix c A, complex float* trace)

ElError ElTrace z(ElConstMatrix z A, complex double* trace)

ElError ElTraceDist i(ElConstDistMatrix i A, ElInt* trace)

ElError ElTraceDist s(ElConstDistMatrix s A, float* trace)

ElError ElTraceDist d(ElConstDistMatrix d A, double* trace)

ElError ElTraceDist c(ElConstDistMatrix c A, complex float* trace)

ElError ElTraceDist z(ElConstDistMatrix z A, complex double* trace)

References

C++11 implementation

C++11 header

C99 wrapper

C99 header

Python wrapper

5.6 Linear solvers

5.6.1 Linear solve

Implementation

Solves AX = B for X given a general square nonsingular matrix A and right-hand side matrixB. In all cases, on exit, the following routines overwrite B with inv(A)B.

Dense algorithm

For dense matrices, the solution is computed through Gaussian elimination with partial pivot-ing.

Sparse-direct algorithm

For sparse matrices, the original problem is embedded into the augmented system(αI AAH 0

)(R/α

X

)=

(B0

),

366 Chapter 5. LAPACK-like linear algebra

Page 371: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

where α ≈ σmin(A) is known to be near-optimal with respect to minimizing the conditionnumber of the augmented system. A priori regularization is added to the linear system, asparse-direct Cholesky-like factorization is performed, and the factorization is used as a pre-conditioner for Flexible GMRES.

It is worth noting that this is a special case of LeastSquares() , and that, unlike cases where Ais not invertible, it is possible for LinearSolve() to choose α = 0.

Python API

LinearSolve(A, B[, ctrl=None])Parameters

• A – Dense or sparse matrix to solve against

• B – Right-hand sides (which will be overwritten with the solution).

• ctrl – (optional) sparse-direct Least Squares control structure

Type of A Type of BMatrix Matrix

AbstractDistMatrix AbstractDistMatrix

SparseMatrix Matrix

DistSparseMatrix DistMultiVec

C++ API

void LinearSolve(const Matrix<F> &A, Matrix<F> &B)

void LinearSolve(const AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B)

void LinearSolve(const SparseMatrix<F> &A, Matrix<F> &B, const LeastSquaresC-trl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

void LinearSolve(const DistSparseMatrix<F> &A, DistMultiVec<F> &B, const Least-SquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

Dense in-place alternatives

The following routines factor A in place.

lin solve::Overwrite(Matrix<F> &A, Matrix<F> &B)

lin solve::Overwrite(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B)

C API

Standard interface

Single-precisionElError ElLinearSolve s(ElConstMatrix s A, ElMatrix s B)ElError ElLinearSolveDist s(ElConstDistMatrix s A, ElDistMatrix s B)

5.6. Linear solvers 367

Page 372: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLinearSolveSparse s(ElConstSparseMatrix s A, ElMatrix s B)

ElError ElLinearSolveDistSparse s(ElConstDistSparseMatrix s A, ElDistMulti-Vec s B)

Double-precisionElError ElLinearSolve d(ElConstMatrix d A, ElMatrix d B)ElError ElLinearSolveDist d(ElConstDistMatrix d A, ElDistMatrix d B)

ElError ElLinearSolveSparse d(ElConstSparseMatrix d A, ElMatrix d B)

ElError ElLinearSolveDistSparse d(ElConstDistSparseMatrix d A, ElDistMulti-Vec d B)

Single-precision complexElError ElLinearSolve c(ElConstMatrix c A, ElMatrix c B)ElError ElLinearSolveDist c(ElConstDistMatrix c A, ElDistMatrix c B)

ElError ElLinearSolveSparse c(ElConstSparseMatrix c A, ElMatrix c B)

ElError ElLinearSolveDistSparse c(ElConstDistSparseMatrix c A, ElDistMulti-Vec c B)

Double-precision complexElError ElLinearSolve z(ElConstMatrix z A, ElMatrix z B)ElError ElLinearSolveDist z(ElConstDistMatrix z A, ElDistMatrix z B)

ElError ElLinearSolveSparse z(ElConstSparseMatrix z A, ElMatrix z B)

ElError ElLinearSolveDistSparse z(ElConstDistSparseMatrix z A, ElDistMulti-Vec z B)

Expert versions

Single-precisionElError ElLinearSolveXSparse s(ElConstSparseMatrix s A, ElMatrix s B, ElLeast-

SquaresCtrl s ctrl)ElError ElLinearSolveXDistSparse s(ElConstDistSparseMatrix s A, ElDistMulti-

Vec s B, ElLeastSquaresCtrl s ctrl)

Double-precisionElError ElLinearSolveXSparse d(ElConstSparseMatrix d A, ElMatrix d B, ElLeast-

SquaresCtrl d ctrl)ElError ElLinearSolveXDistSparse d(ElConstDistSparseMatrix d A, ElDistMulti-

Vec d B, ElLeastSquaresCtrl d ctrl)

Single-precision complexElError ElLinearSolveXSparse c(ElConstSparseMatrix c A, ElMatrix c B, ElLeast-

SquaresCtrl s ctrl)ElError ElLinearSolveXDistSparse c(ElConstDistSparseMatrix c A, ElDistMulti-

Vec c B, ElLeastSquaresCtrl s ctrl)

368 Chapter 5. LAPACK-like linear algebra

Page 373: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision complexElError ElLinearSolveXSparse z(ElConstSparseMatrix z A, ElMatrix z B, ElLeast-

SquaresCtrl d ctrl)ElError ElLinearSolveXDistSparse z(ElConstDistSparseMatrix z A, ElDistMulti-

Vec z B, ElLeastSquaresCtrl d ctrl)

5.6.2 Symmetric solve

Implementation

Solve AX = B, ATX = B, or AHX = B for X given a Hermitian matrix A and a right-handside matrix B. When A is dense, the default algorithm is Bunch-Kaufman, whereas, when Ais sparse, the default approach embeds the problem in the same manner as LinearSolve() ,though it is possible to override this behaviour and attempt a sparse LDL factorization whichonly dynamically pivots within supernodes.

Note: Only the lower-triangular storage case (uplo=LOWER) is supported by the followingroutines.

Python API

SymmetricSolve(A, B[, tryLDL=False, conjugate=False, uplo=LOWER, orient=NORMAL])Parameters

• A – Dense or sparse symmetric matrix to solve against

• B – Right-hand sides (which will be overwritten with the solution).

• tryLDL – (optional) if a sparse LDLT or LDLH factorization withoutpivoting should be attempted instead of embedding in a QSD system

• conjugate – (optional) whether the matrix is equal to its transpose orconjugate-transpose

• uplo – (optional) which triangle the data is explicitly stored in

• orient – (optional) whether to use A, AT, or AH

Type of A Type of BMatrix Matrix

AbstractDistMatrix AbstractDistMatrix

SparseMatrix Matrix

DistSparseMatrix DistMultiVec

C++ API

void SymmetricSolve(UpperOrLower uplo, Orientation orientation, const Matrix<F>&A, Matrix<F> &B, bool conjugate = false, const LDLPivotC-trl<Base<F>> &ctrl = LDLPivotCtrl<Base<F>>())

5.6. Linear solvers 369

Page 374: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void SymmetricSolve(UpperOrLower uplo, Orientation orientation, const AbstractDist-Matrix<F> &A, AbstractDistMatrix<F> &B, bool conjugate= false, const LDLPivotCtrl<Base<F>> &ctrl = LDLPivotC-trl<Base<F>>())

void SymmetricSolve(const SparseMatrix<F> &A, Matrix<F> &B, bool conjugate = false,bool tryLDL = false, const BisectCtrl &ctrl = BisectCtrl())

void SymmetricSolve(const DistSparseMatrix<F> &A, DistMultiVec<F> &B, bool conju-gate = false, bool tryLDL = false, const BisectCtrl &ctrl = BisectC-trl())

Dense versions which factor in-place

void symm solve::Overwrite(UpperOrLower uplo, Orientation orientation, Matrix<F>&A, Matrix<F> &B, bool conjugate = false, const LDLPiv-otCtrl<Base<F>> &ctrl = LDLPivotCtrl<Base<F>>())

void symm solve::Overwrite(UpperOrLower uplo, Orientation orientation, AbstractDist-Matrix<F> &A, AbstractDistMatrix<F> &B, bool con-jugate = false, const LDLPivotCtrl<Base<F>> &ctrl =LDLPivotCtrl<Base<F>>())

C API

Single-precision

ElError ElSymmetricSolve s(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix s A, ElMatrix s B)

ElError ElSymmetricSolveDist s(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix s A, ElDistMatrix s B)

ElError ElSymmetricSolveSparse s(ElConstSparseMatrix s A, ElMatrix s B,bool tryLDL)

ElError ElSymmetricSolveDistSparse s(ElConstDistSparseMatrix s A, ElDistMulti-Vec s B, bool tryLDL)

Double-precision

ElError ElSymmetricSolve d(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix d A, ElMatrix d B)

ElError ElSymmetricSolveDist d(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix d A, ElDistMatrix d B)

ElError ElSymmetricSolveSparse d(ElConstSparseMatrix d A, ElMatrix d B,bool tryLDL)

ElError ElSymmetricSolveDistSparse d(ElConstDistSparseMatrix d A, ElDistMulti-Vec d B, bool tryLDL)

370 Chapter 5. LAPACK-like linear algebra

Page 375: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Single-precision complex

ElError ElSymmetricSolve c(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix c A, ElMatrix c B)

ElError ElSymmetricSolveDist c(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix c A, ElDistMatrix c B)

ElError ElSymmetricSolveSparse c(ElConstSparseMatrix c A, ElMatrix c B,bool tryLDL)

ElError ElSymmetricSolveDistSparse c(ElConstDistSparseMatrix c A, ElDistMulti-Vec c B, bool tryLDL)

Double-precision complex

ElError ElSymmetricSolve z(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix z A, ElMatrix z B)

ElError ElSymmetricSolveDist z(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix z A, ElDistMatrix z B)

ElError ElSymmetricSolveSparse z(ElConstSparseMatrix z A, ElMatrix z B,bool tryLDL)

ElError ElSymmetricSolveDistSparse z(ElConstDistSparseMatrix z A, ElDistMulti-Vec z B, bool tryLDL)

5.6.3 Hermitian solve

Implementation

Solve AX = B, ATX = B, or AHX = B for X given a Hermitian matrix A and a right-handside matrix B. When A is dense, the default algorithm is Bunch-Kaufman, whereas, when Ais sparse, the default approach embeds the problem in the same manner as LinearSolve() ,though it is possible to override this behaviour and attempt a sparse LDLH factorization whichonly dynamically pivots within supernodes.

Note: Only the lower-triangular storage case (uplo=LOWER) is supported by the followingroutines.

Python API

HermitianSolve(A, B[, tryLDL=False, uplo=LOWER, orient=NORMAL])Parameters

• A – Dense or sparse Hermitian matrix to solve against

• B – Right-hand sides (which will be overwritten with the solution).

• tryLDL – (optional) if a sparse LDLH factorization without pivotingshould be attempted instead of embedding in a QSD system

• uplo – (optional) which triangle the data is explicitly stored in

5.6. Linear solvers 371

Page 376: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

• orient – (optional) whether to use A, AT, or AH

Type of A Type of BMatrix Matrix

AbstractDistMatrix AbstractDistMatrix

SparseMatrix Matrix

DistSparseMatrix DistMultiVec

C++ API

void HermitianSolve(UpperOrLower uplo, Orientation orientation, const Matrix<F>&A, Matrix<F> &B, bool conjugate = false, const LDLPivotC-trl<Base<F>> &ctrl = LDLPivotCtrl<Base<F>>())

void HermitianSolve(UpperOrLower uplo, Orientation orientation, const AbstractDist-Matrix<F> &A, AbstractDistMatrix<F> &B, bool conjugate= false, const LDLPivotCtrl<Base<F>> &ctrl = LDLPivotC-trl<Base<F>>())

void HermitianSolve(const SparseMatrix<F> &A, Matrix<F> &B, bool tryLDL = false,const BisectCtrl &ctrl = BisectCtrl())

void HermitianSolve(const DistSparseMatrix<F> &A, DistMultiVec<F> &B, booltryLDL = false, const BisectCtrl &ctrl = BisectCtrl())

Dense versions which factor in-place

void herm solve::Overwrite(UpperOrLower uplo, Orientation orientation, const Ma-trix<F> &A, Matrix<F> &B, bool conjugate = false,const LDLPivotCtrl<Base<F>> &ctrl = LDLPivotC-trl<Base<F>>())

void herm solve::Overwrite(UpperOrLower uplo, Orientation orientation, const Abstract-DistMatrix<F> &A, AbstractDistMatrix<F> &B, bool con-jugate = false, const LDLPivotCtrl<Base<F>> &ctrl =LDLPivotCtrl<Base<F>>())

C API

Single-precision complex

ElError ElHermitianSolve c(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix c A, ElMatrix c B)

ElError ElHermitianSolveDist c(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix c A, ElDistMatrix c B)

ElError ElHermitianSolveSparse c(ElConstSparseMatrix c A, ElMatrix c B,bool tryLDL)

ElError ElHermitianSolveDistSparse c(ElConstDistSparseMatrix c A, ElDistMulti-Vec c B, bool tryLDL)

372 Chapter 5. LAPACK-like linear algebra

Page 377: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision complex

ElError ElHermitianSolve z(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix z A, ElMatrix z B)

ElError ElHermitianSolveDist z(ElUpperOrLower uplo, ElOrientation orientation, ElCon-stDistMatrix z A, ElDistMatrix z B)

ElError ElHermitianSolveSparse z(ElConstSparseMatrix z A, ElMatrix z B,bool tryLDL)

ElError ElHermitianSolveDistSparse z(ElConstDistSparseMatrix z A, ElDistMulti-Vec z B, bool tryLDL)

5.6.4 HPD solve

Implementation

Solves AX = B, ATX = B, or AHX = B for X given Hermitian positive-definite (HPD) Aand right-hand side matrix B (note that these options are all identical except for when A. iscomplex). The solution is computed by first finding the Cholesky factorization of A and thenperforming two successive triangular solves against B.

Note that only the uplo triangle of A is accessed by the below routines.

Python API

HPDSolve(A, B[, uplo=LOWER, orient=NORMAL])Parameters

• A – Dense or sparse HPD matrix to solve against

• B – Right-hand sides (which will be overwritten with the solution).

• uplo – (optional) which triangle the data is explicitly stored in

• orient – (optional) whether to use A, AT, or AH

Type of A Type of BMatrix Matrix

AbstractDistMatrix AbstractDistMatrix

SparseMatrix Matrix

DistSparseMatrix DistMultiVec

C++ API

void HPDSolve(UpperOrLower uplo, Orientation orientation, const Matrix<F> &A, Ma-trix<F> &B)

void HPDSolve(UpperOrLower uplo, Orientation orientation, const AbstractDistMatrix<F>&A, AbstractDistMatrix<F> &B)

void HPDSolve(const SparseMatrix<F> &A, Matrix<F> &B, const BisectCtrl &ctrl = Bi-sectCtrl())

5.6. Linear solvers 373

Page 378: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void HPDSolve(const DistSparseMatrix<F> &A, DistMultiVec<F> &B, const BisectCtrl&ctrl = BisectCtrl())

Dense versions which factor in-place

void hpd solve::Overwrite(UpperOrLower uplo, Orientation orientation, Matrix<F> &A,Matrix<F> &B)

void hpd solve::Overwrite(UpperOrLower uplo, Orientation orientation, AbstractDistMa-trix<F> &A, AbstractDistMatrix<F> &B)

C API

Single-precision

ElError ElHPDSolve s(ElUpperOrLower uplo, ElOrientation orientation, ElConstMatrix s A,ElMatrix s B)

ElError ElHPDSolveDist s(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix s A, ElDistMatrix s B)

ElError ElHPDSolveSparse s(ElConstSparseMatrix s A, ElMatrix s B)

ElError ElHPDSolveDistSparse s(ElConstDistSparseMatrix s A, ElDistMultiVec s B)

Double-precision

ElError ElHPDSolve d(ElUpperOrLower uplo, ElOrientation orientation, ElConstMa-trix d A, ElMatrix d B)

ElError ElHPDSolveDist d(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix d A, ElDistMatrix d B)

ElError ElHPDSolveSparse d(ElConstSparseMatrix d A, ElMatrix d B)

ElError ElHPDSolveDistSparse d(ElConstDistSparseMatrix d A, ElDistMultiVec d B)

Single-precision complex

ElError ElHPDSolve c(ElUpperOrLower uplo, ElOrientation orientation, ElConstMatrix c A,ElMatrix c B)

ElError ElHPDSolveDist c(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix c A, ElDistMatrix c B)

ElError ElHPDSolveSparse c(ElConstSparseMatrix c A, ElMatrix c B)

ElError ElHPDSolveDistSparse c(ElConstDistSparseMatrix c A, ElDistMultiVec c B)

Double-precision complex

ElError ElHPDSolve z(ElUpperOrLower uplo, ElOrientation orientation, ElConstMatrix z A,ElMatrix z B)

374 Chapter 5. LAPACK-like linear algebra

Page 379: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHPDSolveDist z(ElUpperOrLower uplo, ElOrientation orientation, ElConstDist-Matrix z A, ElDistMatrix z B)

ElError ElHPDSolveSparse z(ElConstSparseMatrix z A, ElMatrix z B)

ElError ElHPDSolveDistSparse z(ElConstDistSparseMatrix z A, ElDistMultiVec z B)

5.6.5 Multi-shift Hessenberg solves

Implementation

Solve for X in the system

H#X − XD# = αY

where H is Hessenberg, D is diagonal, and A# is defined to be one of A, AT, AH.

Note: Only a few subcases are currently supported, as this was added as part ofHessenbergPseudospectrum()

Python API

MultiShiftHessSolve(H, shifts, X[, alpha=1, uplo=LOWER, orient=NORMAL])Parameters

• H – Dense Hessenberg matrix to solve against (with shifts)

• shifts – a list of shifts (one per right-hand side) to subtract from thediagonal of H before solving the linear system

• X – the right-hand sides to solve against (and overwrite)

• alpha – (optional) the scaling of the right-hand sides

• uplo – (optional) whether H is lower or upper-Hessenberg

• orient – (optional) whether to solve against H, HT, or HH

C++ API

void MultiShiftHessSolve(UpperOrLower uplo, Orientation orientation, F alpha, constMatrix<F> &H, const Matrix<F> &shifts, Matrix<F> &X)

void MultiShiftHessSolve(UpperOrLower uplo, Orientation orientation, F alpha, constAbstractDistMatrix<F> &H, const AbstractDistMatrix<F>&shifts, AbstractDistMatrix<F> &X)

C API

Single-precision

ElError ElMultiShiftHessSolve s(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstMatrix s H, ElConstMa-trix s shifts, ElMatrix s X)

5.6. Linear solvers 375

Page 380: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElMultiShiftHessSolveDist s(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstDistMatrix s H, ElConstDist-Matrix s shifts, ElDistMatrix s X)

Double-precision

ElError ElMultiShiftHessSolve d(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstMatrix d H, ElConstMa-trix d shifts, ElMatrix d X)

ElError ElMultiShiftHessSolveDist d(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstDistMatrix d H, ElConst-DistMatrix d shifts, ElDistMatrix d X)

Single-precision complex

ElError ElMultiShiftHessSolve c(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstMatrix c H, ElConstMa-trix c shifts, ElMatrix c X)

ElError ElMultiShiftHessSolveDist c(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstDistMatrix c H, ElConstDist-Matrix c shifts, ElDistMatrix c X)

Double-precision complex

ElError ElMultiShiftHessSolve z(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstMatrix z H, ElConstMa-trix z shifts, ElMatrix z X)

ElError ElMultiShiftHessSolveDist z(ElUpperOrLower uplo, ElOrientation orientation,float alpha, ElConstDistMatrix z H, ElConstDist-Matrix z shifts, ElDistMatrix z X)

5.6.6 References

C++ Header

C Header

Python wrapper

5.7 Euclidean minimization

5.7.1 Least Squares

Implementation

376 Chapter 5. LAPACK-like linear algebra

Page 381: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

A Least Squares problem involves the solution of

minX

‖AX − B‖2F

and is applicable for overdetermined (as well as square) linear system. Whenever the systemis underdetermined, it is more appropriate to solve a Minimum Length problem,

minX

‖X‖2F

s.t. AX = B.

Dense algorithm

Elemental solves dense instances of these problems in a straight-forward manner using QRand LQ factorizations, respectively.

Sparse-direct algorithm

Sparse instances are solved via applying a priori regularization to the symmetric quasi-semidefinite augmented systems (

αI AAH 0

)(R/α

X

)=

(B0

)and (

αI AH

A 0

)(XαY

)=

(0B

),

where α should ideally be chosen near σmin(A) in order to minimize the condition number(relative to both the augmented system and the solution for X [Bjorck92] [Bjorck96]). The aug-mented systems are of interest because they have nearby quasi-definite [Vanderbei95] matriceswhich be factored with a Cholesky-like sparse-direct solver (and can therefore be effectivelypreconditioned) [Saunders96].

Lastly, Elemental in fact allows for slight generalizations of the above problems: AT or AH mayalso be used in the above equations rather than only A.

Python API

LeastSquares(A, B[, ctrl=None, orient=NORMAL])

C++ API

void LeastSquares(Orientation orientation, const Matrix<F> &A, const Matrix<F> &B,Matrix<F> &X)

void LeastSquares(Orientation orientation, const AbstractDistMatrix<F> &A, const Ab-stractDistMatrix<F> &B, AbstractDistMatrix<F> &X)

void LeastSquares(Orientation orientation, const SparseMatrix<F> &A, const Ma-trix<F> &B, Matrix<F> &X, const LeastSquaresCtrl<Base<F>>&ctrl = LeastSquaresCtrl<Base<F>>())

5.7. Euclidean minimization 377

Page 382: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void LeastSquares(Orientation orientation, const DistSparseMatrix<F> &A, const Dist-MultiVec<F> &B, DistMultiVec<F> &X, const LeastSquaresC-trl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

Dense versions which overwrite some of the input

void ls::Overwrite(Orientation orientation, Matrix<F> &A, const Matrix<F> &B, Ma-trix<F> &X)

void ls::Overwrite(Orientation orientation, AbstractDistMatrix<F> &A, const Abstract-DistMatrix<F> &B, AbstractDistMatrix<F> &X)

C API

Standard interface

Single-precisionElError ElLeastSquares s(ElOrientation orientation, ElConstMatrix s A, ElConstMa-

trix s B, ElMatrix s X)ElError ElLeastSquaresDist s(ElOrientation orientation, ElConstDistMatrix s A, ElCon-

stDistMatrix s B, ElDistMatrix s X)

ElError ElLeastSquaresSparse s(ElOrientation orientation, ElConstSparseMatrix s A, El-ConstMatrix s B, ElMatrix s X)

ElError ElLeastSquaresDistSparse s(ElOrientation orientation, ElConstDistSparseMa-trix s A, ElConstDistMultiVec s B, ElDistMulti-Vec s X)

Double-precisionElError ElLeastSquares d(ElOrientation orientation, ElConstMatrix d A, ElConstMa-

trix d B, ElMatrix d X)ElError ElLeastSquaresDist d(ElOrientation orientation, ElConstDistMatrix d A, ElCon-

stDistMatrix d B, ElDistMatrix d X)

ElError ElLeastSquaresSparse d(ElOrientation orientation, ElConstSparseMatrix d A,ElConstMatrix d B, ElMatrix d X)

ElError ElLeastSquaresDistSparse d(ElOrientation orientation, ElConstDistSparseMa-trix d A, ElConstDistMultiVec d B, ElDistMulti-Vec d X)

Single-precision complexElError ElLeastSquares c(ElOrientation orientation, ElConstMatrix c A, ElConstMa-

trix c B, ElMatrix c X)ElError ElLeastSquaresDist c(ElOrientation orientation, ElConstDistMatrix c A, ElCon-

stDistMatrix c B, ElDistMatrix c X)

ElError ElLeastSquaresSparse c(ElOrientation orientation, ElConstSparseMatrix c A, El-ConstMatrix c B, ElMatrix c X)

ElError ElLeastSquaresDistSparse c(ElOrientation orientation, ElConstDistSparseMa-trix c A, ElConstDistMultiVec c B, ElDistMulti-Vec c X)

378 Chapter 5. LAPACK-like linear algebra

Page 383: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision complexElError ElLeastSquares z(ElOrientation orientation, ElConstMatrix z A, ElConstMa-

trix z B, ElMatrix z X)ElError ElLeastSquaresDist z(ElOrientation orientation, ElConstDistMatrix z A, ElCon-

stDistMatrix z B, ElDistMatrix z X)

ElError ElLeastSquaresSparse z(ElOrientation orientation, ElConstSparseMatrix z A, El-ConstMatrix z B, ElMatrix z X)

ElError ElLeastSquaresDistSparse z(ElOrientation orientation, ElConstDistSparseMa-trix z A, ElConstDistMultiVec z B, ElDistMulti-Vec z X)

Expert versions

Single-precisionElError ElLeastSquaresXSparse s(ElOrientation orientation, ElConstSparseMatrix s A,

ElConstMatrix s B, ElMatrix s X, ElLeastSquaresC-trl s ctrl)

ElError ElLeastSquaresXDistSparse s(ElOrientation orientation, ElConstDistSparseMa-trix s A, ElConstDistMultiVec s B, ElDistMulti-Vec s X, ElLeastSquaresCtrl s ctrl)

Double-precisionElError ElLeastSquaresXSparse d(ElOrientation orientation, ElConstSparseMatrix d A,

ElConstMatrix d B, ElMatrix d X, ElLeastSquaresC-trl d ctrl)

ElError ElLeastSquaresXDistSparse d(ElOrientation orientation, ElConstDistSparseMa-trix d A, ElConstDistMultiVec d B, ElDistMulti-Vec d X, ElLeastSquaresCtrl d ctrl)

Single-precision complexElError ElLeastSquaresXSparse c(ElOrientation orientation, ElConstSparseMatrix c A,

ElConstMatrix c B, ElMatrix c X, ElLeastSquaresC-trl s ctrl)

ElError ElLeastSquaresXDistSparse c(ElOrientation orientation, ElConstDistSparseMa-trix c A, ElConstDistMultiVec c B, ElDistMulti-Vec c X, ElLeastSquaresCtrl s ctrl)

Double-precision complexElError ElLeastSquaresXSparse z(ElOrientation orientation, ElConstSparseMatrix z A,

ElConstMatrix z B, ElMatrix z X, ElLeastSquaresC-trl d ctrl)

ElError ElLeastSquaresXDistSparse z(ElOrientation orientation, ElConstDistSparseMa-trix z A, ElConstDistMultiVec z B, ElDistMulti-Vec z X, ElLeastSquaresCtrl d ctrl)

5.7. Euclidean minimization 379

Page 384: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.7.2 Tikhonov regularization

Tikhonov regularization involves the solution of either a Regularized Least Squares problem,

minX

‖AX − B‖2F + ‖GX‖2

F,

where G is the regularization matrix, or a Regularized Minimum Length problem

minX,S

‖X‖2F + ‖S‖2

F

s.t. AX + GS = B.

Each of these problems is equivalent to a larger standard Least Squares or Minimum Lengthproblems, i.e.,

minX

∥∥∥∥(AG

)X −

(B0

)∥∥∥∥2

F

or

minXS

∥∥∥∥(X

S

)∥∥∥∥2

F

s.t.(

A G) (X

S

)= B.

Elemental explicitly exploits this equivalence for sparse matrices so that its sparseLeastSquares() solver can be directly leveraged; for dense matrices, the embedding is usedimplicitly to avoid large unncessary memory usage.

Lastly, Elemental in fact allows for slight generalizations of the above problems: AT or AH mayalso be used in the above equations rather than only A.

Python API

Tikhonov(A, B, Gamma[, alg=TIKHONOV CHOLESKY ])

C++ API

type TikhonovAlg

An enum that can take on the values:

•TIKHONOV CHOLESKY: Run a less accurate, but often faster, Cholesky-based algorithm

•TIKHONOV QR: Run a QR-based algorithm

void Tikhonov(Orientation orientation, const Matrix<F> &A, const Matrix<F>&B, const Matrix<F> &Gamma, Matrix<F> &X, TikhonovAlg alg =TIKHONOV CHOLESKY)

void Tikhonov(Orientation orientation, const AbstractDistMatrix<F> &A, const Abstract-DistMatrix<F> &B, const AbstractDistMatrix<F> &Gamma, AbstractDist-Matrix<F> &X, TikhonovAlg alg = TIKHONOV CHOLESKY)

380 Chapter 5. LAPACK-like linear algebra

Page 385: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Tikhonov(Orientation orientation, const SparseMatrix<F> &A, const Matrix<F>&B, const SparseMatrix<F> &G, Matrix<F> &X, const LeastSquaresC-trl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

void Tikhonov(Orientation orientation, const DistSparseMatrix<F> &A, const DistMul-tiVec<F> &B, const DistSparseMatrix<F> &G, DistMultiVec<F>&X, const LeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresC-trl<Base<F>>())

C API

ElTikhonovAlg

An enum which can take on the values:

•EL TIKHONOV CHOLESKY: Run a less accurate, but often faster, Cholesky-based algo-rithm

•EL TIKHONOV QR: Run a QR-based algorithm

Single-precision

ElError ElTikhonov s(ElOrientation orientation, ElConstMatrix s A, ElConstMatrix s B,ElConstMatrix s Gamma, ElMatrix s X, ElTikhonovAlg alg)

ElError ElTikhonovDist s(ElOrientation orientation, ElConstDistMatrix s A, ElCon-stDistMatrix s B, ElConstDistMatrix s Gamma, ElDistMa-trix s X, ElTikhonovAlg alg)

ElError ElTikhonovSparse s(ElOrientation orientation, ElConstSparseMatrix s A, ElCon-stMatrix s B, ElConstSparseMatrix s G, ElMatrix s X)

ElError ElTikhonovDistSparse s(ElOrientation orientation, ElConstDistSparseMa-trix s A, ElConstDistMultiVec s B, ElConstDistSparse-Matrix s G, ElDistMultiVec s X)

Double-precision

ElError ElTikhonov d(ElOrientation orientation, ElConstMatrix d A, ElConstMatrix d B,ElConstMatrix d Gamma, ElMatrix d X, ElTikhonovAlg alg)

ElError ElTikhonovDist d(ElOrientation orientation, ElConstDistMatrix d A, ElConst-DistMatrix d B, ElConstDistMatrix d Gamma, ElDistMa-trix d X, ElTikhonovAlg alg)

ElError ElTikhonovSparse d(ElOrientation orientation, ElConstSparseMatrix d A, ElCon-stMatrix d B, ElConstSparseMatrix d G, ElMatrix d X)

ElError ElTikhonovDistSparse d(ElOrientation orientation, ElConstDistSparseMa-trix d A, ElConstDistMultiVec d B, ElConst-DistSparseMatrix d G, ElDistMultiVec d X)

5.7. Euclidean minimization 381

Page 386: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Single-precision complex

ElError ElTikhonov c(ElOrientation orientation, ElConstMatrix c A, ElConstMatrix c B,ElConstMatrix c Gamma, ElMatrix c X, ElTikhonovAlg alg)

ElError ElTikhonovDist c(ElOrientation orientation, ElConstDistMatrix c A, ElCon-stDistMatrix c B, ElConstDistMatrix c Gamma, ElDistMa-trix c X, ElTikhonovAlg alg)

ElError ElTikhonovSparse c(ElOrientation orientation, ElConstSparseMatrix c A, ElCon-stMatrix c B, ElConstSparseMatrix c G, ElMatrix c X)

ElError ElTikhonovDistSparse c(ElOrientation orientation, ElConstDistSparseMa-trix c A, ElConstDistMultiVec c B, ElConstDistSparse-Matrix c G, ElDistMultiVec c X)

Double-precision complex

ElError ElTikhonov z(ElOrientation orientation, ElConstMatrix z A, ElConstMatrix z B,ElConstMatrix z Gamma, ElMatrix z X, ElTikhonovAlg alg)

ElError ElTikhonovDist z(ElOrientation orientation, ElConstDistMatrix z A, ElConst-DistMatrix z B, ElConstDistMatrix z Gamma, ElDistMa-trix z X, ElTikhonovAlg alg)

ElError ElTikhonovSparse z(ElOrientation orientation, ElConstSparseMatrix z A, ElCon-stMatrix z B, ElConstSparseMatrix z G, ElMatrix z X)

ElError ElTikhonovDistSparse z(ElOrientation orientation, ElConstDistSparseMa-trix z A, ElConstDistMultiVec z B, ElConst-DistSparseMatrix z G, ElDistMultiVec z X)

5.7.3 Ridge regression

Ridge regression is a special case of Tikhonov regularization where the regularization matrix, G, isof the form G = γI. When the linear system is either square or overdetermined, one solves theRegularized Least Squares problem

minX

‖AX − B‖2F + ‖γX‖2

F,

whereas, when the system is underdetermined, one solves a Regularized Minimum Length prob-lem

minX,S

‖X‖2F + ‖S‖2

F

s.t. AX + γS = B.

Just as with Tikhonov regularization, Elemental in fact supports replacing A in the above equa-tions with A, AT, or AH.

Python API

Ridge(A, B, alpha[, alg=RIDGE CHOLESKY ])

382 Chapter 5. LAPACK-like linear algebra

Page 387: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

enum RidgeAlg

enumerator RIDGE CHOLESKY

Run a less accurate, but often faster, Cholesky-based algorithm

enumerator RIDGE QR

Run a QR-based algorithm

enumerator RIDGE SVD

Run an SVD-based algorithm

void Ridge(Orientation orientation, const Matrix<F> &A, const Matrix<F> &B, Base<F>gamma, Matrix<F> &X, RidgeAlg alg = RIDGE CHOLESKY)

void Ridge(Orientation orientation, const AbstractDistMatrix<F> &A, const AbstractDist-Matrix<F> &B, Base<F> gamma, AbstractDistMatrix<F> &X, RidgeAlg alg =RIDGE CHOLESKY)

void Ridge(Orientation orientation, const SparseMatrix<F> &A, const Matrix<F> &B,Base<F> gamma, Matrix<F> &X, const LeastSquaresCtrl<Base<F>> &ctrl= LeastSquaresCtrl<Base<F>>())

void Ridge(Orientation orientation, const DistSparseMatrix<F> &A, const DistMulti-Vec<F> &B, Base<F> gamma, DistMultiVec<F> &X, const LeastSquaresC-trl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

C API

ElRidgeAlg

An enum that can take on the values:

•EL RIDGE CHOLESKY: Run a less accurate, but often faster, Cholesky-based algorithm

•EL RIDGE QR: Run a QR-based algorithm

•EL RIDGE SVD: Run an SVD-based algorithm

Single-precision

ElError ElRidge s(ElOrientation orientation, ElConstMatrix s A, ElConstMatrix s B,float gamma, ElMatrix s X, ElRidgeAlg alg)

ElError ElRidgeDist s(ElOrientation orientation, ElConstDistMatrix s A, ElConstDistMa-trix s B, float gamma, ElDistMatrix s X, ElRidgeAlg alg)

ElError ElRidgeSparse s(ElOrientation orientation, ElConstSparseMatrix s A, ElConst-Matrix s B, float gamma, ElMatrix s X)

ElError ElRidgeDistSparse s(ElOrientation orientation, ElConstDistSparseMatrix s A,ElConstDistMultiVec s B, float gamma, ElDistMulti-Vec s X)

5.7. Euclidean minimization 383

Page 388: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision

ElError ElRidge d(ElOrientation orientation, ElConstMatrix d A, ElConstMatrix d B, dou-ble gamma, ElMatrix d X, ElRidgeAlg alg)

ElError ElRidgeDist d(ElOrientation orientation, ElConstDistMatrix d A, ElConstDist-Matrix d B, double gamma, ElDistMatrix d X, ElRidgeAlg alg)

ElError ElRidgeSparse d(ElOrientation orientation, ElConstSparseMatrix d A, ElConst-Matrix d B, double gamma, ElMatrix d X)

ElError ElRidgeDistSparse d(ElOrientation orientation, ElConstDistSparseMatrix d A,ElConstDistMultiVec d B, double gamma, ElDistMulti-Vec d X)

Single-precision complex

ElError ElRidge c(ElOrientation orientation, ElConstMatrix c A, ElConstMatrix c B,float gamma, ElMatrix c X, ElRidgeAlg alg)

ElError ElRidgeDist c(ElOrientation orientation, ElConstDistMatrix c A, ElConstDistMa-trix c B, float gamma, ElDistMatrix c X, ElRidgeAlg alg)

ElError ElRidgeSparse c(ElOrientation orientation, ElConstSparseMatrix c A, ElConst-Matrix c B, float gamma, ElMatrix c X)

ElError ElRidgeDistSparse c(ElOrientation orientation, ElConstDistSparseMatrix c A,ElConstDistMultiVec c B, float gamma, ElDistMulti-Vec c X)

Double-precision complex

ElError ElRidge z(ElOrientation orientation, ElConstMatrix z A, ElConstMatrix z B, dou-ble gamma, ElMatrix z X, ElRidgeAlg alg)

ElError ElRidgeDist z(ElOrientation orientation, ElConstDistMatrix z A, ElConstDist-Matrix z B, double gamma, ElDistMatrix z X, ElRidgeAlg alg)

ElError ElRidgeSparse z(ElOrientation orientation, ElConstSparseMatrix z A, ElConst-Matrix z B, double gamma, ElMatrix z X)

ElError ElRidgeDistSparse z(ElOrientation orientation, ElConstDistSparseMatrix z A,ElConstDistMultiVec z B, double gamma, ElDistMulti-Vec z X)

5.7.4 General (Gauss-Markov) Linear Model

Implementation

Example driver

The following routines implement solvers for dense and sparse-direct instances of the GeneralLinear Model,

minX,Y

‖Y‖F subject to AX + BY = D.

384 Chapter 5. LAPACK-like linear algebra

Page 389: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Dense algorithm

For dense instances of the problem, where A is m × n and B is m × p, we assume that n ≤ m ≤n + p as well as that A has full column rank, n, and

(A B

)has full row rank, m.

A Generalized QR factorization of (A,B),

A = QR = Q(

R1,10

), B = QTZ = Q

(T1,1 T1,20 T2,2

)Z,

where Q and Z are unitary and R and T are upper-trapezoidal, allows us to re-express theconstraint as

QHd =

(R11

0

)x +

(T1,1 T1,20 T2,2

)(Zy).

which is re-written as (g1g2

)=

(R1,1x + T1,1c1 + T1,2c2

T2,2c2

).

Since ‖c‖2 = ‖Zy‖2 = ‖y‖2 is to be minimized, and c2 is fixed, our only freedom is in thechoice of c1, which we set to zero. Then all that is left is to solve

R1,1x = g1 − T1,2c2

for x. Note that essentially the same scheme is used in LAPACK’s S,D,C,ZGGGLM.

Sparse-direct algorithm

For sparse instances of the GLM problem, the symmetric quasi-semidefinite augmented sys-tem 0 A B

AH 0 0BH 0 −αI

ZX/αY/α

=

D/α00

is formed, equilibrated, and then a priori regularization is added in order to make the systemsufficiently quasi-definite. A Cholesky-like factorization of this regularized system is thenused as a preconditioner for FGMRES(k).

Python API

GLM(A, B, D[, ctrl=None])

C++ API

void GLM(const Matrix<F> &A, const Matrix<F> &B, const Matrix<F> &D, Matrix<F>&X, Matrix<F> &Y)

void GLM(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B, const Ab-stractDistMatrix<F> &D, AbstractDistMatrix<F> &X, AbstractDistMatrix<F>&Y)

5.7. Euclidean minimization 385

Page 390: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void GLM(const SparseMatrix<F> &A, const SparseMatrix<F> &B, const Matrix<F> &D,Matrix<F> &X, Matrix<F> &Y, const LeastSquaresCtrl<Base<F>> &ctrl =LeastSquaresCtrl<Base<F>>())

void GLM(const DistSparseMatrix<F> &A, const DistSparseMatrix<F> &B, const Dist-MultiVec<F> &D, DistMultiVec<F> &X, DistMultiVec<F> &Y, const Least-SquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

Dense versions which overwrite their input

void glm::Overwrite(Matrix<F> &A, Matrix<F> &B, Matrix<F> &D, Matrix<F> &Y)

void glm::Overwrite(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B, Abstract-DistMatrix<F> &D, AbstractDistMatrix<F> &Y)

C API

Standard interface

Single-precisionElError ElGLM s(ElConstMatrix s A, ElConstMatrix s B, ElConstMatrix s D, ElMa-

trix s X, ElMatrix s Y)ElError ElGLMDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElConstDistMa-

trix s D, ElDistMatrix s X, ElDistMatrix s Y)

ElError ElGLMSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s B, ElConstMa-trix s D, ElMatrix s X, ElMatrix s Y)

ElError ElGLMDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparseMa-trix s B, ElConstDistMultiVec s D, ElDistMultiVec s X,ElDistMultiVec s Y)

Double-precisionElError ElGLM d(ElConstMatrix d A, ElConstMatrix d B, ElConstMatrix d D, ElMa-

trix d X, ElMatrix d Y)ElError ElGLMDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElConstDistMa-

trix d D, ElDistMatrix d X, ElDistMatrix d Y)

ElError ElGLMSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d B, ElConst-Matrix d D, ElMatrix d X, ElMatrix d Y)

ElError ElGLMDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparseMa-trix d B, ElConstDistMultiVec d D, ElDistMultiVec d X,ElDistMultiVec d Y)

Single-precision complexElError ElGLM c(ElConstMatrix c A, ElConstMatrix c B, ElConstMatrix c D, ElMa-

trix c X, ElMatrix c Y)ElError ElGLMDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, ElConstDistMa-

trix c D, ElDistMatrix c X, ElDistMatrix c Y)

ElError ElGLMSparse c(ElConstSparseMatrix c A, ElConstSparseMatrix c B, ElConstMa-trix c D, ElMatrix c X, ElMatrix c Y)

386 Chapter 5. LAPACK-like linear algebra

Page 391: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElGLMDistSparse c(ElConstDistSparseMatrix c A, ElConstDistSparseMa-trix c B, ElConstDistMultiVec c D, ElDistMultiVec c X,ElDistMultiVec c Y)

Double-precision complexElError ElGLM z(ElConstMatrix z A, ElConstMatrix z B, ElConstMatrix z D, ElMa-

trix z X, ElMatrix z Y)ElError ElGLMDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, ElConstDistMa-

trix z D, ElDistMatrix z X, ElDistMatrix z Y)

ElError ElGLMSparse z(ElConstSparseMatrix z A, ElConstSparseMatrix z B, ElConst-Matrix z D, ElMatrix z X, ElMatrix z Y)

ElError ElGLMDistSparse z(ElConstDistSparseMatrix z A, ElConstDistSparseMa-trix z B, ElConstDistMultiVec z D, ElDistMultiVec z X,ElDistMultiVec z Y)

Expert versions

Single-precisionElError ElGLMXSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s B, ElCon-

stMatrix s D, ElMatrix s X, ElMatrix s Y, ElLeastSquaresC-trl s ctrl)

ElError ElGLMXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparseMa-trix s B, ElConstDistMultiVec s D, ElDistMultiVec s X,ElDistMultiVec s Y, ElLeastSquaresCtrl s ctrl)

Double-precisionElError ElGLMXSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d B, ElCon-

stMatrix d D, ElMatrix d X, ElMatrix d Y, ElLeastSquaresC-trl d ctrl)

ElError ElGLMXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparseMa-trix d B, ElConstDistMultiVec d D, ElDistMultiVec d X,ElDistMultiVec d Y, ElLeastSquaresCtrl d ctrl)

Single-precision complexElError ElGLMXSparse c(ElConstSparseMatrix c A, ElConstSparseMatrix c B, ElCon-

stMatrix c D, ElMatrix c X, ElMatrix c Y, ElLeastSquaresC-trl s ctrl)

ElError ElGLMXDistSparse c(ElConstDistSparseMatrix c A, ElConstDistSparseMa-trix c B, ElConstDistMultiVec c D, ElDistMultiVec c X,ElDistMultiVec c Y, ElLeastSquaresCtrl s ctrl)

Double-precision complexElError ElGLMXSparse z(ElConstSparseMatrix z A, ElConstSparseMatrix z B, ElCon-

stMatrix z D, ElMatrix z X, ElMatrix z Y, ElLeastSquaresC-trl d ctrl)

ElError ElGLMXDistSparse z(ElConstDistSparseMatrix z A, ElConstDistSparseMa-trix z B, ElConstDistMultiVec z D, ElDistMultiVec z X,ElDistMultiVec z Y, ElLeastSquaresCtrl d ctrl)

5.7. Euclidean minimization 387

Page 392: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.7.5 Equality-constrained Least Squares

Implementation

Example driver

The following routines support the solution of dense and sparse-direct instances of theEquality-constrained Least Squares problem

minX

‖AX − C‖F subject to BX = D.

Dense algorithm

For dense instances of the problem, a Generalized RQ factorization can be employed as longas A is m × n, B is p × n, and p ≤ n ≤ m + p. It is assumed that B has full row rank, p, and(

AB

)has full column rank, n.

A Generalized RQ factorization of (B, A),

B = TQ =(0 T1,2

)Q, A = Z

(R1,1 R1,2

0 R2,2

)Q,

where Q and Z are unitary and R and T are upper-trapezoidal, allows us to re-express theconstraint

TQx = d,

as (0 T1,2

) (y1y2

)= d,

where y = Qx, which only requires the solution of the upper-triangular system

T1,2y2 = d.

The objective can be rewritten as

‖Ax − c‖2 = ‖ZH Ax − ZHc‖2 = ‖RQx − ZHc‖2

which, defining g = ZHc, can be partitioned as(R1,1 R1,2

0 R2,2

)(y1y2

)−(

g1g2

)=

(R1,1y1 + R1,2y2 − g1

R2,2y2 − g2

).

Since y2 is fixed by the constraint, the norm is minimized by setting the top term to zero, whichinvolves solving the upper-triangular system

R1,1y1 = g1 − R1,2y2.

On exit of the internal dense routine, A and B are overwritten with their implicit GeneralizedRQ factorization of (B, A), and, optionally, C is overwritten with the rotated residual matrix

ZH(AX − C) = (RQX − ZHC) =(

0R2,2Y2 − G1

),

where R2,2 is an upper-trapezoidal (not necessarily triangular) matrix. Note that essentially thesame scheme is used in LAPACK’s S,D,C,ZGGLSE.

388 Chapter 5. LAPACK-like linear algebra

Page 393: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Sparse-direct algorithm

For sparse instances of the LSE problem, the symmetric quasi-semidefinite augmented system 0 AH BH

A −αI 0B 0 0

X−R/αY/α

=

0CD

is formed, equilibrated, and then a priori regularization is added in order to make the systemsufficiently quasi-definite. A Cholesky-like factorization of this regularized system is thenused as a preconditioner for FGMRES(k).

Python API

LSE(A, B, C, D[, ctrl=None])

C++ API

void LSE(const Matrix<F> &A, const Matrix<F> &B, const Matrix<F> &C, const Ma-trix<F> &D, Matrix<F> &X)

void LSE(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B, const Ab-stractDistMatrix<F> &C, const AbstractDistMatrix<F> &D, AbstractDistMa-trix<F> &X)

void LSE(const SparseMatrix<F> &A, const SparseMatrix<F> &B, const Matrix<F>&C, const Matrix<F> &D, Matrix<F> &X, const LeastSquaresCtrl<Base<F>>&ctrl = LeastSquaresCtrl<Base<F>>())

void LSE(const DistSparseMatrix<F> &A, const DistSparseMatrix<F> &B, const Dist-MultiVec<F> &C, const DistMultiVec<F> &D, DistMultiVec<F> &X, constLeastSquaresCtrl<Base<F>> &ctrl = LeastSquaresCtrl<Base<F>>())

Dense versions which overwrite their input

void lse::Overwrite(Matrix<F> &A, Matrix<F> &B, Matrix<F> &C, Matrix<F> &D,Matrix<F> &X, bool computeResidual = false)

void lse::Overwrite(AbstractDistMatrix<F> &A, AbstractDistMatrix<F> &B, Abstract-DistMatrix<F> &C, AbstractDistMatrix<F> &D, AbstractDistMa-trix<F> &X, bool computeResidual = false)

C API

Standard interface

Single-precisionElError ElLSE s(ElConstMatrix s A, ElConstMatrix s B, ElConstMatrix s C, ElConstMa-

trix s D, ElMatrix s X)ElError ElLSEDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElConstDistMa-

trix s C, ElConstDistMatrix s D, ElDistMatrix s X)

5.7. Euclidean minimization 389

Page 394: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLSESparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s B, ElConstMa-trix s C, ElConstMatrix s D, ElMatrix s X)

ElError ElLSEDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparseMa-trix s B, ElConstDistMultiVec s C, ElConstDistMulti-Vec s D, ElDistMultiVec s X)

Double-precisionElError ElLSE d(ElConstMatrix d A, ElConstMatrix d B, ElConstMatrix d C, ElConstMa-

trix d D, ElMatrix d X)ElError ElLSEDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElConstDistMa-

trix d C, ElConstDistMatrix d D, ElDistMatrix d X)

ElError ElLSESparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d B, ElConst-Matrix d C, ElConstMatrix d D, ElMatrix d X)

ElError ElLSEDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparseMa-trix d B, ElConstDistMultiVec d C, ElConstDistMulti-Vec d D, ElDistMultiVec d X)

Single-precision complexElError ElLSE c(ElConstMatrix c A, ElConstMatrix c B, ElConstMatrix c C, ElConstMa-

trix c D, ElMatrix c X)ElError ElLSEDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, ElConstDistMa-

trix c C, ElConstDistMatrix c D, ElDistMatrix c X)

ElError ElLSESparse c(ElConstSparseMatrix c A, ElConstSparseMatrix c B, ElConstMa-trix c C, ElConstMatrix c D, ElMatrix c X)

ElError ElLSEDistSparse c(ElConstDistSparseMatrix c A, ElConstDistSparseMa-trix c B, ElConstDistMultiVec c C, ElConstDistMulti-Vec c D, ElDistMultiVec c X)

Double-precision complexElError ElLSE z(ElConstMatrix z A, ElConstMatrix z B, ElConstMatrix z C, ElConstMa-

trix z D, ElMatrix z X)ElError ElLSEDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, ElConstDistMa-

trix z C, ElConstDistMatrix z D, ElDistMatrix z X)

ElError ElLSESparse z(ElConstSparseMatrix z A, ElConstSparseMatrix z B, ElConst-Matrix z C, ElConstMatrix z D, ElMatrix z X)

ElError ElLSEDistSparse z(ElConstDistSparseMatrix z A, ElConstDistSparseMa-trix z B, ElConstDistMultiVec z C, ElConstDistMulti-Vec z D, ElDistMultiVec z X)

Expert versions

Single-precisionElError ElLSEXSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s B, ElConst-

Matrix s C, ElConstMatrix s D, ElMatrix s X, ElLeastSquaresC-trl s ctrl)

ElError ElLSEXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparseMa-trix s B, ElConstDistMultiVec s C, ElConstDistMulti-Vec s D, ElDistMultiVec s X, ElLeastSquaresCtrl s ctrl)

390 Chapter 5. LAPACK-like linear algebra

Page 395: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precisionElError ElLSEXSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d B, ElCon-

stMatrix d C, ElConstMatrix d D, ElMatrix d X, ElLeast-SquaresCtrl d ctrl)

ElError ElLSEXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparseMa-trix d B, ElConstDistMultiVec d C, ElConstDistMulti-Vec d D, ElDistMultiVec d X, ElLeastSquaresCtrl d ctrl)

Single-precision complexElError ElLSEXSparse c(ElConstSparseMatrix c A, ElConstSparseMatrix c B, ElConst-

Matrix c C, ElConstMatrix c D, ElMatrix c X, ElLeastSquaresC-trl s ctrl)

ElError ElLSEXDistSparse c(ElConstDistSparseMatrix c A, ElConstDistSparseMa-trix c B, ElConstDistMultiVec c C, ElConstDistMulti-Vec c D, ElDistMultiVec c X, ElLeastSquaresCtrl s ctrl)

Double-precision complexElError ElLSEXSparse z(ElConstSparseMatrix z A, ElConstSparseMatrix z B, ElConst-

Matrix z C, ElConstMatrix z D, ElMatrix z X, ElLeastSquaresC-trl d ctrl)

ElError ElLSEXDistSparse z(ElConstDistSparseMatrix z A, ElConstDistSparseMa-trix z B, ElConstDistMultiVec z C, ElConstDistMulti-Vec z D, ElDistMultiVec z X, ElLeastSquaresCtrl d ctrl)

5.7.6 References

C++ Header

C Header

Python wrapper E

5.8 Permutations

5.8.1 Permutation vectors

In order to represent arbitrary permutations, Elemental recently switched from LAPACK-stylepivot sequence representations to general permutation vectors, where entry i of the permu-tation vector p contains the column index of the nonzero entry in row i of the correspondingpermutation matrix.

PermuteCols

void PermuteCols(Matrix<T> &A, const Matrix<int> &p)

void PermuteCols(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &p)

void PermuteCols(Matrix<T> &A, const Matrix<int> &p, const Matrix<int> &pInv)

5.8. Permutations 391

Page 396: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void PermuteCols(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &p, constAbstractDistMatrix<int> &pInv)

Provide the inverse permutations so that they do not need to be internally computed anddiscarded.

PermuteRows

void PermuteRows(Matrix<T> &A, const Matrix<int> &p)

void PermuteRows(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &p)

void PermuteRows(Matrix<T> &A, const Matrix<int> &p, const Matrix<int> &pInv)

void PermuteRows(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &p, constAbstractDistMatrix<int> &pInv)

Provide the inverse permutations so that they do not need to be internally computed anddiscarded.

InversePermuteCols

void InversePermuteCols(Matrix<T> &A, const Matrix<int> &p)

void InversePermuteCols(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int>&p)

InversePermuteRows

void InversePermuteRows(Matrix<T> &A, const Matrix<int> &p)

void InversePermuteRows(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int>&p)

InvertPermutation

void InvertPermutation(const Matrix<int> &p, Matrix<int> &pInv)

void InvertPermutation(const AbstractDistMatrix<int> &p, AbstractDistMatrix<int>&pInv)

Compute the inverse permutation matrix in compressed (vector) form.

ExplicitPermutation

void ExplicitPermutation(const Matrix<int> &p, Matrix<int> &P)

void ExplicitPermutation(const AbstractDistMatrix<int> &p, AbstractDistMa-trix<int> &P)

Return the full permutation matrix, P, represented by the permutation vector p.

392 Chapter 5. LAPACK-like linear algebra

Page 397: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

PermutationParity

bool PermutationParity(const Matrix<int> &p)

bool PermutationParity(const AbstractDistMatrix<int> &p)Return true if the given permutation is odd. The parity is determined in linear time byfinding the decomposition of the inverse of the permutation as a product of transposi-tions.

PermutationMeta

type PermutationMeta

Int align

mpi::Comm comm

std::vector<int> sendCounts

std::vector<int> sendDispls

std::vector<int> sendIdx

std::vector<int> sendRanks

std::vector<int> recvCounts

std::vector<int> recvDispls

std::vector<int> recvIdx

std::vector<int> recvRanks

int TotalSend() const

int TotalRecv() const

void ScaleUp(int length)

void ScaleDown(int length)

PermutationMeta(const AbstractDistMatrix<int> &p, const AbstractDistMa-trix<int> &pInv)

5.8.2 Pivot sequences

These routines make use of LAPACK-style pivot sequence vectors, where the pivot sequence vec-tor p implies the sequence of swaps (0, p0), (1, p1), ..., (n − 1, pn−1). Elemental used to followthis convention when returning permutations from factorizations, but clearly this representa-tion is somewhat restrictive, as routines which perform multiple swaps for each pivot (e.g.,some variants of Bunch-Kaufman) cannot be handled.

ApplyColPivots

void ApplyColPivots(Matrix<T> &A, const Matrix<int> &pivots)

5.8. Permutations 393

Page 398: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void ApplyColPivots(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &piv-ots)

ApplyInverseColPivots

void ApplyInverseColPivots(Matrix<T> &A, const Matrix<int> &pivots)

void ApplyInverseColPivots(AbstractDistMatrix<T> &A, const AbstractDistMa-trix<int> &pivots)

ApplyRowPivots

void ApplyRowPivots(Matrix<T> &A, const Matrix<int> &pivots)

void ApplyRowPivots(AbstractDistMatrix<T> &A, const AbstractDistMatrix<int> &piv-ots)

ApplyInverseRowPivots

void ApplyInverseRowPivots(Matrix<T> &A, const Matrix<int> &pivots)

void ApplyInverseRowPivots(AbstractDistMatrix<T> &A, const AbstractDistMa-trix<int> &pivots)

ApplySymmetricPivots

void ApplySymmetricPivots(UpperOrLower uplo, Matrix<T> &A, const Matrix<int>&pivots, bool conjugate = false)

void ApplySymmetricPivots(UpperOrLower uplo, AbstractDistMatrix<T> &A, const Ab-stractDistMatrix<int> &pivots, bool conjugate = false)

ApplyInverseSymmetricPivots

void ApplyInverseSymmetricPivots(UpperOrLower uplo, Matrix<T> &A, const Ma-trix<int> &pivots, bool conjugate = false)

void ApplyInverseSymmetricPivots(UpperOrLower uplo, AbstractDistMatrix<T> &A,const AbstractDistMatrix<int> &pivots, bool con-jugate = false)

PivotParity

bool PivotParity(const Matrix<int> &pivots)

bool PivotParity(const AbstractDistMatrix<int> &pivots)Return true if the permutation implied by the pivot sequence is odd. This is determinedby determining if an odd number of non-trivial transpositions are performed.

394 Chapter 5. LAPACK-like linear algebra

Page 399: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.8.3 Converting pivot sequences to permutations

PivotsToPermutation

void PivotsToPermutation(const Matrix<int> &pivots, Matrix<int> &p, int offset = 0)

void PivotsToPermutation(const AbstractDistMatrix<int> &pivots, AbstractDistMa-trix<int> &p, int offset = 0)

PivotsToInversePermutation

void PivotsToInversePermutation(const Matrix<int> &pivots, Matrix<int> &pInv, intoffset = 0)

void PivotsToInversePermutation(const AbstractDistMatrix<int> &pivots, Abstract-DistMatrix<int> &pInv, int offset = 0)

PivotsToPartialPermutation

void PivotsToPartialPermutation(const Matrix<int> &pivots, Matrix<int> &p, Ma-trix<int> &pInv, int offset = 0)

void PivotsToPartialPermutation(const AbstractDistMatrix<int> &pivots, Abstract-DistMatrix<int> &p, AbstractDistMatrix<int>&pInv, int offset = 0)

5.9 Reflectors

5.9.1 Householder reflectors

Generate a reflector

TODO: Describe major difference from LAPACK’s conventions (i.e., we do not treat the iden-tity matrix as a Householder transform since it requires the u in H = I − 2uu′ to have normzero rather than one).

F LeftReflector(F &chi, Matrix<F> &x)

F LeftReflector(Matrix<F> &chi, Matrix<F> &x)

F LeftReflector(F &chi, AbstractDistMatrix<F> &x)

F LeftReflector(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

F reflector::Col(F &chi, AbstractDistMatrix<F> &x)

F reflector::Col(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

F RightReflector(F &chi, Matrix<F> &x)

F RightReflector(Matrix<F> &chi, Matrix<F> &x)

F RightReflector(F &chi, AbstractDistMatrix<F> &x)

F RightReflector(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

5.9. Reflectors 395

Page 400: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

F reflector::Row(F &chi, AbstractDistMatrix<F> &x)

F reflector::Row(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

Apply packed reflectors

void ApplyPackedReflectors(LeftOrRight side, UpperOrLower uplo, VerticalOrHorizontaldir, ForwardOrBackward order, Conjugation conjugation, Intoffset, const Matrix<F> &H, const Matrix<F> &t, Ma-trix<F> &A)

void ApplyPackedReflectors(LeftOrRight side, UpperOrLower uplo, VerticalOrHorizontaldir, ForwardOrBackward order, Conjugation conjugation, Intoffset, const AbstractDistMatrix<F> &H, const Abstract-DistMatrix<F> &t, AbstractDistMatrix<F> &A)

Expand packed reflectors

void ExpandPackedReflectors(UpperOrLower uplo, VerticalOrHorizontal dir, Conjugationconjugation, Int offset, Matrix<F> &H, const Matrix<F>&t)

void ExpandPackedReflectors(UpperOrLower uplo, VerticalOrHorizontal dir, Conjugationconjugation, Int offset, AbstractDistMatrix<F> &H, constAbstractDistMatrix<F> &t)

5.9.2 Hyperbolic reflectors

Generate a reflector

F LeftHyperbolicReflector(F &chi, Matrix<F> &x)

F LeftHyperbolicReflector(Matrix<F> &chi, Matrix<F> &x)

F LeftHyperbolicReflector(F &chi, AbstractDistMatrix<F> &x)

F LeftHyperbolicReflector(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

F hyp reflector::Col(F &chi, AbstractDistMatrix<F> &x)

F hyp reflector::Col(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

F RightHyperbolicReflector(F &chi, Matrix<F> &x)

F RightHyperbolicReflector(Matrix<F> &chi, Matrix<F> &x)

F RightHyperbolicReflector(F &chi, AbstractDistMatrix<F> &x)

F RightHyperbolicReflector(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F>&x)

F hyp reflector::Row(F &chi, AbstractDistMatrix<F> &x)

F hyp reflector::Row(AbstractDistMatrix<F> &chi, AbstractDistMatrix<F> &x)

396 Chapter 5. LAPACK-like linear algebra

Page 401: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

5.10 Utilities

5.10.1 Median

ValueInt<Real> Median(const Matrix<Real> &x)

ValueInt<Real> Median(const AbstractDistMatrix<Real> &x)

5.10.2 Sorting

void Sort(Matrix<Real> &X, SortType sort = ASCENDING)

void Sort(AbstractDistMatrix<Real> &X, SortType sort = ASCENDING)

std::vector<ValueInt<Real>> TaggedSort(const Matrix<Real> &X, SortType sort = AS-CENDING)

std::vector<ValueInt<Real>> TaggedSort(const AbstractDistMatrix<Real> &X, Sort-Type sort = ASCENDING)

5.10. Utilities 397

Page 402: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

398 Chapter 5. LAPACK-like linear algebra

Page 403: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

SIX

OPTIMIZATION

Elemental currently supports distributed dense and sparse Linear, Quadratic, and Second-Order Cone Programs via Mehrotra Predictor-Corrector primal-dual Interior Point Methods(though geometric and semidefinite support is also planned). In addition to building on topof these backends to provide support for basis pursuit (BP), basis pursuit denoising (BPDN)/ least absolute shrinkage and selection operator (LASSO), Chebyshev points (CP), Dantzigselectors (DS), non-negative least squares (NNLS), and (soft-margin) Support Vector Machines(SVM), alternating direction and operator splitting methods for more general routines are cur-rently being explored.

Please note that the distributed sparse implementations are currently only modestly scalabledue to Elemental’s current usage of 1D sparse matrix distributions (which will soon be re-placed with combinations of 2D + low-rank sparse matrix distributions).

6.1 Solvers

6.1.1 Linear Programs

The following routines attempt to solve primal-dual pairs of linear programs in either “direct”conic form,

minx

cTx | Ax = b ∧ x ≥ 0 ,

maxy,z

−bTy | ATy − z + c = 0 ∧ z ≥ 0 ,

or “affine” conic form

minx,s

cTx | Ax = b ∧ Gx + s = h ∧ s ≥ 0 ,

maxy,z

−bTy − hTz | ATy + GTz + c = 0 ∧ z ≥ 0 .

By default a Mehrotra Predictor-Corrector primal-dual Interior Point Method is used.

Direct Linear Programs

minx

cTx | Ax = b ∧ x ≥ 0 ,

maxy,z

−bTy | ATy − z + c = 0 ∧ z ≥ 0

399

Page 404: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

LPDirect(A, b, c, x, y, z[, ctrl=None])

C++ API

void LP(const Matrix<Real> &A, const Matrix<Real> &b, const Matrix<Real>&c, Matrix<Real> &x, Matrix<Real> &y, Matrix<Real> &z, constlp::direct::Ctrl<Real> &ctrl = lp::direct::Ctrl<Real>(false))

void LP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, constElementalMatrix<Real> &c, ElementalMatrix<Real> &x, ElementalMa-trix<Real> &y, ElementalMatrix<Real> &z, const lp::direct::Ctrl<Real>&ctrl = lp::direct::Ctrl<Real>(false))

void LP(const SparseMatrix<Real> &A, const Matrix<Real> &b, const Matrix<Real>&c, Matrix<Real> &x, Matrix<Real> &y, Matrix<Real> &z, constlp::direct::Ctrl<Real> &ctrl = lp::direct::Ctrl<Real>(true))

void LP(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, constDistMultiVec<Real> &c, DistMultiVec<Real> &x, DistMultiVec<Real>&y, DistMultiVec<Real> &z, const lp::direct::Ctrl<Real> &ctrl =lp::direct::Ctrl<Real>(true))

C API

Single-precisionElError ElLPDirect s(ElConstMatrix s A, ElConstMatrix s b, ElConstMatrix s c, ElMa-

trix s x, ElMatrix s y, ElMatrix s z)ElError ElLPDirectDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElConstDist-

Matrix s c, ElDistMatrix s x, ElDistMatrix s y, ElDistMa-trix s z)

ElError ElLPDirectSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElConstMa-trix s c, ElMatrix s x, ElMatrix s y, ElMatrix s z)

ElError ElLPDirectDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMulti-Vec s b, ElConstDistMultiVec s c, ElDistMultiVec s x,ElDistMultiVec s y, ElDistMultiVec s z)

Double-precisionElError ElLPDirect d(ElConstMatrix d A, ElConstMatrix d b, ElConstMatrix d c, ElMa-

trix d x, ElMatrix d y, ElMatrix d z)ElError ElLPDirectDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElConstDist-

Matrix d c, ElDistMatrix d x, ElDistMatrix d y, ElDistMa-trix d z)

ElError ElLPDirectSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElConstMa-trix d c, ElMatrix d x, ElMatrix d y, ElMatrix d z)

ElError ElLPDirectDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMulti-Vec d b, ElConstDistMultiVec d c, ElDistMultiVec d x,ElDistMultiVec d y, ElDistMultiVec d z)

400 Chapter 6. Optimization

Page 405: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Expert interface

Single-precisionElError ElLPDirectX s(ElConstMatrix s A, ElConstMatrix s b, ElConstMatrix s c, ElMa-

trix s x, ElMatrix s y, ElMatrix s z, ElLPDirectCtrl s ctrl)ElError ElLPDirectXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElConstDist-

Matrix s c, ElDistMatrix s x, ElDistMatrix s y, ElDistMa-trix s z, ElLPDirectCtrl s ctrl)

ElError ElLPDirectXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElConstMa-trix s c, ElMatrix s x, ElMatrix s y, ElMatrix s z, ElLPDi-rectCtrl s ctrl)

ElError ElLPDirectXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMul-tiVec s b, ElConstDistMultiVec s c, ElDistMulti-Vec s x, ElDistMultiVec s y, ElDistMultiVec s z,ElLPDirectCtrl s ctrl)

Double-precisionElError ElLPDirectX d(ElConstMatrix d A, ElConstMatrix d b, ElConstMatrix d c, El-

Matrix d x, ElMatrix d y, ElMatrix d z, ElLPDirectCtrl d ctrl)ElError ElLPDirectXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElConst-

DistMatrix d c, ElDistMatrix d x, ElDistMatrix d y, ElDist-Matrix d z, ElLPDirectCtrl d ctrl)

ElError ElLPDirectXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElConst-Matrix d c, ElMatrix d x, ElMatrix d y, ElMatrix d z,ElLPDirectCtrl d ctrl)

ElError ElLPDirectXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMul-tiVec d b, ElConstDistMultiVec d c, ElDistMulti-Vec d x, ElDistMultiVec d y, ElDistMultiVec d z,ElLPDirectCtrl d ctrl)

Affine Linear Programs

minx,s

cTx | Ax = b ∧ Gx + s = h ∧ s ≥ 0 ,

maxy,z

−bTy − hTz | ATy + GTz + c = 0 ∧ z ≥ 0

Python API

LPAffine(A, G, b, c, h, x, y, z, s[, ctrl=None])

C++ API

void LP(const Matrix<Real> &A, const Matrix<Real> &G, const Matrix<Real>&b, const Matrix<Real> &c, const Matrix<Real> &h, Matrix<Real>&x, Matrix<Real> &y, Matrix<Real> &z, Matrix<Real> &s, constlp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

6.1. Solvers 401

Page 406: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void LP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &G, const Ele-mentalMatrix<Real> &b, const ElementalMatrix<Real> &c, const ElementalMa-trix<Real> &h, ElementalMatrix<Real> &x, ElementalMatrix<Real> &y, Elemen-talMatrix<Real> &z, ElementalMatrix<Real> &s, const lp::affine::Ctrl<Real>&ctrl = lp::affine::Ctrl<Real>())

void LP(const SparseMatrix<Real> &A, const SparseMatrix<Real> &G, const Ma-trix<Real> &b, const Matrix<Real> &c, const Matrix<Real> &h, Ma-trix<Real> &x, Matrix<Real> &y, Matrix<Real> &z, Matrix<Real> &s, constlp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void LP(const DistSparseMatrix<Real> &A, const DistSparseMatrix<Real> &G, constDistMultiVec<Real> &b, const DistMultiVec<Real> &c, const DistMulti-Vec<Real> &h, DistMultiVec<Real> &x, DistMultiVec<Real> &y, DistMulti-Vec<Real> &z, DistMultiVec<Real> &s, const lp::affine::Ctrl<Real> &ctrl =lp::affine::Ctrl<Real>())

C API

Single-precisionElError ElLPAffine s(ElConstMatrix s A, ElConstMatrix s G, ElConstMatrix s b, ElCon-

stMatrix s c, ElConstMatrix s h, ElMatrix s x, ElMatrix s y, ElMa-trix s z, ElMatrix s s)

ElError ElLPAffineDist s(ElConstDistMatrix s A, ElConstDistMatrix s G, ElConstDist-Matrix s b, ElConstDistMatrix s c, ElConstDistMatrix s h, El-DistMatrix s x, ElDistMatrix s y, ElDistMatrix s z, ElDistMa-trix s s)

ElError ElLPAffineSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s G, El-ConstMatrix s b, ElConstMatrix s c, ElConstMatrix s h, El-Matrix s x, ElMatrix s y, ElMatrix s z, ElMatrix s s)

ElError ElLPAffineDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparseMa-trix s G, ElConstDistMultiVec s b, ElConstDistMulti-Vec s c, ElConstDistMultiVec s h, ElDistMultiVec s x,ElDistMultiVec s y, ElDistMultiVec s z, ElDistMulti-Vec s s)

Double-precisionElError ElLPAffine d(ElConstMatrix d A, ElConstMatrix d G, ElConstMatrix d b, El-

ConstMatrix d c, ElConstMatrix d h, ElMatrix d x, ElMatrix d y,ElMatrix d z, ElMatrix d s)

ElError ElLPAffineDist d(ElConstDistMatrix d A, ElConstDistMatrix s G, ElConstDist-Matrix d b, ElConstDistMatrix d c, ElConstDistMatrix d h,ElDistMatrix d x, ElDistMatrix d y, ElDistMatrix d z, ElDist-Matrix d s)

ElError ElLPAffineSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d G, El-ConstMatrix d b, ElConstMatrix d c, ElConstMatrix d h,ElMatrix d x, ElMatrix d y, ElMatrix d z, ElMatrix d s)

402 Chapter 6. Optimization

Page 407: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLPAffineDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparseMa-trix s G, ElConstDistMultiVec d b, ElConstDistMulti-Vec d c, ElConstDistMultiVec d h, ElDistMultiVec d x,ElDistMultiVec d y, ElDistMultiVec d z, ElDistMulti-Vec d s)

Expert interfaces

Single-precisionElError ElLPAffineX s(ElConstMatrix s A, ElConstMatrix s G, ElConstMatrix s b, El-

ConstMatrix s c, ElConstMatrix s h, ElMatrix s x, ElMatrix s y,ElMatrix s z, ElMatrix s s, ElLPAffineCtrl s ctrl)

ElError ElLPAffineXDist s(ElConstDistMatrix s A, ElConstDistMatrix s G, ElConst-DistMatrix s b, ElConstDistMatrix s c, ElConstDistMa-trix s h, ElDistMatrix s x, ElDistMatrix s y, ElDistMatrix s z,ElDistMatrix s s, ElLPAffineCtrl s ctrl)

ElError ElLPAffineXSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s G, El-ConstMatrix s b, ElConstMatrix s c, ElConstMatrix s h,ElMatrix s x, ElMatrix s y, ElMatrix s z, ElMatrix s s, ElL-PAffineCtrl s ctrl)

ElError ElLPAffineXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparse-Matrix s G, ElConstDistMultiVec s b, ElConstDist-MultiVec s c, ElConstDistMultiVec s h, ElDistMulti-Vec s x, ElDistMultiVec s y, ElDistMultiVec s z, ElD-istMultiVec s s, ElLPAffineCtrl s ctrl)

Double-precisionElError ElLPAffineX d(ElConstMatrix d A, ElConstMatrix d G, ElConstMatrix d b, El-

ConstMatrix d c, ElConstMatrix d h, ElMatrix d x, ElMatrix d y,ElMatrix d z, ElMatrix d s, ElLPAffineCtrl d ctrl)

ElError ElLPAffineXDist d(ElConstDistMatrix d A, ElConstDistMatrix s G, ElConst-DistMatrix d b, ElConstDistMatrix d c, ElConstDistMa-trix d h, ElDistMatrix d x, ElDistMatrix d y, ElDistMa-trix d z, ElDistMatrix d s, ElLPAffineCtrl d ctrl)

ElError ElLPAffineXSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d G, El-ConstMatrix d b, ElConstMatrix d c, ElConstMatrix d h,ElMatrix d x, ElMatrix d y, ElMatrix d z, ElMatrix d s,ElLPAffineCtrl d ctrl)

ElError ElLPAffineXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparse-Matrix s G, ElConstDistMultiVec d b, ElConstDist-MultiVec d c, ElConstDistMultiVec d h, ElDistMulti-Vec d x, ElDistMultiVec d y, ElDistMultiVec d z, El-DistMultiVec d s, ElLPAffineCtrl d ctrl)

6.1. Solvers 403

Page 408: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.1.2 Quadratic Programs

The following routines attempt to solve primal-dual pairs of (convex) quadratic programs ineither “direct” conic form,

minx

12

xTQx + cTx | Ax = b ∧ x ≥ 0 ,

maxy,z

−12

rTQ†r − bTy | r = ATy − z + c ∈ range(Q) ∧ z ≥ 0 ,

or “affine” conic form

minx,s

12

xTQx + cTx | Ax = b ∧ Gx + s = h, s ≥ 0 ,

maxy,z

−12

rTQ†r − bTy − hTz | r = ATy + GTz + c ∈ range(Q) ∧ z ≥ 0 .

By default a Mehrotra Predictor-Corrector primal-dual Interior Point Method is used.

Unpolished alternating direction methods for solving the box-constrained QP

minx

12

xTQx + cTx | lb ≤ x ≤ ub

are also available.

Direct Quadratic Programs

minx

12

xTQx + cTx | Ax = b ∧ x ≥ 0 ,

maxy,z

−12

rTQ†r − bTy | r = ATy − z + c ∈ range(Q) ∧ z ≥ 0

Python API

QPDirect(Q, A, b, c, x, y, z[, ctrl=None])

C++ API

void QP(const Matrix<Real> &Q, const Matrix<Real> &A, const Matrix<Real> &b,const Matrix<Real> &c, Matrix<Real> &x, Matrix<Real> &y, Matrix<Real>&z, const qp::direct::Ctrl<Real> &ctrl = qp::direct::Ctrl<Real>())

void QP(const ElementalMatrix<Real> &Q, const ElementalMatrix<Real> &A, constElementalMatrix<Real> &b, const ElementalMatrix<Real> &c, ElementalMa-trix<Real> &x, ElementalMatrix<Real> &y, ElementalMatrix<Real> &z, constqp::direct::Ctrl<Real> &ctrl = qp::direct::Ctrl<Real>())

void QP(const SparseMatrix<Real> &Q, const SparseMatrix<Real> &A, constMatrix<Real> &b, const Matrix<Real> &c, Matrix<Real> &x, Ma-trix<Real> &y, Matrix<Real> &z, const qp::direct::Ctrl<Real> &ctrl =qp::direct::Ctrl<Real>())

404 Chapter 6. Optimization

Page 409: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void QP(const DistSparseMatrix<Real> &Q, const DistSparseMatrix<Real> &A,const DistMultiVec<Real> &b, const DistMultiVec<Real> &c, DistMulti-Vec<Real> &x, DistMultiVec<Real> &y, DistMultiVec<Real> &z, constqp::direct::Ctrl<Real> &ctrl = qp::direct::Ctrl<Real>())

C API

Single-precisionElError ElQPDirect s(ElConstMatrix s Q, ElConstMatrix s A, ElConstMatrix s b, ElCon-

stMatrix s c, ElMatrix s x, ElMatrix s y, ElMatrix s z)ElError ElQPDirectDist s(ElConstDistMatrix s Q, ElConstDistMatrix s A, ElConstDist-

Matrix s b, ElConstDistMatrix s c, ElDistMatrix s x, ElDist-Matrix s y, ElDistMatrix s z)

ElError ElQPDirectSparse s(ElConstSparseMatrix s Q, ElConstSparseMatrix s A, El-ConstMatrix s b, ElConstMatrix s c, ElMatrix s x, ElMa-trix s y, ElMatrix s z)

ElError ElQPDirectDistSparse s(ElConstDistSparseMatrix s Q, ElConstDistSparseMa-trix s A, ElConstDistMultiVec s b, ElConstDistMulti-Vec s c, ElDistMultiVec s x, ElDistMultiVec s y, ElD-istMultiVec s z)

Double-precisionElError ElQPDirect d(ElConstMatrix d Q, ElConstMatrix d A, ElConstMatrix d b, El-

ConstMatrix d c, ElMatrix d x, ElMatrix d y, ElMatrix d z)ElError ElQPDirectDist d(ElConstDistMatrix d Q, ElConstDistMatrix d A, ElConst-

DistMatrix d b, ElConstDistMatrix d c, ElDistMatrix d x, El-DistMatrix d y, ElDistMatrix d z)

ElError ElQPDirectSparse d(ElConstSparseMatrix d Q, ElConstSparseMatrix d A, El-ConstMatrix d b, ElConstMatrix d c, ElMatrix d x, ElMa-trix d y, ElMatrix d z)

ElError ElQPDirectDistSparse d(ElConstDistSparseMatrix d Q, ElConstDistSparseMa-trix d A, ElConstDistMultiVec d b, ElConstDistMulti-Vec d c, ElDistMultiVec d x, ElDistMultiVec d y, ElD-istMultiVec d z)

Expert interfaces

Single-precisionElError ElQPDirectX s(ElConstMatrix s Q, ElConstMatrix s A, ElConstMatrix s b, El-

ConstMatrix s c, ElMatrix s x, ElMatrix s y, ElMatrix s z,ElQPDirectCtrl s ctrl)

ElError ElQPDirectXDist s(ElConstDistMatrix s Q, ElConstDistMatrix s A, ElConst-DistMatrix s b, ElConstDistMatrix s c, ElDistMatrix s x, El-DistMatrix s y, ElDistMatrix s z, ElQPDirectCtrl s ctrl)

ElError ElQPDirectXSparse s(ElConstSparseMatrix s Q, ElConstSparseMatrix s A, El-ConstMatrix s b, ElConstMatrix s c, ElMatrix s x, ElMa-trix s y, ElMatrix s z, ElQPDirectCtrl s ctrl)

6.1. Solvers 405

Page 410: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElQPDirectXDistSparse s(ElConstDistSparseMatrix s Q, ElConstDistSparse-Matrix s A, ElConstDistMultiVec s b, ElConstDist-MultiVec s c, ElDistMultiVec s x, ElDistMultiVec s y,ElDistMultiVec s z, ElQPDirectCtrl s ctrl)

Double-precisionElError ElQPDirectX d(ElConstMatrix d Q, ElConstMatrix d A, ElConstMatrix d b, El-

ConstMatrix d c, ElMatrix d x, ElMatrix d y, ElMatrix d z,ElQPDirectCtrl d ctrl)

ElError ElQPDirectXDist d(ElConstDistMatrix d Q, ElConstDistMatrix d A, ElConst-DistMatrix d b, ElConstDistMatrix d c, ElDistMatrix d x, El-DistMatrix d y, ElDistMatrix d z, ElQPDirectCtrl d ctrl)

ElError ElQPDirectXSparse d(ElConstSparseMatrix d Q, ElConstSparseMatrix d A, El-ConstMatrix d b, ElConstMatrix d c, ElMatrix d x, ElMa-trix d y, ElMatrix d z, ElQPDirectCtrl d ctrl)

ElError ElQPDirectXDistSparse d(ElConstDistSparseMatrix d Q, ElConstDistSparse-Matrix d A, ElConstDistMultiVec d b, ElConst-DistMultiVec d c, ElDistMultiVec d x, ElDistMulti-Vec d y, ElDistMultiVec d z, ElQPDirectCtrl d ctrl)

Affine Quadratic Programs

minx,s

12

xTQx + cTx | Ax = b ∧ Gx + s = h, s ≥ 0 ,

maxy,z

−12

rTQ†r − bTy − hTz | r = ATy + GTz + c ∈ range(Q) ∧ z ≥ 0

Python API

QPAffine(Q, A, G, b, c, h, x, y, z, s[, ctrl=None])

C++ API

void QP(const Matrix<Real> &Q, const Matrix<Real> &A, const Matrix<Real> &G,const Matrix<Real> &b, const Matrix<Real> &c, const Matrix<Real> &h, Ma-trix<Real> &x, Matrix<Real> &y, Matrix<Real> &z, Matrix<Real> &s, constqp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void QP(const ElementalMatrix<Real> &Q, const ElementalMatrix<Real> &A, const El-ementalMatrix<Real> &G, const ElementalMatrix<Real> &b, const Elemental-Matrix<Real> &c, const ElementalMatrix<Real> &h, ElementalMatrix<Real>&x, ElementalMatrix<Real> &y, ElementalMatrix<Real> &z, ElementalMa-trix<Real> &s, const qp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void QP(const SparseMatrix<Real> &Q, const SparseMatrix<Real> &A, const SparseMa-trix<Real> &G, const Matrix<Real> &b, const Matrix<Real> &c, const Ma-trix<Real> &h, Matrix<Real> &x, Matrix<Real> &y, Matrix<Real> &z, Ma-trix<Real> &s, const qp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

406 Chapter 6. Optimization

Page 411: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void QP(const DistSparseMatrix<Real> &Q, const DistSparseMatrix<Real> &A, constDistSparseMatrix<Real> &G, const DistMultiVec<Real> &b, const DistMulti-Vec<Real> &c, const DistMultiVec<Real> &h, DistMultiVec<Real> &x, Dist-MultiVec<Real> &y, DistMultiVec<Real> &z, DistMultiVec<Real> &s, constqp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

C API

Single-precisionElError ElQPAffine s(ElConstMatrix s Q, ElConstMatrix s A, ElConstMatrix s G, El-

ConstMatrix s b, ElConstMatrix s c, ElConstMatrix s h, ElMa-trix s x, ElMatrix s y, ElMatrix s z, ElMatrix s s)

ElError ElQPAffineDist s(ElConstDistMatrix s Q, ElConstDistMatrix s A, ElConstDist-Matrix s G, ElConstDistMatrix s b, ElConstDistMatrix s c, El-ConstDistMatrix s h, ElDistMatrix s x, ElDistMatrix s y, ElD-istMatrix s z, ElDistMatrix s s)

ElError ElQPAffineSparse s(ElConstSparseMatrix s Q, ElConstSparseMatrix s A, El-ConstSparseMatrix s G, ElConstMatrix s b, ElConstMa-trix s c, ElConstMatrix s h, ElMatrix s x, ElMatrix s y, El-Matrix s z, ElMatrix s s)

ElError ElQPAffineDistSparse s(ElConstDistSparseMatrix s Q, ElConstDistSparseMa-trix s A, ElConstDistSparseMatrix s G, ElConstDist-MultiVec s b, ElConstDistMultiVec s c, ElConstDist-MultiVec s h, ElDistMultiVec s x, ElDistMultiVec s y,ElDistMultiVec s z, ElDistMultiVec s s)

Double-precisionElError ElQPAffine d(ElConstMatrix d Q, ElConstMatrix d A, ElConstMatrix d G, El-

ConstMatrix d b, ElConstMatrix d c, ElConstMatrix d h, ElMa-trix d x, ElMatrix d y, ElMatrix d z, ElMatrix d s)

ElError ElQPAffineDist d(ElConstDistMatrix d Q, ElConstDistMatrix d A, ElConst-DistMatrix d G, ElConstDistMatrix d b, ElConstDistMa-trix d c, ElConstDistMatrix d h, ElDistMatrix d x, ElDistMa-trix d y, ElDistMatrix d z, ElDistMatrix d s)

ElError ElQPAffineSparse d(ElConstSparseMatrix d Q, ElConstSparseMatrix d A, El-ConstSparseMatrix d G, ElConstMatrix d b, ElConstMa-trix d c, ElConstMatrix d h, ElMatrix d x, ElMatrix d y, El-Matrix d z, ElMatrix d s)

ElError ElQPAffineDistSparse d(ElConstDistSparseMatrix d Q, ElConstDistSparseMa-trix d A, ElConstDistSparseMatrix d G, ElConstDist-MultiVec d b, ElConstDistMultiVec d c, ElConstDist-MultiVec d h, ElDistMultiVec d x, ElDistMultiVec d y,ElDistMultiVec d z, ElDistMultiVec d s)

Expert interfaces

Single-precision

6.1. Solvers 407

Page 412: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElQPAffineX s(ElConstMatrix s Q, ElConstMatrix s A, ElConstMatrix s G, El-ConstMatrix s b, ElConstMatrix s c, ElConstMatrix s h, ElMa-trix s x, ElMatrix s y, ElMatrix s z, ElMatrix s s, ElQPAffineC-trl s ctrl)

ElError ElQPAffineXDist s(ElConstDistMatrix s Q, ElConstDistMatrix s A, ElConst-DistMatrix s G, ElConstDistMatrix s b, ElConstDistMa-trix s c, ElConstDistMatrix s h, ElDistMatrix s x, ElDistMa-trix s y, ElDistMatrix s z, ElDistMatrix s s, ElQPAffineC-trl s ctrl)

ElError ElQPAffineXSparse s(ElConstSparseMatrix s Q, ElConstSparseMatrix s A, El-ConstSparseMatrix s G, ElConstMatrix s b, ElConstMa-trix s c, ElConstMatrix s h, ElMatrix s x, ElMatrix s y, El-Matrix s z, ElMatrix s s, ElQPAffineCtrl s ctrl)

ElError ElQPAffineXDistSparse s(ElConstDistSparseMatrix s Q, ElConstDistSparse-Matrix s A, ElConstDistSparseMatrix s G, ElConst-DistMultiVec s b, ElConstDistMultiVec s c, ElCon-stDistMultiVec s h, ElDistMultiVec s x, ElDistMulti-Vec s y, ElDistMultiVec s z, ElDistMultiVec s s, ElQ-PAffineCtrl s ctrl)

Double-precisionElError ElQPAffineX d(ElConstMatrix d Q, ElConstMatrix d A, ElConstMatrix d G, El-

ConstMatrix d b, ElConstMatrix d c, ElConstMatrix d h, ElMa-trix d x, ElMatrix d y, ElMatrix d z, ElMatrix d s, ElQPAffineC-trl d ctrl)

ElError ElQPAffineXDist d(ElConstDistMatrix d Q, ElConstDistMatrix d A, ElConst-DistMatrix d G, ElConstDistMatrix d b, ElConstDistMa-trix d c, ElConstDistMatrix d h, ElDistMatrix d x, ElD-istMatrix d y, ElDistMatrix d z, ElDistMatrix d s, ElQ-PAffineCtrl d ctrl)

ElError ElQPAffineXSparse d(ElConstSparseMatrix d Q, ElConstSparseMatrix d A, El-ConstSparseMatrix d G, ElConstMatrix d b, ElConstMa-trix d c, ElConstMatrix d h, ElMatrix d x, ElMatrix d y,ElMatrix d z, ElMatrix d s, ElQPAffineCtrl d ctrl)

ElError ElQPAffineXDistSparse d(ElConstDistSparseMatrix d Q, ElConstDistSparse-Matrix d A, ElConstDistSparseMatrix d G, ElConst-DistMultiVec d b, ElConstDistMultiVec d c, ElCon-stDistMultiVec d h, ElDistMultiVec d x, ElDistMul-tiVec d y, ElDistMultiVec d z, ElDistMultiVec d s,ElQPAffineCtrl d ctrl)

Box-constrained Quadratic Programs

minx

12

xTQx + cTx | lb ≤ x ≤ ub

408 Chapter 6. Optimization

Page 413: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Int qp::ADMM(const Matrix<Real> &Q, const Matrix<Real> &C, Real lb, Real ub, Ma-trix<Real> &X, const ADMMCtrl<Real> &ctrl = ADMMCtrl<Real>())

Int qp::ADMM(const ElementalMatrix<Real> &Q, const ElementalMatrix<Real> &C, Reallb, Real ub, ElementalMatrix<Real> &X, const ADMMCtrl<Real> &ctrl =ADMMCtrl<Real>())

C API

Single-precisionElError ElQPBoxADMM s(ElConstMatrix s Q, ElConstMatrix s C, float lb, float ub, ElMa-

trix s X, ElInt* numIts)ElError ElQPBoxADMMDist s(ElConstDistMatrix s Q, ElConstDistMatrix s C, float lb,

float ub, ElDistMatrix s X, ElInt* numIts)

Double-precisionElError ElQPBoxADMM d(ElConstMatrix d Q, ElConstMatrix d C, double lb, double ub, El-

Matrix d X, ElInt* numIts)ElError ElQPBoxADMMDist d(ElConstDistMatrix d Q, ElConstDistMatrix d C, double lb,

double ub, ElDistMatrix d X, ElInt* numIts)

6.1.3 Second-Order Cone Programs

The following routines attempt to solve primal-dual pairs of Second-Order Cone Programs ineither “direct” conic form,

minx

cTx | Ax = b ∧ x ∈ 𝒦 ,

maxy,z

−bTy | ATy − z + c = 0 ∧ z ∈ 𝒦 ,

or “affine” conic form

minx,s

cTx | Ax = b ∧ Gx + s = h ∧ s ∈ 𝒦 ,

maxy,z

−bTy − hTz | ATy + GTz + c = 0 ∧ z ∈ 𝒦 ,

where 𝒦 is a product of Second-Order (a.k.a. Lorentz, or icecream) Cones of the form

𝒬m = (χ0, x1) ∈ Rm : χ0 ≥ ‖x1‖2.

By default a Mehrotra Predictor-Corrector primal-dual Interior Point Method is used.

Direct Second-Order Cone Programs

minx

cTx | Ax = b ∧ x ∈ 𝒦 ,

maxy,z

−bTy | ATy − z + c = 0 ∧ z ∈ 𝒦

In order to represent that product of second-order cones, the following routinesaccept twointeger vectors which are of the same length as x and z:

6.1. Solvers 409

Page 414: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

1. orders: The size of the subcone containing each entry of x

2. firstInds: The first index (counting from zero) of the subcone containing each entry ofx

Python API

SOCPDirect(A, b, c, orders, firstInds, x, y, z[, ctrl=None])

C++ API

void SOCP(const Matrix<Real> &A, const Matrix<Real> &b, const Matrix<Real> &c,const Matrix<Int> &orders, const Matrix<Int> &firstInds, Matrix<Real> &x,Matrix<Real> &y, Matrix<Real> &z, const socp::direct::Ctrl<Real> &ctrl =socp::direct::Ctrl<Real>(false))

void SOCP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, constElementalMatrix<Real> &c, const ElementalMatrix<Int> &orders, const El-ementalMatrix<Int> &firstInds, ElementalMatrix<Real> &x, ElementalMa-trix<Real> &y, ElementalMatrix<Real> &z, const socp::direct::Ctrl<Real>&ctrl = socp::direct::Ctrl<Real>(false))

void SOCP(const SparseMatrix<Real> &A, const Matrix<Real> &b, const Matrix<Real>&c, const Matrix<Int> &orders, const Matrix<Int> &firstInds, Matrix<Real>&x, Matrix<Real> &y, Matrix<Real> &z, const socp::direct::Ctrl<Real>&ctrl = socp::direct::Ctrl<Real>(true))

void SOCP(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, constDistMultiVec<Real> &c, const DistMultiVec<Int> &orders, const Dist-MultiVec<Int> &firstInds, DistMultiVec<Real> &x, DistMultiVec<Real>&y, DistMultiVec<Real> &z, const socp::direct::Ctrl<Real> &ctrl =socp::direct::Ctrl<Real>(true))

C API

Single-precisionElError ElSOCPDirect s(ElConstMatrix s A, ElConstMatrix s b, ElConstMatrix s c, El-

ConstMatrix i orders, ElConstMatrix i firstInds, ElMatrix s x, El-Matrix s y, ElMatrix s z)

ElError ElSOCPDirectDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElConst-DistMatrix s c, ElConstDistMatrix i orders, ElConstDist-Matrix i firstInds, ElDistMatrix s x, ElDistMatrix s y, ElD-istMatrix s z)

ElError ElSOCPDirectSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, El-ConstMatrix s c, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix s x, ElMatrix s y, ElMatrix s z)

ElError ElSOCPDirectDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMulti-Vec s b, ElConstDistMultiVec s c, ElConstDistMul-tiVec i orders, ElConstDistMultiVec i firstInds, El-DistMultiVec s x, ElDistMultiVec s y, ElDistMulti-Vec s z)

410 Chapter 6. Optimization

Page 415: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precisionElError ElSOCPDirect d(ElConstMatrix d A, ElConstMatrix d b, ElConstMatrix d c, El-

ConstMatrix i orders, ElConstMatrix i firstInds, ElMatrix d x, El-Matrix d y, ElMatrix d z)

ElError ElSOCPDirectDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElConst-DistMatrix d c, ElConstDistMatrix i orders, ElConstDist-Matrix i firstInds, ElDistMatrix d x, ElDistMatrix d y, El-DistMatrix d z)

ElError ElSOCPDirectSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, El-ConstMatrix d c, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix d x, ElMatrix d y, ElMatrix d z)

ElError ElSOCPDirectDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMulti-Vec d b, ElConstDistMultiVec d c, ElConstDistMul-tiVec i orders, ElConstDistMultiVec i firstInds, ElD-istMultiVec d x, ElDistMultiVec d y, ElDistMulti-Vec d z)

Expert interface

Single-precisionElError ElSOCPDirectX s(ElConstMatrix s A, ElConstMatrix s b, ElConstMatrix s c, El-

ConstMatrix i orders, ElConstMatrix i firstInds, ElMatrix s x,ElMatrix s y, ElMatrix s z, ElSOCPDirectCtrl s ctrl)

ElError ElSOCPDirectXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElConst-DistMatrix s c, ElConstDistMatrix i orders, ElConstDist-Matrix i firstInds, ElDistMatrix s x, ElDistMatrix s y, ElD-istMatrix s z, ElSOCPDirectCtrl s ctrl)

ElError ElSOCPDirectXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElCon-stMatrix s c, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix s x, ElMatrix s y, ElMatrix s z,ElSOCPDirectCtrl s ctrl)

ElError ElSOCPDirectXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMulti-Vec s b, ElConstDistMultiVec s c, ElConstDist-MultiVec i orders, ElConstDistMultiVec i firstInds,ElDistMultiVec s x, ElDistMultiVec s y, ElDist-MultiVec s z, ElSOCPDirectCtrl s ctrl)

Double-precisionElError ElSOCPDirectX d(ElConstMatrix d A, ElConstMatrix d b, ElConstMatrix d c, El-

ConstMatrix i orders, ElConstMatrix i firstInds, ElMatrix d x,ElMatrix d y, ElMatrix d z, ElSOCPDirectCtrl d ctrl)

ElError ElSOCPDirectXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElConst-DistMatrix d c, ElConstDistMatrix i orders, ElConstDist-Matrix i firstInds, ElDistMatrix d x, ElDistMatrix d y, El-DistMatrix d z, ElSOCPDirectCtrl d ctrl)

ElError ElSOCPDirectXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, El-ConstMatrix d c, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix d x, ElMatrix d y, ElMatrix d z,ElSOCPDirectCtrl d ctrl)

6.1. Solvers 411

Page 416: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSOCPDirectXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMulti-Vec d b, ElConstDistMultiVec d c, ElConstDist-MultiVec i orders, ElConstDistMultiVec i firstInds,ElDistMultiVec d x, ElDistMultiVec d y, ElDist-MultiVec d z, ElSOCPDirectCtrl d ctrl)

Affine Second-Order Cone Programs

minx,s

cTx | Ax = b ∧ Gx + s = h ∧ s ∈ 𝒦 ,

maxy,z

−bTy − hTz | ATy + GTz + c = 0 ∧ z ∈ 𝒦

In order to represent that product of second-order cones, the following routines accept twointeger vectors which are of the same length as s and z:

1. orders: The size of the subcone containing each entry of s

2. firstInds: The first index (counting from zero) of the subcone containing each entry ofs

Python API

SOCPAffine(A, G, b, c, h, orders, firstInds, x, y, z, s[, ctrl=None])

C++ API

void SOCP(const Matrix<Real> &A, const Matrix<Real> &G, const Matrix<Real> &b,const Matrix<Real> &c, const Matrix<Real> &h, const Matrix<Int> &or-ders, const Matrix<Int> &firstInds, Matrix<Real> &x, Matrix<Real> &y,Matrix<Real> &z, Matrix<Real> &s, const socp::affine::Ctrl<Real> &ctrl =socp::affine::Ctrl<Real>())

void SOCP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &G, constElementalMatrix<Real> &b, const ElementalMatrix<Real> &c, const Ele-mentalMatrix<Real> &h, const ElementalMatrix<Int> &orders, const El-ementalMatrix<Int> &firstInds, ElementalMatrix<Real> &x, ElementalMa-trix<Real> &y, ElementalMatrix<Real> &z, ElementalMatrix<Real> &s, constsocp::affine::Ctrl<Real> &ctrl = socp::affine::Ctrl<Real>())

void SOCP(const SparseMatrix<Real> &A, const SparseMatrix<Real> &G, constMatrix<Real> &b, const Matrix<Real> &c, const Matrix<Real> &h,Matrix<Real> &x, const Matrix<Int> &orders, const Matrix<Int>&firstInds, Matrix<Real> &y, Matrix<Real> &z, Matrix<Real> &s, constsocp::affine::Ctrl<Real> &ctrl = socp::affine::Ctrl<Real>())

void SOCP(const DistSparseMatrix<Real> &A, const DistSparseMatrix<Real> &G, constDistMultiVec<Real> &b, const DistMultiVec<Real> &c, const DistMulti-Vec<Real> &h, const DistMultiVec<Int> &orders, const DistMultiVec<Int>&firstInds, DistMultiVec<Real> &x, DistMultiVec<Real> &y, DistMulti-Vec<Real> &z, DistMultiVec<Real> &s, const socp::affine::Ctrl<Real> &ctrl= socp::affine::Ctrl<Real>())

412 Chapter 6. Optimization

Page 417: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

Single-precisionElError ElSOCPAffine s(ElConstMatrix s A, ElConstMatrix s G, ElConstMatrix s b, El-

ConstMatrix s c, ElConstMatrix s h, ElConstMatrix i orders, El-ConstMatrix i firstInds, ElMatrix s x, ElMatrix s y, ElMatrix s z,ElMatrix s s)

ElError ElSOCPAffineDist s(ElConstDistMatrix s A, ElConstDistMatrix s G, ElCon-stDistMatrix s b, ElConstDistMatrix s c, ElConstDist-Matrix s h, ElConstDistMatrix i orders, ElConstDistMa-trix i firstInds, ElDistMatrix s x, ElDistMatrix s y, ElDist-Matrix s z, ElDistMatrix s s)

ElError ElSOCPAffineSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s G, El-ConstMatrix s b, ElConstMatrix s c, ElConstMatrix s h,ElConstMatrix i orders, ElConstMatrix i firstInds, ElMa-trix s x, ElMatrix s y, ElMatrix s z, ElMatrix s s)

ElError ElSOCPAffineDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparse-Matrix s G, ElConstDistMultiVec s b, ElCon-stDistMultiVec s c, ElConstDistMultiVec s h,ElConstDistMultiVec i orders, ElConstDistMulti-Vec i firstInds, ElDistMultiVec s x, ElDistMulti-Vec s y, ElDistMultiVec s z, ElDistMultiVec s s)

Double-precisionElError ElSOCPAffine d(ElConstMatrix d A, ElConstMatrix d G, ElConstMatrix d b, El-

ConstMatrix d c, ElConstMatrix d h, ElConstMatrix i orders,ElConstMatrix i firstInds, ElMatrix d x, ElMatrix d y, ElMa-trix d z, ElMatrix d s)

ElError ElSOCPAffineDist d(ElConstDistMatrix d A, ElConstDistMatrix s G, ElCon-stDistMatrix d b, ElConstDistMatrix d c, ElConstDist-Matrix d h, ElConstDistMatrix i orders, ElConstDistMa-trix i firstInds, ElDistMatrix d x, ElDistMatrix d y, ElDist-Matrix d z, ElDistMatrix d s)

ElError ElSOCPAffineSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d G,ElConstMatrix d b, ElConstMatrix d c, ElConst-Matrix d h, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix d x, ElMatrix d y, ElMatrix d z,ElMatrix d s)

ElError ElSOCPAffineDistSparse d(ElConstDistSparseMatrix d A, ElConstDistSparse-Matrix s G, ElConstDistMultiVec d b, ElCon-stDistMultiVec d c, ElConstDistMultiVec d h,ElConstDistMultiVec i orders, ElConstDistMulti-Vec i firstInds, ElDistMultiVec d x, ElDistMulti-Vec d y, ElDistMultiVec d z, ElDistMultiVec d s)

Expert interfaces

Single-precision

6.1. Solvers 413

Page 418: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSOCPAffineX s(ElConstMatrix s A, ElConstMatrix s G, ElConstMatrix s b, El-ConstMatrix s c, ElConstMatrix s h, ElConstMatrix i orders,ElConstMatrix i firstInds, ElMatrix s x, ElMatrix s y, ElMa-trix s z, ElMatrix s s, ElSOCPAffineCtrl s ctrl)

ElError ElSOCPAffineXDist s(ElConstDistMatrix s A, ElConstDistMatrix s G, ElCon-stDistMatrix s b, ElConstDistMatrix s c, ElConstDist-Matrix s h, ElConstDistMatrix i orders, ElConstDistMa-trix i firstInds, ElDistMatrix s x, ElDistMatrix s y, ElDist-Matrix s z, ElDistMatrix s s, ElSOCPAffineCtrl s ctrl)

ElError ElSOCPAffineXSparse s(ElConstSparseMatrix s A, ElConstSparseMatrix s G,ElConstMatrix s b, ElConstMatrix s c, ElConst-Matrix s h, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix s x, ElMatrix s y, ElMatrix s z,ElMatrix s s, ElSOCPAffineCtrl s ctrl)

ElError ElSOCPAffineXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistSparse-Matrix s G, ElConstDistMultiVec s b, ElCon-stDistMultiVec s c, ElConstDistMultiVec s h,ElConstDistMultiVec i orders, ElConstDistMulti-Vec i firstInds, ElDistMultiVec s x, ElDistMulti-Vec s y, ElDistMultiVec s z, ElDistMultiVec s s,ElSOCPAffineCtrl s ctrl)

Double-precisionElError ElSOCPAffineX d(ElConstMatrix d A, ElConstMatrix d G, ElConstMatrix d b,

ElConstMatrix d c, ElConstMatrix d h, ElConstMatrix i orders,ElConstMatrix i firstInds, ElMatrix d x, ElMatrix d y, ElMa-trix d z, ElMatrix d s, ElSOCPAffineCtrl d ctrl)

ElError ElSOCPAffineXDist d(ElConstDistMatrix d A, ElConstDistMatrix s G, ElCon-stDistMatrix d b, ElConstDistMatrix d c, ElConstDist-Matrix d h, ElConstDistMatrix i orders, ElConstDistMa-trix i firstInds, ElDistMatrix d x, ElDistMatrix d y, ElDist-Matrix d z, ElDistMatrix d s, ElSOCPAffineCtrl d ctrl)

ElError ElSOCPAffineXSparse d(ElConstSparseMatrix d A, ElConstSparseMatrix d G,ElConstMatrix d b, ElConstMatrix d c, ElConst-Matrix d h, ElConstMatrix i orders, ElConstMa-trix i firstInds, ElMatrix d x, ElMatrix d y, ElMatrix d z,ElMatrix d s, ElSOCPAffineCtrl d ctrl)

ElError ElSOCPAffineXDistSparse d(ElConstDistSparseMatrix d A, ElConst-DistSparseMatrix s G, ElConstDistMultiVec d b,ElConstDistMultiVec d c, ElConstDistMulti-Vec d h, ElConstDistMultiVec i orders, ElCon-stDistMultiVec i firstInds, ElDistMultiVec d x,ElDistMultiVec d y, ElDistMultiVec d z, ElDist-MultiVec d s, ElSOCPAffineCtrl d ctrl)

414 Chapter 6. Optimization

Page 419: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2 Models

6.2.1 Basis pursuit

Basis pursuit (BP) is the search for a solution to Ax = b which minimizes the one norm of x,i.e.,

minx

‖x‖1 such that Ax = b.

Real instances of the problem are expressible as a Linear Program by decomposing x into itspositive and negative parts, say x = u − v, and posing the problem

minu,v

1T(

uv

)|(

A −A) (u

v

)= b ∧

(uv

)≥ 0 .

By default, Elemental solves this linear program via a Mehrotra Predictor-Corrector primal-dual Interior Point Method.

Complex instances of Basis Pursuit are currently supported through Second-Order Cone Pro-grams. TODO: Describe this embedding.

Python API

BP(A, b[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• ctrl – (optional) LPDirectCtrl instance

Return type dense solution vector (with type matching that of b)

C++ API

void BP(const Matrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x, constlp::direct::Ctrl<Real> &ctrl = lp::direct::Ctrl<Real>(false))

void BP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real>&b, ElementalMatrix<Real> &x, const lp::direct::Ctrl<Real> &ctrl =lp::direct::Ctrl<Real>(false))

void BP(const SparseMatrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x,const lp::direct::Ctrl<Real> &ctrl = lp::direct::Ctrl<Real>(true))

void BP(const DistSparseMatrix<Real> &A, const DistMultiVec<Real>&b, DistMultiVec<Real> &x, const lp::direct::Ctrl<Real> &ctrl =lp::direct::Ctrl<Real>(true))

void BP(const Matrix<Complex<Real>> &A, const Matrix<Complex<Real>>&b, Matrix<Complex<Real>> &x, const socp::direct::Ctrl<Real> &ctrl =socp::direct::Ctrl<Real>(false))

6.2. Models 415

Page 420: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void BP(const ElementalMatrix<Complex<Real>> &A, const ElementalMa-trix<Complex<Real>> &b, ElementalMatrix<Complex<Real>> &x, constsocp::direct::Ctrl<Real> &ctrl = socp::direct::Ctrl<Real>(false))

void BP(const SparseMatrix<Complex<Real>> &A, const Matrix<Complex<Real>>&b, Matrix<Complex<Real>> &x, const socp::direct::Ctrl<Real> &ctrl =socp::direct::Ctrl<Real>(true))

void BP(const DistSparseMatrix<Complex<Real>> &A, const DistMulti-Vec<Complex<Real>> &b, DistMultiVec<Complex<Real>> &x, constsocp::direct::Ctrl<Real> &ctrl = socp::direct::Ctrl<Real>(true))

C API

Single-precision

ElError ElBP s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElBPDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x)

ElError ElBPSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElBPDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b, ElD-istMultiVec s x)

Double-precision

ElError ElBP d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElBPDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x)

ElError ElBPSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElBPDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b, El-DistMultiVec d x)

Single-precision complex

ElError ElBP c(ElConstMatrix c A, ElConstMatrix c b, ElMatrix c x)

ElError ElBPDist c(ElConstDistMatrix c A, ElConstDistMatrix c b, ElDistMatrix c x)

ElError ElBPSparse c(ElConstSparseMatrix c A, ElConstMatrix c b, ElMatrix c x)

ElError ElBPDistSparse c(ElConstDistSparseMatrix c A, ElConstDistMultiVec c b, ElD-istMultiVec c x)

Double-precision complex

ElError ElBP z(ElConstMatrix z A, ElConstMatrix z b, ElMatrix z x)

ElError ElBPDist z(ElConstDistMatrix z A, ElConstDistMatrix z b, ElDistMatrix z x)

ElError ElBPSparse z(ElConstSparseMatrix z A, ElConstMatrix z b, ElMatrix z x)

416 Chapter 6. Optimization

Page 421: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElBPDistSparse z(ElConstDistSparseMatrix z A, ElConstDistMultiVec z b, ElD-istMultiVec z x)

Expert interface

Single-precision

ElError ElBPX s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x, ElLPDirectC-trl s ctrl)

ElError ElBPXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x,ElLPDirectCtrl s ctrl)

ElError ElBPXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x,ElLPDirectCtrl s ctrl)

ElError ElBPXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b, El-DistMultiVec s x, ElLPDirectCtrl s ctrl)

Double-precision

ElError ElBPX d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x, ElLPDirectC-trl d ctrl)

ElError ElBPXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x,ElLPDirectCtrl d ctrl)

ElError ElBPXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x,ElLPDirectCtrl d ctrl)

ElError ElBPXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b, El-DistMultiVec d x, ElLPDirectCtrl d ctrl)

Single-precision complex

ElError ElBPX c(ElConstMatrix c A, ElConstMatrix c b, ElMatrix c x, ElSOCPDirectC-trl s ctrl)

ElError ElBPXDist c(ElConstDistMatrix c A, ElConstDistMatrix c b, ElDistMatrix c x,ElSOCPDirectCtrl s ctrl)

ElError ElBPXSparse c(ElConstSparseMatrix c A, ElConstMatrix c b, ElMatrix c x, El-SOCPDirectCtrl s ctrl)

ElError ElBPXDistSparse c(ElConstDistSparseMatrix c A, ElConstDistMultiVec c b, El-DistMultiVec c x, ElSOCPDirectCtrl s ctrl)

Double-precision complex

ElError ElBPX z(ElConstMatrix z A, ElConstMatrix z b, ElMatrix z x, ElSOCPDirectC-trl d ctrl)

ElError ElBPXDist z(ElConstDistMatrix z A, ElConstDistMatrix z b, ElDistMatrix z x,ElSOCPDirectCtrl d ctrl)

ElError ElBPXSparse z(ElConstSparseMatrix z A, ElConstMatrix z b, ElMatrix z x, El-SOCPDirectCtrl d ctrl)

6.2. Models 417

Page 422: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElBPXDistSparse z(ElConstDistSparseMatrix z A, ElConstDistMultiVec z b, El-DistMultiVec z x, ElSOCPDirectCtrl d ctrl)

6.2.2 Basis pursuit denoising / Lasso

Basis pursuit denoising (BPDN) seeks the solution to the problem

minx

12‖b − Ax‖2

2 + λ‖x‖1,

which, for a particular value of λ, is equivalent to the Least absolute shrinkage and selectionoperator (Lasso).

Real instances of the problem are expressable as a Quadratic Program by decomposing x intoits positive and negative parts, say x = u − v, and posing the problem

minu,v,r

12

rTr + λT(

uv

)|(

A −A) (u

v

)+ r = b ∧

(uv

)≥ 0 .

By default, Elemental solves this quadratic program via a Mehrotra Predictor-Correctorprimal-dual Interior Point Method.

Python API

BPDN(A, b, lambd[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• lambd – penalty on the one-norm of the solution vector

• ctrl – (optional) BPDNCtrl s or BPDNCtrl d instance, depending uponwhether the data is single-precision or double-precision

Return type dense solution vector (with type matching that of b)

C++ API

void BPDN(const Matrix<Real> &A, const Matrix<Real> &b, Real lambda, Matrix<Real>&x, const BPDNCtrl<Real> &ctrl = BPDNCtrl<Real>())

void BPDN(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, Reallambda, ElementalMatrix<Real> &x, const BPDNCtrl<Real> &ctrl = BPDNC-trl<Real>())

void BPDN(const SparseMatrix<Real> &A, const Matrix<Real> &b, Real lambda, Ma-trix<Real> &x, const BPDNCtrl<Real> &ctrl = BPDNCtrl<Real>())

void BPDN(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, Reallambda, DistMultiVec<Real> &x, const BPDNCtrl<Real> &ctrl = BPDNC-trl<Real>())

418 Chapter 6. Optimization

Page 423: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

Single-precision

ElError ElBPDN s(ElConstMatrix s A, ElConstMatrix s b, float lambda, ElMatrix s x)

ElError ElBPDNDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda, ElD-istMatrix s x)

ElError ElBPDNSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda, El-Matrix s x)

ElError ElBPDNDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda, ElDistMultiVec s x)

Double-precision

ElError ElBPDN d(ElConstMatrix d A, ElConstMatrix d b, double lambda, ElMatrix d x)

ElError ElBPDNDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda, El-DistMatrix d x)

ElError ElBPDNSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda,ElMatrix d x)

ElError ElBPDNDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda, ElDistMultiVec d x)

Expert interface

Single-precision

ElError ElBPDNX s(ElConstMatrix s A, ElConstMatrix s b, float lambda, ElMatrix s x,ElBPDNCtrl s ctrl)

ElError ElBPDNXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda, ElD-istMatrix s x, ElBPDNCtrl s ctrl)

ElError ElBPDNXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda, El-Matrix s x, ElBPDNCtrl s ctrl)

ElError ElBPDNXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda, ElDistMultiVec s x, ElBPDNCtrl s ctrl)

Double-precision

ElError ElBPDNX d(ElConstMatrix d A, ElConstMatrix d b, double lambda, ElMatrix d x,ElBPDNCtrl d ctrl)

ElError ElBPDNXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda,ElDistMatrix d x, ElBPDNCtrl d ctrl)

ElError ElBPDNXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda,ElMatrix d x, ElBPDNCtrl d ctrl)

ElError ElBPDNXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda, ElDistMultiVec d x, ElBPDNCtrl d ctrl)

6.2. Models 419

Page 424: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.3 Chebyshev point

A Chebyshev point (CP) minimizes b − Ax in a pointwise sense, i.e.,

minx

‖Ax − b‖∞,

and is known to be the solution of a linear program when A and b are real. In particular, wemay solve

minx,t

t | − t ≤ Ax − b ≤ t ,

which, in affine conic form, becomes

minx,t

(

01

)T (xt

)|(

A −1−A −1

)(xt

)≤(

b−b

).

By default, Elemental solves this linear program via a Mehrotra Predictor-Corrector primal-dual Interior Point Method.

Python API

CP(A, b[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• ctrl – (optional) LPAffineCtrl instance

Return type dense solution vector (with type matching that of b)

C++ API

void CP(const Matrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x, constlp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void CP(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, Elemental-Matrix<Real> &x, const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void CP(const SparseMatrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x,const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void CP(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, DistMulti-Vec<Real> &x, const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElCP s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElCPDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x)

420 Chapter 6. Optimization

Page 425: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElCPSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElCPDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b, ElD-istMultiVec s x)

Double-precision

ElError ElCP d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElCPDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x)

ElError ElCPSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElCPDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b, El-DistMultiVec d x)

Expert interface

Single-precision

ElError ElCPX s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x, ElLPAffineC-trl s ctrl)

ElError ElCPXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x,ElLPAffineCtrl s ctrl)

ElError ElCPXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x, ElL-PAffineCtrl s ctrl)

ElError ElCPXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b, El-DistMultiVec s x, ElLPAffineCtrl s ctrl)

Double-precision

ElError ElCPX d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x, ElLPAffineC-trl d ctrl)

ElError ElCPXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x,ElLPAffineCtrl d ctrl)

ElError ElCPXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x, ElL-PAffineCtrl d ctrl)

ElError ElCPXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b, El-DistMultiVec d x, ElLPAffineCtrl d ctrl)

6.2.4 Dantzig selector

The Dantzig selector (DS) attempts to balance the approximate satisfaction of a highly under-determined system of equations with a sparsity-promoting ℓ1 penalty on the solution usingonly linear programming:

minx

‖x‖1 such that ‖AT(b − Ax)‖∞ ≤ λ.

6.2. Models 421

Page 426: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

In addition to the specific LP formulation in Candes and Tao’s original paper, Friedlander andSaunders proposed two mappings, (DS1):

minu,v,t

1T(u + v) |(

AT A −AT A I)u

vt

= ATb ∧ u, v ≥ 0 ∧ ‖t‖∞ ≤ λ , and

(DS2):

minu,v,r,t

1T(u + v) |(

A −A I 00 0 AT I

)uvrt

=

(b0

)∧ u, v ≥ 0 ∧ ‖t‖∞ ≤ λ ,

which they argued to be superior in performance and conditioning. Elemental defaults to(DS1) for dense matrices and (DS2) for sparse matrices and applies a Mehrotra Predictor-Corrector primal-dual Interior Point Method.

Python API

DS(A, b, lambd[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• lambd – bound on the maximum absolute value of AT(b − Ax)

• ctrl – (optional) LPAffineCtrl instance

Return type dense solution vector (with type matching that of b)

C++ API

void DS(const Matrix<Real> &A, const Matrix<Real> &b, Real lambda, Matrix<Real>&x, const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void DS(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, Reallambda, ElementalMatrix<Real> &x, const lp::affine::Ctrl<Real> &ctrl =lp::affine::Ctrl<Real>())

void DS(const SparseMatrix<Real> &A, const Matrix<Real> &b, Real lambda, Ma-trix<Real> &x, const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void DS(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, Reallambda, DistMultiVec<Real> &x, const lp::affine::Ctrl<Real> &ctrl =lp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElDS s(ElConstMatrix s A, ElConstMatrix s b, float lambda, ElMatrix s x)

422 Chapter 6. Optimization

Page 427: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElDSDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda, ElDist-Matrix s x)

ElError ElDSSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda, ElMa-trix s x)

ElError ElDSDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda, ElDistMultiVec s x)

Double-precision

ElError ElDS d(ElConstMatrix d A, ElConstMatrix d b, double lambda, ElMatrix d x)

ElError ElDSDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda, ElD-istMatrix d x)

ElError ElDSSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda, El-Matrix d x)

ElError ElDSDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda, ElDistMultiVec d x)

Expert interface

Single-precision

ElError ElDSX s(ElConstMatrix s A, ElConstMatrix s b, float lambda, ElMatrix s x, ElL-PAffineCtrl s ctrl)

ElError ElDSXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda, ElDist-Matrix s x, ElLPAffineCtrl s ctrl)

ElError ElDSXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda, ElMa-trix s x, ElLPAffineCtrl s ctrl)

ElError ElDSXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda, ElDistMultiVec s x, ElLPAffineCtrl s ctrl)

Double-precision

ElError ElDSX d(ElConstMatrix d A, ElConstMatrix d b, double lambda, ElMatrix d x,ElLPAffineCtrl d ctrl)

ElError ElDSXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda, El-DistMatrix d x, ElLPAffineCtrl d ctrl)

ElError ElDSXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda, El-Matrix d x, ElLPAffineCtrl d ctrl)

ElError ElDSXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda, ElDistMultiVec d x, ElLPAffineCtrl d ctrl)

6.2. Models 423

Page 428: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.5 Elastic net

The elastic net (EN) seeks an approximate solution to a (usually undetermined) system ofequations which penalizes both the one and two norms of the solution:

minx

‖b − Ax‖22 + λ1‖x‖1 + λ2‖x‖2

2.

One could perhaps motivate the elastic net by recognizing that an LQ decomposition of anunderdetermined systems of equations finds an x which exactly satisfies Ax = b and simulta-neously minimizes ‖x‖2. From this perspective, for underdetermined systems, the elastic nettrades the exact satisfaction of Ax = b, which would be provided via an LQ decomposition,for the hope of a sparse x via the addition of a penalty on ‖x‖1.

Real instances of the problem are expressable as an (affine) quadratic program in a mannerwhich is nearly identical to that of basis pursuit denoising (BPDN): by splitting x into its pos-itive and negative components, say x = u − v, and introducing the residual r = b − Ax, onearrives at

minu,v,r

rTr + λ2(uTu + vTv) + λ11T(u + v)

s.t.(

A −A) (u

v

)+ r = b, u, v ≥ 0.

By default, Elemental solves this equation using a Mehrotra Predictor-Corrector primal-dualInterior Point Method.

Python API

EN(A, b, lambda1, lambda2[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• lambda1 – penalty on the one-norm of the solution

• lambda2 – penalty on the square of the two-norm of the solution

• ctrl – (optional) QPAffineCtrl instance

Return type dense solution vector (with type matching that of b)

C++ API

void EN(const Matrix<Real> &A, const Matrix<Real> &b, Real lambda1,Real lambda2, Matrix<Real> &x, const qp::affine::Ctrl<Real> &ctrl =qp::affine::Ctrl<Real>())

void EN(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &b, Reallambda1, Real lambda2, ElementalMatrix<Real> &x, const qp::affine::Ctrl<Real>&ctrl = qp::affine::Ctrl<Real>())

void EN(const SparseMatrix<Real> &A, const Matrix<Real> &b, Real lambda1,Real lambda2, Matrix<Real> &x, const qp::affine::Ctrl<Real> &ctrl =qp::affine::Ctrl<Real>())

424 Chapter 6. Optimization

Page 429: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void EN(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, Real lambda1,Real lambda2, DistMultiVec<Real> &x, const qp::affine::Ctrl<Real> &ctrl =qp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElEN s(ElConstMatrix s A, ElConstMatrix s b, float lambda1, float lambda2, ElMa-trix s x)

ElError ElENDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda1,float lambda2, ElDistMatrix s x)

ElError ElENSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda1,float lambda2, ElMatrix s x)

ElError ElENDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda1, float lambda2, ElDistMultiVec s x)

Double-precision

ElError ElEN d(ElConstMatrix d A, ElConstMatrix d b, double lambda1, double lambda2,ElMatrix d x)

ElError ElENDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda1,double lambda2, ElDistMatrix d x)

ElError ElENSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda1,double lambda2, ElMatrix d x)

ElError ElENDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda1, double lambda2, ElDistMultiVec d x)

Expert interface

Single-precision

ElError ElENX s(ElConstMatrix s A, ElConstMatrix s b, float lambda1, float lambda2, El-Matrix s x, ElQPAffineCtrl s ctrl)

ElError ElENXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, float lambda1,float lambda2, ElDistMatrix s x, ElQPAffineCtrl s ctrl)

ElError ElENXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, float lambda1,float lambda2, ElMatrix s x, ElQPAffineCtrl s ctrl)

ElError ElENXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,float lambda1, float lambda2, ElDistMultiVec s x, ElQ-PAffineCtrl s ctrl)

6.2. Models 425

Page 430: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision

ElError ElENX d(ElConstMatrix d A, ElConstMatrix d b, double lambda1, double lambda2,ElMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElENXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, double lambda1,double lambda2, ElDistMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElENXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, double lambda1,double lambda2, ElMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElENXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,double lambda1, double lambda2, ElDistMultiVec d x, ElQ-PAffineCtrl d ctrl)

6.2.6 Least Absolute Value regression

Least Absolute Value (LAV) regression minimizes a residual b − Ax in the one-norm, i.e.,

minx

‖Ax − b‖1,

and is known to be the solution of a linear program when A and b are real. In particular, wemay solve

minx,u,v

1T(

uv

)|(

A I −I)x

uv

= b ∧ u, v ≥ 0 .

By default, Elemental solves this linear program via a Mehrotra Predictor-Corrector primal-dual Interior Point Method.

Python API

LAV(A, b[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• b – dense right-hand side vector (with type compatible to A)

• ctrl – (optional) LPAffineCtrl instance

Return type dense solution vector (with type matching that of b)

C++ API

void LAV(const Matrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x, constlp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

void LAV(const ElementalMatrix<Real> &A, const ElementalMatrix<Real>&b, ElementalMatrix<Real> &x, const lp::affine::Ctrl<Real> &ctrl =lp::affine::Ctrl<Real>())

void LAV(const SparseMatrix<Real> &A, const Matrix<Real> &b, Matrix<Real> &x,const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

426 Chapter 6. Optimization

Page 431: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void LAV(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &b, DistMulti-Vec<Real> &x, const lp::affine::Ctrl<Real> &ctrl = lp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElLAV s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElLAVDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x)

ElError ElLAVSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x)

ElError ElLAVDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b, El-DistMultiVec s x)

Double-precision

ElError ElLAV d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElLAVDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x)

ElError ElLAVSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x)

ElError ElLAVDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b, El-DistMultiVec d x)

Expert interface

Single-precision

ElError ElLAVX s(ElConstMatrix s A, ElConstMatrix s b, ElMatrix s x, ElLPAffineC-trl s ctrl)

ElError ElLAVXDist s(ElConstDistMatrix s A, ElConstDistMatrix s b, ElDistMatrix s x,ElLPAffineCtrl s ctrl)

ElError ElLAVXSparse s(ElConstSparseMatrix s A, ElConstMatrix s b, ElMatrix s x, ElL-PAffineCtrl s ctrl)

ElError ElLAVXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s b,ElDistMultiVec s x, ElLPAffineCtrl s ctrl)

Double-precision

ElError ElLAVX d(ElConstMatrix d A, ElConstMatrix d b, ElMatrix d x, ElLPAffineC-trl d ctrl)

ElError ElLAVXDist d(ElConstDistMatrix d A, ElConstDistMatrix d b, ElDistMatrix d x,ElLPAffineCtrl d ctrl)

ElError ElLAVXSparse d(ElConstSparseMatrix d A, ElConstMatrix d b, ElMatrix d x,ElLPAffineCtrl d ctrl)

ElError ElLAVXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d b,ElDistMultiVec d x, ElLPAffineCtrl d ctrl)

6.2. Models 427

Page 432: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.7 Logistic regression

Given a sequence of vectors ain−1i=0 ⊂ Rm with binary labels ηin−1

i=0 ⊂ 0, 1, ℓp-regularizedlogistic regression solves the problem

minz,ν

1n

n−1

∑i=0

f (zHai + νηi) + λ‖z‖p,

where f is the logistic loss function,

f (t) = log(1 + e−t).

Note: While sometimes functional, this implementation is still very much a work-in-progress.

C++ API

Regularization

An enum which can take on the values NO PENALTY, L1 PENALTY, and L2 PENALTY

Int LogisticRegression(const Matrix<Real> &G, const Matrix<Real> &q, Ma-trix<Real> &z, Real gamma, Regularization penalty =L1 PENALTY, Real rho = 1, Int maxIter = 500, bool inv = true,bool progress = true)

Int LogisticRegression(const ElementalMatrix<Real> &G, const ElementalMa-trix<Real> &q, ElementalMatrix<Real> &z, Real gamma,Regularization penalty = L1 PENALTY, Real rho = 1, Int maxIter= 500, bool inv = true, bool progress = true)

C API

ElRegularization

An enum which can take on the values EL NO PENALTY, EL L1 PENALTY, andEL L2 PENALTY

ElError ElLogisticRegression s(ElConstMatrix s G, ElConstMatrix s q, ElMatrix s z,float gamma, ElRegularization penalty, ElInt* numIts)

ElError ElLogisticRegression d(ElConstMatrix d G, ElConstMatrix d q, ElMatrix d z,double gamma, ElRegularization penalty, ElInt* numIts)

ElError ElLogisticRegressionDist s(ElConstDistMatrix s G, ElConstDistMatrix s q,ElDistMatrix s z, float gamma, ElRegulariza-tion penalty, ElInt* numIts)

ElError ElLogisticRegressionDist d(ElConstDistMatrix d G, ElConstDistMatrix d q,ElDistMatrix d z, double gamma, ElRegulariza-tion penalty, ElInt* numIts)

428 Chapter 6. Optimization

Page 433: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.8 Model fit

Rather than fitting a model

minz

l(Az + b) + r(z),

via a specific choice of a loss function, l, and regularization function, r, such as for a supportvector machine or logistic regression, the following routines accept function wrappers for theproximal maps said functions and execute an Alternating Direction Method of Multipliers.

Note: While sometimes functional, this implementation is still very much a work-in-progress.

C++ API

Int ModelFit(std::function<void)Matrix<Real>&, Real> lossProx, std::function<voidMatrix<Real>&, Real> regProx, const Matrix<Real> &A,const Matrix<Real> &b, Matrix<Real> &w, Real rho, Int maxIter = 1000, bool inv = true,bool progress = true

Int ModelFit(std::function<void)DistMatrix<Real>&, Real> lossProx, std::function<voidDistMatrix<Real>&, Real> regProx, const ElementalMa-trix<Real> &A, const ElementalMatrix<Real> &b, ElementalMatrix<Real> &w, Real rho,Int maxIter = 1000, bool inv = true, bool progress = true

C API

ElError ElModelFit s(void (*lossProx)(ElMatrix s,float), void (*reg-Prox)(ElMatrix s,float), ElConstMatrix s A, ElConstMatrix s b,ElMatrix s w, float rho, ElInt* numIts)

ElError ElModelFit d(void (*lossProx)(ElMatrix d,double), void (*reg-Prox)(ElMatrix d,double), ElConstMatrix d A, ElConstMatrix d b,ElMatrix d w, double rho, ElInt* numIts)

ElError ElModelFitDist s(void (*lossProx)(ElDistMatrix s,float), void (*reg-Prox)(ElDistMatrix s,float), ElConstDistMatrix s A, ElConst-DistMatrix s b, ElDistMatrix s w, float rho, ElInt* numIts)

ElError ElModelFitDist d(void (*lossProx)(ElDistMatrix d,double), void (*reg-Prox)(ElDistMatrix d,double), ElConstDistMatrix d A,ElConstDistMatrix d b, ElDistMatrix d w, double rho,ElInt* numIts)

6.2.9 Non-negative matrix factorizations

A rank-k non-negative matrix factorization of an m × n matrix A with all non-negative entries isa solution to the problem

minX,Y

‖A − XY‖F, such that X, Y ≥ 0

where X is m × k and Y is k × n.

The following routines employ alternating non-negative least squares algorithms.

6.2. Models 429

Page 434: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Note: The following routines are still just prototypes and do not employ proper stoppingcriteria

Python API

NMF(A[, ctrl=None])Parameters

• A – dense, sequential or distributed matrix to approximate with NMF

• ctrl – (optional) NNLSCtrl s or NNLSCtrl d control structure, depend-ing upon whether the data is single-precision or double-precision

Return type the two non-negative factors (which will have types compatiblewith that of A)

C++ API

void NMF(const Matrix<Real> &A, Matrix<Real> &X, Matrix<Real> &Y, const NNLSC-trl<Real> &ctrl = NNLSCtrl<Real>())

void NMF(const ElementalMatrix<Real> &A, ElementalMatrix<Real> &X, ElementalMa-trix<Real> &Y, const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())

C API

Standard interface

Single-precisionElError ElNMF s(ElConstMatrix s A, ElMatrix s X, ElMatrix s Y)ElError ElNMFDist s(ElConstDistMatrix s A, ElDistMatrix s X, ElDistMatrix s Y)

Double-precisionElError ElNMF d(ElConstMatrix d A, ElMatrix d X, ElMatrix d Y)ElError ElNMFDist d(ElConstDistMatrix d A, ElDistMatrix d X, ElDistMatrix d Y)

Expert interface

Single-precisionElError ElNMFX s(ElConstMatrix s A, ElMatrix s X, ElMatrix s Y, ElNNLSCtrl s ctrl)ElError ElNMFXDist s(ElConstDistMatrix s A, ElDistMatrix s X, ElDistMatrix s Y,

ElNNLSCtrl s ctrl)

Double-precisionElError ElNMFX d(ElConstMatrix d A, ElMatrix d X, ElMatrix d Y, ElNNLSCtrl d ctrl)ElError ElNMFXDist d(ElConstDistMatrix d A, ElDistMatrix d X, ElDistMatrix d Y,

ElNNLSCtrl d ctrl)

430 Chapter 6. Optimization

Page 435: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.10 Non-negative least squares

Non-negative least squares minimizes the residual b − Ax under the constraint that x must havenon-negative entries, i.e.,

minx

‖Ax − b‖2 such that x ≥ 0,

and real instances of this problem is well-known to be expressable as the quadratic program

minx

12

xT(AT A)x + (−ATb)Tx

s.t. x ≥ 0.

Elemental defaults to solving this QP via a Mehrotra Predictor-Corrector primal-dual InteriorPoint Method, but a (prototype) batched version of QP ADMM is also available.

Python API

NNLS(A, B[, ctrl=None])Parameters

• A – dense or sparse, sequential or distributed matrix

• B – dense right-hand side matrix (with type compatible to A)

• ctrl – (optional) NNLSCtrl s or NNLSCtrl d instance, depending uponwhether data is single-precision or double-precision

Return type dense solution vector (with type matching that of b)

C++ API

void NNLS(const Matrix<Real> &A, const Matrix<Real> &B, Matrix<Real> &X, constNNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())

void NNLS(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &B, Elemen-talMatrix<Real> &X, const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())

void NNLS(const SparseMatrix<Real> &A, const Matrix<Real> &B, Matrix<Real> &X,const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())

void NNLS(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &B, DistMulti-Vec<Real> &X, const NNLSCtrl<Real> &ctrl = NNLSCtrl<Real>())

C API

Single-precision

ElError ElNNLS s(ElConstMatrix s A, ElConstMatrix s B, ElMatrix s X)

ElError ElNNLSDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElDistMatrix s X)

ElError ElNNLSSparse s(ElConstSparseMatrix s A, ElConstMatrix s B, ElMatrix s X)

ElError ElNNLSDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s B,ElDistMultiVec s X)

6.2. Models 431

Page 436: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision

ElError ElNNLS d(ElConstMatrix d A, ElConstMatrix d B, ElMatrix d X)

ElError ElNNLSDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElDistMa-trix d X)

ElError ElNNLSSparse d(ElConstSparseMatrix d A, ElConstMatrix d B, ElMatrix d X)

ElError ElNNLSDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d B,ElDistMultiVec d X)

Expert interface

Single-precision

ElError ElNNLSX s(ElConstMatrix s A, ElConstMatrix s B, ElMatrix s X, ElNNLSC-trl s ctrl)

ElError ElNNLSXDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElDistMa-trix s X, ElNNLSCtrl s ctrl)

ElError ElNNLSXSparse s(ElConstSparseMatrix s A, ElConstMatrix s B, ElMatrix s X,ElNNLSCtrl s ctrl)

ElError ElNNLSXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s B,ElDistMultiVec s X, ElNNLSCtrl s ctrl)

Double-precision

ElError ElNNLSX d(ElConstMatrix d A, ElConstMatrix d B, ElMatrix d X, ElNNLSC-trl d ctrl)

ElError ElNNLSXDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElDistMa-trix d X, ElNNLSCtrl d ctrl)

ElError ElNNLSXSparse d(ElConstSparseMatrix d A, ElConstMatrix d B, ElMatrix d X,ElNNLSCtrl d ctrl)

ElError ElNNLSXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d B,ElDistMultiVec d X, ElNNLSCtrl d ctrl)

6.2.11 Robust principal component analysis

Robust principal component analysis (RPCA) seeks a decomposition of a matrix as a sum of alow-rank and sparse matrix, i.e.,

M = L + S,

where a balance is sought between the rank of L and the number of nonzeros in S. Such abalance is (weakly) imposed via convex relaxations of penalties on the number of nonzerosingular values of L and entries of S to their ℓ1 counterparts. In particular, a solution is soughtfor the problem

minL,S

‖L‖* + ‖vec(S)‖1 such that M = L + S,

where ‖ · ‖* denotes the nuclear norm and ‖vec(·)‖1 denotes the entrywise one-norm.

432 Chapter 6. Optimization

Page 437: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

RPCA(M[, ctrl=None])

C++ API

class RPCACtrl

bool useALM

bool usePivQR

bool progress

Int numPivSteps

Int maxIts

Real tau

Real beta

Real rho

Real tol

RPCACtrl()

void RPCA(const ElementalMatrix<F> &M, ElementalMatrix<F> &L, ElementalMa-trix<F> &S, const RPCACtrl<Base<F>> &ctrl = RPCACtrl<Base<F>>())

C API

ElError ElRPCADist s(ElConstDistMatrix s M, ElDistMatrix s L, ElDistMatrix s S)

ElError ElRPCADist d(ElConstDistMatrix d M, ElDistMatrix d L, ElDistMatrix d S)

ElError ElRPCADist c(ElConstDistMatrix c M, ElDistMatrix c L, ElDistMatrix c S)

ElError ElRPCADist z(ElConstDistMatrix z M, ElDistMatrix z L, ElDistMatrix z S)

6.2.12 Sparse inverse covariance selection

The following routines attempt to find a sparse inverse covariance matrix which could gener-ate the given observations. This search is performed by attempting to solve the program

min trace(SZ)− log det Z + λ‖vec(Z)‖1

using the Alternating Direction Method of Multipliers.

The following functions were inspired by a simple ADMM solver due to Boyd et al. Elemen-tal’s implementations make use of parallel (dense) linear algebra (including PMRRR for thesymmetric tridiagonal eigensolver).

6.2. Models 433

Page 438: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

SparseInvCov(D,lambd[,ctrl=None]

C++ API

Int SparseInvCov(const Matrix<F> &D, Base<F> lambda, Matrix<F> &Z, const Spar-seInvCovCtrl<Base<F>> &ctrl = SparseInvCovCtrl<Base<F>>())

Int SparseInvCov(const ElementalMatrix<F> &D, Base<F> lambda, ElementalMatrix<F>&Z, const SparseInvCovCtrl<Base<F>> &ctrl = SparseInvCovC-trl<Base<F>>())

Implementations

Example driver

C API

Single-precision

ElError ElSparseInvCov s(ElConstMatrix s D, float lambda, ElMatrix s Z, ElInt* numIts)

ElError ElSparseInvCovDist s(ElConstDistMatrix s D, float lambda, ElDistMatrix s Z,ElInt* numIts)

Double-precision

ElError ElSparseInvCov d(ElConstMatrix d D, double lambda, ElMatrix d Z, ElInt* nu-mIts)

ElError ElSparseInvCovDist d(ElConstDistMatrix d D, double lambda, ElDistMa-trix d Z, ElInt* numIts)

Single-precision complex

ElError ElSparseInvCov c(ElConstMatrix c D, float lambda, ElMatrix c Z, ElInt* numIts)

ElError ElSparseInvCovDist c(ElConstDistMatrix c D, float lambda, ElDistMatrix c Z,ElInt* numIts)

Double-precision complex

ElError ElSparseInvCov z(ElConstMatrix z D, double lambda, ElMatrix z Z, ElInt* nu-mIts)

ElError ElSparseInvCovDist z(ElConstDistMatrix z D, double lambda, ElDistMa-trix z Z, ElInt* numIts)

434 Chapter 6. Optimization

Page 439: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.13 Support vector machines

Given a collection of m labeled vectors, each of the form (ai, δi) ⊂ Rn × −1, 1, a soft-marginSupport Vector Machine seeks the “best” hyperplane for approximately separating the labeledvectors in the sense that it balances maximizing the separation distance (“margin”) associatedwith the hyperplane with the possibility that some of the vectors might not fit the model.

More specifically, a solution is sought for

minw,β,z

12‖w‖2

2 + λ ∑i

ξi

s.t. δi(wTai + β) ≤ 1 − ξi, ξi ≥ 0, ∀ i,

where w is the unnormalized normal vector for the separating hyperplane, 2/‖w‖2 is the mar-gin, β/‖w‖2 is the distance between the hyperplane and the origin, and the i‘th entry of z, ξi,is the misfit for the i‘th vector.

The problem can be placed in affine quadratic form by building an m × n matrix A with its i‘throw set to ai and a vector d with its i‘th entry set to δi, yielding

minw,β,z

12‖w‖2

2 + λ1Tz

s.t.(−diag(d)A −d −I

0 0 −I

)wβz

≤(−10

),

which Elemental then defaults to solving with a Mehrotra Predictor-Corrector primal-dualInterior Point Method.

Python API

SVM(A, d, lambd[, ctrl=None])

C++ API

void SVM(const Matrix<Real> &A, const Matrix<Real> &d, Real lambda, Matrix<Real>&x, const qp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void SVM(const ElementalMatrix<Real> &A, const ElementalMatrix<Real> &d, Reallambda, ElementalMatrix<Real> &x, const qp::affine::Ctrl<Real> &ctrl =qp::affine::Ctrl<Real>())

void SVM(const SparseMatrix<Real> &A, const Matrix<Real> &d, Real lambda, Ma-trix<Real> &x, const qp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void SVM(const DistSparseMatrix<Real> &A, const DistMultiVec<Real> &d, Reallambda, DistMultiVec<Real> &x, const qp::affine::Ctrl<Real> &ctrl =qp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElSVM s(ElConstMatrix s A, ElConstMatrix s d, float lambda, ElMatrix s x)

6.2. Models 435

Page 440: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSVMDist s(ElConstDistMatrix s A, ElConstDistMatrix s d, float lambda, ElDist-Matrix s x)

ElError ElSVMSparse s(ElConstSparseMatrix s A, ElConstMatrix s d, float lambda, ElMa-trix s x)

ElError ElSVMDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s d,float lambda, ElDistMultiVec s x)

Double-precision

ElError ElSVM d(ElConstMatrix d A, ElConstMatrix d d, double lambda, ElMatrix d x)

ElError ElSVMDist d(ElConstDistMatrix d A, ElConstDistMatrix d d, double lambda, El-DistMatrix d x)

ElError ElSVMSparse d(ElConstSparseMatrix d A, ElConstMatrix d d, double lambda, El-Matrix d x)

ElError ElSVMDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d d,double lambda, ElDistMultiVec d x)

Expert interface

Single-precision

ElError ElSVMX s(ElConstMatrix s A, ElConstMatrix s d, float lambda, ElMatrix s x, ElQ-PAffine s ctrl)

ElError ElSVMXDist s(ElConstDistMatrix s A, ElConstDistMatrix s d, float lambda, ElD-istMatrix s x, ElQPAffineCtrl s ctrl)

ElError ElSVMXSparse s(ElConstSparseMatrix s A, ElConstMatrix s d, float lambda, El-Matrix s x, ElQPAffineCtrl s ctrl)

ElError ElSVMXDistSparse s(ElConstDistSparseMatrix s A, ElConstDistMultiVec s d,float lambda, ElDistMultiVec s x, ElQPAffineCtrl s ctrl)

Double-precision

ElError ElSVMX d(ElConstMatrix d A, ElConstMatrix d d, double lambda, ElMatrix d x,ElQPAffine d ctrl)

ElError ElSVMXDist d(ElConstDistMatrix d A, ElConstDistMatrix d d, double lambda,ElDistMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElSVMXSparse d(ElConstSparseMatrix d A, ElConstMatrix d d, double lambda,ElMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElSVMXDistSparse d(ElConstDistSparseMatrix d A, ElConstDistMultiVec d d,double lambda, ElDistMultiVec d x, ElQPAffineCtrl d ctrl)

436 Chapter 6. Optimization

Page 441: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

6.2.14 Total variation denoising

Total variation denoising (TV) seeks the solution to the problem

minx

12‖b − x‖2

2 + λ‖Dx‖1,

where b ∈ Rn is the original (1D) signal and D : Rn → Rn−1 is the upper-bidiagonal differenceoperator which maps a vector x to

(Dx)i = xi − xi+1.

Real instances of the problem are expressable as a Quadratic Program, and Elemental followsthe formulation used within CVXOPT:

minx,t

12‖x − b‖2

2 + λ1Tt

s.t. − t ≤ Dx ≤ t.

By default, Elemental solves this quadratic program via a Mehrotra Predictor-Correctorprimal-dual Interior Point Method.

Python API

TV(b, lambd[, ctrl=None])

C++ API

void TV(const Matrix<Real> &b, Real lambda, Matrix<Real> &x, constqp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void TV(const ElementalMatrix<Real> &b, Real lambda, ElementalMatrix<Real> &x,const qp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

void TV(const DistMultiVec<Real> &b, Real lambda, DistMultiVec<Real> &x, constqp::affine::Ctrl<Real> &ctrl = qp::affine::Ctrl<Real>())

C API

Single-precision

ElError ElTV s(ElConstMatrix s b, float lambda, ElMatrix s x)

ElError ElTVDist s(ElConstDistMatrix s b, float lambda, ElDistMatrix s x)

ElError ElTVSparse s(ElConstMatrix s b, float lambda, ElMatrix s x)

ElError ElTVDistSparse s(ElConstDistMultiVec s b, float lambda, ElDistMultiVec s x)

6.2. Models 437

Page 442: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision

ElError ElTV d(ElConstMatrix d b, double lambda, ElMatrix d x)

ElError ElTVDist d(ElConstDistMatrix d b, double lambda, ElDistMatrix d x)

ElError ElTVSparse d(ElConstMatrix d b, double lambda, ElMatrix d x)

ElError ElTVDistSparse d(ElConstDistMultiVec d b, double lambda, ElDistMulti-Vec d x)

Expert interface

Single-precision

ElError ElTVX s(ElConstMatrix s b, float lambda, ElMatrix s x, ElQPAffineCtrl s ctrl)

ElError ElTVXDist s(ElConstDistMatrix s b, float lambda, ElDistMatrix s x, ElQPAffineC-trl s ctrl)

ElError ElTVXSparse s(ElConstMatrix s b, float lambda, ElMatrix s x, ElQPAffineC-trl s ctrl)

ElError ElTVXDistSparse s(ElConstDistMultiVec s b, float lambda, ElDistMultiVec s x,ElQPAffineCtrl s ctrl)

Double-precision

ElError ElTVX d(ElConstMatrix d b, double lambda, ElMatrix d x, ElQPAffineCtrl d ctrl)

ElError ElTVXDist d(ElConstDistMatrix d b, double lambda, ElDistMatrix d x, ElQ-PAffineCtrl d ctrl)

ElError ElTVXSparse d(ElConstMatrix d b, double lambda, ElMatrix d x, ElQPAffineC-trl d ctrl)

ElError ElTVXDistSparse d(ElConstDistMultiVec d b, double lambda, ElDistMulti-Vec d x, ElQPAffineCtrl d ctrl)

6.3 Proximal maps

6.3.1 Clip

Force every entry of a matrix to lie within a given (half-)interval.

Implementations

Lower clip

Force every entry to be at least lowerBound.

438 Chapter 6. Optimization

Page 443: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void LowerClip(Matrix<Real> &X, Real lowerBound = 0)

void LowerClip(AbstractDistMatrix<Real> &X, Real lowerBound = 0)

C API

ElError ElLowerClip s(ElMatrix s X, float lowerBound)

ElError ElLowerClip d(ElMatrix d X, double lowerBound)

ElError ElLowerClipDist s(ElDistMatrix s X, float lowerBound)

ElError ElLowerClipDist d(ElDistMatrix d X, double lowerBound)

Upper clip

Force every entry to be at most upperBound.

C++ API

void UpperClip(Matrix<Real> &X, Real upperBound = 0)

void UpperClip(AbstractDistMatrix<Real> &X, Real upperBound = 0)

C API

ElError ElUpperClip s(ElMatrix s X, float upperBound)

ElError ElUpperClip d(ElMatrix d X, double upperBound)

ElError ElUpperClipDist s(ElDistMatrix s X, float upperBound)

ElError ElUpperClipDist d(ElDistMatrix d X, double upperBound)

Interval clip

Force every entry to lie within the interval defined by lowerBound and upperBound.

C++ API

void Clip(Matrix<Real> &X, Real lowerBound = 0, Real upperBound = 1)

void Clip(AbstractDistMatrix<Real> &X, Real lowerBound = 0, Real upperBound = 1)

6.3. Proximal maps 439

Page 444: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElClip s(ElMatrix s X, float lowerBound, float upperBound)

ElError ElClip d(ElMatrix d X, double lowerBound, double upperBound)

ElError ElClipDist s(ElDistMatrix s X, float lowerBound, float upperBound)

ElError ElClipDist d(ElDistMatrix d X, double lowerBound, double upperBound)

6.3.2 Frobenius prox

minA

‖A‖F +ρ

2‖A − A0‖2

F

C++ API

void FrobeniusProx(Matrix<F> &A, Base<F> rho)

void FrobeniusProx(AbstractDistMatrix<F> &A, Base<F> rho)

C API

ElError ElFrobeniusProx s(ElMatrix s A, float rho)

ElError ElFrobeniusProx d(ElMatrix d A, double rho)

ElError ElFrobeniusProx c(ElMatrix c A, float rho)

ElError ElFrobeniusProx z(ElMatrix z A, double rho)

ElError ElFrobeniusProxDist s(ElDistMatrix s A, float rho)

ElError ElFrobeniusProxDist d(ElDistMatrix d A, double rho)

ElError ElFrobeniusProxDist c(ElDistMatrix c A, float rho)

ElError ElFrobeniusProxDist z(ElDistMatrix z A, double rho)

6.3.3 Hinge-loss prox

C++ API

void HingeLossProx(Matrix<Real> &A, Real rho)

void HingeLossProx(AbstractDistMatrix<Real> &A, Real rho)

C API

ElError ElHingeLossProx s(ElMatrix s A, float rho)

ElError ElHingeLossProx d(ElMatrix d A, double rho)

ElError ElHingeLossProxDist s(ElDistMatrix s A, float rho)

440 Chapter 6. Optimization

Page 445: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHingeLossProxDist d(ElDistMatrix d A, double rho)

6.3.4 Logistic prox

C++ API

void LogisticProx(Matrix<Real> &A, Real rho)

void LogisticProx(AbstractDistMatrix<Real> &A, Real rho)

C API

ElError ElLogisticProx s(ElMatrix s A, float rho)

ElError ElLogisticProx d(ElMatrix d A, double rho)

ElError ElLogisticProxDist s(ElDistMatrix s A, float rho)

ElError ElLogisticProxDist d(ElDistMatrix d A, double rho)

6.3.5 Singular-value soft-thresholding

Overwrites A with USτ(Σ)VH, where UΣVH is the singular-value decomposition of A uponinput and Sτ performs soft-thresholding with parameter τ. The return value is the rank of thesoft-thresholded matrix.

Implementation

Standard algorithm

Runs the default SVT algorithm. In the sequential case, this is currently svt::Normal, and, in theparallel case, it is svt::Cross.

C++ API

Int SVT(Matrix<F> &A, Base<F> tau, bool relative = false)

Int SVT(ElementalMatrix<F> &A, Base<F> tau, bool relative = false)

C API

ElError ElSVT s(ElMatrix s A, float rho, bool relative)

ElError ElSVT d(ElMatrix d A, double rho, bool relative)

ElError ElSVT c(ElMatrix c A, float rho, bool relative)

ElError ElSVT z(ElMatrix z A, double rho, bool relative)

ElError ElSVTDist s(ElDistMatrix s A, float rho, bool relative)

ElError ElSVTDist d(ElDistMatrix d A, double rho, bool relative)

6.3. Proximal maps 441

Page 446: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSVTDist c(ElDistMatrix c A, float rho, bool relative)

ElError ElSVTDist z(ElDistMatrix z A, double rho, bool relative)

Approximate algorithm

Runs a faster (for small ranks), but less accurate, algorithm given an upper bound on the rankof the soft-thresholded matrix. The current implementation preprocesses via relaxedRank stepsof (Businger-Golub) column-pivoted QR via the routine svt::PivotedQR.

C++ API

Int SVT(Matrix<F> &A, Base<F> tau, Int relaxedRank, bool relative = false)

Int SVT(ElementalMatrix<F> &A, Base<F> tau, Int relaxedRank, bool relative = false)

C API

TODO

Tall-skinny algorithm

Runs an SVT algorithm designed for tall-skinny matrices. The current implementation is basedon TSQR factorization and is svt::TSQR.

C++ API

Int SVT(DistMatrix<F, U, STAR> &A, Base<F> tau, bool relative = false)

C API

TODO

namespace svt

Int svt::Normal(Matrix<F> &A, Base<F> tau, bool relative = false)

Int svt::Normal(ElementalMatrix<F> &A, Base<F> tau, bool relative = false)Runs a standard SVD, soft-thresholds the singular values, and then reforms the matrix.

Int svt::Cross(Matrix<F> &A, Base<F> tau, bool relative = false)

Int svt::Cross(ElementalMatrix<F> &A, Base<F> tau, bool relative = false)Forms the normal matrix, computes its Hermitian EVD, soft-thresholds the eigenvalues,and then reforms the matrix. Note that Elemental’s parallel Hermitian EVD is muchfaster than its parallel SVD; this is typically worth the loss of accuracy in the computedsmall (truncated) singular values and is therefore the default choice for parallel SVT.

Int svt::PivotedQR(Matrix<F> &A, Base<F> tau, Int numStepsQR, bool relative = false)

442 Chapter 6. Optimization

Page 447: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Int svt::PivotedQR(ElementalMatrix<F> &A, Base<F> tau, Int numStepsQR, bool rela-tive = false)

Computes an approximate SVT by first approximating A as the rank-numSteps approxi-mation produced by numSteps iterations of column-pivoted QR.

Int svt::TSQR(ElementalMatrix<F> &A, Base<F> tau, bool relative = false)Since the majority of the work in a tall-skinny SVT will be in the initial QR factorization,this algorithm runs a TSQR factorization and then computes the SVT of the small R factorusing a single process.

6.3.6 Soft-thresholding

Overwrites each entry of A with its soft-thresholded value.

Implementation

C++ API

void SoftThreshold(Matrix<F> &A, Base<F> tau, bool relative = false)

void SoftThreshold(AbstractDistMatrix<F> &A, Base<F> tau, bool relative = false)

C API

ElError ElSoftThreshold s(ElMatrix s A, float rho, bool relative)

ElError ElSoftThreshold d(ElMatrix d A, double rho, bool relative)

ElError ElSoftThreshold c(ElMatrix c A, float rho, bool relative)

ElError ElSoftThreshold z(ElMatrix z A, double rho, bool relative)

ElError ElSoftThresholdDist s(ElDistMatrix s A, float rho, bool relative)

ElError ElSoftThresholdDist d(ElDistMatrix d A, double rho, bool relative)

ElError ElSoftThresholdDist c(ElDistMatrix c A, float rho, bool relative)

ElError ElSoftThresholdDist z(ElDistMatrix z A, double rho, bool relative)

6.4 Utilities

6.4.1 Cone Utilities

AllReduce

Fill each subcone with the reduction (in some cases, sum) of the members of the subcone.

6.4. Utilities 443

Page 448: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void cone::AllReduce(Matrix<Real> &x, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds, mpi::Op op = mpi::SUM)

void cone::AllReduce(ElementalMatrix<Real> &x, const ElementalMatrix<Int> &or-ders, const ElementalMatrix<Int> &firstInds, mpi::Op op =mpi::SUM, Int cutoff = 1000)

void cone::AllReduce(DistMultiVec<Real> &x, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, mpi::Op op = mpi::SUM, Intcutoff = 1000)

C API

TODO

Python API

TODO

Broadcast

Replicate the entry in the root position of each member cone over the entire cone.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void cone::Broadcast(Matrix<Real> &x, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

void cone::Broadcast(ElementalMatrix<Real> &x, const ElementalMatrix<Int> &or-ders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000)

void cone::Broadcast(DistMultiVec<Real> &x, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

C API

TODO

444 Chapter 6. Optimization

Page 449: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

TODO

Geometric equilibration

Perform geometric diagonal equilibration of a matrix in a way which ensures that membersof subcones are scaled equally (otherwise equilibration would not preserve, for example, aSecond-Order Cone Program).

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void cone::GeomEquil(Matrix<F> &A, Matrix<F> &B, Matrix<Base<F>> &dRowA,Matrix<Base<F>> &dRowB, Matrix<Base<F>> &dCol, constMatrix<Int> &orders, const Matrix<Int> &firstInds, bool progress= false)

void cone::GeomEquil(ElementalMatrix<F> &A, ElementalMatrix<F> &B, ElementalMa-trix<Base<F>> &dRowA, ElementalMatrix<Base<F>> &dRowB,ElementalMatrix<Base<F>> &dCol, const ElementalMatrix<Int>&orders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000,bool progress = false)

void cone::GeomEquil(SparseMatrix<F> &A, SparseMatrix<F> &B, Matrix<Base<F>>&dRowA, Matrix<Base<F>> &dRowB, Matrix<Base<F>>&dCol, const Matrix<Int> &orders, const Matrix<Int> &firstInds,bool progress = false)

void cone::GeomEquil(DistSparseMatrix<F> &A, DistSparseMatrix<F> &B, DistMul-tiVec<Base<F>> &dRowA, DistMultiVec<Base<F>> &dRowB,DistMultiVec<Base<F>> &dCol, const DistMultiVec<Int> &or-ders, const DistMultiVec<Int> &firstInds, Int cutoff = 1000, boolprogress = false)

C API

TODO

Python API

TODO

6.4. Utilities 445

Page 450: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Ruiz Equilibration

Perform Ruiz diagonal equilibration of a matrix in a way which ensures that members of sub-cones are scaled equally (otherwise equilibration would not preserve, for example, a Second-Order Cone Program).

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void cone::RuizEquil(Matrix<F> &A, Matrix<F> &B, Matrix<Base<F>> &dRowA,Matrix<Base<F>> &dRowB, Matrix<Base<F>> &dCol, constMatrix<Int> &orders, const Matrix<Int> &firstInds, bool progress= false)

void cone::RuizEquil(ElementalMatrix<F> &A, ElementalMatrix<F> &B, ElementalMa-trix<Base<F>> &dRowA, ElementalMatrix<Base<F>> &dRowB,ElementalMatrix<Base<F>> &dCol, const ElementalMatrix<Int>&orders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000,bool progress = false)

void cone::RuizEquil(SparseMatrix<F> &A, SparseMatrix<F> &B, Matrix<Base<F>>&dRowA, Matrix<Base<F>> &dRowB, Matrix<Base<F>>&dCol, const Matrix<Int> &orders, const Matrix<Int> &firstInds,bool progress = false)

void cone::RuizEquil(DistSparseMatrix<F> &A, DistSparseMatrix<F> &B, DistMul-tiVec<Base<F>> &dRowA, DistMultiVec<Base<F>> &dRowB,DistMultiVec<Base<F>> &dCol, const DistMultiVec<Int> &or-ders, const DistMultiVec<Int> &firstInds, Int cutoff = 1000, boolprogress = false)

C API

TODO

Python API

TODO

6.4.2 Positive Orthant Utilities

Complementarity ratio

Compute the complementarity ratio of the primal-dual pair (s, z), sTz/n, where n is the degreeof the cone (in this case, the lengths of s and z).

446 Chapter 6. Optimization

Page 451: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Real pos orth::ComplementRatio(const Matrix<Real> &s, const Matrix<Real> &z)

Real pos orth::ComplementRatio(const ElementalMatrix<Real> &s, const Elemental-Matrix<Real> &z)

Real pos orth::ComplementRatio(const DistMultiVec<Real> &s, const DistMulti-Vec<Real> &z)

C API

TODO

Python API

TODO

Maximum step

Compute the maximum step in the direction ds that can be taken from the point s that will stilllie in the positive orthant.

C++ API

Real pos orth::MaxStep(const Matrix<Real> &s, const Matrix<Real> &ds, Real upper-Bound = std::numeric limits<Real>::max())

Real pos orth::MaxStep(const ElementalMatrix<Real> &s, const Ele-mentalMatrix<Real> &ds, Real upperBound =std::numeric limits<Real>::max())

Real pos orth::MaxStep(const DistMultiVec<Real> &s, const DistMultiVec<Real> &ds,Real upperBound = std::numeric limits<Real>::max())

C API

TODO

Python API

TODO

Nesterov-Todd scaling point

Compute the (positive-orthant) Nesterov-Todd scaling point for the primal-dual pair (s, z).

6.4. Utilities 447

Page 452: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void pos orth::NesterovTodd(const Matrix<Real> &s, const Matrix<Real> &z, Ma-trix<Real> &w)

void pos orth::NesterovTodd(const ElementalMatrix<Real> &s, const ElementalMa-trix<Real> &z, ElementalMatrix<Real> &w)

void pos orth::NesterovTodd(const DistMultiVec<Real> &s, const DistMulti-Vec<Real> &z, DistMultiVec<Real> &w)

C API

TODO

Python API

TODO

Number outside cone

Compute the number of entries of the matrix that are negative.

C++ API

Int pos orth::NumOutside(const Matrix<Real> &A)

Int pos orth::NumOutside(const SparseMatrix<Real> &A)

Int pos orth::NumOutside(const AbstractDistMatrix<Real> &A)

Int pos orth::NumOutside(const DistSparseMatrix<Real> &A)

Int pos orth::NumOutside(const DistMultiVec<Real> &A)

C API

TODO

Python API

TODO

Push pair into cone

Push the primal-dual pair (s, z), with Nesterov-Todd scaling point w, into the cone.

448 Chapter 6. Optimization

Page 453: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void pos orth::PushPairInto(Matrix<Real> &s, Matrix<Real> &z, const Ma-trix<Real> &w, Real wMaxNormLimit)

void pos orth::PushPairInto(ElementalMatrix<Real> &s, ElementalMatrix<Real> &z,const ElementalMatrix<Real> &w, Real wMaxNorm-Limit)

void pos orth::PushPairInto(DistMultiVec<Real> &s, DistMultiVec<Real> &z, constDistMultiVec<Real> &w, Real wMaxNormLimit)

C API

TODO

Python API

TODO

6.4.3 Second-order Cone Utilities

Apply

Apply a member of the Jordan algebra which generates the Second-Order Cone to anothermember of the Jordan algebra using the symmetric product,

x ∘ y =

[xTy

χ0y1 + η0x1

],

where x = (χ0; x1) and (η0, y1).

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::Apply(const Matrix<Real> &x, const Matrix<Real> &y, Matrix<Real> &z,const Matrix<Int> &orders, const Matrix<Int> &firstInds)

void soc::Apply(const ElementalMatrix<Real> &x, const ElementalMatrix<Real> &y,ElementalMatrix<Real> &z, const ElementalMatrix<Int> &orders,const ElementalMatrix<Int> &firstInds, Int cutoff = 1000)

void soc::Apply(const DistMultiVec<Real> &x, const DistMultiVec<Real> &y, Dist-MultiVec<Real> &z, const DistMultiVec<Int> &orders, const DistMul-tiVec<Int> &firstInds, Int cutoff = 1000)

void soc::Apply(const Matrix<Real> &x, Matrix<Real> &y, const Matrix<Int> &or-ders, const Matrix<Int> &firstInds)

6.4. Utilities 449

Page 454: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::Apply(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &y, constElementalMatrix<Int> &orders, const ElementalMatrix<Int> &firstInds,Int cutoff = 1000)

void soc::Apply(const DistMultiVec<Real> &x, DistMultiVec<Real> &y, const Dist-MultiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Int cutoff= 1000)

C API

TODO

Python API

TODO

Apply quadratic

Apply a member of the Jordan algebra which generates the Second-Order Cone to anothermember of the Jordan algebra using the quadratic product,

Qx(y) =(

2xxT − det(x)R)

y,

where det(x) is the determinant of x in the sense of the eigenvalues from the Jordan frame ofthe Jordan algebra.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::ApplyQuadratic(const Matrix<Real> &x, const Matrix<Real> &y, Ma-trix<Real> &z, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

void soc::ApplyQuadratic(const ElementalMatrix<Real> &x, const ElementalMa-trix<Real> &y, ElementalMatrix<Real> &z, const Ele-mentalMatrix<Int> &orders, const ElementalMatrix<Int>&firstInds, Int cutoff = 1000)

void soc::ApplyQuadratic(const DistMultiVec<Real> &x, const DistMultiVec<Real>&y, DistMultiVec<Real> &z, const DistMultiVec<Int> &or-ders, const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

void soc::ApplyQuadratic(const Matrix<Real> &x, Matrix<Real> &y, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds)

void soc::ApplyQuadratic(const ElementalMatrix<Real> &x, ElementalMatrix<Real>&y, const ElementalMatrix<Int> &orders, const Elemental-Matrix<Int> &firstInds, Int cutoff = 1000)

450 Chapter 6. Optimization

Page 455: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::ApplyQuadratic(const DistMultiVec<Real> &x, DistMultiVec<Real> &y,const DistMultiVec<Int> &orders, const DistMultiVec<Int>&firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

Degree

Return the number of subcones in the product of second-order cones.

C++ API

Int soc::Degree(const Matrix<Int> &firstInds)

Int soc::Degree(const ElementalMatrix<Int> &firstInds)

Int soc::Degree(const DistMultiVec<Int> &firstInds)

C API

TODO

Python API

TODO

Determinants

Store the (Jordan algebra) determinants of each member of the product of second-order coneswithin the root entry of each subcone.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::Dets(const Matrix<Real> &x, Matrix<Real> &d, const Matrix<Int> &orders,const Matrix<Int> &firstInds)

6.4. Utilities 451

Page 456: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::Dets(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &d, const El-ementalMatrix<Int> &orders, const ElementalMatrix<Int> &firstInds, Intcutoff = 1000)

void soc::Dets(const DistMultiVec<Real> &x, DistMultiVec<Real> &d, const DistMul-tiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Int cutoff =1000)

C API

TODO

Python API

TODO

Dot products

Store the dot products between each corresponding subcone of two vectors x and y within theroot position of each subcone of the output vector.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::Dots(const Matrix<Real> &x, const Matrix<Real> &y, Matrix<Real> &z,const Matrix<Int> &orders, const Matrix<Int> &firstInds)

void soc::Dots(const ElementalMatrix<Real> &x, const ElementalMatrix<Real> &y, El-ementalMatrix<Real> &z, const ElementalMatrix<Int> &orders, constElementalMatrix<Int> &firstInds, Int cutoff = 1000)

void soc::Dots(const DistMultiVec<Real> &x, const DistMultiVec<Real> &y, DistMul-tiVec<Real> &z, const DistMultiVec<Int> &orders, const DistMulti-Vec<Int> &firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

452 Chapter 6. Optimization

Page 457: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Embedding maps

Compute the various mappings related to a sparse embedding of a member of a product ofsecond-order cones.

C++ API

Note: The parameter cutoffSparse determines whether a subcone is determined large enoughfor it to be worthwhile to perform a sparse embedding of its Hessian (which is diagonal plusrank-one).

void soc::EmbeddingMaps(const Matrix<Int> &orders, const Matrix<Int> &firstInds,Matrix<Int> &sparseOrders, Matrix<Int> &sparseFirstInds,Matrix<Int> &origToSparseOrders, Matrix<Int> &orig-ToSparseFirstInds, Matrix<Int> &sparseToOrigOrders, Ma-trix<Int> &sparseToOrigFirstInds, Int cutoffSparse)

void soc::EmbeddingMaps(const DistMultiVec<Int> &orders, const DistMultiVec<Int>&firstInds, DistMultiVec<Int> &sparseOrders, DistMul-tiVec<Int> &sparseFirstInds, DistMultiVec<Int> &orig-ToSparseOrders, DistMultiVec<Int> &origToSparseFirstInds,DistMultiVec<Int> &sparseToOrigOrders, DistMultiVec<Int>&sparseToOrigFirstInds, Int cutoffSparse)

C API

TODO

Python API

TODO

Identity

Form the identity element of a product of second-order cones.

C++ API

void soc::Identity(Matrix<Real> &e, const Matrix<Int> &orders, const Matrix<Int>&firstInds)

void soc::Identity(ElementalMatrix<Real> &e, const ElementalMatrix<Int> &orders,const ElementalMatrix<Int> &firstInds)

void soc::Identity(DistMultiVec<Real> &e, const DistMultiVec<Int> &orders, constDistMultiVec<Int> &firstInds)

6.4. Utilities 453

Page 458: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

TODO

Python API

TODO

Inverse

Form the inverse of a member of the Jordan algebra whose squared elements generate therelevant product of second-order cones.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::Inverse(const Matrix<Real> &x, Matrix<Real> &xInv, const Matrix<Int>&orders, const Matrix<Int> &firstInds)

void soc::Inverse(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &xInv,const ElementalMatrix<Int> &orders, const ElementalMatrix<Int>&firstInds, Int cutoff = 1000)

void soc::Inverse(const DistMultiVec<Real> &x, DistMultiVec<Real> &xInv, constDistMultiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Intcutoff = 1000)

C API

TODO

Python API

TODO

Lower norms

Store the lower norms (i.e., ‖x1‖2, where the member of the subcone is (χ0; x1)) of each subconeand store the norm within the root entry of said subcone.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

454 Chapter 6. Optimization

Page 459: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::LowerNorms(const Matrix<Real> &x, Matrix<Real> &lowerNorms, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds)

void soc::LowerNorms(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &low-erNorms, const ElementalMatrix<Int> &orders, const Elemental-Matrix<Int> &firstInds, Int cutoff = 1000)

void soc::LowerNorms(const DistMultiVec<Real> &x, DistMultiVec<Real> &lower-Norms, const DistMultiVec<Int> &orders, const DistMulti-Vec<Int> &firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

Maximum eigenvalues

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::MaxEig(const Matrix<Real> &x, Matrix<Real> &maxEigs, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds)

void soc::MaxEig(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &maxEigs,const ElementalMatrix<Int> &orders, const ElementalMatrix<Int>&firstInds, Int cutoff = 1000)

void soc::MaxEig(const DistMultiVec<Real> &x, DistMultiVec<Real> &maxEigs, constDistMultiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Intcutoff = 1000)

Store the maximum eigenvalue of each subcone member within the root entry of its sub-cone.

Real soc::MaxEig(const Matrix<Real> &x, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

Real soc::MaxEig(const ElementalMatrix<Real> &x, const ElementalMatrix<Int> &or-ders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000)

Real soc::MaxEig(const DistMultiVec<Real> &x, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

Return the maximum of all of the maximum eigenvalues of each subcone member.

6.4. Utilities 455

Page 460: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

TODO

Python API

TODO

Maximum step

Return the maximum step size that can be taken in the direction ds from the point s that willremain within the product of second-order cones.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

Real MaxStep(const Matrix<Real> &x, const Matrix<Real> &y, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds, Real upperBound =std::numeric limits<Real>::max())

Real MaxStep(const ElementalMatrix<Real> &x, const ElementalMatrix<Real> &y, constElementalMatrix<Int> &orders, const ElementalMatrix<Int> &firstInds,Real upperBound = std::numeric limits<Real>::max(), Int cutoff = 1000)

Real MaxStep(const DistMultiVec<Real> &x, const DistMultiVec<Real> &y, const Dist-MultiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Real upper-Bound = std::numeric limits<Real>::max(), Int cutoff = 1000)

C API

TODO

Python API

TODO

Minimum eigenvalues

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

456 Chapter 6. Optimization

Page 461: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::MinEig(const Matrix<Real> &x, Matrix<Real> &minEigs, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds)

void soc::MinEig(const ElementalMatrix<Real> &x, ElementalMatrix<Real> &minEigs,const ElementalMatrix<Int> &orders, const ElementalMatrix<Int>&firstInds, Int cutoff = 1000)

void soc::MinEig(const DistMultiVec<Real> &x, DistMultiVec<Real> &minEigs, constDistMultiVec<Int> &orders, const DistMultiVec<Int> &firstInds, Intcutoff = 1000)

Store the minimum eigenvalue of each subcone member within the root entry of its sub-cone.

Real soc::MinEig(const Matrix<Real> &x, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

Real soc::MinEig(const ElementalMatrix<Real> &x, const ElementalMatrix<Int> &or-ders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000)

Real soc::MinEig(const DistMultiVec<Real> &x, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

Return the minimum of all of the minimum eigenvalues of each subcone member.

C API

TODO

Python API

TODO

Nesterov-Todd scaling point

Compute the Nesterov-Todd scaling point of the primal-dual pair (s, z) with respect to therelevant product of second-order cones.

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::NesterovTodd(const Matrix<Real> &x, const Matrix<Real> &y, Ma-trix<Real> &w, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

void soc::NesterovTodd(const ElementalMatrix<Real> &x, const ElementalMa-trix<Real> &y, ElementalMatrix<Real> &w, const Elemental-Matrix<Int> &orders, const ElementalMatrix<Int> &firstInds,Int cutoff = 1000)

6.4. Utilities 457

Page 462: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::NesterovTodd(const DistMultiVec<Real> &x, const DistMultiVec<Real> &y,DistMultiVec<Real> &w, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

Number outside of cone

Return the number of members which are outside of their subcone.

C++ API

Int soc::NumOutside(const Matrix<Real> &x, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

Int soc::NumOutside(const ElementalMatrix<Real> &x, const ElementalMatrix<Int>&orders, const ElementalMatrix<Int> &firstInds, Int cutoff = 1000)

Int soc::NumOutside(const DistMultiVec<Real> &x, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

Push into cone

Push a vector into the relevant product of second-order cones.

C++ API

void soc::PushInto(Matrix<Real> &x, const Matrix<Int> &orders, const Matrix<Int>&firstInds, Real minDist = 0)

void soc::PushInto(ElementalMatrix<Real> &x, const ElementalMatrix<Int> &orders,const ElementalMatrix<Int> &firstInds, Real minDist = 0, Int cutoff= 1000)

458 Chapter 6. Optimization

Page 463: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void soc::PushInto(DistMultiVec<Real> &x, const DistMultiVec<Int> &orders, constDistMultiVec<Int> &firstInds, Real minDist = 0, Int cutoff = 1000)

C API

TODO

Python API

TODO

Push pair into cone

Given a primal-dual pair (s, z), with Nesterov-Todd scaling point w, push each subvector of sand z into the relevant second-order cone.

C++ API

void soc::PushPairInto(Matrix<Real> &s, Matrix<Real> &z, const Matrix<Real>&w, const Matrix<Int> &orders, const Matrix<Int> &firstInds,Real minDist = 0)

void soc::PushPairInto(ElementalMatrix<Real> &s, ElementalMatrix<Real> &z, constElementalMatrix<Real> &w, const ElementalMatrix<Int> &or-ders, const ElementalMatrix<Int> &firstInds, Real minDist = 0,Int cutoff = 1000)

void soc::PushPairInto(DistMultiVec<Real> &s, DistMultiVec<Real> &z, const Dist-MultiVec<Real> &w, const DistMultiVec<Int> &orders, constDistMultiVec<Int> &firstInds, Real minDist = 0, Int cutoff =1000)

C API

TODO

Python API

TODO

Reflect

Overwrite a member of a product of second-order cones with its reflection.

6.4. Utilities 459

Page 464: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void soc::Reflect(Matrix<Real> &x, const Matrix<Int> &orders, const Matrix<Int>&firstInds)

void soc::Reflect(ElementalMatrix<Real> &x, const ElementalMatrix<Int> &orders,const ElementalMatrix<Int> &firstInds)

void soc::Reflect(DistMultiVec<Real> &x, const DistMultiVec<Int> &orders, constDistMultiVec<Int> &firstInds)

C API

TODO

Python API

TODO

Shift

Add a multiple of the identity to a member of the product of second-order cones.

C++ API

void soc::Shift(Matrix<Real> &x, Real shift, const Matrix<Int> &orders, const Ma-trix<Int> &firstInds)

void soc::Shift(ElementalMatrix<Real> &x, Real shift, const ElementalMatrix<Int>&orders, const ElementalMatrix<Int> &firstInds)

void soc::Shift(DistMultiVec<Real> &x, Real shift, const DistMultiVec<Int> &orders,const DistMultiVec<Int> &firstInds)

C API

TODO

Python API

TODO

Square-root

Form the square-root of a member of the Jordan algebra whose squared elements generate therelevant product of second-order cones.

460 Chapter 6. Optimization

Page 465: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Note: The cutoff parameter only effects parallel performance and is used to decide whether asubcone is sufficiently large to be treated separately.

void soc::SquareRoot(const Matrix<Real> &x, Matrix<Real> &xRoot, const Ma-trix<Int> &orders, const Matrix<Int> &firstInds)

void soc::SquareRoot(const ElementalMatrix<Real> &x, ElementalMatrix<Real>&xRoot, const ElementalMatrix<Int> &orders, const Elemental-Matrix<Int> &firstInds, Int cutoff = 1000)

void soc::SquareRoot(const DistMultiVec<Real> &x, DistMultiVec<Real> &xRoot,const DistMultiVec<Int> &orders, const DistMultiVec<Int>&firstInds, Int cutoff = 1000)

C API

TODO

Python API

TODO

6.4.4 Coherence

The coherence of an m × n matrix A can be defined as

‖AH A − I‖max,

where A is formed by normalizing each column of A to have a unit Euclidean norm.

C++ API

Base<F> Coherence(const Matrix<F> &A)

Base<F> Coherence(const ElementalMatrix<F> &A)

C API

ElError ElCoherence s(ElConstMatrix s A, float* coherence)

ElError ElCoherence d(ElConstMatrix d A, double* coherence)

ElError ElCoherence c(ElConstMatrix c A, float* coherence)

ElError ElCoherence z(ElConstMatrix z A, double* coherence)

ElError ElCoherence s(ElConstDistMatrix s A, float* coherence)

ElError ElCoherence d(ElConstDistMatrix d A, double* coherence)

6.4. Utilities 461

Page 466: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElCoherence c(ElConstDistMatrix c A, float* coherence)

ElError ElCoherence z(ElConstDistMatrix z A, double* coherence)

Python API

Coherence(A)

6.4.5 Covariance

The following routines compute the covariance matrix

S :=1

n − 1

n−1

∑j=0

(dj − d)(dj − d)H,

where d is the average of the n observations (the columns of D).

C++ API

void Covariance(const Matrix<F> &D, Matrix<F> &S)

void Covariance(const ElementalMatrix<F> &D, ElementalMatrix<F> &S)

C API

ElError ElCovariance s(ElConstMatrix s D, ElMatrix s S)

ElError ElCovariance d(ElConstMatrix d D, ElMatrix d S)

ElError ElCovariance c(ElConstMatrix c D, ElMatrix c S)

ElError ElCovariance z(ElConstMatrix z D, ElMatrix z S)

ElError ElCovarianceDist s(ElConstDistMatrix s D, ElDistMatrix s S)

ElError ElCovarianceDist d(ElConstDistMatrix d D, ElDistMatrix d S)

ElError ElCovarianceDist c(ElConstDistMatrix c D, ElDistMatrix c S)

ElError ElCovarianceDist z(ElConstDistMatrix z D, ElDistMatrix z S)

6.4.6 LogBarrier

Uses a careful calculation of the log of the determinant in order to return the log barrier of aHermitian positive-definite matrix A, − log(det(A)).

Implementations

462 Chapter 6. Optimization

Page 467: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

Base<F> LogBarrier(UpperOrLower uplo, const Matrix<F> &A)

Base<F> LogBarrier(UpperOrLower uplo, const ElementalMatrix<F> &A)

Base<F> LogBarrier(UpperOrLower uplo, Matrix<F> &A, bool canOverwrite = false)

Base<F> LogBarrier(UpperOrLower uplo, ElementalMatrix<F> &A, bool canOverwrite =false)

C API

ElError ElLogBarrier s(ElUpperOrLower uplo, ElConstMatrix s A, float* barrier)

ElError ElLogBarrier d(ElUpperOrLower uplo, ElConstMatrix d A, double* barrier)

ElError ElLogBarrier c(ElUpperOrLower uplo, ElConstMatrix c A, float* barrier)

ElError ElLogBarrier z(ElUpperOrLower uplo, ElConstMatrix z A, double* barrier)

ElError ElLogBarrierDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, float* bar-rier)

ElError ElLogBarrierDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, double* bar-rier)

ElError ElLogBarrierDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, float* bar-rier)

ElError ElLogBarrierDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, double* bar-rier)

6.4.7 LogDetDiv

The log-det divergence of a pair of n × n Hermitian positive-definite matrices A and B is

Dld(A, B) = tr(AB−1)− log(det(AB−1))− n,

which can be greatly simplified using the Cholesky factors of A and B. In particular, if we setZ = L−1

B LA, where A = LALHA and B = LBLH

B are Cholesky factorizations, then

Dld(A, B) = ‖Z‖2F − 2 log(det(Z))− n.

Implementation

Example driver

C++ API

Base<F> LogDetDiv(UpperOrLower uplo, const Matrix<F> &A, const Matrix<F> &B)

Base<F> LogDetDiv(UpperOrLower uplo, const ElementalMatrix<F> &A, const Elemen-talMatrix<F> &B)

6.4. Utilities 463

Page 468: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElLogDetDiv s(ElUpperOrLower uplo, ElConstMatrix s A, ElConstMatrix s B)

ElError ElLogDetDiv d(ElUpperOrLower uplo, ElConstMatrix d A, ElConstMatrix d B)

ElError ElLogDetDiv c(ElUpperOrLower uplo, ElConstMatrix c A, ElConstMatrix c B)

ElError ElLogDetDiv z(ElUpperOrLower uplo, ElConstMatrix z A, ElConstMatrix z B)

ElError ElLogDetDivDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElConstDist-Matrix s B)

ElError ElLogDetDivDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElConstDist-Matrix d B)

ElError ElLogDetDivDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElConstDist-Matrix c B)

ElError ElLogDetDivDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElConstDist-Matrix z B)

464 Chapter 6. Optimization

Page 469: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

SEVEN

CONTROL THEORY

The following rudimentary algorithms draw heavily from the second chapter of Nicholas J.Higham’s “Functions of Matrices: Theory and Computation” and depend heavily on the ma-trix sign function. They have only undergone cursory testing and primarily exist due to thesimplicity of their implementation. Ideally, there will eventually be high-performance imple-mentations based upon Schur decompositions.

7.1 Algebraic Ricatti

Under suitable conditions, the following routines solve for X in the algebraic Ricatti equation

XKX − AHX − XA = L,

where both K and L are Hermitian, via computing the matrix sign of

W =

(AH LK −A

).

7.1.1 Python API

Ricatti(uplo, A, K, L)

RicattiPreformed(W)

7.1.2 C++ API

void Ricatti(UpperOrLower uplo, const Matrix<F> &A, const Matrix<F> &K, constMatrix<F> &L, Matrix<F> &X, SignCtrl<Base<F>> signCtrl = SignC-trl<Base<F>>())

void Ricatti(UpperOrLower uplo, const AbstractDistMatrix<F> &A, const AbstractDist-Matrix<F> &K, const AbstractDistMatrix<F> &L, AbstractDistMatrix<F>&X, SignCtrl<Base<F>> signCtrl = SignCtrl<Base<F>>())

Versions which accept the individual matrices

void Ricatti(Matrix<F> &W, Matrix<F> &X, SignCtrl<Base<F>> signCtrl = SignC-trl<Base<F>>())

void Ricatti(AbstractDistMatrix<F> &W, AbstractDistMatrix<F> &X, SignC-trl<Base<F>> signCtrl = SignCtrl<Base<F>>())

Versions which save memory by directly accepting the preformed W matrix

465

Page 470: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

7.1.3 C API

Single-precision

ElError ElRicatti s(ElUpperOrLower uplo, ElConstMatrix s A, ElConstMatrix s K, El-ConstMatrix s L, ElMatrix s X)

ElError ElRicattiDist s(ElUpperOrLower uplo, ElConstDistMatrix s A, ElConstDistMa-trix s K, ElConstDistMatrix s L, ElDistMatrix s X)

Versions which accept the individual matrices

ElError ElRicattiPreformed s(ElMatrix s W, ElMatrix s X)

ElError ElRicattiPreformedDist s(ElDistMatrix s W, ElDistMatrix s X)

Versions which accept the preformed W matrix

Double-precision

ElError ElRicatti d(ElUpperOrLower uplo, ElConstMatrix d A, ElConstMatrix d K, El-ConstMatrix d L, ElMatrix d X)

ElError ElRicattiDist d(ElUpperOrLower uplo, ElConstDistMatrix d A, ElConstDistMa-trix d K, ElConstDistMatrix d L, ElDistMatrix d X)

Versions which accept the individual matrices

ElError ElRicattiPreformed d(ElMatrix d W, ElMatrix d X)

ElError ElRicattiPreformedDist d(ElDistMatrix d W, ElDistMatrix d X)

Versions which accept the preformed W matrix

Single-precision complex

ElError ElRicatti c(ElUpperOrLower uplo, ElConstMatrix c A, ElConstMatrix c K, El-ConstMatrix c L, ElMatrix c X)

ElError ElRicattiDist c(ElUpperOrLower uplo, ElConstDistMatrix c A, ElConstDistMa-trix c K, ElConstDistMatrix c L, ElDistMatrix c X)

Versions which accept the individual matrices

ElError ElRicattiPreformed c(ElMatrix c W, ElMatrix c X)

ElError ElRicattiPreformedDist c(ElDistMatrix c W, ElDistMatrix c X)

Versions which accept the preformed W matrix

Double-precision complex

ElError ElRicatti z(ElUpperOrLower uplo, ElConstMatrix z A, ElConstMatrix z K, El-ConstMatrix z L, ElMatrix z X)

ElError ElRicattiDist z(ElUpperOrLower uplo, ElConstDistMatrix z A, ElConstDistMa-trix z K, ElConstDistMatrix z L, ElDistMatrix z X)

Versions which accept the individual matrices

ElError ElRicattiPreformed z(ElMatrix z W, ElMatrix z X)

ElError ElRicattiPreformedDist z(ElDistMatrix z W, ElDistMatrix z X)

Versions which accept the preformed W matrix

466 Chapter 7. Control theory

Page 471: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

7.2 Lyapunov

A special case of the Sylvester solver, where B = AH.

Note: If minimizing memory usage is of importance, then the “preformed” Sylvester interfaceshould be used instead.

7.2.1 Python API

Lyapunov(A, C)

7.2.2 C++ API

void Lyapunov(const Matrix<F> &A, const Matrix<F> &C, Matrix<F> &X, SignC-trl<Base<F>> signCtrl = SignCtrl<Base<F>>())

void Lyapunov(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &C,AbstractDistMatrix<F> &X, SignCtrl<Base<F>> signCtrl = SignC-trl<Base<F>>())

7.2.3 C API

Note: An “expert” C interface needs to be added and documented.

Single-precision

ElError ElLyapunov s(ElConstMatrix s A, ElConstMatrix s C, ElMatrix s X)

ElError ElLyapunovDist s(ElConstDistMatrix s A, ElConstDistMatrix s C, ElDistMa-trix s X)

Double-precision

ElError ElLyapunov d(ElConstMatrix d A, ElConstMatrix d C, ElMatrix d X)

ElError ElLyapunovDist d(ElConstDistMatrix d A, ElConstDistMatrix d C, ElDistMa-trix d X)

Single-precision complex

ElError ElLyapunov c(ElConstMatrix c A, ElConstMatrix c C, ElMatrix c X)

ElError ElLyapunovDist c(ElConstDistMatrix c A, ElConstDistMatrix c C, ElDistMa-trix c X)

7.2. Lyapunov 467

Page 472: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Double-precision complex

ElError ElLyapunov z(ElConstMatrix z A, ElConstMatrix z C, ElMatrix z X)

ElError ElLyapunovDist z(ElConstDistMatrix z A, ElConstDistMatrix z C, ElDistMa-trix z X)

7.3 Sylvester

As long as both A and B only have eigenvalues in the open right-half plane, the followingroutines solve for X in the Sylvester equation

AX + XB = C

via computing sgn(W), where

W =

(A −C0 −B

).

7.3.1 Python API

Sylvester(A, B, C)

SylvesterPreformed(m, W)

7.3.2 C++ API

void Sylvester(const Matrix<F> &A, const Matrix<F> &B, const Matrix<F> &C, Ma-trix<F> &X, SignCtrl<Base<F>> signCtrl = SignCtrl<Base<F>>())

void Sylvester(const AbstractDistMatrix<F> &A, const AbstractDistMatrix<F> &B,const AbstractDistMatrix<F> &C, AbstractDistMatrix<F> &X, SignC-trl<Base<F>> signCtrl = SignCtrl<Base<F>>())

Versions where the individual matrices are passed in

void Sylvester(int m, Matrix<F> &W, Matrix<F> &X, SignCtrl<Base<F>> signCtrl =SignCtrl<Base<F>>())

void Sylvester(int m, AbstractDistMatrix<F> &W, AbstractDistMatrix<F> &X, SignC-trl<Base<F>> signCtrl = SignCtrl<Base<F>>())

Versions which saves space by accepting the preformed W matrix

7.3.3 C API

Single-precision

ElError ElSylvester s(ElConstMatrix s A, ElConstMatrix s B, ElConstMatrix s C, ElMa-trix s X)

ElError ElSylvesterDist s(ElConstDistMatrix s A, ElConstDistMatrix s B, ElConst-DistMatrix s C, ElDistMatrix s X)

Versions where the individual matrices are passed in

468 Chapter 7. Control theory

Page 473: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElSylvesterPreformed s(ElInt m, ElMatrix s W, ElMatrix s X)

ElError ElSylvesterPreformedDist s(ElInt m, ElMatrix s W, ElMatrix s X)

Versions which save memory by accepting the preformed W matrix

Double-precision

ElError ElSylvester d(ElConstMatrix d A, ElConstMatrix d B, ElConstMatrix d C, El-Matrix d X)

ElError ElSylvesterDist d(ElConstDistMatrix d A, ElConstDistMatrix d B, ElConst-DistMatrix d C, ElDistMatrix d X)

Versions where the individual matrices are passed in

ElError ElSylvesterPreformed d(ElInt m, ElMatrix d W, ElMatrix d X)

ElError ElSylvesterPreformedDist d(ElInt m, ElMatrix d W, ElMatrix d X)

Versions which save memory by accepting the preformed W matrix

Single-precision complex

ElError ElSylvester c(ElConstMatrix c A, ElConstMatrix c B, ElConstMatrix c C, El-Matrix c X)

ElError ElSylvesterDist c(ElConstDistMatrix c A, ElConstDistMatrix c B, ElConst-DistMatrix c C, ElDistMatrix c X)

Versions where the individual matrices are passed in

ElError ElSylvesterPreformed c(ElInt m, ElMatrix c W, ElMatrix c X)

ElError ElSylvesterPreformedDist c(ElInt m, ElMatrix c W, ElMatrix c X)

Versions which save memory by accepting the preformed W matrix

Double-precision complex

ElError ElSylvester z(ElConstMatrix z A, ElConstMatrix z B, ElConstMatrix z C, El-Matrix z X)

ElError ElSylvesterDist z(ElConstDistMatrix z A, ElConstDistMatrix z B, ElConst-DistMatrix z C, ElDistMatrix z X)

Versions where the individual matrices are passed in

ElError ElSylvesterPreformed z(ElInt m, ElMatrix z W, ElMatrix z X)

ElError ElSylvesterPreformedDist z(ElInt m, ElMatrix z W, ElMatrix z X)

Versions which save memory by accepting the preformed W matrix

7.3. Sylvester 469

Page 474: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

470 Chapter 7. Control theory

Page 475: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

EIGHT

SPECIAL MATRICES

It is frequently useful to generate matrices with well-studied properties, and so Elementalprovides routines for generating a wide variety of both deterministic and random matrices.

8.1 Deterministic

TODO: FoxLi documentation

8.1.1 Bull’s Head

The Bull’s head matrix is a banded Toeplitz matrix with symbol

f (z) = 2iz−1 + z2 +710

z3.

Please see L. Reichel and L. N. Trefethen’s Eigenvalues and pseudo-eigenvalues of Toeplitz matricesfor more details.

C++ API

void BullsHead(Matrix<Complex<Real>> &A, Int n)

void BullsHead(AbstractDistMatrix<Complex<Real>> &A, Int n)

C API

ElError ElBullsHead c(ElMatrix c A, ElInt n)

ElError ElBullsHead z(ElMatrix z A, ElInt n)

ElError ElBullsHeadDist c(ElDistMatrix c A, ElInt n)

ElError ElBullsHeadDist z(ElDistMatrix z A, ElInt n)

Python API

BullsHead(A, n)

471

Page 476: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.2 Cauchy

An m × n matrix A is called Cauchy if there exist vectors x and y such that

A(i, j) =1

x(i)− y(j).

The following functions generate a Cauchy matrix using the defining vectors, x and y.

C++ API

void Cauchy(Matrix<F> &A, const std::vector<F> &x, const std::vector<F> &y)

void Cauchy(AbstractDistMatrix<F> &A, const std::vector<F> &x, const std::vector<F>&y)

C API

ElError ElCauchy s(ElMatrix s A, ElInt xSize, float* xBuf, ElInt ySize, float* yBuf)

ElError ElCauchy d(ElMatrix d A, ElInt xSize, double* xBuf, ElInt ySize, double* yBuf)

ElError ElCauchy c(ElMatrix c A, ElInt xSize, complex float* xBuf, ElInt ySize, com-plex float* yBuf)

ElError ElCauchy z(ElMatrix z A, ElInt xSize, complex double* xBuf, ElInt ySize, com-plex double* yBuf)

ElError ElCauchyDist s(ElDistMatrix s A, ElInt xSize, float* xBuf, ElInt ySize, float* yBuf)

ElError ElCauchyDist d(ElDistMatrix d A, ElInt xSize, double* xBuf, ElInt ySize, dou-ble* yBuf)

ElError ElCauchyDist c(ElDistMatrix c A, ElInt xSize, complex float* xBuf, ElInt ySize,complex float* yBuf)

ElError ElCauchyDist z(ElDistMatrix z A, ElInt xSize, complex double* xBuf, ElInt ySize,complex double* yBuf)

Python API

Cauchy(A, x, y)

8.1.3 Cauchy-like

An m × n matrix A is called Cauchy-like if there exist vectors r, s, x, and y such that

A(i, j) =r(i)s(j)

x(i)− y(j).

The following routines generate a Cauchy-like matrix using the defining vectors: r, s, x, and y.

472 Chapter 8. Special matrices

Page 477: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void CauchyLike(Matrix<F> &A, const std::vector<F> &r, const std::vector<F> &s,const std::vector<F> &x, const std::vector<F> &y)

void CauchyLike(AbstractDistMatrix<F> &A, const std::vector<F> &r, conststd::vector<F> &s, const std::vector<F> &x, const std::vector<F>&y)

C API

ElError ElCauchyLike s(ElMatrix s A, ElInt rSize, float* rBuf, ElInt sSize, float* sBuf,ElInt xSize, float* xBuf, ElInt ySize, float* yBuf)

ElError ElCauchyLike d(ElMatrix d A, ElInt rSize, double* rBuf, ElInt sSize, double* sBuf,ElInt xSize, double* xBuf, ElInt ySize, double* yBuf)

ElError ElCauchyLike c(ElMatrix c A, ElInt rSize, complex float* rBuf, ElInt sSize, com-plex float* sBuf, ElInt xSize, complex float* xBuf, ElInt ySize, com-plex float* yBuf)

ElError ElCauchyLike z(ElMatrix z A, ElInt rSize, complex double* rBuf, ElInt sSize, com-plex double* sBuf, ElInt xSize, complex double* xBuf, ElInt ySize,complex double* yBuf)

ElError ElCauchyLikeDist s(ElDistMatrix s A, ElInt rSize, float* rBuf, ElInt sSize,float* sBuf, ElInt xSize, float* xBuf, ElInt ySize, float* yBuf)

ElError ElCauchyLikeDist d(ElDistMatrix d A, ElInt rSize, double* rBuf, ElInt sSize,double* sBuf, ElInt xSize, double* xBuf, ElInt ySize, dou-ble* yBuf)

ElError ElCauchyLikeDist c(ElDistMatrix c A, ElInt rSize, complex float* rBuf, ElInt sSize,complex float* sBuf, ElInt xSize, complex float* xBuf,ElInt ySize, complex float* yBuf)

ElError ElCauchyLikeDist z(ElDistMatrix z A, ElInt rSize, complex double* rBuf,ElInt sSize, complex double* sBuf, ElInt xSize, com-plex double* xBuf, ElInt ySize, complex double* yBuf)

Python API

CauchyLike(A, r, s, x, y)

8.1.4 Circulant

An n × n matrix A is called circulant if there exists a vector b such that

A(i, j) = b((i − j) mod n).

The following routines generate a circulant matrix using the vector a.

8.1. Deterministic 473

Page 478: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Circulant(Matrix<T> &A, const std::vector<T> &a)

void Circulant(AbstractDistMatrix<T> &A, const std::vector<T> &a)

C API

ElError ElCirculant i(ElMatrix i A, ElInt aSize, ElInt* aBuf)

ElError ElCirculant s(ElMatrix s A, ElInt aSize, float* aBuf)

ElError ElCirculant d(ElMatrix d A, ElInt aSize, double* aBuf)

ElError ElCirculant c(ElMatrix c A, ElInt aSize, complex float* aBuf)

ElError ElCirculant z(ElMatrix z A, ElInt aSize, complex double* aBuf)

ElError ElCirculantDist i(ElDistMatrix i A, ElInt aSize, ElInt* aBuf)

ElError ElCirculantDist s(ElDistMatrix s A, ElInt aSize, float* aBuf)

ElError ElCirculantDist d(ElDistMatrix d A, ElInt aSize, double* aBuf)

ElError ElCirculantDist c(ElDistMatrix c A, ElInt aSize, complex float* aBuf)

ElError ElCirculantDist z(ElDistMatrix z A, ElInt aSize, complex double* aBuf)

Python API

Circulant(A, a)

8.1.5 Demmel

An n × n Demmel matrix is of the form

D(n, β) = (βJ(−β−1, n))−1,

where J(−β−1, n) is the n × n Jordan block with eigenvalue −β−1, and the standard valuefor β is 104/(n−1). More explicitly, D(n, β) is an upper-triangular matrix where the j‘th super-diagonal is equal to −βj.

C++ API

void Demmel(Matrix<F> &A, Int n)

void Demmel(AbstractDistMatrix<F> &A, Int n)

C API

ElError ElDemmel s(ElMatrix s A, ElInt n)

ElError ElDemmel d(ElMatrix d A, ElInt n)

ElError ElDemmel c(ElMatrix c A, ElInt n)

474 Chapter 8. Special matrices

Page 479: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElDemmel z(ElMatrix z A, ElInt n)

ElError ElDemmelDist s(ElDistMatrix s A, ElInt n)

ElError ElDemmelDist d(ElDistMatrix d A, ElInt n)

ElError ElDemmelDist c(ElDistMatrix c A, ElInt n)

ElError ElDemmelDist z(ElDistMatrix z A, ElInt n)

Python API

Demmel(A, n)

8.1.6 Diagonal

An n × n matrix A is called diagonal if each entry (i, j), where i = j, is 0. They are thereforedefined by the diagonal values, where i = j.

The following routines construct a diagonal matrix from the vector of diagonal values, d.

C++ API

void Diagonal(Matrix<S> &D, const std::vector<T> &d)

void Diagonal(AbstractDistMatrix<S> &D, const std::vector<T> &d)

C API

ElError ElDiagonal i(ElMatrix i A, ElInt dSize, ElInt* dBuf)

ElError ElDiagonal s(ElMatrix s A, ElInt dSize, float* dBuf)

ElError ElDiagonal d(ElMatrix d A, ElInt dSize, double* dBuf)

ElError ElDiagonal c(ElMatrix c A, ElInt dSize, complex float* dBuf)

ElError ElDiagonal z(ElMatrix z A, ElInt dSize, complex double* dBuf)

ElError ElDiagonalDist i(ElDistMatrix i A, ElInt dSize, ElInt* dBuf)

ElError ElDiagonalDist s(ElDistMatrix s A, ElInt dSize, float* dBuf)

ElError ElDiagonalDist d(ElDistMatrix d A, ElInt dSize, double* dBuf)

ElError ElDiagonalDist c(ElDistMatrix c A, ElInt dSize, complex float* dBuf)

ElError ElDiagonalDist z(ElDistMatrix z A, ElInt dSize, complex double* dBuf)

Python API

Diagonal(A, d)

8.1. Deterministic 475

Page 480: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.7 Druinsky-Toledo

A Druinsky-Toledo matrix of order k is of the form

Ak =

(Gk IkIk Ik

),

where

Gk =

(diag(d0, d1, · · · , dn−3) ones(k − 2, 2)

ones(2, k − 2) ones(2, 2)

)Such a matrix is well-conditioned and achieves near the worst-case bound for element-growthwith the “A” pivoting rule for Bunch-Kaufman factorizations

TODO: Longer description with a reference

C++ API

void DruinskyToledo(Matrix<F> &A, Int k)

void DruinskyToledo(ElementalMatrix<F> &A, Int k)

C API

ElError ElDruinskyToledo s(ElMatrix s A, ElInt k)

ElError ElDruinskyToledo d(ElMatrix d A, ElInt k)

ElError ElDruinskyToledo c(ElMatrix c A, ElInt k)

ElError ElDruinskyToledo z(ElMatrix z A, ElInt k)

ElError ElDruinskyToledoDist s(ElDistMatrix s A, ElInt k)

ElError ElDruinskyToledoDist d(ElDistMatrix d A, ElInt k)

ElError ElDruinskyToledoDist c(ElDistMatrix c A, ElInt k)

ElError ElDruinskyToledoDist z(ElDistMatrix z A, ElInt k)

Python API

DruinskyToledo(A, k)

8.1.8 Egorov

Sets A to an n × n matrix with the (i, j) entry equal to

A(i, j) = exp(iφ(i, j)).

476 Chapter 8. Special matrices

Page 481: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Egorov(Matrix<Complex<Real>> &A, std::function<Real)Int, Int> phi, Int n

void Egorov(AbstractDistMatrix<Complex<Real>> &A, std::function<Real)Int, Int> phi, Int n

C API

ElError ElEgorov c(ElMatrix c A, float (*phase)(ElInt,ElInt), ElInt n)

ElError ElEgorov z(ElMatrix z A, double (*phase)(ElInt,ElInt), ElInt n)

ElError ElEgorovDist c(ElDistMatrix c A, float (*phase)(ElInt,ElInt), ElInt n)

ElError ElEgorovDist z(ElDistMatrix z A, double (*phase)(ElInt,ElInt), ElInt n)

Python API

Egorov(A, phase, n)

8.1.9 Ehrenfest

An n × n Ehrenfest matrix is the transition matrix for the famous Ehrenfest urns: a set of twourns collectively contains n − 1 balls, and, at each step, a ball is selected at random and movedto the other urn.

The transition matrix for the Markov chain is described by a tridiagonal matrix where the maindiagonal is zero, the superdiagonal is of the form 1

N−1 , 2N−1 , ..., 1, and the subdiagonal is of the

form 1, N−2N−1 , ..., 1

N−1 .

There is a well-known connection between this model and a random walk over the cornersof a hypercube. Please see Lloyd N. Trefethen and S. J. Chapman’s Wave packet pseudomodes oftwisted Toepitz matrices for more details.

C++ API

void Ehrenfest(Matrix<F> &P, Int n)

void Ehrenfest(AbstractDistMatrix<F> &P, Int n)

void Ehrenfest(Matrix<F> &P, Matrix<F> &PInf, Int n)

void Ehrenfest(ElementalMatrix<F> &P, ElementalMatrix<F> &PInf, Int n)

void EhrenfestStationary(Matrix<F> &PInf, Int n)

void EhrenfestStationary(AbstractDistMatrix<F> &PInf, Int n)

void EhrenfestDecay(Matrix<F> &A, Int n)

void EhrenfestDecay(ElementalMatrix<F> &A, Int n)

8.1. Deterministic 477

Page 482: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElEhrenfest s(ElMatrix s P, ElInt n)

ElError ElEhrenfest d(ElMatrix d P, ElInt n)

ElError ElEhrenfest c(ElMatrix c P, ElInt n)

ElError ElEhrenfest z(ElMatrix z P, ElInt n)

ElError ElEhrenfestDist s(ElMatrix s P, ElInt n)

ElError ElEhrenfestDist d(ElMatrix d P, ElInt n)

ElError ElEhrenfestDist c(ElMatrix c P, ElInt n)

ElError ElEhrenfestDist z(ElMatrix z P, ElInt n)

ElError ElEhrenfestStationary s(ElMatrix s PInf, ElInt n)

ElError ElEhrenfestStationary d(ElMatrix d PInf, ElInt n)

ElError ElEhrenfestStationary c(ElMatrix c PInf, ElInt n)

ElError ElEhrenfestStationary z(ElMatrix z PInf, ElInt n)

ElError ElEhrenfestStationaryDist s(ElDistMatrix s PInf, ElInt n)

ElError ElEhrenfestStationaryDist d(ElDistMatrix d PInf, ElInt n)

ElError ElEhrenfestStationaryDist c(ElDistMatrix c PInf, ElInt n)

ElError ElEhrenfestStationaryDist z(ElDistMatrix z PInf, ElInt n)

ElError ElEhrenfestDecay s(ElMatrix s A, ElInt n)

ElError ElEhrenfestDecay d(ElMatrix d A, ElInt n)

ElError ElEhrenfestDecay c(ElMatrix c A, ElInt n)

ElError ElEhrenfestDecay z(ElMatrix z A, ElInt n)

ElError ElEhrenfestDecayDist s(ElDistMatrix s A, ElInt n)

ElError ElEhrenfestDecayDist d(ElDistMatrix d A, ElInt n)

ElError ElEhrenfestDecayDist c(ElDistMatrix c A, ElInt n)

ElError ElEhrenfestDecayDist z(ElDistMatrix z A, ElInt n)

Python API

Ehrenfest(P, n)

EhrenfestStationary(PInf, n)

EhrenfestDecay(A, n)

478 Chapter 8. Special matrices

Page 483: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.10 Extended Kahan

The upper-triangular matrix A = SR, where S = diag(1, ζ, ..., ζ32k−1), and

R =

I −φHk 00 I φHk0 0 I

.

TODO: Reference for its introduction and a description of its relevance to rank-revealingQR factorizations

C++ API

void ExtendedKahan(Matrix<F> &A, Int k, Base<F> phi, Base<F> mu)

void ExtendedKahan(ElementalMatrix<F> &A, Int k, Base<F> phi, Base<F> mu)

C API

ElError ElExtendedKahan s(ElMatrix s A, ElInt k, float phi, float mu)

ElError ElExtendedKahan d(ElMatrix d A, ElInt k, double phi, double mu)

ElError ElExtendedKahan c(ElMatrix c A, ElInt k, float phi, float mu)

ElError ElExtendedKahan z(ElMatrix z A, ElInt k, double phi, double mu)

ElError ElExtendedKahanDist s(ElDistMatrix s A, ElInt k, float phi, float mu)

ElError ElExtendedKahanDist d(ElDistMatrix d A, ElInt k, double phi, double mu)

ElError ElExtendedKahanDist c(ElDistMatrix c A, ElInt k, float phi, float mu)

ElError ElExtendedKahanDist z(ElDistMatrix z A, ElInt k, double phi, double mu)

Python API

ExtendedKahan(A, k, phi, mu)

8.1.11 Fiedler

Given a vector c of length n, a Fielder matrix is an n × n matrix with entry (i, j) (counting fromzero) set to

A(i, j) = |c(i)− c(j)|.

C++ API

void Fiedler(Matrix<F> &A, const std::vector<F> &c)

void Fiedler(AbstractDistMatrix<F> &A, const std::vector<F> &c)

8.1. Deterministic 479

Page 484: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElFiedler s(ElMatrix s A, ElInt cSize, float* cBuf)

ElError ElFiedler d(ElMatrix d A, ElInt cSize, double* cBuf)

ElError ElFiedler c(ElMatrix c A, ElInt cSize, complex float* cBuf)

ElError ElFiedler z(ElMatrix z A, ElInt cSize, complex double* cBuf)

ElError ElFiedlerDist s(ElDistMatrix s A, ElInt cSize, float* cBuf)

ElError ElFiedlerDist d(ElDistMatrix d A, ElInt cSize, double* cBuf)

ElError ElFiedlerDist c(ElDistMatrix c A, ElInt cSize, complex float* cBuf)

ElError ElFiedlerDist z(ElDistMatrix z A, ElInt cSize, complex double* cBuf)

Python API

Fiedler(A, c)

8.1.12 Forsythe

A Forsythe matrix is a Jordan block with the bottom-left entry replaced with an arbitrary value.In the below routines, the eigenvalue of the n × n Jordan block is λ, and the entry placed in the(n − 1, 0) position is α.

C++ API

void Forsythe(Matrix<T> &J, Int n, T alpha, T lambda)

void Forsythe(AbstractDistMatrix<T> &J, Int n, T alpha, T lambda)

C API

ElError ElForsythe i(ElMatrix i J, ElInt n, ElInt alpha, ElInt lambda)

ElError ElForsythe s(ElMatrix s J, ElInt n, float alpha, float lambda)

ElError ElForsythe d(ElMatrix d J, ElInt n, double alpha, double lambda)

ElError ElForsythe c(ElMatrix c J, ElInt n, complex float alpha, complex float lambda)

ElError ElForsythe z(ElMatrix z J, ElInt n, complex double alpha, complex double lambda)

ElError ElForsytheDist i(ElDistMatrix i J, ElInt n, ElInt alpha, ElInt lambda)

ElError ElForsytheDist s(ElDistMatrix s J, ElInt n, float alpha, float lambda)

ElError ElForsytheDist d(ElDistMatrix d J, ElInt n, double alpha, double lambda)

ElError ElForsytheDist c(ElDistMatrix c J, ElInt n, complex float alpha, com-plex float lambda)

ElError ElForsytheDist z(ElDistMatrix z J, ElInt n, complex double alpha, com-plex double lambda)

480 Chapter 8. Special matrices

Page 485: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Forsythe(J, n, alpha, lamb)

8.1.13 Fourier

The n × n Discrete Fourier Transform (DFT) matrix, say A, is given by

A(i, j) =1√n

e−2πij/n.

The following routines set the matrix A equal to the n × n DFT matrix.

C++ API

void Fourier(Matrix<Complex<Real>> &A, Int n)

void Fourier(AbstractDistMatrix<Complex<Real>> &A, Int n)

C API

ElError ElFourier c(ElMatrix c A, ElInt n)

ElError ElFourier z(ElMatrix z A, ElInt n)

ElError ElFourierDist c(ElDistMatrix c A, ElInt n)

ElError ElFourierDist z(ElDistMatrix z A, ElInt n)

Python API

Fourier(A, n)

8.1.14 Fourier-Identity

The n × 2n Fourier-Identity matrix, say A, is given by

A = [FI] ,

where F is the n × n Discrete Fourier Transform matrix, and I is the n × n identity. It is acommon example of a matrix with low coherence.

C++ API

void FourierIdentity(Matrix<Complex<Real>> &A, Int n)

void FourierIdentity(ElementalMatrix<Complex<Real>> &A, Int n)

8.1. Deterministic 481

Page 486: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElFourierIdentity c(ElMatrix c A, ElInt n)

ElError ElFourierIdentity z(ElMatrix z A, ElInt n)

ElError ElFourierIdentityDist c(ElDistMatrix c A, ElInt n)

ElError ElFourierIdentityDist z(ElDistMatrix z A, ElInt n)

Python API

FourierIdentity(A, n)

8.1.15 GCDMatrix

A GCD matrix fills each entry (i, j) (counting from zero) of an m × n matrix with the greatestcommon denominator of i + 1 and j + 1, i.e.,

A(i, j) = gcd(i + 1, j + 1).

C++ API

void GCDMatrix(Matrix<T> &G, Int m, Int n)

void GCDMatrix(AbstractDistMatrix<T> &G, Int m, Int n)

C API

ElError ElGCDMatrix i(ElMatrix i G, ElInt m, ElInt n)

ElError ElGCDMatrix s(ElMatrix s G, ElInt m, ElInt n)

ElError ElGCDMatrix d(ElMatrix d G, ElInt m, ElInt n)

ElError ElGCDMatrix c(ElMatrix c G, ElInt m, ElInt n)

ElError ElGCDMatrix z(ElMatrix z G, ElInt m, ElInt n)

ElError ElGCDMatrixDist i(ElDistMatrix i G, ElInt m, ElInt n)

ElError ElGCDMatrixDist s(ElDistMatrix s G, ElInt m, ElInt n)

ElError ElGCDMatrixDist d(ElDistMatrix d G, ElInt m, ElInt n)

ElError ElGCDMatrixDist c(ElDistMatrix c G, ElInt m, ElInt n)

ElError ElGCDMatrixDist z(ElDistMatrix z G, ElInt m, ElInt n)

Python API

GCDMatrix(G, m, n)

482 Chapter 8. Special matrices

Page 487: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.16 Gear

An n× n Gear matrix with integer parameters s, t = 0 is a modification of the tridiagonal matrixwith a main diagonal of zeros and sub and superdiagonals of ones such that entries (0, |s| − 1)and (n − 1, n − |t|) are respectively set to sgn(s) and sgn(t).

C++ API

void Gear(Matrix<T> &G, Int n, Int s, Int t)

void Gear(AbstractDistMatrix<T> &G, Int n, Int s, Int t)

C API

ElError ElGear i(ElMatrix i G, ElInt n, ElInt s, ElInt t)

ElError ElGear s(ElMatrix s G, ElInt n, ElInt s, ElInt t)

ElError ElGear d(ElMatrix d G, ElInt n, ElInt s, ElInt t)

ElError ElGear c(ElMatrix c G, ElInt n, ElInt s, ElInt t)

ElError ElGear z(ElMatrix z G, ElInt n, ElInt s, ElInt t)

ElError ElGearDist i(ElDistMatrix i G, ElInt n, ElInt s, ElInt t)

ElError ElGearDist s(ElDistMatrix s G, ElInt n, ElInt s, ElInt t)

ElError ElGearDist d(ElDistMatrix d G, ElInt n, ElInt s, ElInt t)

ElError ElGearDist c(ElDistMatrix c G, ElInt n, ElInt s, ElInt t)

ElError ElGearDist z(ElDistMatrix z G, ElInt n, ElInt s, ElInt t)

Python API

Gear(G, n, s, t)

8.1.17 GEPP Growth

n × n extensions of matrices of the form

A =

1 0 0 1−1 1 0 1−1 −1 1 1−1 −1 −1 1

were known by Wilkinson to lead to an element-growth factor of 2n−1 for Gaussian Eliminationwith Partial Pivoting (GEPP).

C++ API

void GEPPGrowth(Matrix<F> &A, Int n)

void GEPPGrowth(ElementalMatrix<F> &A, Int n)

8.1. Deterministic 483

Page 488: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElGEPPGrowth s(ElMatrix s A, ElInt n)

ElError ElGEPPGrowth d(ElMatrix d A, ElInt n)

ElError ElGEPPGrowth c(ElMatrix c A, ElInt n)

ElError ElGEPPGrowth z(ElMatrix z A, ElInt n)

ElError ElGEPPGrowthDist s(ElDistMatrix s A, ElInt n)

ElError ElGEPPGrowthDist d(ElDistMatrix d A, ElInt n)

ElError ElGEPPGrowthDist c(ElDistMatrix c A, ElInt n)

ElError ElGEPPGrowthDist z(ElDistMatrix z A, ElInt n)

Python API

GEPPGrowth(A, n)

8.1.18 Golub/Klema/Stewart

The Golub/Klema/Stewart matrix is upper-triangular with 1/√

j + 1 in the j‘th entry of its maindiagonal and −1/

√j + 1 in the j‘th column of the upper triangle. It was originally introduced

as an example of where greedy Rank-Revealing QR factorizations fail.

C++ API

void GKS(Matrix<F> &A, Int n)

void GKS(AbstractDistMatrix<F> &A, Int n)

C API

ElError ElGKS s(ElMatrix s A, ElInt n)

ElError ElGKS d(ElMatrix d A, ElInt n)

ElError ElGKS c(ElMatrix c A, ElInt n)

ElError ElGKS z(ElMatrix z A, ElInt n)

ElError ElGKSDist s(ElDistMatrix s A, ElInt n)

ElError ElGKSDist d(ElDistMatrix d A, ElInt n)

ElError ElGKSDist c(ElDistMatrix c A, ElInt n)

ElError ElGKSDist z(ElDistMatrix z A, ElInt n)

Python API

GKS(A, n)

484 Chapter 8. Special matrices

Page 489: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.19 Grcar

An n × n Grcar matrix of order k is a banded Toeplitz matrix with its subdiagonal set to −1and both its main and k superdiagonals set to 1. It is a highly non-normal matrix whose pseu-dospectra is regularly visualized.

C++ API

void Grcar(Matrix<T> &A, Int n, Int k = 3)

void Grcar(AbstractDistMatrix<T> &A, Int n, Int k = 3)

C API

ElError ElGrcar i(ElMatrix i A, ElInt n, ElInt k)

ElError ElGrcar s(ElMatrix s A, ElInt n, ElInt k)

ElError ElGrcar d(ElMatrix d A, ElInt n, ElInt k)

ElError ElGrcar c(ElMatrix c A, ElInt n, ElInt k)

ElError ElGrcar z(ElMatrix z A, ElInt n, ElInt k)

ElError ElGrcarDist i(ElDistMatrix i A, ElInt n, ElInt k)

ElError ElGrcarDist s(ElDistMatrix s A, ElInt n, ElInt k)

ElError ElGrcarDist d(ElDistMatrix d A, ElInt n, ElInt k)

ElError ElGrcarDist c(ElDistMatrix c A, ElInt n, ElInt k)

ElError ElGrcarDist z(ElDistMatrix z A, ElInt n, ElInt k)

Python API

Grcar(A, n, k=3)

8.1.20 Hankel

An m × n matrix A is called a Hankel matrix if there exists a vector b such that

A(i, j) = b(i + j).

The following routines create an m × n Hankel matrix from the generate vector, b.

C++ API

void Hankel(Matrix<T> &A, Int m, Int n, const std::vector<T> &b)

void Hankel(AbstractDistMatrix<T> &A, Int m, Int n, const std::vector<T> &b)

8.1. Deterministic 485

Page 490: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElHankel i(ElMatrix i A, ElInt m, ElInt n, ElInt aSize, ElInt* aBuf)

ElError ElHankel s(ElMatrix s A, ElInt m, ElInt n, ElInt aSize, float* aBuf)

ElError ElHankel d(ElMatrix d A, ElInt m, ElInt n, ElInt aSize, double* aBuf)

ElError ElHankel c(ElMatrix c A, ElInt m, ElInt n, ElInt aSize, complex float* aBuf)

ElError ElHankel z(ElMatrix z A, ElInt m, ElInt n, ElInt aSize, complex double* aBuf)

ElError ElHankelDist i(ElDistMatrix i A, ElInt m, ElInt n, ElInt aSize, ElInt* aBuf)

ElError ElHankelDist s(ElDistMatrix s A, ElInt m, ElInt n, ElInt aSize, float* aBuf)

ElError ElHankelDist d(ElDistMatrix d A, ElInt m, ElInt n, ElInt aSize, double* aBuf)

ElError ElHankelDist c(ElDistMatrix c A, ElInt m, ElInt n, ElInt aSize, com-plex float* aBuf)

ElError ElHankelDist z(ElDistMatrix z A, ElInt m, ElInt n, ElInt aSize, com-plex double* aBuf)

Python API

Hankel(A, m, n, a)

8.1.21 Hanowa

A 2n × 2n matrix is said to be a Hanowa matrix if it is of the form

A =

(µIn×n −D

D µIn×n

),

where D = diag([1, 2, ..., n]) and In×n is the n × n identity matrix.

C++ API

void Hanowa(Matrix<T> &A, Int n, T mu)

void Hanowa(ElementalMatrix<T> &A, Int n, T mu)

C API

ElError ElHanowa i(ElMatrix i A, ElInt n, ElInt mu)

ElError ElHanowa s(ElMatrix s A, ElInt n, float mu)

ElError ElHanowa d(ElMatrix d A, ElInt n, double mu)

ElError ElHanowa c(ElMatrix c A, ElInt n, complex float mu)

ElError ElHanowa z(ElMatrix z A, ElInt n, complex double mu)

ElError ElHanowaDist i(ElDistMatrix i A, ElInt n, ElInt mu)

ElError ElHanowaDist s(ElDistMatrix s A, ElInt n, float mu)

486 Chapter 8. Special matrices

Page 491: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHanowaDist d(ElDistMatrix d A, ElInt n, double mu)

ElError ElHanowaDist c(ElDistMatrix c A, ElInt n, complex float mu)

ElError ElHanowaDist z(ElDistMatrix z A, ElInt n, complex double mu)

Python API

Hanowa(A, n, mu)

8.1.22 Helmholtz

A shifted discrete Laplacian over [0, 1]d.

C++ API

void Helmholtz(Matrix<F> &H, Int n, F shift)

void Helmholtz(AbstractDistMatrix<F> &H, Int n, F shift)1D Helmholtz

void Helmholtz(Matrix<F> &H, Int nx, Int ny, F shift)

void Helmholtz(AbstractDistMatrix<F> &H, Int nx, Int ny, F shift)2D Helmholtz

void Helmholtz(Matrix<F> &H, Int nx, Int ny, Int nz, F shift)

void Helmholtz(AbstractDistMatrix<F> &H, Int nx, Int ny, Int nz, F shift)3D Helmholtz

C API

ElError ElHelmholtz1D s(ElMatrix s H, ElInt nx, float shift)

ElError ElHelmholtz1D d(ElMatrix d H, ElInt nx, double shift)

ElError ElHelmholtz1D c(ElMatrix c H, ElInt nx, complex float shift)

ElError ElHelmholtz1D z(ElMatrix z H, ElInt nx, complex double shift)

ElError ElHelmholtz1DDist s(ElDistMatrix s H, ElInt nx, float shift)

ElError ElHelmholtz1DDist d(ElDistMatrix d H, ElInt nx, double shift)

ElError ElHelmholtz1DDist c(ElDistMatrix c H, ElInt nx, complex float shift)

ElError ElHelmholtz1DDist z(ElDistMatrix z H, ElInt nx, complex double shift)1D Helmholtz

ElError ElHelmholtz2D s(ElMatrix s H, ElInt nx, ElInt ny, float shift)

ElError ElHelmholtz2D d(ElMatrix d H, ElInt nx, ElInt ny, double shift)

ElError ElHelmholtz2D c(ElMatrix c H, ElInt nx, ElInt ny, complex float shift)

ElError ElHelmholtz2D z(ElMatrix z H, ElInt nx, ElInt ny, complex double shift)

8.1. Deterministic 487

Page 492: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElHelmholtz2DDist s(ElDistMatrix s H, ElInt nx, ElInt ny, float shift)

ElError ElHelmholtz2DDist d(ElDistMatrix d H, ElInt nx, ElInt ny, double shift)

ElError ElHelmholtz2DDist c(ElDistMatrix c H, ElInt nx, ElInt ny, complex float shift)

ElError ElHelmholtz2DDist z(ElDistMatrix z H, ElInt nx, ElInt ny, complex double shift)2D Helmholtz

ElError ElHelmholtz3D s(ElMatrix s H, ElInt nx, ElInt ny, ElInt nz, float shift)

ElError ElHelmholtz3D d(ElMatrix d H, ElInt nx, ElInt ny, ElInt nz, double shift)

ElError ElHelmholtz3D c(ElMatrix c H, ElInt nx, ElInt ny, ElInt nz, complex float shift)

ElError ElHelmholtz3D z(ElMatrix z H, ElInt nx, ElInt ny, ElInt nz, complex double shift)

ElError ElHelmholtz3DDist s(ElDistMatrix s H, ElInt nx, ElInt ny, ElInt nz, float shift)

ElError ElHelmholtz3DDist d(ElDistMatrix d H, ElInt nx, ElInt ny, ElInt nz, double shift)

ElError ElHelmholtz3DDist c(ElDistMatrix c H, ElInt nx, ElInt ny, ElInt nz, com-plex float shift)

ElError ElHelmholtz3DDist z(ElDistMatrix z H, ElInt nx, ElInt ny, ElInt nz, com-plex double shift)

3D Helmholtz

Python API

Helmholtz1D(H, nx, shift)

Helmholtz2D(H, nx, ny, shift)

Helmholtz3D(H, nx, ny, nz, shift)

8.1.23 Helmholtz with PML

The following routines return a simple second-order discretization of the constant coefficientHelmholtz equation over [0, 1]d with Perfectly Matched Layer boundary conditions with pro-file defined by the amplitude σ and exponent pmlExp, discretized over numPmlPoints gridpoints.

C++ API

void HelmholtzPML(Matrix<Complex<Real>> &H, Int n, Complex<Real> shift, IntnumPmlPoints, Real sigma, Real pmlExp)

void HelmholtzPML(AbstractDistMatrix<Complex<Real>> &H, Int n, Complex<Real>shift, Int numPmlPoints, Real sigma, Real pmlExp)

1D Helmholtz

void HelmholtzPML(Matrix<Complex<Real>> &H, Int nx, Int ny, Complex<Real> shift,Int numPmlPoints, Real sigma, Real pmlExp)

void HelmholtzPML(AbstractDistMatrix<Complex<Real>> &H, Int nx, Int ny, Com-plex<Real> shift, Int numPmlPoints, Real sigma, Real pmlExp)

2D Helmholtz

488 Chapter 8. Special matrices

Page 493: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void HelmholtzPML(Matrix<Complex<Real>> &H, Int nx, Int ny, Int nz, Complex<Real>shift, Int numPmlPoints, Real sigma, Real pmlExp)

void HelmholtzPML(AbstractDistMatrix<Complex<Real>> &H, Int nx, Int ny, Int nz,Complex<Real> shift, Int numPmlPoints, Real sigma, Real pmlExp)

3D Helmholtz

C API

ElError ElHelmholtzPML1D c(ElMatrix c H, ElInt nx, complex float omega, ElInt numPml-Points, float sigma, float pmlExp)

ElError ElHelmholtzPML1D z(ElMatrix z H, ElInt nx, complex double omega, ElInt numPml-Points, double sigma, double pmlExp)

ElError ElHelmholtzPML1DDist c(ElDistMatrix c H, ElInt nx, complex float omega,ElInt numPmlPoints, float sigma, float pmlExp)

ElError ElHelmholtzPML1DDist z(ElDistMatrix z H, ElInt nx, complex double omega,ElInt numPmlPoints, double sigma, double pmlExp)

1D Helmholtz

ElError ElHelmholtzPML2D c(ElMatrix c H, ElInt nx, ElInt ny, complex float omega,ElInt numPmlPoints, float sigma, float pmlExp)

ElError ElHelmholtzPML2D z(ElMatrix z H, ElInt nx, ElInt ny, complex double omega,ElInt numPmlPoints, double sigma, double pmlExp)

ElError ElHelmholtzPML2DDist c(ElDistMatrix c H, ElInt nx, ElInt ny, com-plex float omega, ElInt numPmlPoints, float sigma,float pmlExp)

ElError ElHelmholtzPML2DDist z(ElDistMatrix z H, ElInt nx, ElInt ny, com-plex double omega, ElInt numPmlPoints, double sigma,double pmlExp)

2D Helmholtz

ElError ElHelmholtzPML3D c(ElMatrix c H, ElInt nx, ElInt ny, ElInt nz, com-plex float omega, ElInt numPmlPoints, float sigma, float pml-Exp)

ElError ElHelmholtzPML3D z(ElMatrix z H, ElInt nx, ElInt ny, ElInt nz, com-plex double omega, ElInt numPmlPoints, double sigma,double pmlExp)

ElError ElHelmholtzPML3DDist c(ElDistMatrix c H, ElInt nx, ElInt ny, ElInt nz, com-plex float omega, ElInt numPmlPoints, float sigma,float pmlExp)

ElError ElHelmholtzPML3DDist z(ElDistMatrix z H, ElInt nx, ElInt ny, ElInt nz, com-plex double omega, ElInt numPmlPoints, double sigma,double pmlExp)

3D Helmholtz

Python API

HelmholtzPML1D(H, nx, omega, numPmlPoints, sigma, pmlExp)

8.1. Deterministic 489

Page 494: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

HelmholtzPML2D(H, nx, ny, omega, numPmlPoints, sigma, pmlExp)

HelmholtzPML3D(H, nx, ny, nz, omega, numPmlPoints, sigma, pmlExp)

8.1.24 Hermitian from EVD

Construct a Hermitian matrix from its spectral decomposition, Form

A := ZΩZH,

where Ω = diag(w) and w is real.

C++ API

void HermitianFromEVD(UpperOrLower uplo, Matrix<F> &A, const Matrix<Base<F>>&w, const Matrix<F> &Z)

void HermitianFromEVD(UpperOrLower uplo, ElementalMatrix<F> &A, const Elemental-Matrix<Base<F>> &w, const ElementalMatrix<F> &Z)

C API

ElError ElHermitianFromEVD s(ElUpperOrLower uplo, ElMatrix s A, ElConstMatrix s w,ElConstMatrix s Z)

ElError ElHermitianFromEVD d(ElUpperOrLower uplo, ElMatrix d A, ElConstMatrix d w,ElConstMatrix d Z)

ElError ElHermitianFromEVD c(ElUpperOrLower uplo, ElMatrix c A, ElConstMatrix s w,ElConstMatrix c Z)

ElError ElHermitianFromEVD z(ElUpperOrLower uplo, ElMatrix z A, ElConstMatrix d w,ElConstMatrix z Z)

ElError ElHermitianFromEVDDist s(ElUpperOrLower uplo, ElDistMatrix s A, ElConst-DistMatrix s w, ElConstDistMatrix s Z)

ElError ElHermitianFromEVDDist d(ElUpperOrLower uplo, ElDistMatrix d A, ElConst-DistMatrix d w, ElConstDistMatrix d Z)

ElError ElHermitianFromEVDDist c(ElUpperOrLower uplo, ElDistMatrix c A, ElConst-DistMatrix s w, ElConstDistMatrix c Z)

ElError ElHermitianFromEVDDist z(ElUpperOrLower uplo, ElDistMatrix z A, ElConst-DistMatrix d w, ElConstDistMatrix z Z)

Python API

HermitianFromEVD(uplo, A, w, Z)

8.1.25 Hilbert

The Hilbert matrix of order n is the n × n matrix where

A(i, j) =1

i + j + 1.

490 Chapter 8. Special matrices

Page 495: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Hilbert(Matrix<F> &A, Int n)

void Hilbert(AbstractDistMatrix<F> &A, Int n)

C API

ElError ElHilbert s(ElMatrix s A, ElInt n)

ElError ElHilbert d(ElMatrix d A, ElInt n)

ElError ElHilbert c(ElMatrix c A, ElInt n)

ElError ElHilbert z(ElMatrix z A, ElInt n)

ElError ElHilbertDist s(ElDistMatrix s A, ElInt n)

ElError ElHilbertDist d(ElDistMatrix d A, ElInt n)

ElError ElHilbertDist c(ElDistMatrix c A, ElInt n)

ElError ElHilbertDist z(ElDistMatrix z A, ElInt n)

Python API

Hilbert(A, n)

8.1.26 Identity

The n × n identity matrix is simply defined by setting entry (i, j) to one if i = j, and zerootherwise. For various reasons, we generalize this definition to nonsquare, m × n, matrices.

C++ API

void Identity(Matrix<T> &A, Int m, Int n)

void Identity(AbstractDistMatrix<T> &A, Int m, Int n)Set the matrix A equal to the m × n identity(-like) matrix.

void MakeIdentity(Matrix<T> &A)

void MakeIdentity(AbstractDistMatrix<T> &A)

Set the matrix A to be identity-like.

C API

ElError ElIdentity i(ElMatrix i A, ElInt m, ElInt n)

ElError ElIdentity s(ElMatrix s A, ElInt m, ElInt n)

ElError ElIdentity d(ElMatrix d A, ElInt m, ElInt n)

ElError ElIdentity c(ElMatrix c A, ElInt m, ElInt n)

ElError ElIdentity z(ElMatrix z A, ElInt m, ElInt n)

8.1. Deterministic 491

Page 496: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElIdentityDist i(ElDistMatrix i A, ElInt m, ElInt n)

ElError ElIdentityDist s(ElDistMatrix s A, ElInt m, ElInt n)

ElError ElIdentityDist d(ElDistMatrix d A, ElInt m, ElInt n)

ElError ElIdentityDist c(ElDistMatrix c A, ElInt m, ElInt n)

ElError ElIdentityDist z(ElDistMatrix z A, ElInt m, ElInt n)

Python API

Identity(A, m, n)

8.1.27 Jordan

An n × n Jordan block with eigenvalue λ is a bidiagonal matrix with main diagonal equal to λand superdiagonal equal to 1.

C++ API

void Jordan(Matrix<T> &J, Int n, T lambda)

void Jordan(AbstractDistMatrix<T> &J, Int n, T lambda)

C API

ElError ElJordan i(ElMatrix i J, ElInt n, ElInt lambda)

ElError ElJordan s(ElMatrix s J, ElInt n, float lambda)

ElError ElJordan d(ElMatrix d J, ElInt n, double lambda)

ElError ElJordan c(ElMatrix c J, ElInt n, complex float lambda)

ElError ElJordan z(ElMatrix z J, ElInt n, complex double lambda)

ElError ElJordanDist i(ElDistMatrix i J, ElInt n, ElInt lambda)

ElError ElJordanDist s(ElDistMatrix s J, ElInt n, float lambda)

ElError ElJordanDist d(ElDistMatrix d J, ElInt n, double lambda)

ElError ElJordanDist c(ElDistMatrix c J, ElInt n, complex float lambda)

ElError ElJordanDist z(ElDistMatrix z J, ElInt n, complex double lambda)

Python API

Jordan(J, n, lamb)

492 Chapter 8. Special matrices

Page 497: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.28 Kahan

For any pair (φ, ζ) such that |φ|2 + |ζ|2 = 1, the corresponding n × n Kahan matrix is given by:

K = diag(1, φ, . . . , φn−1)

1 −ζ −ζ · · · −ζ0 1 −ζ · · · −ζ

. . ....

...... 1 −ζ0 · · · 1

C++ API

void Kahan(Matrix<F> &A, Int n, F phi)

void Kahan(AbstractDistMatrix<F> &A, Int n, F phi)Sets the matrix A equal to the n × n Kahan matrix with the specified value for φ.

C API

ElError ElKahan s(ElMatrix s A, ElInt n, float phi)

ElError ElKahan d(ElMatrix d A, ElInt n, double phi)

ElError ElKahan c(ElMatrix c A, ElInt n, complex float phi)

ElError ElKahan z(ElMatrix z A, ElInt n, complex double phi)

ElError ElKahanDist s(ElDistMatrix s A, ElInt n, float phi)

ElError ElKahanDist d(ElDistMatrix d A, ElInt n, double phi)

ElError ElKahanDist c(ElDistMatrix c A, ElInt n, complex float phi)

ElError ElKahanDist z(ElDistMatrix z A, ElInt n, complex double phi)

Python API

Kahan(A, n, phi)

8.1.29 KMS

An n × n KMS matrix with parameter ρ is a skew-Hermitian matrix such that

A(i, j) = ρj−i, i <= j.

C++ API

void KMS(Matrix<T> &K, Int n, T rho)

void KMS(AbstractDistMatrix<T> &K, Int n, T rho)

8.1. Deterministic 493

Page 498: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElKMS i(ElMatrix i K, ElInt n, ElInt rho)

ElError ElKMS s(ElMatrix s K, ElInt n, float rho)

ElError ElKMS d(ElMatrix d K, ElInt n, double rho)

ElError ElKMS c(ElMatrix c K, ElInt n, complex float rho)

ElError ElKMS z(ElMatrix z K, ElInt n, complex double rho)

ElError ElKMSDist i(ElDistMatrix i K, ElInt n, ElInt rho)

ElError ElKMSDist s(ElDistMatrix s K, ElInt n, float rho)

ElError ElKMSDist d(ElDistMatrix d K, ElInt n, double rho)

ElError ElKMSDist c(ElDistMatrix c K, ElInt n, complex float rho)

ElError ElKMSDist z(ElDistMatrix z K, ElInt n, complex double rho)

Python API

KMS(K, n, rho)

8.1.30 Laplacian

C++ API

void Laplacian(Matrix<F> &L, Int n)

void Laplacian(AbstractDistMatrix<F> &L, Int n)Discrete Laplacian over [0, 1] with n grid points

void Laplacian(Matrix<F> &L, Int nx, Int ny)

void Laplacian(AbstractDistMatrix<F> &L, Int nx, Int ny)Discrete Laplacian over [0, 1]2 with nx × ny grid points

void Laplacian(Matrix<F> &L, Int nx, Int ny, Int nz)

void Laplacian(AbstractDistMatrix<F> &L, Int nx, Int ny, Int nz)Discrete Laplacian over [0, 1]3 with nx × ny × nz grid points

C API

ElError ElLaplacian1D s(ElMatrix s L, ElInt n)

ElError ElLaplacian1D d(ElMatrix d L, ElInt n)

ElError ElLaplacian1D c(ElMatrix c L, ElInt n)

ElError ElLaplacian1D z(ElMatrix z L, ElInt n)

ElError ElLaplacian1DDist s(ElDistMatrix s L, ElInt n)

ElError ElLaplacian1DDist d(ElDistMatrix d L, ElInt n)

494 Chapter 8. Special matrices

Page 499: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLaplacian1DDist c(ElDistMatrix c L, ElInt n)

ElError ElLaplacian1DDist z(ElDistMatrix z L, ElInt n)Discrete Laplacian over [0, 1] with n grid points

ElError ElLaplacian2D s(ElMatrix s L, ElInt nx, ElInt ny)

ElError ElLaplacian2D d(ElMatrix d L, ElInt nx, ElInt ny)

ElError ElLaplacian2D c(ElMatrix c L, ElInt nx, ElInt ny)

ElError ElLaplacian2D z(ElMatrix z L, ElInt nx, ElInt ny)

ElError ElLaplacian2DDist s(ElDistMatrix s L, ElInt nx, ElInt ny)

ElError ElLaplacian2DDist d(ElDistMatrix d L, ElInt nx, ElInt ny)

ElError ElLaplacian2DDist c(ElDistMatrix c L, ElInt nx, ElInt ny)

ElError ElLaplacian2DDist z(ElDistMatrix z L, ElInt nx, ElInt ny)Discrete Laplacian over [0, 1]2 with nx × ny grid points

Python API

Laplacian1D(L, nx)

Laplacian2D(L, nx, ny)

Laplacian3D(L, nx, ny, nz)

8.1.31 Lauchli

An n + 1 × n Lauchli matrix has is a concatenation of a 1 × n row-vector of all ones with then × n matrix muI. The case where mu =

√ε is a prominent example of where the explicit

formation of AH A can be catastrophic.

C++ API

void Lauchli(Matrix<T> &A, Int n, T mu)

void Lauchli(ElementalMatrix<T> &A, Int n, T mu)

C API

ElError ElLauchli i(ElMatrix i A, ElInt n, ElInt mu)

ElError ElLauchli s(ElMatrix s A, ElInt n, float mu)

ElError ElLauchli d(ElMatrix d A, ElInt n, double mu)

ElError ElLauchli c(ElMatrix c A, ElInt n, complex float mu)

ElError ElLauchli z(ElMatrix z A, ElInt n, complex double mu)

ElError ElLauchliDist i(ElDistMatrix i A, ElInt n, ElInt mu)

ElError ElLauchliDist s(ElDistMatrix s A, ElInt n, float mu)

8.1. Deterministic 495

Page 500: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElLauchliDist d(ElDistMatrix d A, ElInt n, double mu)

ElError ElLauchliDist c(ElDistMatrix c A, ElInt n, complex float mu)

ElError ElLauchliDist z(ElDistMatrix z A, ElInt n, complex double mu)

Python API

Lauchli(A, n, mu)

8.1.32 Legendre

The n × n tridiagonal Jacobi matrix associated with the Legendre polynomials. Its main diag-onal is zero, and the off-diagonal terms are given by

β j =12(1 − (2(j + 1))−2)−1/2

,

where β j connects the j‘th degree of freedom to the j + 1‘th degree of freedom, counting fromzero. The eigenvalues of this matrix lie in [−1, 1] and are the locations for Gaussian quadratureof order n. The corresponding weights may be found by doubling the square of the first entryof the corresponding normalized eigenvector.

C++ API

void Legendre(Matrix<F> &A, Int n)

void Legendre(AbstractDistMatrix<F> &A, Int n)Sets the matrix A equal to the n × n Jacobi matrix.

C API

ElError ElLegendre s(ElMatrix s A, ElInt n)

ElError ElLegendre d(ElMatrix d A, ElInt n)

ElError ElLegendre c(ElMatrix c A, ElInt n)

ElError ElLegendre z(ElMatrix z A, ElInt n)

ElError ElLegendreDist s(ElDistMatrix s A, ElInt n)

ElError ElLegendreDist d(ElDistMatrix d A, ElInt n)

ElError ElLegendreDist c(ElDistMatrix c A, ElInt n)

ElError ElLegendreDist z(ElDistMatrix z A, ElInt n)

Python API

Legendre(A, n)

496 Chapter 8. Special matrices

Page 501: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.33 Lehmer

An n× n Lehmer matrix is a symmetric positive-definite matrix whose upper-triangle is definedvia the equation

A(i, j) =i + 1j + 1

, i ≤ j.

The inverse of the Lehmer matrix is known to be symmetric tridiagonal (with positive eigen-values), and the condition number is known to be bounded by the relationship

n ≤ cond(A) ≤ 4n2.

C++ API

void Lehmer(Matrix<F> &L, Int n)

void Lehmer(AbstractDistMatrix<F> &L, Int n)

C API

ElError ElLehmer s(ElMatrix s L, ElInt n)

ElError ElLehmer d(ElMatrix d L, ElInt n)

ElError ElLehmer c(ElMatrix c L, ElInt n)

ElError ElLehmer z(ElMatrix z L, ElInt n)

ElError ElLehmerDist s(ElDistMatrix s L, ElInt n)

ElError ElLehmerDist d(ElDistMatrix d L, ElInt n)

ElError ElLehmerDist c(ElDistMatrix c L, ElInt n)

ElError ElLehmerDist z(ElDistMatrix z L, ElInt n)

Python API

Lehmer(L, n)

8.1.34 Lotkin

The n × n Lotkin matrix is equal to the Hilbert matrix with its first row replaced with ones. Itsinverse is analytically known and contains integer entries.

C++ API

void Lotkin(Matrix<F> &A, Int n)

void Lotkin(AbstractDistMatrix<F> &A, Int n)

8.1. Deterministic 497

Page 502: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElLotkin s(ElMatrix s A, ElInt n)

ElError ElLotkin d(ElMatrix d A, ElInt n)

ElError ElLotkin c(ElMatrix c A, ElInt n)

ElError ElLotkin z(ElMatrix z A, ElInt n)

ElError ElLotkinDist s(ElDistMatrix s A, ElInt n)

ElError ElLotkinDist d(ElDistMatrix d A, ElInt n)

ElError ElLotkinDist c(ElDistMatrix c A, ElInt n)

ElError ElLotkinDist z(ElDistMatrix z A, ElInt n)

Python API

Lotkin(A, n)

8.1.35 MinIJ

Return an n × n matrix with the (i, j) entry equal to min(i + 1, j + 1) (counting from zero).

C++ API

void MinIJ(Matrix<T> &M, Int n)

void MinIJ(AbstractDistMatrix<T> &M, Int n)

C API

ElError ELMinIJ i(ElMatrix i M, ElInt n)

ElError ELMinIJ s(ElMatrix s M, ElInt n)

ElError ELMinIJ d(ElMatrix d M, ElInt n)

ElError ELMinIJ c(ElMatrix c M, ElInt n)

ElError ELMinIJ z(ElMatrix z M, ElInt n)

ElError ELMinIJDist i(ElDistMatrix i M, ElInt n)

ElError ELMinIJDist s(ElDistMatrix s M, ElInt n)

ElError ELMinIJDist d(ElDistMatrix d M, ElInt n)

ElError ELMinIJDist c(ElDistMatrix c M, ElInt n)

ElError ELMinIJDist z(ElDistMatrix z M, ElInt n)

Python API

MinIJ(M, n)

498 Chapter 8. Special matrices

Page 503: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.36 NormalFromEVD

Form

A := ZΩZH,

where Ω is a complex diagonal matrix with diagonal entries given by the vector w.

C++ API

void NormalFromEVD(Matrix<Complex<Real>> &A, const Matrix<Complex<Real>>&w, const Matrix<Complex<Real>> &Z)

void NormalFromEVD(ElementalMatrix<Complex<Real>> &A, const Elemen-talMatrix<Complex<Real>> &w, const ElementalMa-trix<Complex<Real>> &Z)

C API

ElError ElNormalFromEVD c(ElMatrix c A, ElConstMatrix c w, ElConstMatrix c Z)

ElError ElNormalFromEVD z(ElMatrix z A, ElConstMatrix z w, ElConstMatrix z Z)

ElError ElNormalFromEVDDist c(ElDistMatrix c A, ElConstDistMatrix c w, ElConstDist-Matrix c Z)

ElError ElNormalFromEVDDist z(ElDistMatrix z A, ElConstDistMatrix z w, ElConstDist-Matrix z Z)

Python API

NormalFromEVD(A, w, Z)

8.1.37 Ones

Create an m × n matrix of all ones.

C++ API

void Ones(Matrix<T> &A, Int m, Int n)

void Ones(AbstractDistMatrix<T> &A, Int m, Int n)

C API

ElError ElOnes i(ElMatrix i A, ElInt m, ElInt n)

ElError ElOnes s(ElMatrix s A, ElInt m, ElInt n)

ElError ElOnes d(ElMatrix d A, ElInt m, ElInt n)

ElError ElOnes c(ElMatrix c A, ElInt m, ElInt n)

8.1. Deterministic 499

Page 504: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElOnes z(ElMatrix z A, ElInt m, ElInt n)

ElError ElOnesDist i(ElDistMatrix i A, ElInt m, ElInt n)

ElError ElOnesDist s(ElDistMatrix s A, ElInt m, ElInt n)

ElError ElOnesDist d(ElDistMatrix d A, ElInt m, ElInt n)

ElError ElOnesDist c(ElDistMatrix c A, ElInt m, ElInt n)

ElError ElOnesDist z(ElDistMatrix z A, ElInt m, ElInt n)

Python API

Ones(A, m, n)

8.1.38 OneTwoOne

A “1-2-1” matrix is tridiagonal with a diagonal of all twos and sub- and super-diagonals of allones.

C++ API

void OneTwoOne(Matrix<T> &A, Int n)

void OneTwoOne(AbstractDistMatrix<T> &A, Int n)

C API

ElError ElOneTwoOne i(ElMatrix i A, ElInt n)

ElError ElOneTwoOne s(ElMatrix s A, ElInt n)

ElError ElOneTwoOne d(ElMatrix d A, ElInt n)

ElError ElOneTwoOne c(ElMatrix c A, ElInt n)

ElError ElOneTwoOne z(ElMatrix z A, ElInt n)

ElError ElOneTwoOneDist i(ElDistMatrix i A, ElInt n)

ElError ElOneTwoOneDist s(ElDistMatrix s A, ElInt n)

ElError ElOneTwoOneDist d(ElDistMatrix d A, ElInt n)

ElError ElOneTwoOneDist c(ElDistMatrix c A, ElInt n)

ElError ElOneTwoOneDist z(ElDistMatrix z A, ElInt n)

Python API

OneTwoOne(A, n)

500 Chapter 8. Special matrices

Page 505: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.39 Parter

An n × n Parter matrix has entry (i, j) set to

P(i, j) =1

i − j + 12

.

C++ API

void Parter(Matrix<F> &P, Int n)

void Parter(AbstractDistMatrix<F> &P, Int n)

C API

ElError ElParter s(ElMatrix s P, ElInt n)

ElError ElParter d(ElMatrix d P, ElInt n)

ElError ElParter c(ElMatrix c P, ElInt n)

ElError ElParter z(ElMatrix z P, ElInt n)

ElError ElParterDist s(ElDistMatrix s P, ElInt n)

ElError ElParterDist d(ElDistMatrix d P, ElInt n)

ElError ElParterDist c(ElDistMatrix c P, ElInt n)

ElError ElParterDist z(ElDistMatrix z P, ElInt n)

Python API

Parter(P, n)

8.1.40 Pei

An n × n Pei matrix with parameter α has a main diagonal of α + 1 and all other entries set to1.

C++ API

void Pei(Matrix<T> &P, Int n, T alpha)

void Pei(AbstractDistMatrix<T> &P, Int n, T alpha)

C API

ElError ElPei i(ElMatrix i P, ElInt n, ElInt alpha)

ElError ElPei s(ElMatrix s P, ElInt n, float alpha)

ElError ElPei d(ElMatrix d P, ElInt n, double alpha)

8.1. Deterministic 501

Page 506: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElPei c(ElMatrix c P, ElInt n, complex float alpha)

ElError ElPei z(ElMatrix z P, ElInt n, complex double alpha)

ElError ElPeiDist i(ElDistMatrix i P, ElInt n, ElInt alpha)

ElError ElPeiDist s(ElDistMatrix s P, ElInt n, float alpha)

ElError ElPeiDist d(ElDistMatrix d P, ElInt n, double alpha)

ElError ElPeiDist c(ElDistMatrix c P, ElInt n, complex float alpha)

ElError ElPeiDist z(ElDistMatrix z P, ElInt n, complex double alpha)

Python API

Pei(P, n, alpha)

8.1.41 Redheffer

Return the n × n matrix with entry (i, j) (counting from zero) set to

1, j = 0, or (j + 1) mod (i + 1) = 0,0, otherwise.

The determinants of such matrices are connected to the Riemann hypothesis, which holds ifand only if

det(R) = O(n1/2+ε)

for every ε > 0.

C++ API

void Redheffer(Matrix<T> &R, Int n)

void Redheffer(AbstractDistMatrix<T> &R, Int n)

C API

ElError ElRedheffer i(ElMatrix i R, ElInt n)

ElError ElRedheffer s(ElMatrix s R, ElInt n)

ElError ElRedheffer d(ElMatrix d R, ElInt n)

ElError ElRedheffer c(ElMatrix c R, ElInt n)

ElError ElRedheffer z(ElMatrix z R, ElInt n)

ElError ElRedhefferDist i(ElDistMatrix i R, ElInt n)

ElError ElRedhefferDist s(ElDistMatrix s R, ElInt n)

ElError ElRedhefferDist d(ElDistMatrix d R, ElInt n)

ElError ElRedhefferDist c(ElDistMatrix c R, ElInt n)

ElError ElRedhefferDist z(ElDistMatrix z R, ElInt n)

502 Chapter 8. Special matrices

Page 507: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Redheffer(R, n)

8.1.42 Riffle

This is an implementation of the riffle-shuffle transition matrix made famous by Diaconis etal. The computation of binomial and Eulerian coefficients closely follows the scripts providedin Trefethen and Embree’s Spectra and Pseudospectra: The Behaviour of Nonnormal Matrices andOperators.

C++ API

void Riffle(Matrix<F> &P, Int n)

void Riffle(AbstractDistMatrix<F> &P, Int n)Return the n × n transition matrix.

void Riffle(Matrix<F> &P, Matrix<F> &PInf, Int n)

void Riffle(ElementalMatrix<F> &P, ElementalMatrix<F> &PInf, Int n)Return both the n × n transition matrix and its stationary distribution (as a square matrixwith identical rows).

void RiffleStationary(Matrix<F> &PInf, Int n)

void RiffleStationary(AbstractDistMatrix<F> &PInf, Int n)Return the stationary distribution of the n × n system as a square matrix with identicalrows.

void RiffleDecay(Matrix<F> &A, Int n)

void RiffleDecay(ElementalMatrix<F> &A, Int n)Return the transition matrix with its stationary distribution subtracted from each row.

C API

ElError ElRiffle s(ElMatrix s P, ElInt n)

ElError ElRiffle d(ElMatrix d P, ElInt n)

ElError ElRiffle c(ElMatrix c P, ElInt n)

ElError ElRiffle z(ElMatrix z P, ElInt n)

ElError ElRiffleDist s(ElDistMatrix s P, ElInt n)

ElError ElRiffleDist d(ElDistMatrix d P, ElInt n)

ElError ElRiffleDist c(ElDistMatrix c P, ElInt n)

ElError ElRiffleDist z(ElDistMatrix z P, ElInt n)Return the n × n transition matrix.

ElError ElRiffleStationary s(ElMatrix s PInf, ElInt n)

ElError ElRiffleStationary d(ElMatrix d PInf, ElInt n)

8.1. Deterministic 503

Page 508: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRiffleStationary c(ElMatrix c PInf, ElInt n)

ElError ElRiffleStationary z(ElMatrix z PInf, ElInt n)

ElError ElRiffleStationaryDist s(ElDistMatrix s PInf, ElInt n)

ElError ElRiffleStationaryDist d(ElDistMatrix d PInf, ElInt n)

ElError ElRiffleStationaryDist c(ElDistMatrix c PInf, ElInt n)

ElError ElRiffleStationaryDist z(ElDistMatrix z PInf, ElInt n)Return the stationary distribution of the n × n system as a square matrix with identicalrows.

ElError ElRiffleDecay s(ElMatrix s A, ElInt n)

ElError ElRiffleDecay d(ElMatrix d A, ElInt n)

ElError ElRiffleDecay c(ElMatrix c A, ElInt n)

ElError ElRiffleDecay z(ElMatrix z A, ElInt n)Return the transition matrix with its stationary distribution subtracted from each row.

Python API

Riffle(P, n)

RiffleStationary(PInf, n)

RiffleDecay(A, n)

8.1.43 Ris

Return the n × n matrix with the (i, j) entry (counting from zero) set to

A(i, j) =1

2(n − i − j)− 1.

C++ API

void Ris(Matrix<F> &R, Int n)

void Ris(AbstractDistMatrix<F> &R, Int n)

C API

ElError ElRis s(ElMatrix s R, ElInt n)

ElError ElRis d(ElMatrix d R, ElInt n)

ElError ElRis c(ElMatrix c R, ElInt n)

ElError ElRis z(ElMatrix z R, ElInt n)

ElError ElRisDist s(ElDistMatrix s R, ElInt n)

ElError ElRisDist d(ElDistMatrix d R, ElInt n)

504 Chapter 8. Special matrices

Page 509: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElRisDist c(ElDistMatrix c R, ElInt n)

ElError ElRisDist z(ElDistMatrix z R, ElInt n)

Python API

Ris(R, n)

8.1.44 Toeplitz

An m × n matrix is Toeplitz if there exists a vector b such that, for each entry A(i, j) of A,

A(i, j) = b(i − j + (n − 1)).

C++ API

void Toeplitz(Matrix<T> &A, Int m, Int n, const std::vector<T> &b)

void Toeplitz(AbstractDistMatrix<T> &A, Int m, Int n, const std::vector<T> &b)

C API

ElError ElToeplitz i(ElMatrix i A, ElInt m, ElInt n, ElInt aSize, ElInt* aBuf)

ElError ElToeplitz s(ElMatrix s A, ElInt m, ElInt n, ElInt aSize, float* aBuf)

ElError ElToeplitz d(ElMatrix d A, ElInt m, ElInt n, ElInt aSize, double* aBuf)

ElError ElToeplitz c(ElMatrix c A, ElInt m, ElInt n, ElInt aSize, complex float* aBuf)

ElError ElToeplitz z(ElMatrix z A, ElInt m, ElInt n, ElInt aSize, complex double* aBuf)

ElError ElToeplitzDist i(ElDistMatrix i A, ElInt m, ElInt n, ElInt aSize, ElInt* aBuf)

ElError ElToeplitzDist s(ElDistMatrix s A, ElInt m, ElInt n, ElInt aSize, float* aBuf)

ElError ElToeplitzDist d(ElDistMatrix d A, ElInt m, ElInt n, ElInt aSize, double* aBuf)

ElError ElToeplitzDist c(ElDistMatrix c A, ElInt m, ElInt n, ElInt aSize, com-plex float* aBuf)

ElError ElToeplitzDist z(ElDistMatrix z A, ElInt m, ElInt n, ElInt aSize, com-plex double* aBuf)

Python API

Toeplitz(A, m, n, a)

8.1. Deterministic 505

Page 510: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.1.45 Trefethen-Embree

The Trefethen-Embree matrix (since the author is not aware of another name) is a banded Toeplitzmatrix with symbol

f (z) = 2z−3 − z−2 + 2iz−1 − 4z2 − 2iz3.

Please see Chapter II of Lloyd N. Trefethen and Mark Embree’s Spectra and Pseudospectra formore details.

C++ API

void TrefethenEmbree(Matrix<Complex<Real>> &A, Int n)

void TrefethenEmbree(AbstractDistMatrix<Complex<Real>> &A, Int n)

C API

ElError ElTrefethenEmbree c(ElMatrix c A, ElInt n)

ElError ElTrefethenEmbree z(ElMatrix z A, ElInt n)

ElError ElTrefethenEmbreeDist c(ElDistMatrix c A, ElInt n)

ElError ElTrefethenEmbreeDist z(ElDistMatrix z A, ElInt n)

Python API

TrefethenEmbree(A, n)

8.1.46 Triangle

C++ API

void Triangle(Matrix<F> &A, Int n)

void Triangle(AbstractDistMatrix<F> &A, Int n)

C API

ElError ElTriangle s(ElMatrix s A, ElInt n)

ElError ElTriangle d(ElMatrix d A, ElInt n)

ElError ElTriangle c(ElMatrix c A, ElInt n)

ElError ElTriangle z(ElMatrix z A, ElInt n)

ElError ElTriangleDist s(ElDistMatrix s A, ElInt n)

ElError ElTriangleDist d(ElDistMatrix d A, ElInt n)

ElError ElTriangleDist c(ElDistMatrix c A, ElInt n)

ElError ElTriangleDist z(ElDistMatrix z A, ElInt n)

506 Chapter 8. Special matrices

Page 511: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Triangle(A, n)

8.1.47 TriW

An n × n TriW matrix of order k is a banded upper-triangular matrix with its main diagonal setto one and its k super-diagonals each set to some value α. This family of matrices was regularlyemployed by Wilkinson.

C++ API

void TriW(Matrix<T> &A, Int n, T alpha, Int k)

void TriW(AbstractDistMatrix<T> &A, Int n, T alpha, Int k)

C API

ElError ElTriW i(ElMatrix i A, ElInt n, ElInt alpha, ElInt k)

ElError ElTriW s(ElMatrix s A, ElInt n, float alpha, ElInt k)

ElError ElTriW d(ElMatrix d A, ElInt n, double alpha, ElInt k)

ElError ElTriW c(ElMatrix c A, ElInt n, complex float alpha, ElInt k)

ElError ElTriW z(ElMatrix z A, ElInt n, complex double alpha, ElInt k)

ElError ElTriWDist i(ElDistMatrix i A, ElInt n, ElInt alpha, ElInt k)

ElError ElTriWDist s(ElDistMatrix s A, ElInt n, float alpha, ElInt k)

ElError ElTriWDist d(ElDistMatrix d A, ElInt n, double alpha, ElInt k)

ElError ElTriWDist c(ElDistMatrix c A, ElInt n, complex float alpha, ElInt k)

ElError ElTriWDist z(ElDistMatrix z A, ElInt n, complex double alpha, ElInt k)

Python API

TriW(A, n, alpha, k)

8.1.48 Walsh

The Walsh matrix of order k is a 2k × 2k matrix, where

W1 =

(1 11 −1

),

and

Wk =

(Wk−1 Wk−1Wk−1 −Wk−1

).

A binary Walsh matrix changes the bottom-right entry of W1 from −1 to 0.

8.1. Deterministic 507

Page 512: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Walsh(Matrix<T> &W, Int k, bool binary = false)

void Walsh(AbstractDistMatrix<T> &W, Int k, bool binary = false)

C API

ElError ElWalsh i(ElMatrix i W, ElInt k, bool binary)

ElError ElWalsh s(ElMatrix s W, ElInt k, bool binary)

ElError ElWalsh d(ElMatrix d W, ElInt k, bool binary)

ElError ElWalsh c(ElMatrix c W, ElInt k, bool binary)

ElError ElWalsh z(ElMatrix z W, ElInt k, bool binary)

ElError ElWalshDist i(ElDistMatrix i W, ElInt k, bool binary)

ElError ElWalshDist s(ElDistMatrix s W, ElInt k, bool binary)

ElError ElWalshDist d(ElDistMatrix d W, ElInt k, bool binary)

ElError ElWalshDist c(ElDistMatrix c W, ElInt k, bool binary)

ElError ElWalshDist z(ElDistMatrix z W, ElInt k, bool binary)

Python API

Walsh(W, k, binary=False)

8.1.49 Whale

The Whale matrix is a banded Toeplitz matrix with symbol

f (z) = −z−4 − (3 + 2i)z−3 + iz−2 + z−1 + 10z + (3 + i)z2 + 4z3 + iz4

Please see A. Bottcher’s Infinite matrices and projection methods for more details.

C++ API

void Whale(Matrix<Complex<Real>> &A, Int n)

void Whale(AbstractDistMatrix<Complex<Real>> &A, Int n)

C API

ElError ElWhale c(ElMatrix c A, ElInt n)

ElError ElWhale z(ElMatrix z A, ElInt n)

ElError ElWhaleDist c(ElDistMatrix c A, ElInt n)

ElError ElWhaleDist z(ElDistMatrix z A, ElInt n)

508 Chapter 8. Special matrices

Page 513: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Python API

Whale(A, n)

8.1.50 Wilkinson

A Wilkinson matrix of order k is a tridiagonal matrix with diagonal

[k, k − 1, k − 2, ..., 1, 0, 1, ..., k − 2, k − 1, k],

and sub- and super-diagonals of all ones.

C++ API

void Wilkinson(Matrix<T> &W, Int k)

void Wilkinson(AbstractDistMatrix<T> &W, Int k)

C API

ElError ElWilkinson i(ElMatrix i W, ElInt k)

ElError ElWilkinson s(ElMatrix s W, ElInt k)

ElError ElWilkinson d(ElMatrix d W, ElInt k)

ElError ElWilkinson c(ElMatrix c W, ElInt k)

ElError ElWilkinson z(ElMatrix z W, ElInt k)

ElError ElWilkinsonDist i(ElDistMatrix i W, ElInt k)

ElError ElWilkinsonDist s(ElDistMatrix s W, ElInt k)

ElError ElWilkinsonDist d(ElDistMatrix d W, ElInt k)

ElError ElWilkinsonDist c(ElDistMatrix c W, ElInt k)

ElError ElWilkinsonDist z(ElDistMatrix z W, ElInt k)

Python API

Wilkinson(W, k)

8.1.51 Zeros

Create an m × n matrix of all zeros.

C++ API

void Zeros(Matrix<T> &A, Int m, Int n)

void Zeros(AbstractDistMatrix<T> &A, Int m, Int n)

8.1. Deterministic 509

Page 514: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElZeros i(ElMatrix i A, ElInt m, ElInt n)

ElError ElZeros s(ElMatrix s A, ElInt m, ElInt n)

ElError ElZeros d(ElMatrix d A, ElInt m, ElInt n)

ElError ElZeros c(ElMatrix c A, ElInt m, ElInt n)

ElError ElZeros z(ElMatrix z A, ElInt m, ElInt n)

ElError ElZerosDist i(ElDistMatrix i A, ElInt m, ElInt n)

ElError ElZerosDist s(ElDistMatrix s A, ElInt m, ElInt n)

ElError ElZerosDist d(ElDistMatrix d A, ElInt m, ElInt n)

ElError ElZerosDist c(ElDistMatrix c A, ElInt m, ElInt n)

ElError ElZerosDist z(ElDistMatrix z A, ElInt m, ElInt n)

Python API

Zeros(A, m, n)

8.2 Random

8.2.1 Bernoulli

A Bernoulli matrix with parameter 0 < p < 1 is a matrix which is equal to 0 with probability1 − p and 1 with probability p.

C++ API

void Bernoulli(Matrix<T> &A, Int m, Int n, double p = 0.5)

void Bernoulli(AbstractDistMatrix<T> &A, Int m, Int n, double p = 0.5)

C API

ElError ElBernoulli i(ElMatrix i A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulli s(ElMatrix s A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulli d(ElMatrix d A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulli c(ElMatrix c A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulli z(ElMatrix z A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulliDist i(ElDistMatrix i A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulliDist s(ElDistMatrix s A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulliDist d(ElDistMatrix d A, ElInt m, ElInt n, double p=0.5)

510 Chapter 8. Special matrices

Page 515: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElBernoulliDist c(ElDistMatrix c A, ElInt m, ElInt n, double p=0.5)

ElError ElBernoulliDist z(ElDistMatrix z A, ElInt m, ElInt n, double p=0.5)

Python API

Bernoulli(A, m, n[, p=0.5])

8.2.2 Gaussian

An m × n matrix is Gaussian if each entry is independently drawn from a normal distribution.

C++ API

void Gaussian(Matrix<T> &A, Int m, Int n, T mean = 0, Base<T> stddev = 1)

void Gaussian(AbstractDistMatrix<T> &A, Int m, Int n, T mean = 0, Base<T> stddev = 1)Sets the matrix A to an m × n Gaussian matrix with the specified mean and standarddeviation.

void MakeGaussian(Matrix<T> &A, T mean = 0, Base<T> stddev = 1)

void MakeGaussian(AbstractDistMatrix<T> &A, T mean = 0, Base<T> stddev = 1)Changes each entry to an independent sample from the specified normal distribution.

C API

ElError ElGaussian s(ElMatrix s A, ElInt m, ElInt n, float mean, float stddev)

ElError ElGaussian d(ElMatrix d A, ElInt m, ElInt n, double mean, double stddev)

ElError ElGaussian c(ElMatrix c A, ElInt m, ElInt n, complex float mean, float stddev)

ElError ElGaussian z(ElMatrix z A, ElInt m, ElInt n, complex double mean, double stddev)

ElError ElGaussianDist s(ElDistMatrix s A, ElInt m, ElInt n, float mean, float stddev)

ElError ElGaussianDist d(ElDistMatrix d A, ElInt m, ElInt n, double mean, double std-dev)

ElError ElGaussianDist c(ElDistMatrix c A, ElInt m, ElInt n, complex float mean, float std-dev)

ElError ElGaussianDist z(ElDistMatrix z A, ElInt m, ElInt n, complex double mean, dou-ble stddev)

Python API

Gaussian(A, m, n, mean=0, stddev=1)

8.2.3 Haar

The Haar distribution is the uniform distribution over the space of real or complex unitarymatrices.

8.2. Random 511

Page 516: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Haar(Matrix<F> &A, Int n)

void Haar(ElementalMatrix<F> &A, Int n)Draws A from the Haar distribution. The current scheme performs a QR factorizationof a Gaussian matrix, but Stewart introduced a well-known scheme which only requiresquadratic work for the implicit representation as a product of random Householder re-flectors.

void ImplicitHaar(Matrix<F> &A, Matrix<F> &t, Matrix<Base<F>> &d, Int n)

void ImplicitHaar(ElementalMatrix<F> &A, ElementalMatrix<F> &t, Elemen-tal<Base<F>> &d, Int n)

Sets A to a set of Householder reflectors with the same structure as the result of a QRdecomposition. The product of these reflectors is a sample from the Haar distribution.

C API

ElError ElHaar s(ElMatrix s A, ElInt n)

ElError ElHaar d(ElMatrix d A, ElInt n)

ElError ElHaar c(ElMatrix c A, ElInt n)

ElError ElHaar z(ElMatrix z A, ElInt n)

ElError ElHaarDist s(ElDistMatrix s A, ElInt n)

ElError ElHaarDist d(ElDistMatrix d A, ElInt n)

ElError ElHaarDist c(ElDistMatrix c A, ElInt n)

ElError ElHaarDist z(ElDistMatrix z A, ElInt n)

ElError ElImplicitHaar s(ElMatrix s A, ElMatrix s t, ElMatrix s d, ElInt n)

ElError ElImplicitHaar d(ElMatrix d A, ElMatrix d t, ElMatrix d d, ElInt n)

ElError ElImplicitHaar c(ElMatrix c A, ElMatrix c t, ElMatrix s d, ElInt n)

ElError ElImplicitHaar z(ElMatrix z A, ElMatrix z t, ElMatrix d d, ElInt n)

ElError ElImplicitHaarDist s(ElDistMatrix s A, ElDistMatrix s t, ElDistMatrix s d,ElInt n)

ElError ElImplicitHaarDist d(ElDistMatrix d A, ElDistMatrix d t, ElDistMatrix d d,ElInt n)

ElError ElImplicitHaarDist c(ElDistMatrix c A, ElDistMatrix c t, ElDistMatrix s d,ElInt n)

ElError ElImplicitHaarDist z(ElDistMatrix z A, ElDistMatrix z t, ElDistMatrix d d,ElInt n)

Python API

Haar(A, n)

ImplicitHaar(A, t, d, n)

512 Chapter 8. Special matrices

Page 517: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

8.2.4 Hatano-Nelson

Hatano-Nelson matrices extend the (Nobel prize winning) work of Anderson on the localizationof eigenvalues of random tridiagonal matrices. The matrices have a main diagonal with eachentry sampled from the uniform distribution over a ball from the real line or complex plane;each entry of the superdiagonal is set to eg (if periodic, also the bottom-left corner), each entryof the subdiagonal is set to e−g (if periodic, also the top-right corner).

C++ API

void HatanoNelson(Matrix<F> &A, Int n, F center, Base<F> radius, F g, bool periodic =true)

void HatanoNelson(ElementalMatrix<F> &A, Int n, F center, Base<F> radius, F g, boolperiodic = true)

C API

ElError ElHatanoNelson s(ElMatrix s A, ElInt n, float center, float radius, float g, bool pe-riodic)

ElError ElHatanoNelson d(ElMatrix d A, ElInt n, double center, double radius, double g,bool periodic)

ElError ElHatanoNelson c(ElMatrix c A, ElInt n, complex float center, float radius, com-plex float g, bool periodic)

ElError ElHatanoNelson z(ElMatrix z A, ElInt n, complex double center, double radius,complex double g, bool periodic)

ElError ElHatanoNelsonDist s(ElDistMatrix s A, ElInt n, float center, float radius, float g,bool periodic)

ElError ElHatanoNelsonDist d(ElDistMatrix d A, ElInt n, double center, double radius,double g, bool periodic)

ElError ElHatanoNelsonDist c(ElDistMatrix c A, ElInt n, complex float center, float ra-dius, complex float g, bool periodic)

ElError ElHatanoNelsonDist z(ElDistMatrix z A, ElInt n, complex double center, dou-ble radius, complex double g, bool periodic)

Python API

HatanoNelson(A, n, center, radius, g, periodic=True)

8.2.5 Hermitian uniform spectrum

These routines sample a diagonal matrix from the specified interval of the real line,(lower, upper], and then perform a similarity transformation using a random Householdertransform.

8.2. Random 513

Page 518: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void HermitianUniformSpectrum(Matrix<F> &A, Int n, Base<F> lower = 0, Base<F>upper = 1)

void HermitianUniformSpectrum(ElementalMatrix<F> &A, Int n, Base<F> lower = 0,Base<F> upper = 1)

C API

ElError ElHermitianUniformSpectrum s(ElMatrix s A, ElInt n, float lower, float upper)

ElError ElHermitianUniformSpectrum d(ElMatrix d A, ElInt n, double lower, double up-per)

ElError ElHermitianUniformSpectrum c(ElMatrix c A, ElInt n, float lower, float upper)

ElError ElHermitianUniformSpectrum z(ElMatrix z A, ElInt n, double lower, double up-per)

ElError ElHermitianUniformSpectrumDist s(ElDistMatrix s A, ElInt n, float lower,float upper)

ElError ElHermitianUniformSpectrumDist d(ElDistMatrix d A, ElInt n, double lower,double upper)

ElError ElHermitianUniformSpectrumDist c(ElDistMatrix c A, ElInt n, float lower,float upper)

ElError ElHermitianUniformSpectrumDist z(ElDistMatrix z A, ElInt n, double lower,double upper)

Python API

HermitianUniformSpectrum(A, n, lower=0, upper=1)

8.2.6 Normal uniform spectrum

These routines sample a diagonal matrix from the specified ball in the complex plane,Bradius(center), and then perform a similarity transformation using a random Householdertransform.

C++ API

void NormalUniformSpectrum(Matrix<Complex<Real>> &A, Int n, Complex<Real> cen-ter = 0, Real radius = 1)

void NormalUniformSpectrum( ElementalMatrix<Complex<Real>& A, Int n, Complex<Real> center=0, Real radius=1 )

C API

ElError ElNormalUniformSpectrum c(ElMatrix c A, ElInt n, complex float center, float ra-dius)

514 Chapter 8. Special matrices

Page 519: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElNormalUniformSpectrum z(ElMatrix z A, ElInt n, complex double center, dou-ble radius)

ElError ElNormalUniformSpectrumDist c(ElDistMatrix c A, ElInt n, complex float center,float radius)

ElError ElNormalUniformSpectrumDist z(ElDistMatrix z A, ElInt n, complex double cen-ter, double radius)

Python API

NormalUniformSpectrum(A, n, center=0, radius=1)

8.2.7 Rademacher

A Rademacher matrix is a matrix whose entries are independent and uniformly sampled from−1, 1.

C++ API

void Rademacher(Matrix<T> &A, Int m, Int n)

void Rademacher(AbstractDistMatrix<T> &A, Int m, Int n)

C API

ElError ElRademacher i(ElMatrix i A, ElInt m, ElInt n)

ElError ElRademacher s(ElMatrix s A, ElInt m, ElInt n)

ElError ElRademacher d(ElMatrix d A, ElInt m, ElInt n)

ElError ElRademacher c(ElMatrix c A, ElInt m, ElInt n)

ElError ElRademacher z(ElMatrix z A, ElInt m, ElInt n)

ElError ElRademacherDist i(ElDistMatrix i A, ElInt m, ElInt n)

ElError ElRademacherDist s(ElDistMatrix s A, ElInt m, ElInt n)

ElError ElRademacherDist d(ElDistMatrix d A, ElInt m, ElInt n)

ElError ElRademacherDist c(ElDistMatrix c A, ElInt m, ElInt n)

ElError ElRademacherDist z(ElDistMatrix z A, ElInt m, ElInt n)

Python API

Rademacher(A, m, n)

8.2.8 Three-valued

A three-valued matrix is a matrix whose entries are independently sampled from −1, 0, 1.withprobabilities p/2, 1 − p, p/2.

8.2. Random 515

Page 520: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void ThreeValued(Matrix<T> &A, Int m, Int n, double p = 2./3.)

void ThreeValued(AbstractDistMatrix<T> &A, Int m, Int n, double p = 2./3.)

C API

ElError ElThreeValued i(ElMatrix i A, ElInt m, ElInt n, double p)

ElError ElThreeValued s(ElMatrix s A, ElInt m, ElInt n, double p)

ElError ElThreeValued d(ElMatrix d A, ElInt m, ElInt n, double p)

ElError ElThreeValued c(ElMatrix c A, ElInt m, ElInt n, double p)

ElError ElThreeValued z(ElMatrix z A, ElInt m, ElInt n, double p)

ElError ElThreeValuedDist i(ElDistMatrix i A, ElInt m, ElInt n, double p)

ElError ElThreeValuedDist s(ElDistMatrix s A, ElInt m, ElInt n, double p)

ElError ElThreeValuedDist d(ElDistMatrix d A, ElInt m, ElInt n, double p)

ElError ElThreeValuedDist c(ElDistMatrix c A, ElInt m, ElInt n, double p)

ElError ElThreeValuedDist z(ElDistMatrix z A, ElInt m, ElInt n, double p)

Python API

ThreeValued(A, m, n, p)

8.2.9 Uniform

We call an m× n matrix is uniformly random if each entry is drawn from a uniform distributionover a ball with the specified center and radius.

C++ API

void Uniform(Matrix<T> &A, Int m, Int n, T center = 0, Base<T> radius = 1)

void Uniform(AbstractDistMatrix<T> &A, Int m, Int n, T center = 0, Base<T> radius = 1)

void MakeUniform(Matrix<T> &A, T center = 0, Base<T> radius = 1)

void MakeUniform(AbstractDistMatrix<T> &A, T center = 0, Base<T> radius = 1)

C API

ElError ElUniform i(ElMatrix i A, ElInt m, ElInt n, ElInt center, ElInt radius)

ElError ElUniform s(ElMatrix s A, ElInt m, ElInt n, float center, float radius)

ElError ElUniform d(ElMatrix d A, ElInt m, ElInt n, double center, double radius)

ElError ElUniform c(ElMatrix c A, ElInt m, ElInt n, complex float center, float radius)

516 Chapter 8. Special matrices

Page 521: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElUniform z(ElMatrix z A, ElInt m, ElInt n, complex double center, double radius)

ElError ElUniformDist i(ElDistMatrix i A, ElInt m, ElInt n, ElInt center, ElInt radius)

ElError ElUniformDist s(ElDistMatrix s A, ElInt m, ElInt n, float center, float radius)

ElError ElUniformDist d(ElDistMatrix d A, ElInt m, ElInt n, double center, double ra-dius)

ElError ElUniformDist c(ElDistMatrix c A, ElInt m, ElInt n, complex float center, float ra-dius)

ElError ElUniformDist z(ElDistMatrix z A, ElInt m, ElInt n, complex double center, dou-ble radius)

Python API

Uniform(A, m, n, center=0, radius=1)

8.2.10 Uniform Helmholtz Green’s

These routines generate a member of the family of “random Green’s matrices” from A.Goetschy and S. E. Skipetrov’s Non-Hermitian Euclidean random matrix theory. Each such matrixis the restriction of a 3D Helmholtz Green’s function to a subset of points chosen uniformlyfrom the unit ball. The behaviour of the spectrum is known to change dramatically dependen-ing upon the number of points sampled per wavelength.

C++ API

void UniformHelmholtzGreens(Matrix<Complex<Real>> &A, Int n, Real lambda)

void UniformHelmholtzGreens(ElementalMatrix<Complex<Real>> &A, Int n, Reallambda)

C API

ElError ElUniformHelmholtzGreens c(ElMatrix c A, ElInt n, float lambda)

ElError ElUniformHelmholtzGreens z(ElMatrix z A, ElInt n, double lambda)

ElError ElUniformHelmholtzGreensDist c(ElDistMatrix c A, ElInt n, float lambda)

ElError ElUniformHelmholtzGreensDist z(ElDistMatrix z A, ElInt n, double lambda)

Python API

UniformHelmholtzGreens(A, n, lamb)

8.2.11 Wigner

A Hermitian matrix whose entries in one triangle are all independent samples from a normaldistribution. The spectra of these matrices are well-studied.

8.2. Random 517

Page 522: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C++ API

void Wigner(Matrix<F> &A, Int n, F mean = 0, Base<F> stddev = 1)

void Wigner(ElementalMatrix<F> &A, Int n, F mean = 0, Base<F> stddev = 1)

C API

ElError ElWigner s(ElMatrix s A, ElInt n, float mean, float stddev)

ElError ElWigner d(ElMatrix d A, ElInt n, double mean, double stddev)

ElError ElWigner c(ElMatrix c A, ElInt n, complex float mean, float stddev)

ElError ElWigner z(ElMatrix z A, ElInt n, complex double mean, double stddev)

ElError ElWignerDist s(ElDistMatrix s A, ElInt n, float mean, float stddev)

ElError ElWignerDist d(ElDistMatrix d A, ElInt n, double mean, double stddev)

ElError ElWignerDist c(ElDistMatrix c A, ElInt n, complex float mean, float stddev)

ElError ElWignerDist z(ElDistMatrix z A, ElInt n, complex double mean, double stddev)

Python API

Wigner(A, n, mean=0, stddev=1)

518 Chapter 8. Special matrices

Page 523: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

NINE

INPUT/OUTPUT

9.1 Display

If Qt5 was detected during Elemental’s configuration process, the following routines drawdata structures on screen; otherwise, they print entries to the standard output stream (i.e.,std::cout).

9.1.1 Dense matrices

C++ API

void Display(const Matrix<T> &A, std::string title = “Matrix”)

void Display(const AbstractDistMatrix<T> &A, std::string title = “DistMatrix”)

C API

ElError ElDisplay i(ElConstMatrix i A, const char* title)

ElError ElDisplay s(ElConstMatrix s A, const char* title)

ElError ElDisplay d(ElConstMatrix d A, const char* title)

ElError ElDisplay c(ElConstMatrix c A, const char* title)

ElError ElDisplay z(ElConstMatrix z A, const char* title)

ElError ElDisplayDist i(ElConstDistMatrix i A, const char* title)

ElError ElDisplayDist s(ElConstDistMatrix s A, const char* title)

ElError ElDisplayDist d(ElConstDistMatrix d A, const char* title)

ElError ElDisplayDist c(ElConstDistMatrix c A, const char* title)

ElError ElDisplayDist z(ElConstDistMatrix z A, const char* title)

9.1.2 Graphs and sparse matrices

C++ API

void Display(const Graph &graph, std::string title = “Graph”)

519

Page 524: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

void Display(const DistGraph &graph, std::string title = “DistGraph”)

void Display(const SparseMatrix<T> &A, std::string title = “SparseMatrix”)

void Display(const DistSparseMatrix<T> &A, std::string title = “DistSparseMatrix”)

C API

TODO

9.1.3 Sparse-direct data structures

C++ API

void DisplayLocal(const DistSymmInfo &info, bool beforeFact, std::string title = “”)

C API

TODO

9.2 Print

The following routines print a given matrix or graph to a given output stream (which defaultsto std::cout).

9.2.1 Dense matrices

C++ API

void Print(const Matrix<T> &A, std::string title = “Matrix”, std::ostream &os =std::cout)

void Print(const AbstractDistMatrix<T> &A, std::string title = “DistMatrix”,std::ostream &os = std::cout)

C API

ElError ElPrint i(ElConstMatrix i A, const char* title)

ElError ElPrint s(ElConstMatrix s A, const char* title)

ElError ElPrint d(ElConstMatrix d A, const char* title)

ElError ElPrint c(ElConstMatrix c A, const char* title)

ElError ElPrint z(ElConstMatrix z A, const char* title)

ElError ElPrintDist i(ElConstDistMatrix i A, const char* title)

ElError ElPrintDist s(ElConstDistMatrix s A, const char* title)

ElError ElPrintDist d(ElConstDistMatrix d A, const char* title)

520 Chapter 9. Input/output

Page 525: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElError ElPrintDist c(ElConstDistMatrix c A, const char* title)

ElError ElPrintDist z(ElConstDistMatrix z A, const char* title)

9.2.2 Graphs and sparse matrices

C++ API

void Print(const Graph &graph, std::string title = “Graph”, std::ostream &os = std::cout)

void Print(const DistGraph &graph, std::string title = “DistGraph”, std::ostream &os =std::cout)

void Print(const SparseMatrix<T> &A, std::string title = “SparseMatrix”, std::ostream&os = std::cout)

void Print(const DistSparseMatrix<T> &A, std::string title = “DistSparseMatrix”,std::ostream &os = std::cout)

C API

TODO

9.2.3 Sparse-direct data structures

C++ API

void PrintLocal(const DistSymmInfo &info, std::string title = “Local DistSymmInfo”,std::ostream &os = std::cout)

C API

TODO

9.2.4 Utilities

C++ API

void Print(const std::vector<T> &x, std::string title = “std::vector”, std::ostream &os =std::cout)

9.3 Spy

If Qt5 was detected during configuration, then the following routines display a sply plot of theelements of a matrix with absolute values greater than or equal to a given tolerance, tol.

9.3. Spy 521

Page 526: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

9.3.1 Dense matrices

C++ API

void Spy(const Matrix<T> &A, std::string title = “Matrix”, Base<T> tol = 0)

void Spy(const AbstractDistMatrix<T> &A, std::string title = “DistMatrix”, Base<T> tol= 0)

C API

ElError ElSpy i(ElConstMatrix i A, const char* title, ElInt tol)

ElError ElSpy s(ElConstMatrix s A, const char* title, float tol)

ElError ElSpy d(ElConstMatrix d A, const char* title, double tol)

ElError ElSpy c(ElConstMatrix c A, const char* title, float tol)

ElError ElSpy z(ElConstMatrix z A, const char* title, double tol)

ElError ElSpyDist i(ElConstDistMatrix i A, const char* title, ElInt tol)

ElError ElSpyDist s(ElConstDistMatrix s A, const char* title, float tol)

ElError ElSpyDist d(ElConstDistMatrix d A, const char* title, double tol)

ElError ElSpyDist c(ElConstDistMatrix c A, const char* title, float tol)

ElError ElSpyDist z(ElConstDistMatrix z A, const char* title, double tol)

9.4 Read

9.4.1 File formats

Note: In the case that a BINARY FLAT file is read, the formed matrix should have already beenof the correct size before reading.

C++ API

enum FileFormat

enumerator AUTOAttempt to detect format from filename extension

enumerator ASCIISimple ASCII text file

enumerator ASCII MATLAB

MATLAB-ready ASCII text file

enumerator BINARYColumn-major binary file with integer height and width header

522 Chapter 9. Input/output

Page 527: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

enumerator BINARY FLAT

Column-major binary file with no header data

enumerator BMPBitmap image format (requires Qt5)

enumerator MATRIX MARKET

Matrix Market format

enumerator JPGJPG image format (requires Qt5)

enumerator JPEGJPEG image format (requires Qt5)

enumerator PNGPNG image format (requires Qt5)

enumerator PPMPPM image format (requires Qt5)

enumerator XBMXBM image format (requires Qt5)

enumerator XPMXPM image format (requires Qt5)

C API

ElFileFormat

An enum that can take on the following values:

•EL AUTO: attempt to detect format from filename extension

•EL ASCII: simple ASCII text file

•EL ASCII ASCII: MATLAB-ready ASCII text file

•EL BINARY: column-major binary file with integer height and width header

•EL BINARY FLAT: column-major binary file with no header data

•EL BMP: bitmap image format (requires Qt5)

•EL MATRIX MARKET: Matrix Market format

•EL JPG: JPG image format (requires Qt5)

•EL JPEG: JPEG image format (requires Qt5)

•EL PNG: PNG image format (requires Qt5)

•EL PPM: PPM image format (requires Qt5)

•EL XBM: XBM image format (requires Qt5)

•EL XPM: XPM image format (requires Qt5)

9.4. Read 523

Page 528: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

9.4.2 Dense matrices

Elemental supports reading matrices from several different file formats (at the moment, ASCII,BINARY, BINARY FLAT and MATRIX MARKET). In the distributed case, the sequential flag deter-mines whether or not the data should be read from file by a single process and then afterwardscattered to the entire set of processes.

C++ API

void Read(Matrix<T> &A, std::string filename, FileFormat format = AUTO)

void Read(AbstractDistMatrix<T> &A, std::string filename, FileFormat format = AUTO,bool sequential = false)

C API

ElError ElRead i(ElMatrix i A, const char* filename, ElFileFormat format)

ElError ElRead s(ElMatrix s A, const char* filename, ElFileFormat format)

ElError ElRead d(ElMatrix d A, const char* filename, ElFileFormat format)

ElError ElRead c(ElMatrix c A, const char* filename, ElFileFormat format)

ElError ElRead z(ElMatrix z A, const char* filename, ElFileFormat format)

ElError ElReadDist i(ElMatrix i A, const char* filename, ElFileFormat format)

ElError ElReadDist s(ElMatrix s A, const char* filename, ElFileFormat format)

ElError ElReadDist d(ElMatrix d A, const char* filename, ElFileFormat format)

ElError ElReadDist c(ElMatrix c A, const char* filename, ElFileFormat format)

ElError ElReadDist z(ElMatrix z A, const char* filename, ElFileFormat format)

9.5 Write

Elemental also supports writing matrices to disk in various file formats. However, please notethat Qt5 is currently required for writing to image formats.

9.5.1 Dense matrices

C++ API

void Write(const Matrix<T> &A, std::string basename = “Matrix”, FileFormat format =BINARY, std::string title = “”)

void Write(const AbstractDistMatrix<T> &A, std::string basename = “DistMatrix”, File-Format format = BINARY, std::string title = “”)

524 Chapter 9. Input/output

Page 529: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

C API

ElError ElWrite i(ElConstMatrix i A, const char* basename, ElFileFormat format, constchar* title)

ElError ElWrite s(ElConstMatrix s A, const char* basename, ElFileFormat format, constchar* title)

ElError ElWrite d(ElConstMatrix d A, const char* basename, ElFileFormat format, constchar* title)

ElError ElWrite c(ElConstMatrix c A, const char* basename, ElFileFormat format, constchar* title)

ElError ElWrite z(ElConstMatrix z A, const char* basename, ElFileFormat format, constchar* title)

ElError ElWriteDist i(ElConstDistMatrix i A, const char* basename, ElFileFormat format,const char* title)

ElError ElWriteDist s(ElConstDistMatrix s A, const char* basename, ElFileFormat format,const char* title)

ElError ElWriteDist d(ElConstDistMatrix d A, const char* basename, ElFileFormat for-mat, const char* title)

ElError ElWriteDist c(ElConstDistMatrix c A, const char* basename, ElFileFormat format,const char* title)

ElError ElWriteDist z(ElConstDistMatrix z A, const char* basename, ElFileFormat format,const char* title)

9.5. Write 525

Page 530: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

526 Chapter 9. Input/output

Page 531: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

CHAPTER

TEN

INDICES

• genindex

• search

527

Page 532: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

528 Chapter 10. Indices

Page 533: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

BIBLIOGRAPHY

[PEtAl2013] Jack Poulson, Bryan Marker, Robert A. van de Geijn, Jeff R. Hammond, andNichols A. Romero, Elemental: A new framework for distributed memory dense matrix com-putations, ACM Transactions on Mathematical Software, Vol. 39, Issue 2, Article No. 13,2013. DOI: http://dx.doi.org/10.1145/2427023.2427030

[LAPACK] 5. Anderson, Z. Bai, C. Bischof, S. Blackford, J. Demmel, J. Dongarra, J. Du Croz,A. Greenbaum, S. Hammarling, A. McKenney, and D. Sorensen, LAPACK Users’ Guide:Third Edition, Society for Industrial and Applied Mathematics, Philadelphia, PA, 1999.Last accessed from: http://www.netlib.org/lapack/lug/

[PLAPACK] Robert A. van de Geijn, Using PLAPACK, The MIT Press, Cambridge, MA, 1997.Currently available from: https://mitpress.mit.edu/books/using-plapack

[ScaLAPACK] L.S. Blackford, J. Choi, A. Cleary, E. D’Azevedo, J. Demmel, I. Dhillon, J. Don-garra, S. Hammarling, G. Henry, A. Petitet, K. Stanley, D. Walker, and C.R. Whaley, ScaLA-PACK Users’ Guide, Society for Industrial and Applied Mathematics, Philadelphia, PA,1997. Last accessed from: http://www.netlib.org/scalapack/slug/

[HWD2002] Greg Henry, David Watkins, and Jack Dongarra, A parallel imple-mentation of the nonsymmetric QR algorithm for distributed memory architectures,SIAM Journal on Scientific Computing, Vol. 24, No. 1, pp. 284–311, 2002. DOI:http://dx.doi.org/10.1137/S1064827597325165

[Fahey2003] Mark R. Fahey, Algorithm 826: A parallel eigenvalue routine for complex Hessenbergmatrices, ACM Transactions on Mathematical Software, Vol. 29, Issue 3, pp. 326–336, 2003.DOI: http://dx.doi.org/10.1145/838250.838256

[GKK2010] Robert Granat, Bo Kagstrom, and Daniel Kressner, A novel parallel QR algorithm forhybrid distributed memory HPC systems, SIAM Journal on Scientific Computing, Vol. 32, No.4, pp. 2345–2378, 2010. DOI: http://dx.doi.org/10.1137/090756934

[vZvdGQ2014] Field G. van Zee, Robert A. van de Geijn, and Gregorio Quintana-Orti,Restructuring the tridiagonal and bidiagonal QR algorithms for performance, ACM Trans-actions on Mathematical Software, Vol. 40, Issue 3, Article No. 18, 2014. DOI:http://dx.doi.org/10.1145/2535371

[ELPA2011] 20. Auckenthaler, V. Blum, H.-J. Bungartz, T. Huckle, R. Johanni, L. Kramer, B.Lang, H. Lederer, and P.R. Willems, Parallel solution of partial symmetric eigenvalue prob-lems from electronic structure calculations, Parallel Computing, Vol. 37, Issue 12, pp.783–794, 2011. DOI: http://dx.doi.org/10.1016/j.parco.2011.05.002

529

Page 534: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

[HJS1999] Bruce Hendrickson, Elizabeth Jessup, and Christopher Smith, Towards an efficientparallel eigensolver for dense symmetric matrices, SIAM Journal on Scientific Computing, Vol.20, No. 3, pp. 1132–1154, 1999. DOI: http://dx.doi.org/10.1137/S1064827596300681

[Stanley1997] Kendall S. Stanley, Execution time of symmetric eigensolvers, EECS Depart-ment, UC Berkeley, Technical Report No. UCB/CSD-98-992, 1997. Accessed from:http://www.eecs.berkeley.edu/Pubs/TechRpts/1999/5365.html

[DSH1989] Jack J. Dongarra, Danny C. Sorensen, and Sven J. Hammarling, Block re-duction of matrices to condensed forms for eigenvalue computations, Journal of Com-putational and Applied Mathematics, Vol. 27, Issues 1–2, pp. 215–227, 1989.DOI: http://dx.doi.org/10.1016/0377-0427(89)90367-1 <http://dx.doi.org/10.1016/0377-0427(89)90367-1>‘

[QvdG2006] Gregorio Quintana-Orti and Robert van de Geijn, Improving the performance of re-duction to Hessenberg form, ACM Transactions on Mathematical Software, Vol. 32, Issue 2,pp. 180–194, 2006. DOI: http://dx.doi.org/10.1145/1141885.1141887

[DSH1989] Jack J. Dongarra, Danny C. Sorensen, and Sven J. Hammarling, Block re-duction of matrices to condensed forms for eigenvalue computations, Journal of Com-putational and Applied Mathematics, Vol. 27, Issues 1–2, pp. 215–227, 1989. DOI:http://dx.doi.org/10.1016/0377-0427(89)90367-1

[Vanderbei1995] Robert J. Vanderbei, Symmetric quasi-definite matrices, SIAM Journal on Opti-mization, Vol. 5, No. 1, pp. 100–113, 1995. DOI: http://dx.doi.org/10.1137/0805005

[GSS1996] Philip E. Gill, Michael A. Saunders, and Joseph R. Shinnerl, On thestability of Cholesky factorization for symmetric quasidefinite systems, SIAM Journalon Matrix Analysis and Applications, Vol. 17, No. 1, pp. 35–46, 1996. DOI:http://dx.doi.org/10.1137/S0895479893252623

[MRRR] Inderjit Dhillon, A new O(nˆ2) algorithm for the symmetric tridiagonal eigen-value/eigenvector problem, Computer Science Technical Report No. UCB//CSD-97-971, UCBerkeley, May 1997.

[BDP1996] Christian H. Bischof, Biswa Nath Datta, and Avijit Purkayastha, A parallel algorithmfor the Sylvester Observer Equation, SIAM Journal on Scientific Computing, Vol. 17, No. 3, pp.686–698, 1996. DOI: http://dx.doi.org/10.1137/S1064827591223276

[Hager1984] William W. Hager, Condition estimates, SIAM Journal on Scientific and StatisticalComputing, Vol. 5, No. 2, pp. 311–316, 1984. DOI: http://dx.doi.org/10.1137/0905023

[Henry1994] Greg Henry, The shifted Hessenberg system solve computation, Tech-nical Report, Cornell University, Ithica, NY, 1994. Last accessed from:http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.33.7403

[Higham1988] Nicholas J. Higham, FORTRAN codes for estimating the one-norm of areal or complex matrix, with applications to condition estimation (Algorithm 674), ACMTransactions on Mathematical Software, Vol. 14, Issue 4, pp. 381–396, 1988. DOI:http://dx.doi.org/10.1145/50063.214386

[Higham1990] Nicholas J. Higham, Experience with a matrix norm estimator, SIAM Jour-nal on Scientific and Statistical Computing, Vol. 11, No. 4, pp. 804–809, 1990. DOI:http://dx.doi.org/10.1137/0911047

[HighamTisseur2006] Nicholas J. Higham and Francoise Tisseur, A block algorithm formatrix 1-norm estimation, with an application to 1-norm pseudospectra, SIAM Journal

530 Bibliography

Page 535: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

on Matrix Analysis and Applications, Vol. 21, No. 4, pp. 1185–1201, 2006. DOI:http://dx.doi.org/10.1137/S0895479899356080

[Lui1997] S.H. Lui, Computation of pseudospectra by continuation, SIAM Jour-nal on Scientific Computing, Vol. 18, No. 2, pp. 565–573, 1997. DOI:http://dx.doi.org/10.1137/S1064827594276035

[Trefethen1999] Lloyd N. Trefethen, Computation of pseudospectra, Acta Numerica, pp. 247–295,1999. Last accessed from: http://eprints.maths.ox.ac.uk/1294/1/NA-99-03.pdf

[TrefethenEmbree2009] Lloyd N. Trefethen and Mark Embree, Spectra and pseudospectra: Thebehavior of nonnormal matrices, Princeton University Press, Princeton, 2009. Official website:http://press.princeton.edu/titles/8113.html

[VanLoan1984] Charles Van Loan, How near is a stable matrix to an unstable ma-trix?, Technical Report, Cornell University, Ithica, NY. Last accessed from:http://hdl.handle.net/1813/6488

[BGvdG2008] Paolo Bientinesi, Brian Gunter, and Robert A. van de Geijn, *Families of algo-rithms related to the inversion of a Symmetric Positive Definite matrix*, ACM Transactionson Mathematical Software, Vol. 35, Issue 1, Article No. 3, 2008.

[Bjorck92] Ake Bjorck, Pivoting and stability in the augmented system method. In D.F. Griffiths andG.A. Watson (eds.), Proc. 14th Dundee Conf., Pitman Research Notes in Math., pp. 1–16,1992.

[Bjorck96] Ake Bjorck, Numerical methods for least squares problems, SIAM, Philadelphia, 1996.DOI

[Saunders96] Michael Saunders, Chapter 8, Cholesky-based Methods for Sparse Least Squares: TheBenefits of Regularization, in L. Adams and J.L. Nazareth (eds.), Linear and Nonlinear Conju-gate Gradient-Related Methods, SIAM, Philadelphia, pp. 92–100, 1996. Currently availablehere

[Vanderbei95] R.J. Vanderbei, Symmetric quasi-definite matrices, SIAM J. Optim., 5(1), pp. 100–113, 1995. Preprint available here

Bibliography 531

Page 536: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

532 Bibliography

Page 537: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

INDEX

AAbs (C++ function), 48AbstractDistMatrix<Base<F>> (C++ class),

68AbstractDistMatrix<Complex<Base<F>>>

(C++ class), 68AbstractDistMatrix<F> (C++ class), 67AbstractDistMatrix<Int> (C++ class), 68AbstractDistMatrix<Real> (C++ class), 68AbstractDistMatrix<scalarType> (C++ class),

61AbstractDistMatrix<scalarType>::˜AbstractDistMatrix

(C++ function), 61AbstractDistMatrix<scalarType>::AbstractDistMatrix

(C++ function), 61AbstractDistMatrix<scalarType>::Align

(C++ function), 61AbstractDistMatrix<scalarType>::AlignAndResize

(C++ function), 62AbstractDistMatrix<scalarType>::AlignCols

(C++ function), 61AbstractDistMatrix<scalarType>::AlignColsAndResize

(C++ function), 62AbstractDistMatrix<scalarType>::AlignColsWith

(C++ function), 62AbstractDistMatrix<scalarType>::AlignRows

(C++ function), 62AbstractDistMatrix<scalarType>::AlignRowsAndResize

(C++ function), 62AbstractDistMatrix<scalarType>::AlignRowsWith

(C++ function), 62AbstractDistMatrix<scalarType>::AlignWith

(C++ function), 62AbstractDistMatrix<scalarType>::AllocatedMemory

(C++ function), 63AbstractDistMatrix<scalarType>::AssertNotLocked

(C++ function), 67AbstractDistMatrix<scalarType>::AssertNotStoringData

(C++ function), 67AbstractDistMatrix<scalarType>::AssertSameGrid

(C++ function), 67

AbstractDistMatrix<scalarType>::AssertSameSize(C++ function), 67

AbstractDistMatrix<scalarType>::AssertValidEntry(C++ function), 67

AbstractDistMatrix<scalarType>::AssertValidSubmatrix(C++ function), 67

AbstractDistMatrix<scalarType>::Attach(C++ function), 62

AbstractDistMatrix<scalarType>::BlockHeight(C++ function), 63

AbstractDistMatrix<scalarType>::BlockWidth(C++ function), 63

AbstractDistMatrix<scalarType>::Buffer(C++ function), 63

AbstractDistMatrix<scalarType>::ColAlign(C++ function), 64

AbstractDistMatrix<scalarType>::ColComm(C++ function), 64

AbstractDistMatrix<scalarType>::ColConstrained(C++ function), 63

AbstractDistMatrix<scalarType>::ColCut(C++ function), 63

AbstractDistMatrix<scalarType>::ColOwner(C++ function), 65

AbstractDistMatrix<scalarType>::ColRank(C++ function), 64

AbstractDistMatrix<scalarType>::ColShift(C++ function), 64

AbstractDistMatrix<scalarType>::ColStride(C++ function), 65

AbstractDistMatrix<scalarType>::ComplainIfReal(C++ function), 67

AbstractDistMatrix<scalarType>::Conjugate(C++ function), 66

AbstractDistMatrix<scalarType>::ConjugateLocal(C++ function), 67

AbstractDistMatrix<scalarType>::CrossComm(C++ function), 64

AbstractDistMatrix<scalarType>::CrossRank(C++ function), 65

533

Page 538: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

AbstractDistMatrix<scalarType>::CrossSize(C++ function), 65

AbstractDistMatrix<scalarType>::DiagonalLength(C++ function), 62

AbstractDistMatrix<scalarType>::DistComm(C++ function), 64

AbstractDistMatrix<scalarType>::DistRank(C++ function), 65

AbstractDistMatrix<scalarType>::DistSize(C++ function), 65

AbstractDistMatrix<scalarType>::Empty(C++ function), 61

AbstractDistMatrix<scalarType>::EmptyData(C++ function), 61

AbstractDistMatrix<scalarType>::FreeAlignments(C++ function), 62

AbstractDistMatrix<scalarType>::Get (C++function), 66

AbstractDistMatrix<scalarType>::GetImagPart(C++ function), 66

AbstractDistMatrix<scalarType>::GetLocal(C++ function), 67

AbstractDistMatrix<scalarType>::GetLocalImagPart(C++ function), 67

AbstractDistMatrix<scalarType>::GetRealPart(C++ function), 66

AbstractDistMatrix<scalarType>::GetRealPartLocal(C++ function), 67

AbstractDistMatrix<scalarType>::GlobalCol(C++ function), 65

AbstractDistMatrix<scalarType>::GlobalRow(C++ function), 65

AbstractDistMatrix<scalarType>::Grid (C++function), 63

AbstractDistMatrix<scalarType>::Height(C++ function), 62

AbstractDistMatrix<scalarType>::IsLocal(C++ function), 66

AbstractDistMatrix<scalarType>::IsLocalCol(C++ function), 66

AbstractDistMatrix<scalarType>::IsLocalRow(C++ function), 66

AbstractDistMatrix<scalarType>::LDim(C++ function), 63

AbstractDistMatrix<scalarType>::LocalCol(C++ function), 65

AbstractDistMatrix<scalarType>::LocalColOffset(C++ function), 66

AbstractDistMatrix<scalarType>::LocalHeight(C++ function), 63

AbstractDistMatrix<scalarType>::LocalRow(C++ function), 65

AbstractDistMatrix<scalarType>::LocalRowOffset(C++ function), 66

AbstractDistMatrix<scalarType>::LocalWidth(C++ function), 63

AbstractDistMatrix<scalarType>::Locked(C++ function), 63

AbstractDistMatrix<scalarType>::LockedAttach(C++ function), 62

AbstractDistMatrix<scalarType>::LockedBuffer(C++ function), 63

AbstractDistMatrix<scalarType>::LockedMatrix(C++ function), 63

AbstractDistMatrix<scalarType>::MakeConsistent(C++ function), 61

AbstractDistMatrix<scalarType>::MakeLocalReal(C++ function), 67

AbstractDistMatrix<scalarType>::MakeReal(C++ function), 66

AbstractDistMatrix<scalarType>::Matrix(C++ function), 63

AbstractDistMatrix<scalarType>::operator*=(C++ function), 61

AbstractDistMatrix<scalarType>::operator=(C++ function), 61

AbstractDistMatrix<scalarType>::Owner(C++ function), 65

AbstractDistMatrix<scalarType>::PartialColComm(C++ function), 64

AbstractDistMatrix<scalarType>::PartialColRank(C++ function), 64

AbstractDistMatrix<scalarType>::PartialColStride(C++ function), 65

AbstractDistMatrix<scalarType>::PartialRowComm(C++ function), 64

AbstractDistMatrix<scalarType>::PartialRowRank(C++ function), 64

AbstractDistMatrix<scalarType>::PartialRowStride(C++ function), 65

AbstractDistMatrix<scalarType>::PartialUnionColComm(C++ function), 64

AbstractDistMatrix<scalarType>::PartialUnionColRank(C++ function), 64

AbstractDistMatrix<scalarType>::PartialUnionColStride(C++ function), 65

AbstractDistMatrix<scalarType>::PartialUnionRowComm(C++ function), 64

AbstractDistMatrix<scalarType>::PartialUnionRowRank(C++ function), 65

534 Index

Page 539: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

AbstractDistMatrix<scalarType>::PartialUnionRowStride(C++ function), 65

AbstractDistMatrix<scalarType>::Participating(C++ function), 65

AbstractDistMatrix<scalarType>::ProcessPullQueue(C++ function), 67

AbstractDistMatrix<scalarType>::ProcessQueues(C++ function), 67

AbstractDistMatrix<scalarType>::QueuePull(C++ function), 67

AbstractDistMatrix<scalarType>::QueueUpdate(C++ function), 66

AbstractDistMatrix<scalarType>::RedundantComm(C++ function), 64

AbstractDistMatrix<scalarType>::RedundantRank(C++ function), 65

AbstractDistMatrix<scalarType>::RedundantSize(C++ function), 65

AbstractDistMatrix<scalarType>::Reserve(C++ function), 66

AbstractDistMatrix<scalarType>::ReservePulls(C++ function), 67

AbstractDistMatrix<scalarType>::Resize(C++ function), 61

AbstractDistMatrix<scalarType>::Root (C++function), 65

AbstractDistMatrix<scalarType>::RootConstrained(C++ function), 64

AbstractDistMatrix<scalarType>::RowAlign(C++ function), 64

AbstractDistMatrix<scalarType>::RowComm(C++ function), 64

AbstractDistMatrix<scalarType>::RowConstrained(C++ function), 63

AbstractDistMatrix<scalarType>::RowCut(C++ function), 63

AbstractDistMatrix<scalarType>::RowOwner(C++ function), 65

AbstractDistMatrix<scalarType>::RowRank(C++ function), 64

AbstractDistMatrix<scalarType>::RowShift(C++ function), 64

AbstractDistMatrix<scalarType>::RowStride(C++ function), 65

AbstractDistMatrix<scalarType>::Set (C++function), 66

AbstractDistMatrix<scalarType>::SetGrid(C++ function), 61

AbstractDistMatrix<scalarType>::SetImagPart(C++ function), 66

AbstractDistMatrix<scalarType>::SetLocal(C++ function), 67

AbstractDistMatrix<scalarType>::SetLocalImagPart(C++ function), 67

AbstractDistMatrix<scalarType>::SetLocalRealPart(C++ function), 67

AbstractDistMatrix<scalarType>::SetRealPart(C++ function), 66

AbstractDistMatrix<scalarType>::SetRoot(C++ function), 62

AbstractDistMatrix<scalarType>::Update(C++ function), 66

AbstractDistMatrix<scalarType>::UpdateImagPart(C++ function), 66

AbstractDistMatrix<scalarType>::UpdateLocal(C++ function), 67

AbstractDistMatrix<scalarType>::UpdateLocalImagPart(C++ function), 67

AbstractDistMatrix<scalarType>::UpdateLocalRealPart(C++ function), 67

AbstractDistMatrix<scalarType>::UpdateRealPart(C++ function), 66

AbstractDistMatrix<scalarType>::Viewing(C++ function), 62

AbstractDistMatrix<scalarType>::Width(C++ function), 62

AbstractDistMatrix<scalarType>::Wrap (C++function), 63

Acos (C++ function), 49Acosh (C++ function), 50adaptive (C++ member), 278Adjoint (C++ function), 161Adjoint() (built-in function), 162AdjointAxpy (C++ function), 162AdjointAxpy() (built-in function), 163AdjointAxpyContract (C++ function), 163AdjointContract (C++ function), 162align (C++ member), 393AllReduce (C++ function), 164alwaysRecomputeNorms (C++ member), 279ApplyColPivots (C++ function), 393ApplyInverseColPivots (C++ function), 394ApplyInverseRowPivots (C++ function), 394ApplyInverseSymmetricPivots (C++ func-

tion), 394ApplyPackedReflectors (C++ function), 396ApplyQAfterBidiag() (built-in function), 253ApplyQAfterHermitianTridiag() (built-in

function), 246ApplyQAfterHessenberg() (built-in function),

249

Index 535

Page 540: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ApplyRowPivots (C++ function), 394ApplySymmetricPivots (C++ function), 394approach (C++ member), 245Arg (C++ function), 47Asin (C++ function), 49Asinh (C++ function), 50Atan (C++ function), 49Atan2 (C++ function), 49Atanh (C++ function), 51Axpy (C++ function), 164Axpy() (built-in function), 165AxpyTrapezoid (C++ function), 165, 166AxpyTrapezoid() (built-in function), 167

BBase<F> (C++ type), 42Bernoulli (C++ function), 510Bernoulli() (built-in function), 511Bidiag (C++ function), 251Bidiag() (built-in function), 251bidiag::ApplyP (C++ function), 253bidiag::ApplyQ (C++ function), 253bidiag::Explicit (C++ function), 251bidiag::ExplicitCondensed (C++ function),

251blacs::Desc (C++ type), 32blacs::Exit (C++ function), 32blacs::FreeGrid (C++ function), 32blacs::FreeHandle (C++ function), 32blacs::GridCol (C++ function), 32blacs::GridHeight (C++ function), 32blacs::GridInit (C++ function), 32blacs::GridRow (C++ function), 32blacs::GridWidth (C++ function), 32blacs::Handle (C++ function), 32blas::Axpy (C++ function), 17blas::Dot (C++ function), 17blas::Dotc (C++ function), 17blas::Dotu (C++ function), 17blas::Gemm (C++ function), 19blas::Gemv (C++ function), 18blas::Ger (C++ function), 18blas::Gerc (C++ function), 18blas::Geru (C++ function), 18blas::Hemm (C++ function), 19blas::Hemv (C++ function), 18blas::Her (C++ function), 18blas::Her2 (C++ function), 18blas::Her2k (C++ function), 19blas::Herk (C++ function), 19blas::Hetrmm (C++ function), 20

blas::Nrm2 (C++ function), 17blas::Rot (C++ function), 18blas::Scal (C++ function), 18blas::Swap (C++ function), 18blas::Symm (C++ function), 20blas::Symv (C++ function), 18blas::Syr (C++ function), 19blas::Syr2 (C++ function), 19blas::Syr2k (C++ function), 20blas::Syrk (C++ function), 20blas::Trmm (C++ function), 20blas::Trmv (C++ function), 19blas::Trsm (C++ function), 20blas::Trsv (C++ function), 19blockHeight (C++ member), 316BlockMatrix<scalarType> (C++ class), 81Blocksize (C++ function), 38blockWidth (C++ member), 316boundRank (C++ member), 278BP (C++ function), 415, 416BP() (built-in function), 415BPDN (C++ function), 418BPDN() (built-in function), 418Broadcast (C++ function), 167BullsHead (C++ function), 471BullsHead() (built-in function), 471BUNCH KAUFMAN A (built-in variable),

260BUNCH KAUFMAN BOUNDED (built-in

variable), 260BUNCH KAUFMAN C (built-in variable),

260BUNCH KAUFMAN D (built-in variable),

260BUNCH PARLETT (built-in variable), 260byte (C++ type), 38

CCauchy (C++ function), 472Cauchy() (built-in function), 472CauchyLike (C++ function), 473CauchyLike() (built-in function), 473Cholesky (C++ function), 255Cholesky() (built-in function), 255cholesky::SolveAfter (C++ function), 257CholeskyMod (C++ function), 258CholeskyMod() (built-in function), 258Circulant (C++ function), 474Circulant() (built-in function), 474Clip (C++ function), 439Coherence (C++ function), 461

536 Index

Page 541: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Coherence() (built-in function), 462colPiv (C++ member), 278, 315ColSwap (C++ function), 204comm (C++ member), 393complex double (C type), 42complex float (C type), 42Complex<Real> (C++ type), 42Condition (C++ function), 343Condition() (built-in function), 344cone::AllReduce (C++ function), 444cone::Broadcast (C++ function), 444cone::GeomEquil (C++ function), 445cone::RuizEquil (C++ function), 446Conj (C++ function), 47Conjugate (C++ function), 167Conjugate() (built-in function), 168ConjugateDiagonal (C++ function), 168ConjugateSubmatrix (C++ function), 168Conjugation (C++ enum), 38Conjugation::CONJUGATED (C++ enumera-

tor), 38Conjugation::UNCONJUGATED (C++ enu-

merator), 38Copy (C++ function), 169Copy() (built-in function), 171CopyFromNonRoot (C++ function), 169CopyFromNonRoot() (built-in function), 172CopyFromRoot (C++ function), 169CopyFromRoot() (built-in function), 171Cos (C++ function), 49Cosh (C++ function), 50Covariance (C++ function), 462CP (C++ function), 420CP() (built-in function), 420cutoff (C++ member), 301, 317

Dd0 (C++ member), 279dcomplex (C++ type), 42DefaultBlockHeight (C++ function), 38DefaultBlockWidth (C++ function), 38DefaultGrid (C++ function), 37Demmel (C++ function), 474Demmel() (built-in function), 475Determinant (C++ function), 344Diagonal (C++ function), 475Diagonal() (built-in function), 475DiagonalScale (C++ function), 172DiagonalScale() (built-in function), 173DiagonalScaleTrapezoid (C++ function), 173

DiagonalScaleTrapezoid() (built-in function),175

DiagonalSolve (C++ function), 175DiagonalSolve() (built-in function), 176Display (C++ function), 519, 520DisplayLocal (C++ function), 520Dist (C++ enum), 38Dist::CIRC (C++ enumerator), 39Dist::MC (C++ enumerator), 38Dist::MD (C++ enumerator), 39Dist::MR (C++ enumerator), 39Dist::STAR (C++ enumerator), 39Dist::VC (C++ enumerator), 39Dist::VR (C++ enumerator), 39distAED (C++ member), 316DistData (C++ class), 68DistData::colAlign (C++ member), 68DistData::colDist (C++ member), 68DistData::DistData (C++ function), 68DistData::grid (C++ member), 68DistData::root (C++ member), 68DistData::rowAlign (C++ member), 68DistData::rowDist (C++ member), 68DistGraph (C++ class), 95DistGraph::˜DistGraph (C++ function), 95DistGraph::Blocksize (C++ function), 96DistGraph::Capacity (C++ function), 96DistGraph::Comm (C++ function), 96DistGraph::Connect (C++ function), 96DistGraph::ConnectLocal (C++ function), 96DistGraph::Disconnect (C++ function), 96DistGraph::DisconnectLocal (C++ function),

96DistGraph::DistGraph (C++ function), 95DistGraph::EdgeOffset (C++ function), 96DistGraph::Empty (C++ function), 95DistGraph::FirstLocalSource (C++ function),

96DistGraph::GlobalSource (C++ function), 96DistGraph::LocallyConsistent (C++ function),

96DistGraph::LockedSourceBuffer (C++ func-

tion), 96DistGraph::LockedTargetBuffer (C++ func-

tion), 97DistGraph::NumConnections (C++ function),

96DistGraph::NumLocalEdges (C++ function),

96DistGraph::NumLocalSources (C++ function),

96

Index 537

Page 542: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistGraph::NumSources (C++ function), 96DistGraph::NumTargets (C++ function), 96DistGraph::operator() (C++ function), 95DistGraph::operator= (C++ function), 95DistGraph::ProcessLocalQueues (C++ func-

tion), 96DistGraph::ProcessQueues (C++ function), 96DistGraph::QueueConnection (C++ function),

96DistGraph::QueueDisconnection (C++ func-

tion), 96DistGraph::QueueLocalConnection (C++

function), 96DistGraph::QueueLocalDisconnection (C++

function), 96DistGraph::Reserve (C++ function), 96DistGraph::Resize (C++ function), 96DistGraph::SetComm (C++ function), 96DistGraph::Source (C++ function), 96DistGraph::SourceBuffer (C++ function), 96DistGraph::SourceOwner (C++ function), 96DistGraph::Target (C++ function), 96DistGraph::TargetBuffer (C++ function), 96DistMatrix<Complex<Real>, CIRC, CIRC,

BLOCK> (C++ class), 88DistMatrix<Complex<Real>, CIRC, CIRC,

ELEMENT> (C++ class), 78DistMatrix<Complex<Real>, CIRC, CIRC>

(C++ class), 78DistMatrix<Complex<Real>, colDist, row-

Dist, BLOCK> (C++ class), 88DistMatrix<Complex<Real>, colDist, row-

Dist, ELEMENT> (C++ class), 78DistMatrix<Complex<Real>, colDist, row-

Dist> (C++ class), 78DistMatrix<Complex<Real>, ELEMENT>

(C++ class), 78DistMatrix<Complex<Real>, MC, MR,

BLOCK> (C++ class), 88DistMatrix<Complex<Real>, MC, MR, ELE-

MENT> (C++ class), 78DistMatrix<Complex<Real>, MC, MR>

(C++ class), 78DistMatrix<Complex<Real>, MC, STAR,

BLOCK> (C++ class), 88DistMatrix<Complex<Real>, MC, STAR, EL-

EMENT> (C++ class), 78DistMatrix<Complex<Real>, MC, STAR>

(C++ class), 78DistMatrix<Complex<Real>, MD, STAR,

BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, MD, STAR, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, MD, STAR>(C++ class), 78

DistMatrix<Complex<Real>, MR, MC,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, MR, MC, ELE-MENT> (C++ class), 78

DistMatrix<Complex<Real>, MR, MC>(C++ class), 78

DistMatrix<Complex<Real>, MR, STAR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, MR, STAR, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, MR, STAR>(C++ class), 78

DistMatrix<Complex<Real>, STAR, MC,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, MC, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, STAR, MC>(C++ class), 78

DistMatrix<Complex<Real>, STAR, MD,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, MD, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, STAR, MD>(C++ class), 78

DistMatrix<Complex<Real>, STAR, MR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, MR, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, STAR, MR>(C++ class), 78

DistMatrix<Complex<Real>, STAR, STAR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, STAR,ELEMENT> (C++ class), 78

DistMatrix<Complex<Real>, STAR, STAR>(C++ class), 78

DistMatrix<Complex<Real>, STAR, VC,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, VC, EL-EMENT> (C++ class), 78

DistMatrix<Complex<Real>, STAR, VC>(C++ class), 78

DistMatrix<Complex<Real>, STAR, VR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, STAR, VR, EL-EMENT> (C++ class), 78

538 Index

Page 543: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<Complex<Real>, STAR, VR>(C++ class), 78

DistMatrix<Complex<Real>, VC, STAR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, VC, STAR, EL-EMENT> (C++ class), 79

DistMatrix<Complex<Real>, VC, STAR>(C++ class), 78

DistMatrix<Complex<Real>, VR, STAR,BLOCK> (C++ class), 88

DistMatrix<Complex<Real>, VR, STAR, EL-EMENT> (C++ class), 79

DistMatrix<Complex<Real>, VR, STAR>(C++ class), 78

DistMatrix<Complex<Real>> (C++ class),78

DistMatrix<F, CIRC, CIRC, BLOCK> (C++class), 89

DistMatrix<F, CIRC, CIRC, ELEMENT>(C++ class), 79

DistMatrix<F, CIRC, CIRC> (C++ class), 79DistMatrix<F, colDist, rowDist, BLOCK>

(C++ class), 89DistMatrix<F, colDist, rowDist, ELEMENT>

(C++ class), 79DistMatrix<F, colDist, rowDist> (C++ class),

79DistMatrix<F, ELEMENT> (C++ class), 79DistMatrix<F, MC, MR, BLOCK> (C++ class),

89DistMatrix<F, MC, MR, ELEMENT> (C++

class), 79DistMatrix<F, MC, MR> (C++ class), 79DistMatrix<F, MC, STAR, BLOCK> (C++

class), 89DistMatrix<F, MC, STAR, ELEMENT> (C++

class), 79DistMatrix<F, MC, STAR> (C++ class), 79DistMatrix<F, MD, STAR, BLOCK> (C++

class), 89DistMatrix<F, MD, STAR, ELEMENT> (C++

class), 79DistMatrix<F, MD, STAR> (C++ class), 79DistMatrix<F, MR, MC, BLOCK> (C++ class),

89DistMatrix<F, MR, MC, ELEMENT> (C++

class), 79DistMatrix<F, MR, MC> (C++ class), 79DistMatrix<F, MR, STAR, BLOCK> (C++

class), 89

DistMatrix<F, MR, STAR, ELEMENT> (C++class), 79

DistMatrix<F, MR, STAR> (C++ class), 79DistMatrix<F, STAR, MC, BLOCK> (C++

class), 89DistMatrix<F, STAR, MC, ELEMENT> (C++

class), 79DistMatrix<F, STAR, MC> (C++ class), 79DistMatrix<F, STAR, MD, BLOCK> (C++

class), 89DistMatrix<F, STAR, MD, ELEMENT> (C++

class), 79DistMatrix<F, STAR, MD> (C++ class), 79DistMatrix<F, STAR, MR, BLOCK> (C++

class), 89DistMatrix<F, STAR, MR, ELEMENT> (C++

class), 79DistMatrix<F, STAR, MR> (C++ class), 79DistMatrix<F, STAR, STAR, BLOCK> (C++

class), 89DistMatrix<F, STAR, STAR, ELEMENT>

(C++ class), 79DistMatrix<F, STAR, STAR> (C++ class), 79DistMatrix<F, STAR, VC, BLOCK> (C++

class), 89DistMatrix<F, STAR, VC, ELEMENT> (C++

class), 79DistMatrix<F, STAR, VC> (C++ class), 79DistMatrix<F, STAR, VR, BLOCK> (C++

class), 89DistMatrix<F, STAR, VR, ELEMENT> (C++

class), 79DistMatrix<F, STAR, VR> (C++ class), 79DistMatrix<F, VC, STAR, BLOCK> (C++

class), 89DistMatrix<F, VC, STAR, ELEMENT> (C++

class), 79DistMatrix<F, VC, STAR> (C++ class), 79DistMatrix<F, VR, STAR, BLOCK> (C++

class), 89DistMatrix<F, VR, STAR, ELEMENT> (C++

class), 79DistMatrix<F, VR, STAR> (C++ class), 79DistMatrix<F> (C++ class), 79DistMatrix<Int, CIRC, CIRC, BLOCK> (C++

class), 89DistMatrix<Int, CIRC, CIRC, ELEMENT>

(C++ class), 80DistMatrix<Int, CIRC, CIRC> (C++ class), 80DistMatrix<Int, colDist, rowDist, BLOCK>

(C++ class), 89

Index 539

Page 544: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<Int, colDist, rowDist, ELE-MENT> (C++ class), 80

DistMatrix<Int, colDist, rowDist> (C++class), 80

DistMatrix<Int, ELEMENT> (C++ class), 80DistMatrix<Int, MC, MR, BLOCK> (C++

class), 89DistMatrix<Int, MC, MR, ELEMENT> (C++

class), 80DistMatrix<Int, MC, MR> (C++ class), 80DistMatrix<Int, MC, STAR, BLOCK> (C++

class), 89DistMatrix<Int, MC, STAR, ELEMENT>

(C++ class), 80DistMatrix<Int, MC, STAR> (C++ class), 80DistMatrix<Int, MD, STAR, BLOCK> (C++

class), 89DistMatrix<Int, MD, STAR, ELEMENT>

(C++ class), 80DistMatrix<Int, MD, STAR> (C++ class), 80DistMatrix<Int, MR, MC, BLOCK> (C++

class), 89DistMatrix<Int, MR, MC, ELEMENT> (C++

class), 80DistMatrix<Int, MR, MC> (C++ class), 80DistMatrix<Int, MR, STAR, BLOCK> (C++

class), 89DistMatrix<Int, MR, STAR, ELEMENT>

(C++ class), 80DistMatrix<Int, MR, STAR> (C++ class), 80DistMatrix<Int, STAR, MC, BLOCK> (C++

class), 89DistMatrix<Int, STAR, MC, ELEMENT>

(C++ class), 80DistMatrix<Int, STAR, MC> (C++ class), 80DistMatrix<Int, STAR, MD, BLOCK> (C++

class), 89DistMatrix<Int, STAR, MD, ELEMENT>

(C++ class), 80DistMatrix<Int, STAR, MD> (C++ class), 80DistMatrix<Int, STAR, MR, BLOCK> (C++

class), 89DistMatrix<Int, STAR, MR, ELEMENT>

(C++ class), 80DistMatrix<Int, STAR, MR> (C++ class), 80DistMatrix<Int, STAR, STAR, BLOCK> (C++

class), 89DistMatrix<Int, STAR, STAR, ELEMENT>

(C++ class), 80DistMatrix<Int, STAR, STAR> (C++ class), 80

DistMatrix<Int, STAR, VC, BLOCK> (C++class), 89

DistMatrix<Int, STAR, VC, ELEMENT> (C++class), 80

DistMatrix<Int, STAR, VC> (C++ class), 80DistMatrix<Int, STAR, VR, BLOCK> (C++

class), 89DistMatrix<Int, STAR, VR, ELEMENT> (C++

class), 80DistMatrix<Int, STAR, VR> (C++ class), 80DistMatrix<Int, VC, STAR, BLOCK> (C++

class), 89DistMatrix<Int, VC, STAR, ELEMENT> (C++

class), 80DistMatrix<Int, VC, STAR> (C++ class), 80DistMatrix<Int, VR, STAR, BLOCK> (C++

class), 89DistMatrix<Int, VR, STAR, ELEMENT> (C++

class), 80DistMatrix<Int, VR, STAR> (C++ class), 80DistMatrix<Int> (C++ class), 80DistMatrix<Real, CIRC, CIRC, BLOCK>

(C++ class), 88DistMatrix<Real, CIRC, CIRC, ELEMENT>

(C++ class), 77DistMatrix<Real, CIRC, CIRC> (C++ class),

77DistMatrix<Real, colDist, rowDist, BLOCK>

(C++ class), 88DistMatrix<Real, colDist, rowDist, ELE-

MENT> (C++ class), 77DistMatrix<Real, colDist, rowDist> (C++

class), 77DistMatrix<Real, ELEMENT> (C++ class), 77DistMatrix<Real, MC, MR, BLOCK> (C++

class), 88DistMatrix<Real, MC, MR, ELEMENT> (C++

class), 77DistMatrix<Real, MC, MR> (C++ class), 77DistMatrix<Real, MC, STAR, BLOCK> (C++

class), 88DistMatrix<Real, MC, STAR, ELEMENT>

(C++ class), 77DistMatrix<Real, MC, STAR> (C++ class), 77DistMatrix<Real, MD, STAR, BLOCK> (C++

class), 88DistMatrix<Real, MD, STAR, ELEMENT>

(C++ class), 77DistMatrix<Real, MD, STAR> (C++ class), 77DistMatrix<Real, MR, MC, BLOCK> (C++

class), 88

540 Index

Page 545: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<Real, MR, MC, ELEMENT> (C++class), 77

DistMatrix<Real, MR, MC> (C++ class), 77DistMatrix<Real, MR, STAR, BLOCK> (C++

class), 88DistMatrix<Real, MR, STAR, ELEMENT>

(C++ class), 77DistMatrix<Real, MR, STAR> (C++ class), 77DistMatrix<Real, STAR, MC, BLOCK> (C++

class), 88DistMatrix<Real, STAR, MC, ELEMENT>

(C++ class), 77DistMatrix<Real, STAR, MC> (C++ class), 77DistMatrix<Real, STAR, MD, BLOCK> (C++

class), 88DistMatrix<Real, STAR, MD, ELEMENT>

(C++ class), 77DistMatrix<Real, STAR, MD> (C++ class), 77DistMatrix<Real, STAR, MR, BLOCK> (C++

class), 88DistMatrix<Real, STAR, MR, ELEMENT>

(C++ class), 77DistMatrix<Real, STAR, MR> (C++ class), 77DistMatrix<Real, STAR, STAR, BLOCK>

(C++ class), 88DistMatrix<Real, STAR, STAR, ELEMENT>

(C++ class), 77DistMatrix<Real, STAR, STAR> (C++ class),

77DistMatrix<Real, STAR, VC, BLOCK> (C++

class), 88DistMatrix<Real, STAR, VC, ELEMENT>

(C++ class), 77DistMatrix<Real, STAR, VC> (C++ class), 77DistMatrix<Real, STAR, VR, BLOCK> (C++

class), 88DistMatrix<Real, STAR, VR, ELEMENT>

(C++ class), 78DistMatrix<Real, STAR, VR> (C++ class), 77DistMatrix<Real, VC, STAR, BLOCK> (C++

class), 88DistMatrix<Real, VC, STAR, ELEMENT>

(C++ class), 78DistMatrix<Real, VC, STAR> (C++ class), 77DistMatrix<Real, VR, STAR, BLOCK> (C++

class), 88DistMatrix<Real, VR, STAR, ELEMENT>

(C++ class), 78DistMatrix<Real, VR, STAR> (C++ class), 77DistMatrix<Real> (C++ class), 77

DistMatrix<scalarType, CIRC, CIRC,BLOCK> (C++ class), 87

DistMatrix<scalarType, CIRC, CIRC, ELE-MENT> (C++ class), 77

DistMatrix<scalarType, CIRC, CIRC> (C++class), 76

DistMatrix<scalarType, colDist, rowDist,BLOCK> (C++ class), 81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::˜DistMatrix (C++ func-tion), 81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::DistData (C++ function),81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::DistMatrix (C++ function),81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::operator() (C++ function),82

DistMatrix<scalarType, colDist, rowDist,BLOCK>::operator*= (C++ function),81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::operator+= (C++ func-tion), 82

DistMatrix<scalarType, colDist, rowDist,BLOCK>::operator-= (C++ function),82

DistMatrix<scalarType, colDist, rowDist,BLOCK>::operator= (C++ function),81

DistMatrix<scalarType, colDist, rowDist,BLOCK>::Wrap (C++ function), 82

DistMatrix<scalarType, colDist, rowDist, EL-EMENT> (C++ class), 69

DistMatrix<scalarType, colDist, rowDist,ELEMENT>::˜DistMatrix (C++function), 70

DistMatrix<scalarType, colDist, rowDist, EL-EMENT>::DistData (C++ function),70

DistMatrix<scalarType, colDist, rowDist,ELEMENT>::DistMatrix (C++ func-tion), 70

DistMatrix<scalarType, colDist, rowDist, EL-EMENT>::operator() (C++ function),71

DistMatrix<scalarType, colDist, rowDist,ELEMENT>::operator*= (C++ func-tion), 70

Index 541

Page 546: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMatrix<scalarType, colDist, rowDist,ELEMENT>::operator+= (C++ func-tion), 70

DistMatrix<scalarType, colDist, rowDist,ELEMENT>::operator-= (C++ func-tion), 71

DistMatrix<scalarType, colDist, rowDist, EL-EMENT>::operator= (C++ function),70

DistMatrix<scalarType, MC, MR, BLOCK>(C++ class), 83

DistMatrix<scalarType, MC, MR, ELE-MENT> (C++ class), 72

DistMatrix<scalarType, MC, MR> (C++class), 72

DistMatrix<scalarType, MC, STAR, BLOCK>(C++ class), 83

DistMatrix<scalarType, MC, STAR, ELE-MENT> (C++ class), 72

DistMatrix<scalarType, MC, STAR> (C++class), 72

DistMatrix<scalarType, MD, STAR, BLOCK>(C++ class), 84

DistMatrix<scalarType, MD, STAR, ELE-MENT> (C++ class), 73

DistMatrix<scalarType, MD, STAR> (C++class), 72

DistMatrix<scalarType, MR, MC, BLOCK>(C++ class), 84

DistMatrix<scalarType, MR, MC, ELE-MENT> (C++ class), 73

DistMatrix<scalarType, MR, MC> (C++class), 73

DistMatrix<scalarType, MR, STAR, BLOCK>(C++ class), 84

DistMatrix<scalarType, MR, STAR, ELE-MENT> (C++ class), 73

DistMatrix<scalarType, MR, STAR> (C++class), 73

DistMatrix<scalarType, STAR, MC, BLOCK>(C++ class), 85

DistMatrix<scalarType, STAR, MC, ELE-MENT> (C++ class), 74

DistMatrix<scalarType, STAR, MC> (C++class), 74

DistMatrix<scalarType, STAR, MD, BLOCK>(C++ class), 85

DistMatrix<scalarType, STAR, MD, ELE-MENT> (C++ class), 74

DistMatrix<scalarType, STAR, MD> (C++class), 74

DistMatrix<scalarType, STAR, MR, BLOCK>(C++ class), 85

DistMatrix<scalarType, STAR, MR, ELE-MENT> (C++ class), 74

DistMatrix<scalarType, STAR, MR> (C++class), 74

DistMatrix<scalarType, STAR, STAR,BLOCK> (C++ class), 86

DistMatrix<scalarType, STAR, STAR, ELE-MENT> (C++ class), 75

DistMatrix<scalarType, STAR, STAR> (C++class), 75

DistMatrix<scalarType, STAR, VC, BLOCK>(C++ class), 86

DistMatrix<scalarType, STAR, VC, ELE-MENT> (C++ class), 75

DistMatrix<scalarType, STAR, VC> (C++class), 75

DistMatrix<scalarType, STAR, VR, BLOCK>(C++ class), 86

DistMatrix<scalarType, STAR, VR, ELE-MENT> (C++ class), 75

DistMatrix<scalarType, STAR, VR> (C++class), 75

DistMatrix<scalarType, VC, STAR, BLOCK>(C++ class), 87

DistMatrix<scalarType, VC, STAR, ELE-MENT> (C++ class), 76

DistMatrix<scalarType, VC, STAR> (C++class), 76

DistMatrix<scalarType, VR, STAR, BLOCK>(C++ class), 87

DistMatrix<scalarType, VR, STAR, ELE-MENT> (C++ class), 76

DistMatrix<scalarType, VR, STAR> (C++class), 76

DistMatrix<scalarType> (C++ class), 72DistMultiVec<Complex<Real>> (C++ class),

101DistMultiVec<F> (C++ class), 101DistMultiVec<Int> (C++ class), 101DistMultiVec<Real> (C++ class), 101DistMultiVec<T> (C++ class), 100DistMultiVec<T>::˜DistMultiVec (C++ func-

tion), 100DistMultiVec<T>::Blocksize (C++ function),

100DistMultiVec<T>::Comm (C++ function), 100DistMultiVec<T>::DistMultiVec (C++ func-

tion), 100DistMultiVec<T>::Empty (C++ function), 100

542 Index

Page 547: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistMultiVec<T>::FirstLocalRow (C++ func-tion), 100

DistMultiVec<T>::Get (C++ function), 101DistMultiVec<T>::GetLocal (C++ function),

101DistMultiVec<T>::GlobalRow (C++ func-

tion), 100DistMultiVec<T>::Height (C++ function), 100DistMultiVec<T>::LocalHeight (C++ func-

tion), 100DistMultiVec<T>::LockedMatrix (C++ func-

tion), 100DistMultiVec<T>::Matrix (C++ function), 100DistMultiVec<T>::operator() (C++ function),

100DistMultiVec<T>::operator= (C++ function),

100DistMultiVec<T>::Resize (C++ function), 100DistMultiVec<T>::RowOwner (C++ func-

tion), 100DistMultiVec<T>::Set (C++ function), 101DistMultiVec<T>::SetComm (C++ function),

100DistMultiVec<T>::SetLocal (C++ function),

101DistMultiVec<T>::Update (C++ function),

101DistMultiVec<T>::UpdateLocal (C++ func-

tion), 101DistMultiVec<T>::Width (C++ function), 100DistSparseMatrix<Complex<Real>> (C++

class), 99DistSparseMatrix<F> (C++ class), 99DistSparseMatrix<Int> (C++ class), 99DistSparseMatrix<Real> (C++ class), 99DistSparseMatrix<T> (C++ class), 97DistSparseMatrix<T>::˜DistSparseMatrix

(C++ function), 97DistSparseMatrix<T>::Capacity (C++ func-

tion), 98DistSparseMatrix<T>::Col (C++ function), 99DistSparseMatrix<T>::DistGraph (C++ func-

tion), 98DistSparseMatrix<T>::DistSparseMatrix

(C++ function), 97DistSparseMatrix<T>::Empty (C++ func-

tion), 98DistSparseMatrix<T>::EntryOffset (C++

function), 99DistSparseMatrix<T>::FirstLocalRow (C++

function), 98

DistSparseMatrix<T>::Height (C++ func-tion), 98

DistSparseMatrix<T>::LocalHeight (C++function), 98

DistSparseMatrix<T>::LocallyConsistent(C++ function), 98

DistSparseMatrix<T>::LockedDistGraph(C++ function), 98

DistSparseMatrix<T>::LockedSourceBuffer(C++ function), 99

DistSparseMatrix<T>::LockedTargetBuffer(C++ function), 99

DistSparseMatrix<T>::LockedValueBuffer(C++ function), 99

DistSparseMatrix<T>::multMeta (C++ mem-ber), 99

DistSparseMatrix<T>::NumConnections(C++ function), 99

DistSparseMatrix<T>::NumLocalEntries(C++ function), 98

DistSparseMatrix<T>::operator() (C++ func-tion), 98

DistSparseMatrix<T>::ProcessLocalQueues(C++ function), 98

DistSparseMatrix<T>::ProcessQueues (C++function), 98

DistSparseMatrix<T>::QueueLocalUpdate(C++ function), 98

DistSparseMatrix<T>::QueueLocalZero(C++ function), 98

DistSparseMatrix<T>::QueueUpdate (C++function), 98

DistSparseMatrix<T>::QueueZero (C++function), 98

DistSparseMatrix<T>::Reserve (C++ func-tion), 98

DistSparseMatrix<T>::Resize (C++ function),98

DistSparseMatrix<T>::Row (C++ function),99

DistSparseMatrix<T>::SourceBuffer (C++function), 99

DistSparseMatrix<T>::TargetBuffer (C++function), 99

DistSparseMatrix<T>::Update (C++ func-tion), 98

DistSparseMatrix<T>::UpdateLocal (C++function), 98

DistSparseMatrix<T>::Value (C++ function),99

Index 543

Page 548: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

DistSparseMatrix<T>::ValueBuffer (C++function), 99

DistSparseMatrix<T>::Width (C++ function),98

DistSparseMatrix<T>::Zero (C++ function),98

DistSparseMatrix<T>::ZeroLocal (C++ func-tion), 98

dList (C++ member), 279Dot (C++ function), 176Dot() (built-in function), 177Dotu (C++ function), 177Dotu() (built-in function), 178DruinskyToledo (C++ function), 476DruinskyToledo() (built-in function), 476DS (C++ function), 422DS() (built-in function), 422DumpCallStack (C++ function), 37

EEgorov (C++ function), 477Egorov() (built-in function), 477Ehrenfest (C++ function), 477Ehrenfest() (built-in function), 478EhrenfestDecay (C++ function), 477EhrenfestDecay() (built-in function), 478EhrenfestStationary (C++ function), 477EhrenfestStationary() (built-in function), 478ElAbs c (C function), 48ElAbs d (C function), 48ElAbs i (C function), 48ElAbs s (C function), 48ElAbs z (C function), 48ElAcos c (C function), 50ElAcos d (C function), 50ElAcos s (C function), 50ElAcos z (C function), 50ElAcosh c (C function), 51ElAcosh d (C function), 51ElAcosh s (C function), 51ElAcosh z (C function), 51ElAdjoint c (C function), 161ElAdjoint z (C function), 161ElAdjointAxpy c (C function), 163ElAdjointAxpy z (C function), 163ElAdjointAxpyDist c (C function), 163ElAdjointAxpyDist z (C function), 163ElAdjointAxpyDistSparse c (C function), 163ElAdjointAxpyDistSparse z (C function), 163ElAdjointAxpySparse c (C function), 163ElAdjointAxpySparse z (C function), 163

ElAdjointDist c (C function), 161ElAdjointDist z (C function), 161ElAdjointDistSparse c (C function), 161ElAdjointDistSparse z (C function), 161ElAdjointSparse c (C function), 161ElAdjointSparse z (C function), 161ElApplyPAfterBidiag c (C function), 254ElApplyPAfterBidiag d (C function), 253ElApplyPAfterBidiag s (C function), 253ElApplyPAfterBidiag z (C function), 254ElApplyPAfterBidiagDist c (C function), 254ElApplyPAfterBidiagDist d (C function), 253ElApplyPAfterBidiagDist s (C function), 253ElApplyPAfterBidiagDist z (C function), 254ElApplyQAfterBidiag c (C function), 254ElApplyQAfterBidiag d (C function), 253ElApplyQAfterBidiag s (C function), 253ElApplyQAfterBidiag z (C function), 254ElApplyQAfterBidiagDist c (C function), 254ElApplyQAfterBidiagDist d (C function), 253ElApplyQAfterBidiagDist s (C function), 253ElApplyQAfterBidiagDist z (C function), 254ElApplyQAfterHermitianTridiag c (C func-

tion), 247ElApplyQAfterHermitianTridiag d (C func-

tion), 247ElApplyQAfterHermitianTridiag z (C func-

tion), 247ElApplyQAfterHermitianTridiagDist c (C

function), 247ElApplyQAfterHermitianTridiagDist d (C

function), 247ElApplyQAfterHermitianTridiagDist z (C

function), 247ElApplyQAfterHessenberg c (C function),

250ElApplyQAfterHessenberg d (C function),

250ElApplyQAfterHessenberg s (C function), 250ElApplyQAfterHessenberg z (C function),

250ElApplyQAfterHessenbergDist c (C func-

tion), 250ElApplyQAfterHessenbergDist d (C func-

tion), 250ElApplyQAfterHessenbergDist s (C func-

tion), 250ElApplyQAfterHessenbergDist z (C func-

tion), 250ElApplyQAfterLQ c (C function), 276ElApplyQAfterLQ d (C function), 275

544 Index

Page 549: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElApplyQAfterLQ s (C function), 275ElApplyQAfterLQ z (C function), 276ElApplyQAfterLQDist c (C function), 276ElApplyQAfterLQDist d (C function), 276ElApplyQAfterLQDist s (C function), 276ElApplyQAfterLQDist z (C function), 276ElApplyQAfterQR c (C function), 282ElApplyQAfterQR d (C function), 282ElApplyQAfterQR s (C function), 282ElApplyQAfterQR z (C function), 282ElApplyQAfterQRDist c (C function), 282ElApplyQAfterQRDist d (C function), 282ElApplyQAfterQRDist s (C function), 282ElApplyQAfterQRDist z (C function), 282ElApplyQAfterRQ c (C function), 285ElApplyQAfterRQ d (C function), 285ElApplyQAfterRQ s (C function), 285ElApplyQAfterRQ z (C function), 285ElApplyQAfterRQDist c (C function), 285ElApplyQAfterRQDist d (C function), 285ElApplyQAfterRQDist s (C function), 285ElApplyQAfterRQDist z (C function), 285ElArg c (C function), 47ElArg d (C function), 47ElArg s (C function), 47ElArg z (C function), 47ElAsin c (C function), 50ElAsin d (C function), 50ElAsin s (C function), 50ElAsin z (C function), 50ElAsinh c (C function), 51ElAsinh d (C function), 51ElAsinh s (C function), 51ElAsinh z (C function), 51ElAtan2 d (C function), 50ElAtan2 s (C function), 50ElAtan c (C function), 50ElAtan d (C function), 50ElAtan s (C function), 50ElAtan z (C function), 50ElAtanh c (C function), 51ElAtanh d (C function), 51ElAtanh s (C function), 51ElAtanh z (C function), 51ElAxpy c (C function), 164ElAxpy d (C function), 164ElAxpy i (C function), 164ElAxpy s (C function), 164ElAxpy z (C function), 164ElAxpyDist c (C function), 165ElAxpyDist d (C function), 165

ElAxpyDist i (C function), 164ElAxpyDist s (C function), 164ElAxpyDist z (C function), 165ElAxpyDistMultiVec c (C function), 165ElAxpyDistMultiVec d (C function), 165ElAxpyDistMultiVec i (C function), 165ElAxpyDistMultiVec s (C function), 165ElAxpyDistMultiVec z (C function), 165ElAxpyDistSparse c (C function), 165ElAxpyDistSparse d (C function), 165ElAxpyDistSparse i (C function), 165ElAxpyDistSparse s (C function), 165ElAxpyDistSparse z (C function), 165ElAxpySparse c (C function), 165ElAxpySparse d (C function), 165ElAxpySparse i (C function), 165ElAxpySparse s (C function), 165ElAxpySparse z (C function), 165ElAxpyTrapezoid c (C function), 166ElAxpyTrapezoid d (C function), 166ElAxpyTrapezoid i (C function), 166ElAxpyTrapezoid s (C function), 166ElAxpyTrapezoid z (C function), 166ElAxpyTrapezoidDist c (C function), 166ElAxpyTrapezoidDist d (C function), 166ElAxpyTrapezoidDist i (C function), 166ElAxpyTrapezoidDist s (C function), 166ElAxpyTrapezoidDist z (C function), 166ElAxpyTrapezoidDistSparse c (C function),

166ElAxpyTrapezoidDistSparse d (C function),

166ElAxpyTrapezoidDistSparse i (C function),

166ElAxpyTrapezoidDistSparse s (C function),

166ElAxpyTrapezoidDistSparse z (C function),

167ElAxpyTrapezoidSparse c (C function), 166ElAxpyTrapezoidSparse d (C function), 166ElAxpyTrapezoidSparse i (C function), 166ElAxpyTrapezoidSparse s (C function), 166ElAxpyTrapezoidSparse z (C function), 166ElBernoulli c (C function), 510ElBernoulli d (C function), 510ElBernoulli i (C function), 510ElBernoulli s (C function), 510ElBernoulli z (C function), 510ElBernoulliDist c (C function), 510ElBernoulliDist d (C function), 510ElBernoulliDist i (C function), 510

Index 545

Page 550: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElBernoulliDist s (C function), 510ElBernoulliDist z (C function), 511ElBidiag c (C function), 252ElBidiag d (C function), 251ElBidiag s (C function), 251ElBidiag z (C function), 252ElBidiagDist c (C function), 252ElBidiagDist d (C function), 251ElBidiagDist s (C function), 251ElBidiagDist z (C function), 252ElBidiagExplicit c (C function), 252ElBidiagExplicit d (C function), 252ElBidiagExplicit s (C function), 251ElBidiagExplicit z (C function), 252ElBidiagExplicitCondensed c (C function),

252ElBidiagExplicitCondensed d (C function),

252ElBidiagExplicitCondensed s (C function),

251ElBidiagExplicitCondensed z (C function),

252ElBidiagExplicitCondensedDist c (C func-

tion), 252ElBidiagExplicitCondensedDist d (C func-

tion), 252ElBidiagExplicitCondensedDist s (C func-

tion), 251ElBidiagExplicitCondensedDist z (C func-

tion), 252ElBidiagExplicitDist c (C function), 252ElBidiagExplicitDist d (C function), 252ElBidiagExplicitDist s (C function), 251ElBidiagExplicitDist z (C function), 252ElBP c (C function), 416ElBP d (C function), 416ElBP s (C function), 416ElBP z (C function), 416ElBPDist c (C function), 416ElBPDist d (C function), 416ElBPDist s (C function), 416ElBPDist z (C function), 416ElBPDistSparse c (C function), 416ElBPDistSparse d (C function), 416ElBPDistSparse s (C function), 416ElBPDistSparse z (C function), 416ElBPDN d (C function), 419ElBPDN s (C function), 419ElBPDNDist d (C function), 419ElBPDNDist s (C function), 419ElBPDNDistSparse d (C function), 419

ElBPDNDistSparse s (C function), 419ElBPDNSparse d (C function), 419ElBPDNSparse s (C function), 419ElBPDNX d (C function), 419ElBPDNX s (C function), 419ElBPDNXDist d (C function), 419ElBPDNXDist s (C function), 419ElBPDNXDistSparse d (C function), 419ElBPDNXDistSparse s (C function), 419ElBPDNXSparse d (C function), 419ElBPDNXSparse s (C function), 419ElBPSparse c (C function), 416ElBPSparse d (C function), 416ElBPSparse s (C function), 416ElBPSparse z (C function), 416ElBPX c (C function), 417ElBPX d (C function), 417ElBPX s (C function), 417ElBPX z (C function), 417ElBPXDist c (C function), 417ElBPXDist d (C function), 417ElBPXDist s (C function), 417ElBPXDist z (C function), 417ElBPXDistSparse c (C function), 417ElBPXDistSparse d (C function), 417ElBPXDistSparse s (C function), 417ElBPXDistSparse z (C function), 418ElBPXSparse c (C function), 417ElBPXSparse d (C function), 417ElBPXSparse s (C function), 417ElBPXSparse z (C function), 417ElBullsHead c (C function), 471ElBullsHead z (C function), 471ElBullsHeadDist c (C function), 471ElBullsHeadDist z (C function), 471ElByte (C type), 41ElCauchy c (C function), 472ElCauchy d (C function), 472ElCauchy s (C function), 472ElCauchy z (C function), 472ElCauchyDist c (C function), 472ElCauchyDist d (C function), 472ElCauchyDist s (C function), 472ElCauchyDist z (C function), 472ElCauchyLike c (C function), 473ElCauchyLike d (C function), 473ElCauchyLike s (C function), 473ElCauchyLike z (C function), 473ElCauchyLikeDist c (C function), 473ElCauchyLikeDist d (C function), 473ElCauchyLikeDist s (C function), 473

546 Index

Page 551: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElCauchyLikeDist z (C function), 473ElCholesky c (C function), 256ElCholesky d (C function), 256ElCholesky s (C function), 255ElCholesky z (C function), 256ElCholeskyDist c (C function), 256ElCholeskyDist d (C function), 256ElCholeskyDist s (C function), 255ElCholeskyDist z (C function), 256ElCholeskyMod c (C function), 259ElCholeskyMod d (C function), 259ElCholeskyMod s (C function), 259ElCholeskyMod z (C function), 259ElCholeskyModDist c (C function), 259ElCholeskyModDist d (C function), 259ElCholeskyModDist s (C function), 259ElCholeskyModDist z (C function), 259ElCholeskyPiv c (C function), 256ElCholeskyPiv d (C function), 256ElCholeskyPiv s (C function), 255ElCholeskyPiv z (C function), 256ElCholeskyPivDist c (C function), 256ElCholeskyPivDist d (C function), 256ElCholeskyPivDist s (C function), 255ElCholeskyPivDist z (C function), 256ElCholeskyQR c (C function), 281ElCholeskyQR d (C function), 281ElCholeskyQR s (C function), 281ElCholeskyQR z (C function), 281ElCholeskyQRDist c (C function), 281ElCholeskyQRDist d (C function), 281ElCholeskyQRDist s (C function), 281ElCholeskyQRDist z (C function), 281ElCirculant c (C function), 474ElCirculant d (C function), 474ElCirculant i (C function), 474ElCirculant s (C function), 474ElCirculant z (C function), 474ElCirculantDist c (C function), 474ElCirculantDist d (C function), 474ElCirculantDist i (C function), 474ElCirculantDist s (C function), 474ElCirculantDist z (C function), 474ElClip d (C function), 440ElClip s (C function), 440ElClipDist d (C function), 440ElClipDist s (C function), 440ElCoherence c (C function), 461ElCoherence d (C function), 461ElCoherence s (C function), 461ElCoherence z (C function), 461, 462

ElColSwap c (C function), 205ElColSwap d (C function), 205ElColSwap i (C function), 205ElColSwap s (C function), 205ElColSwap z (C function), 205ElColSwapDist c (C function), 205ElColSwapDist d (C function), 205ElColSwapDist i (C function), 205ElColSwapDist s (C function), 205ElColSwapDist z (C function), 205ElComplexFromPolar c (C function), 47ElComplexFromPolar z (C function), 47ElComplexHermitianFunction c (C function),

333ElComplexHermitianFunction z (C function),

333ElComplexHermitianFunctionDist c (C func-

tion), 333ElComplexHermitianFunctionDist z (C func-

tion), 333ElCondition c (C function), 343ElCondition d (C function), 343ElCondition s (C function), 343ElCondition z (C function), 344ElConditionDist c (C function), 344ElConditionDist d (C function), 344ElConditionDist s (C function), 344ElConditionDist z (C function), 344ElConjugate c (C function), 168ElConjugate z (C function), 168ElConjugateDist c (C function), 168ElConjugateDist z (C function), 168ElConjugation (C type), 41ElCopy c (C function), 170ElCopy d (C function), 170ElCopy i (C function), 170ElCopy s (C function), 170ElCopy z (C function), 170ElCopyDist c (C function), 170ElCopyDist d (C function), 170ElCopyDist i (C function), 170ElCopyDist s (C function), 170ElCopyDist z (C function), 170ElCopyDistGraph (C function), 171ElCopyDistMultiVec c (C function), 170ElCopyDistMultiVec d (C function), 170ElCopyDistMultiVec i (C function), 170ElCopyDistMultiVec s (C function), 170ElCopyDistMultiVec z (C function), 170ElCopyDistSparse c (C function), 170ElCopyDistSparse d (C function), 170

Index 547

Page 552: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElCopyDistSparse i (C function), 170ElCopyDistSparse s (C function), 170ElCopyDistSparse z (C function), 170ElCopyDistSparseToDense c (C function), 171ElCopyDistSparseToDense d (C function),

170ElCopyDistSparseToDense i (C function), 170ElCopyDistSparseToDense s (C function), 170ElCopyDistSparseToDense z (C function), 171ElCopyGraph (C function), 171ElCopyGraphFromNonRoot (C function), 171ElCopyGraphFromRoot (C function), 171ElCopyMultiVecFromNonRoot c (C func-

tion), 171ElCopyMultiVecFromNonRoot d (C func-

tion), 171ElCopyMultiVecFromNonRoot i (C function),

171ElCopyMultiVecFromNonRoot s (C function),

171ElCopyMultiVecFromNonRoot z (C func-

tion), 171ElCopyMultiVecFromRoot c (C function), 171ElCopyMultiVecFromRoot d (C function), 171ElCopyMultiVecFromRoot i (C function), 171ElCopyMultiVecFromRoot s (C function), 171ElCopyMultiVecFromRoot z (C function), 171ElCopySparse c (C function), 170ElCopySparse d (C function), 170ElCopySparse i (C function), 170ElCopySparse s (C function), 170ElCopySparse z (C function), 170ElCopySparseMatrixFromNonRoot c (C func-

tion), 171ElCopySparseMatrixFromNonRoot d (C

function), 171ElCopySparseMatrixFromNonRoot i (C func-

tion), 171ElCopySparseMatrixFromNonRoot s (C func-

tion), 171ElCopySparseMatrixFromNonRoot z (C func-

tion), 171ElCopySparseMatrixFromRoot c (C function),

171ElCopySparseMatrixFromRoot d (C func-

tion), 171ElCopySparseMatrixFromRoot i (C function),

171ElCopySparseMatrixFromRoot s (C function),

171

ElCopySparseMatrixFromRoot z (C func-tion), 171

ElCopySparseToDense c (C function), 170ElCopySparseToDense d (C function), 170ElCopySparseToDense i (C function), 170ElCopySparseToDense s (C function), 170ElCopySparseToDense z (C function), 170ElCos c (C function), 49ElCos d (C function), 49ElCos s (C function), 49ElCos z (C function), 50ElCosh c (C function), 51ElCosh d (C function), 51ElCosh s (C function), 51ElCosh z (C function), 51ElCovariance c (C function), 462ElCovariance d (C function), 462ElCovariance s (C function), 462ElCovariance z (C function), 462ElCovarianceDist c (C function), 462ElCovarianceDist d (C function), 462ElCovarianceDist s (C function), 462ElCovarianceDist z (C function), 462ElCP d (C function), 421ElCP s (C function), 420ElCPDist d (C function), 421ElCPDist s (C function), 420ElCPDistSparse d (C function), 421ElCPDistSparse s (C function), 421ElCPSparse d (C function), 421ElCPSparse s (C function), 420ElCPX d (C function), 421ElCPX s (C function), 421ElCPXDist d (C function), 421ElCPXDist s (C function), 421ElCPXDistSparse d (C function), 421ElCPXDistSparse s (C function), 421ElCPXSparse d (C function), 421ElCPXSparse s (C function), 421ElDemmel c (C function), 474ElDemmel d (C function), 474ElDemmel s (C function), 474ElDemmel z (C function), 474ElDemmelDist c (C function), 475ElDemmelDist d (C function), 475ElDemmelDist s (C function), 475ElDemmelDist z (C function), 475ElDeterminant c (C function), 345ElDeterminant d (C function), 345ElDeterminant s (C function), 345ElDeterminant z (C function), 345

548 Index

Page 553: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElDeterminantDist c (C function), 345ElDeterminantDist d (C function), 345ElDeterminantDist s (C function), 345ElDeterminantDist z (C function), 345ElDiagonal c (C function), 475ElDiagonal d (C function), 475ElDiagonal i (C function), 475ElDiagonal s (C function), 475ElDiagonal z (C function), 475ElDiagonalDist c (C function), 475ElDiagonalDist d (C function), 475ElDiagonalDist i (C function), 475ElDiagonalDist s (C function), 475ElDiagonalDist z (C function), 475ElDiagonalScale c (C function), 172ElDiagonalScale d (C function), 172ElDiagonalScale i (C function), 172ElDiagonalScale s (C function), 172ElDiagonalScale z (C function), 172ElDiagonalScaleDist c (C function), 172ElDiagonalScaleDist d (C function), 172ElDiagonalScaleDist i (C function), 172ElDiagonalScaleDist s (C function), 172ElDiagonalScaleDist z (C function), 172ElDiagonalScaleDistSparse c (C function), 173ElDiagonalScaleDistSparse d (C function),

173ElDiagonalScaleDistSparse i (C function), 173ElDiagonalScaleDistSparse s (C function), 173ElDiagonalScaleDistSparse z (C function), 173ElDiagonalScaleSparse c (C function), 173ElDiagonalScaleSparse d (C function), 172ElDiagonalScaleSparse i (C function), 172ElDiagonalScaleSparse s (C function), 172ElDiagonalScaleSparse z (C function), 173ElDiagonalScaleTrapezoid c (C function), 174ElDiagonalScaleTrapezoid d (C function), 174ElDiagonalScaleTrapezoid i (C function), 174ElDiagonalScaleTrapezoid s (C function), 174ElDiagonalScaleTrapezoid z (C function), 174ElDiagonalScaleTrapezoidDist c (C function),

174ElDiagonalScaleTrapezoidDist d (C function),

174ElDiagonalScaleTrapezoidDist i (C function),

174ElDiagonalScaleTrapezoidDist s (C function),

174ElDiagonalScaleTrapezoidDist z (C function),

174

ElDiagonalScaleTrapezoidDistSparse c (Cfunction), 175

ElDiagonalScaleTrapezoidDistSparse d (Cfunction), 175

ElDiagonalScaleTrapezoidDistSparse i (Cfunction), 174

ElDiagonalScaleTrapezoidDistSparse s (Cfunction), 175

ElDiagonalScaleTrapezoidDistSparse z (Cfunction), 175

ElDiagonalScaleTrapezoidSparse c (C func-tion), 174

ElDiagonalScaleTrapezoidSparse d (C func-tion), 174

ElDiagonalScaleTrapezoidSparse i (C func-tion), 174

ElDiagonalScaleTrapezoidSparse s (C func-tion), 174

ElDiagonalScaleTrapezoidSparse z (C func-tion), 174

ElDiagonalSolve c (C function), 176ElDiagonalSolve d (C function), 175ElDiagonalSolve s (C function), 175ElDiagonalSolve z (C function), 176ElDiagonalSolveDist c (C function), 176ElDiagonalSolveDist d (C function), 176ElDiagonalSolveDist s (C function), 176ElDiagonalSolveDist z (C function), 176ElDiagonalSolveDistSparse c (C function),

176ElDiagonalSolveDistSparse d (C function),

176ElDiagonalSolveDistSparse s (C function),

176ElDiagonalSolveDistSparse z (C function),

176ElDiagonalSolveSparse c (C function), 176ElDiagonalSolveSparse d (C function), 176ElDiagonalSolveSparse s (C function), 176ElDiagonalSolveSparse z (C function), 176ElDisplay c (C function), 519ElDisplay d (C function), 519ElDisplay i (C function), 519ElDisplay s (C function), 519ElDisplay z (C function), 519ElDisplayDist c (C function), 519ElDisplayDist d (C function), 519ElDisplayDist i (C function), 519ElDisplayDist s (C function), 519ElDisplayDist z (C function), 519ElDist (C type), 41

Index 549

Page 554: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElDot c (C function), 177ElDot d (C function), 177ElDot i (C function), 177ElDot s (C function), 177ElDot z (C function), 177ElDotDist c (C function), 177ElDotDist d (C function), 177ElDotDist i (C function), 177ElDotDist s (C function), 177ElDotDist z (C function), 177ElDotDistMultiVec c (C function), 177ElDotDistMultiVec d (C function), 177ElDotDistMultiVec i (C function), 177ElDotDistMultiVec s (C function), 177ElDotDistMultiVec z (C function), 177ElDotu c (C function), 178ElDotu d (C function), 178ElDotu i (C function), 178ElDotu s (C function), 178ElDotu z (C function), 178ElDotuDist c (C function), 178ElDotuDist d (C function), 178ElDotuDist i (C function), 178ElDotuDist s (C function), 178ElDotuDist z (C function), 178ElDotuDistMultiVec c (C function), 178ElDotuDistMultiVec d (C function), 178ElDotuDistMultiVec i (C function), 178ElDotuDistMultiVec s (C function), 178ElDotuDistMultiVec z (C function), 178ElDruinskyToledo c (C function), 476ElDruinskyToledo d (C function), 476ElDruinskyToledo s (C function), 476ElDruinskyToledo z (C function), 476ElDruinskyToledoDist c (C function), 476ElDruinskyToledoDist d (C function), 476ElDruinskyToledoDist s (C function), 476ElDruinskyToledoDist z (C function), 476ElDS d (C function), 423ElDS s (C function), 422ElDSDist d (C function), 423ElDSDist s (C function), 422ElDSDistSparse d (C function), 423ElDSDistSparse s (C function), 423ElDSSparse d (C function), 423ElDSSparse s (C function), 423ElDSX d (C function), 423ElDSX s (C function), 423ElDSXDist d (C function), 423ElDSXDist s (C function), 423ElDSXDistSparse d (C function), 423

ElDSXDistSparse s (C function), 423ElDSXSparse d (C function), 423ElDSXSparse s (C function), 423ElEgorov c (C function), 477ElEgorov z (C function), 477ElEgorovDist c (C function), 477ElEgorovDist z (C function), 477ElEhrenfest c (C function), 478ElEhrenfest d (C function), 478ElEhrenfest s (C function), 478ElEhrenfest z (C function), 478ElEhrenfestDecay c (C function), 478ElEhrenfestDecay d (C function), 478ElEhrenfestDecay s (C function), 478ElEhrenfestDecay z (C function), 478ElEhrenfestDecayDist c (C function), 478ElEhrenfestDecayDist d (C function), 478ElEhrenfestDecayDist s (C function), 478ElEhrenfestDecayDist z (C function), 478ElEhrenfestDist c (C function), 478ElEhrenfestDist d (C function), 478ElEhrenfestDist s (C function), 478ElEhrenfestDist z (C function), 478ElEhrenfestStationary c (C function), 478ElEhrenfestStationary d (C function), 478ElEhrenfestStationary s (C function), 478ElEhrenfestStationary z (C function), 478ElEhrenfestStationaryDist c (C function), 478ElEhrenfestStationaryDist d (C function), 478ElEhrenfestStationaryDist s (C function), 478ElEhrenfestStationaryDist z (C function), 478ElementalMatrix<scalarType> (C++ class), 69ElEN d (C function), 425ElEN s (C function), 425ElENDist d (C function), 425ElENDist s (C function), 425ElENDistSparse d (C function), 425ElENDistSparse s (C function), 425ElENSparse d (C function), 425ElENSparse s (C function), 425ElEntrywiseFill c (C function), 179ElEntrywiseFill d (C function), 179ElEntrywiseFill i (C function), 179ElEntrywiseFill s (C function), 179ElEntrywiseFill z (C function), 179ElEntrywiseFillDist c (C function), 179ElEntrywiseFillDist d (C function), 179ElEntrywiseFillDist i (C function), 179ElEntrywiseFillDist s (C function), 179ElEntrywiseFillDist z (C function), 179

550 Index

Page 555: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElEntrywiseFillDistMultiVec c (C function),179

ElEntrywiseFillDistMultiVec d (C function),179

ElEntrywiseFillDistMultiVec i (C function),179

ElEntrywiseFillDistMultiVec s (C function),179

ElEntrywiseFillDistMultiVec z (C function),179

ElEntrywiseMap c (C function), 180ElEntrywiseMap d (C function), 180ElEntrywiseMap i (C function), 180ElEntrywiseMap s (C function), 180ElEntrywiseMap z (C function), 180ElEntrywiseMapDist c (C function), 180ElEntrywiseMapDist d (C function), 180ElEntrywiseMapDist i (C function), 180ElEntrywiseMapDist s (C function), 180ElEntrywiseMapDist z (C function), 180ElEntrywiseMapDistMultiVec c (C function),

181ElEntrywiseMapDistMultiVec d (C function),

181ElEntrywiseMapDistMultiVec i (C function),

180ElEntrywiseMapDistMultiVec s (C function),

181ElEntrywiseMapDistMultiVec z (C function),

181ElEntrywiseMapDistSparse c (C function),

180ElEntrywiseMapDistSparse d (C function),

180ElEntrywiseMapDistSparse i (C function),

180ElEntrywiseMapDistSparse s (C function),

180ElEntrywiseMapDistSparse z (C function),

180ElEntrywiseMapSparse c (C function), 180ElEntrywiseMapSparse d (C function), 180ElEntrywiseMapSparse i (C function), 180ElEntrywiseMapSparse s (C function), 180ElEntrywiseMapSparse z (C function), 180ElEntrywiseNorm c (C function), 349ElEntrywiseNorm d (C function), 349ElEntrywiseNorm s (C function), 349ElEntrywiseNorm z (C function), 349ElEntrywiseNormDist c (C function), 349ElEntrywiseNormDist d (C function), 349

ElEntrywiseNormDist s (C function), 349ElEntrywiseNormDist z (C function), 350ElEntrywiseNormDistMultiVec c (C func-

tion), 350ElEntrywiseNormDistMultiVec d (C func-

tion), 350ElEntrywiseNormDistMultiVec s (C func-

tion), 350ElEntrywiseNormDistMultiVec z (C func-

tion), 350ElEntrywiseNormDistSparse c (C function),

350ElEntrywiseNormDistSparse d (C function),

350ElEntrywiseNormDistSparse s (C function),

350ElEntrywiseNormDistSparse z (C function),

350ElEntrywiseNormSparse c (C function), 350ElEntrywiseNormSparse d (C function), 350ElEntrywiseNormSparse s (C function), 350ElEntrywiseNormSparse z (C function), 350ElENX d (C function), 426ElENX s (C function), 425ElENXDist d (C function), 426ElENXDist s (C function), 425ElENXDistSparse d (C function), 426ElENXDistSparse s (C function), 425ElENXSparse d (C function), 426ElENXSparse s (C function), 425ElError (C type), 37ElErrorString (C function), 37ElExp c (C function), 49ElExp d (C function), 49ElExp s (C function), 49ElExp z (C function), 49ElExtendedKahan c (C function), 479ElExtendedKahan d (C function), 479ElExtendedKahan s (C function), 479ElExtendedKahan z (C function), 479ElExtendedKahanDist c (C function), 479ElExtendedKahanDist d (C function), 479ElExtendedKahanDist s (C function), 479ElExtendedKahanDist z (C function), 479ElFastAbs c (C function), 48ElFastAbs z (C function), 48ElFiedler c (C function), 480ElFiedler d (C function), 480ElFiedler s (C function), 480ElFiedler z (C function), 480ElFiedlerDist c (C function), 480

Index 551

Page 556: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElFiedlerDist d (C function), 480ElFiedlerDist s (C function), 480ElFiedlerDist z (C function), 480ElFileFormat (C type), 523ElFill c (C function), 181ElFill d (C function), 181ElFill i (C function), 181ElFill s (C function), 181ElFill z (C function), 181ElFillDiagonal c (C function), 182ElFillDiagonal d (C function), 182ElFillDiagonal i (C function), 182ElFillDiagonal s (C function), 182ElFillDiagonal z (C function), 182ElFillDiagonalDist c (C function), 182ElFillDiagonalDist d (C function), 182ElFillDiagonalDist i (C function), 182ElFillDiagonalDist s (C function), 182ElFillDiagonalDist z (C function), 182ElFillDist c (C function), 181ElFillDist d (C function), 181ElFillDist i (C function), 181ElFillDist s (C function), 181ElFillDist z (C function), 181ElFinalize (C function), 35ElForsythe c (C function), 480ElForsythe d (C function), 480ElForsythe i (C function), 480ElForsythe s (C function), 480ElForsythe z (C function), 480ElForsytheDist c (C function), 480ElForsytheDist d (C function), 480ElForsytheDist i (C function), 480ElForsytheDist s (C function), 480ElForsytheDist z (C function), 480ElForwardOrBackward (C type), 41ElFourier c (C function), 481ElFourier z (C function), 481ElFourierDist c (C function), 481ElFourierDist z (C function), 481ElFourierIdentity c (C function), 482ElFourierIdentity z (C function), 482ElFourierIdentityDist c (C function), 482ElFourierIdentityDist z (C function), 482ElFrobeniusCondition c (C function), 341ElFrobeniusCondition d (C function), 341ElFrobeniusCondition s (C function), 341ElFrobeniusCondition z (C function), 341ElFrobeniusConditionDist c (C function), 341ElFrobeniusConditionDist d (C function), 341ElFrobeniusConditionDist s (C function), 341

ElFrobeniusConditionDist z (C function), 341ElFrobeniusNorm c (C function), 352ElFrobeniusNorm d (C function), 352ElFrobeniusNorm s (C function), 352ElFrobeniusNorm z (C function), 352ElFrobeniusNormDist c (C function), 352ElFrobeniusNormDist d (C function), 352ElFrobeniusNormDist s (C function), 352ElFrobeniusNormDist z (C function), 352ElFrobeniusNormDistMultiVec c (C func-

tion), 352ElFrobeniusNormDistMultiVec d (C func-

tion), 352ElFrobeniusNormDistMultiVec s (C func-

tion), 352ElFrobeniusNormDistMultiVec z (C func-

tion), 353ElFrobeniusNormDistSparse c (C function),

352ElFrobeniusNormDistSparse d (C function),

352ElFrobeniusNormDistSparse s (C function),

352ElFrobeniusNormDistSparse z (C function),

352ElFrobeniusNormSparse c (C function), 352ElFrobeniusNormSparse d (C function), 352ElFrobeniusNormSparse s (C function), 352ElFrobeniusNormSparse z (C function), 352ElFrobeniusProx c (C function), 440ElFrobeniusProx d (C function), 440ElFrobeniusProx s (C function), 440ElFrobeniusProx z (C function), 440ElFrobeniusProxDist c (C function), 440ElFrobeniusProxDist d (C function), 440ElFrobeniusProxDist s (C function), 440ElFrobeniusProxDist z (C function), 440ElGaussian c (C function), 511ElGaussian d (C function), 511ElGaussian s (C function), 511ElGaussian z (C function), 511ElGaussianDist c (C function), 511ElGaussianDist d (C function), 511ElGaussianDist s (C function), 511ElGaussianDist z (C function), 511ElGCDMatrix c (C function), 482ElGCDMatrix d (C function), 482ElGCDMatrix i (C function), 482ElGCDMatrix s (C function), 482ElGCDMatrix z (C function), 482ElGCDMatrixDist c (C function), 482

552 Index

Page 557: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElGCDMatrixDist d (C function), 482ElGCDMatrixDist i (C function), 482ElGCDMatrixDist s (C function), 482ElGCDMatrixDist z (C function), 482ElGear c (C function), 483ElGear d (C function), 483ElGear i (C function), 483ElGear s (C function), 483ElGear z (C function), 483ElGearDist c (C function), 483ElGearDist d (C function), 483ElGearDist i (C function), 483ElGearDist s (C function), 483ElGearDist z (C function), 483ElGemm c (C function), 222ElGemm d (C function), 222ElGemm i (C function), 222ElGemm s (C function), 222ElGemm z (C function), 222ElGemmAlgorithm (C type), 222ElGemmDist c (C function), 222ElGemmDist d (C function), 222ElGemmDist i (C function), 222ElGemmDist s (C function), 222ElGemmDist z (C function), 222ElGemmXDist c (C function), 223ElGemmXDist d (C function), 222ElGemmXDist i (C function), 222ElGemmXDist s (C function), 222ElGemmXDist z (C function), 223ElGemv c (C function), 212ElGemv d (C function), 211ElGemv i (C function), 211ElGemv s (C function), 211ElGemv z (C function), 212ElGemvDist c (C function), 212ElGemvDist d (C function), 212ElGemvDist i (C function), 212ElGemvDist s (C function), 212ElGemvDist z (C function), 212ElGEPPGrowth c (C function), 484ElGEPPGrowth d (C function), 484ElGEPPGrowth s (C function), 484ElGEPPGrowth z (C function), 484ElGEPPGrowthDist c (C function), 484ElGEPPGrowthDist d (C function), 484ElGEPPGrowthDist s (C function), 484ElGEPPGrowthDist z (C function), 484ElGer c (C function), 212ElGer d (C function), 212ElGer i (C function), 212

ElGer s (C function), 212ElGer z (C function), 212ElGerDist c (C function), 213ElGerDist d (C function), 212ElGerDist i (C function), 212ElGerDist s (C function), 212ElGerDist z (C function), 213ElGeru c (C function), 213ElGeru z (C function), 213ElGeruDist c (C function), 213ElGeruDist z (C function), 213ElGetContigSubmatrix c (C function), 185ElGetContigSubmatrix d (C function), 185ElGetContigSubmatrix i (C function), 184ElGetContigSubmatrix s (C function), 185ElGetContigSubmatrix z (C function), 186ElGetContigSubmatrixDist c (C function), 185ElGetContigSubmatrixDist d (C function),

185ElGetContigSubmatrixDist i (C function), 184ElGetContigSubmatrixDist s (C function), 185ElGetContigSubmatrixDist z (C function), 186ElGetContigSubmatrixDistMultiVec c (C

function), 185ElGetContigSubmatrixDistMultiVec d (C

function), 185ElGetContigSubmatrixDistMultiVec i (C

function), 185ElGetContigSubmatrixDistMultiVec s (C

function), 185ElGetContigSubmatrixDistMultiVec z (C

function), 186ElGetContigSubmatrixDistSparse c (C func-

tion), 185ElGetContigSubmatrixDistSparse d (C func-

tion), 185ElGetContigSubmatrixDistSparse i (C func-

tion), 185ElGetContigSubmatrixDistSparse s (C func-

tion), 185ElGetContigSubmatrixDistSparse z (C func-

tion), 186ElGetContigSubmatrixSparse c (C function),

185ElGetContigSubmatrixSparse d (C function),

185ElGetContigSubmatrixSparse i (C function),

184ElGetContigSubmatrixSparse s (C function),

185

Index 553

Page 558: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElGetContigSubmatrixSparse z (C function),186

ElGKS c (C function), 484ElGKS d (C function), 484ElGKS s (C function), 484ElGKS z (C function), 484ElGKSDist c (C function), 484ElGKSDist d (C function), 484ElGKSDist s (C function), 484ElGKSDist z (C function), 484ElGLM c (C function), 386ElGLM d (C function), 386ElGLM s (C function), 386ElGLM z (C function), 387ElGLMDist c (C function), 386ElGLMDist d (C function), 386ElGLMDist s (C function), 386ElGLMDist z (C function), 387ElGLMDistSparse c (C function), 386ElGLMDistSparse d (C function), 386ElGLMDistSparse s (C function), 386ElGLMDistSparse z (C function), 387ElGLMSparse c (C function), 386ElGLMSparse d (C function), 386ElGLMSparse s (C function), 386ElGLMSparse z (C function), 387ElGLMXDistSparse c (C function), 387ElGLMXDistSparse d (C function), 387ElGLMXDistSparse s (C function), 387ElGLMXDistSparse z (C function), 387ElGLMXSparse c (C function), 387ElGLMXSparse d (C function), 387ElGLMXSparse s (C function), 387ElGLMXSparse z (C function), 387ElGQR c (C function), 288ElGQR d (C function), 287ElGQR s (C function), 287ElGQR z (C function), 288ElGQRDist c (C function), 288ElGQRDist d (C function), 287ElGQRDist s (C function), 287ElGQRDist z (C function), 288ElGQRExplicitTriang c (C function), 288ElGQRExplicitTriang d (C function), 288ElGQRExplicitTriang s (C function), 287ElGQRExplicitTriang z (C function), 288ElGQRExplicitTriangDist c (C function), 288ElGQRExplicitTriangDist d (C function), 288ElGQRExplicitTriangDist s (C function), 287ElGQRExplicitTriangDist z (C function), 288ElGrcar c (C function), 485

ElGrcar d (C function), 485ElGrcar i (C function), 485ElGrcar s (C function), 485ElGrcar z (C function), 485ElGrcarDist c (C function), 485ElGrcarDist d (C function), 485ElGrcarDist i (C function), 485ElGrcarDist s (C function), 485ElGrcarDist z (C function), 485ElGridOrder (C type), 41ElGRQ c (C function), 289ElGRQ d (C function), 289ElGRQ s (C function), 289ElGRQ z (C function), 289ElGRQDist c (C function), 289ElGRQDist d (C function), 289ElGRQDist s (C function), 289ElGRQDist z (C function), 289ElGRQExplicitTriang c (C function), 290ElGRQExplicitTriang d (C function), 290ElGRQExplicitTriang s (C function), 290ElGRQExplicitTriang z (C function), 290ElGRQExplicitTriangDist c (C function), 290ElGRQExplicitTriangDist d (C function), 290ElGRQExplicitTriangDist s (C function), 290ElGRQExplicitTriangDist z (C function), 290ElHaar c (C function), 512ElHaar d (C function), 512ElHaar s (C function), 512ElHaar z (C function), 512ElHaarDist c (C function), 512ElHaarDist d (C function), 512ElHaarDist s (C function), 512ElHaarDist z (C function), 512ElHadamard c (C function), 186ElHadamard d (C function), 186ElHadamard i (C function), 186ElHadamard s (C function), 186ElHadamard z (C function), 186ElHadamardDist c (C function), 187ElHadamardDist d (C function), 186ElHadamardDist i (C function), 186ElHadamardDist s (C function), 186ElHadamardDist z (C function), 187ElHankel c (C function), 486ElHankel d (C function), 486ElHankel i (C function), 486ElHankel s (C function), 486ElHankel z (C function), 486ElHankelDist c (C function), 486ElHankelDist d (C function), 486

554 Index

Page 559: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHankelDist i (C function), 486ElHankelDist s (C function), 486ElHankelDist z (C function), 486ElHanowa c (C function), 486ElHanowa d (C function), 486ElHanowa i (C function), 486ElHanowa s (C function), 486ElHanowa z (C function), 486ElHanowaDist c (C function), 487ElHanowaDist d (C function), 487ElHanowaDist i (C function), 486ElHanowaDist s (C function), 486ElHanowaDist z (C function), 487ElHatanoNelson c (C function), 513ElHatanoNelson d (C function), 513ElHatanoNelson s (C function), 513ElHatanoNelson z (C function), 513ElHatanoNelsonDist c (C function), 513ElHatanoNelsonDist d (C function), 513ElHatanoNelsonDist s (C function), 513ElHatanoNelsonDist z (C function), 513ElHelmholtz1D c (C function), 487ElHelmholtz1D d (C function), 487ElHelmholtz1D s (C function), 487ElHelmholtz1D z (C function), 487ElHelmholtz1DDist c (C function), 487ElHelmholtz1DDist d (C function), 487ElHelmholtz1DDist s (C function), 487ElHelmholtz1DDist z (C function), 487ElHelmholtz2D c (C function), 487ElHelmholtz2D d (C function), 487ElHelmholtz2D s (C function), 487ElHelmholtz2D z (C function), 487ElHelmholtz2DDist c (C function), 488ElHelmholtz2DDist d (C function), 488ElHelmholtz2DDist s (C function), 487ElHelmholtz2DDist z (C function), 488ElHelmholtz3D c (C function), 488ElHelmholtz3D d (C function), 488ElHelmholtz3D s (C function), 488ElHelmholtz3D z (C function), 488ElHelmholtz3DDist c (C function), 488ElHelmholtz3DDist d (C function), 488ElHelmholtz3DDist s (C function), 488ElHelmholtz3DDist z (C function), 488ElHelmholtzPML1D c (C function), 489ElHelmholtzPML1D z (C function), 489ElHelmholtzPML1DDist c (C function), 489ElHelmholtzPML1DDist z (C function), 489ElHelmholtzPML2D c (C function), 489ElHelmholtzPML2D z (C function), 489

ElHelmholtzPML2DDist c (C function), 489ElHelmholtzPML2DDist z (C function), 489ElHelmholtzPML3D c (C function), 489ElHelmholtzPML3D z (C function), 489ElHelmholtzPML3DDist c (C function), 489ElHelmholtzPML3DDist z (C function), 489ElHemm c (C function), 223ElHemm z (C function), 223ElHemmDist c (C function), 223ElHemmDist z (C function), 223ElHemv c (C function), 213ElHemv z (C function), 213ElHemvDist c (C function), 214ElHemvDist z (C function), 214ElHer2 c (C function), 215ElHer2 z (C function), 215ElHer2Dist c (C function), 215ElHer2Dist z (C function), 215ElHer2k c (C function), 225ElHer2k z (C function), 225ElHer2kDist c (C function), 225ElHer2kDist z (C function), 225ElHer c (C function), 214ElHer z (C function), 214ElHerDist c (C function), 214ElHerDist z (C function), 214ElHerk c (C function), 224ElHerk z (C function), 224ElHerkDist c (C function), 224ElHerkDist z (C function), 224ElHermitianEig c (C function), 298ElHermitianEig d (C function), 298ElHermitianEig s (C function), 298ElHermitianEig z (C function), 298ElHermitianEigCtrlDefault d (C function),

301ElHermitianEigCtrlDefault s (C function), 301ElHermitianEigDist c (C function), 298ElHermitianEigDist d (C function), 298ElHermitianEigDist s (C function), 298ElHermitianEigDist z (C function), 298ElHermitianEigPair c (C function), 299ElHermitianEigPair d (C function), 299ElHermitianEigPair s (C function), 299ElHermitianEigPair z (C function), 299ElHermitianEigPairDist c (C function), 299ElHermitianEigPairDist d (C function), 299ElHermitianEigPairDist s (C function), 299ElHermitianEigPairDist z (C function), 299ElHermitianEigPairPartial c (C function), 300ElHermitianEigPairPartial d (C function), 300

Index 555

Page 560: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHermitianEigPairPartial s (C function), 299ElHermitianEigPairPartial z (C function), 300ElHermitianEigPairPartialDist c (C function),

300ElHermitianEigPairPartialDist d (C function),

300ElHermitianEigPairPartialDist s (C function),

300ElHermitianEigPairPartialDist z (C function),

300ElHermitianEigPartial c (C function), 298ElHermitianEigPartial d (C function), 298ElHermitianEigPartial s (C function), 298ElHermitianEigPartial z (C function), 298ElHermitianEigPartialDist c (C function), 298ElHermitianEigPartialDist d (C function), 298ElHermitianEigPartialDist s (C function), 298ElHermitianEigPartialDist z (C function), 298ElHermitianEntrywiseNorm c (C function),

351ElHermitianEntrywiseNorm z (C function),

351ElHermitianEntrywiseNormDist c (C func-

tion), 351ElHermitianEntrywiseNormDist z (C func-

tion), 351ElHermitianEntrywiseNormDistSparse c (C

function), 351ElHermitianEntrywiseNormDistSparse z (C

function), 351ElHermitianEntrywiseNormSparse c (C func-

tion), 351ElHermitianEntrywiseNormSparse z (C func-

tion), 351ElHermitianFrobeniusNorm c (C function),

353ElHermitianFrobeniusNorm z (C function),

353ElHermitianFrobeniusNormDist c (C func-

tion), 353ElHermitianFrobeniusNormDist z (C func-

tion), 353ElHermitianFromEVD c (C function), 490ElHermitianFromEVD d (C function), 490ElHermitianFromEVD s (C function), 490ElHermitianFromEVD z (C function), 490ElHermitianFromEVDDist c (C function), 490ElHermitianFromEVDDist d (C function), 490ElHermitianFromEVDDist s (C function), 490ElHermitianFromEVDDist z (C function), 490ElHermitianGenDefEig c (C function), 307

ElHermitianGenDefEig d (C function), 307ElHermitianGenDefEig s (C function), 307ElHermitianGenDefEig z (C function), 307ElHermitianGenDefEigDist c (C function),

307ElHermitianGenDefEigDist d (C function),

307ElHermitianGenDefEigDist s (C function),

307ElHermitianGenDefEigDist z (C function),

307ElHermitianGenDefEigPair c (C function),

308ElHermitianGenDefEigPair d (C function),

308ElHermitianGenDefEigPair s (C function),

308ElHermitianGenDefEigPair z (C function),

308ElHermitianGenDefEigPairDist c (C func-

tion), 309ElHermitianGenDefEigPairDist d (C func-

tion), 309ElHermitianGenDefEigPairDist s (C func-

tion), 309ElHermitianGenDefEigPairDist z (C func-

tion), 309ElHermitianGenDefEigPairPartial c (C func-

tion), 309ElHermitianGenDefEigPairPartial d (C func-

tion), 309ElHermitianGenDefEigPairPartial s (C func-

tion), 309ElHermitianGenDefEigPairPartial z (C func-

tion), 309ElHermitianGenDefEigPairPartialDist c (C

function), 309ElHermitianGenDefEigPairPartialDist d (C

function), 309ElHermitianGenDefEigPairPartialDist s (C

function), 309ElHermitianGenDefEigPairPartialDist z (C

function), 309ElHermitianGenDefEigPartial c (C function),

307ElHermitianGenDefEigPartial d (C function),

307ElHermitianGenDefEigPartial s (C function),

307ElHermitianGenDefEigPartial z (C function),

307

556 Index

Page 561: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHermitianGenDefEigPartialDist c (C func-tion), 307

ElHermitianGenDefEigPartialDist d (C func-tion), 307

ElHermitianGenDefEigPartialDist s (C func-tion), 307

ElHermitianGenDefEigPartialDist z (C func-tion), 308

ElHermitianInfinityNorm c (C function), 355ElHermitianInfinityNorm z (C function), 356ElHermitianInfinityNormDist c (C function),

356ElHermitianInfinityNormDist z (C function),

356ElHermitianInverse c (C function), 331ElHermitianInverse z (C function), 331ElHermitianInverseDist c (C function), 331ElHermitianInverseDist z (C function), 331ElHermitianKyFanNorm c (C function), 354ElHermitianKyFanNorm z (C function), 354ElHermitianKyFanNormDist c (C function),

354ElHermitianKyFanNormDist z (C function),

354ElHermitianMaxNorm c (C function), 357ElHermitianMaxNorm z (C function), 357ElHermitianMaxNormDist c (C function), 357ElHermitianMaxNormDist z (C function), 357ElHermitianNorm c (C function), 365ElHermitianNorm z (C function), 365ElHermitianNormDist c (C function), 365ElHermitianNormDist z (C function), 365ElHermitianNuclearNorm c (C function), 358ElHermitianNuclearNorm z (C function), 358ElHermitianNuclearNormDist c (C function),

358ElHermitianNuclearNormDist z (C function),

358ElHermitianOneNorm c (C function), 359ElHermitianOneNorm z (C function), 359ElHermitianOneNormDist c (C function), 360ElHermitianOneNormDist z (C function), 360ElHermitianPseudoinverse c (C function), 335ElHermitianPseudoinverse d (C function),

335ElHermitianPseudoinverse s (C function), 335ElHermitianPseudoinverse z (C function),

335ElHermitianPseudoinverseDist c (C func-

tion), 335

ElHermitianPseudoinverseDist d (C func-tion), 335

ElHermitianPseudoinverseDist s (C func-tion), 335

ElHermitianPseudoinverseDist z (C func-tion), 335

ElHermitianSDCCtrl d (C type), 302ElHermitianSDCCtrl d.cutoff (C member),

302ElHermitianSDCCtrl d.maxInnerIts (C mem-

ber), 302ElHermitianSDCCtrl d.maxOuterIts (C mem-

ber), 302ElHermitianSDCCtrl d.progress (C member),

302ElHermitianSDCCtrl d.random (C member),

302ElHermitianSDCCtrl d.spreadFactor (C mem-

ber), 302ElHermitianSDCCtrl d.tol (C member), 302ElHermitianSDCCtrl s (C type), 301ElHermitianSDCCtrl s.cutoff (C member), 302ElHermitianSDCCtrl s.maxInnerIts (C mem-

ber), 302ElHermitianSDCCtrl s.maxOuterIts (C mem-

ber), 302ElHermitianSDCCtrl s.progress (C member),

302ElHermitianSDCCtrl s.random (C member),

302ElHermitianSDCCtrl s.spreadFactor (C mem-

ber), 302ElHermitianSDCCtrl s.tol (C member), 302ElHermitianSDCCtrlDefault d (C function),

302ElHermitianSDCCtrlDefault s (C function),

302ElHermitianSign c (C function), 340ElHermitianSign d (C function), 340ElHermitianSign s (C function), 340ElHermitianSign z (C function), 340ElHermitianSignDecomp c (C function), 340ElHermitianSignDecomp d (C function), 340ElHermitianSignDecomp s (C function), 340ElHermitianSignDecomp z (C function), 340ElHermitianSignDecompDist c (C function),

340ElHermitianSignDecompDist d (C function),

340ElHermitianSignDecompDist s (C function),

340

Index 557

Page 562: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHermitianSignDecompDist z (C function),340

ElHermitianSignDist c (C function), 340ElHermitianSignDist d (C function), 340ElHermitianSignDist s (C function), 340ElHermitianSignDist z (C function), 340ElHermitianSingularValues c (C function),

310ElHermitianSingularValues d (C function),

310ElHermitianSingularValues s (C function),

310ElHermitianSingularValues z (C function),

310ElHermitianSingularValuesDist c (C func-

tion), 310ElHermitianSingularValuesDist d (C func-

tion), 310ElHermitianSingularValuesDist s (C func-

tion), 310ElHermitianSingularValuesDist z (C func-

tion), 310ElHermitianSolve c (C function), 372ElHermitianSolve z (C function), 373ElHermitianSolveDist c (C function), 372ElHermitianSolveDist z (C function), 373ElHermitianSolveDistSparse c (C function),

372ElHermitianSolveDistSparse z (C function),

373ElHermitianSolveSparse c (C function), 372ElHermitianSolveSparse z (C function), 373ElHermitianSVD c (C function), 311ElHermitianSVD d (C function), 311ElHermitianSVD s (C function), 311ElHermitianSVD z (C function), 311ElHermitianSVDDist c (C function), 311ElHermitianSVDDist d (C function), 311ElHermitianSVDDist s (C function), 311ElHermitianSVDDist z (C function), 311ElHermitianSwap c (C function), 206ElHermitianSwap z (C function), 206ElHermitianSwapDist c (C function), 206ElHermitianSwapDist z (C function), 206ElHermitianTridiag c (C function), 246ElHermitianTridiag d (C function), 245ElHermitianTridiag s (C function), 245ElHermitianTridiag z (C function), 246ElHermitianTridiagCtrl (C type), 245ElHermitianTridiagCtrlDefault (C function),

245

ElHermitianTridiagDist c (C function), 246ElHermitianTridiagDist d (C function), 245ElHermitianTridiagDist s (C function), 245ElHermitianTridiagDist z (C function), 246ElHermitianTridiagEig c (C function), 293ElHermitianTridiagEig d (C function), 293ElHermitianTridiagEig s (C function), 293ElHermitianTridiagEig z (C function), 293ElHermitianTridiagEigDist c (C function), 293ElHermitianTridiagEigDist d (C function),

293ElHermitianTridiagEigDist s (C function), 293ElHermitianTridiagEigDist z (C function), 293ElHermitianTridiagEigPair c (C function), 294ElHermitianTridiagEigPair d (C function),

294ElHermitianTridiagEigPair s (C function), 294ElHermitianTridiagEigPair z (C function), 294ElHermitianTridiagEigPairDist c (C function),

295ElHermitianTridiagEigPairDist d (C func-

tion), 295ElHermitianTridiagEigPairDist s (C function),

294ElHermitianTridiagEigPairDist z (C func-

tion), 295ElHermitianTridiagEigPairPartial c (C func-

tion), 295ElHermitianTridiagEigPairPartial d (C func-

tion), 295ElHermitianTridiagEigPairPartial s (C func-

tion), 295ElHermitianTridiagEigPairPartial z (C func-

tion), 295ElHermitianTridiagEigPairPartialDist c (C

function), 295ElHermitianTridiagEigPairPartialDist d (C

function), 295ElHermitianTridiagEigPairPartialDist s (C

function), 295ElHermitianTridiagEigPairPartialDist z (C

function), 295ElHermitianTridiagEigPartial c (C function),

293ElHermitianTridiagEigPartial d (C function),

293ElHermitianTridiagEigPartial s (C function),

293ElHermitianTridiagEigPartial z (C function),

293

558 Index

Page 563: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHermitianTridiagEigPartialDist c (C func-tion), 294

ElHermitianTridiagEigPartialDist d (C func-tion), 294

ElHermitianTridiagEigPartialDist s (C func-tion), 293

ElHermitianTridiagEigPartialDist z (C func-tion), 294

ElHermitianTridiagExplicitCondensed c (Cfunction), 246

ElHermitianTridiagExplicitCondensed d (Cfunction), 245

ElHermitianTridiagExplicitCondensed s (Cfunction), 245

ElHermitianTridiagExplicitCondensed z (Cfunction), 246

ElHermitianTridiagExplicitCondensedDist c(C function), 246

ElHermitianTridiagExplicitCondensedDist d(C function), 245

ElHermitianTridiagExplicitCondensedDist s(C function), 245

ElHermitianTridiagExplicitCondensedDist z(C function), 246

ElHermitianTridiagExplicitCondensedXDist c(C function), 246

ElHermitianTridiagExplicitCondensedXDist d(C function), 246

ElHermitianTridiagExplicitCondensedXDist s(C function), 245

ElHermitianTridiagExplicitCondensedXDist z(C function), 246

ElHermitianTridiagXDist c (C function), 246ElHermitianTridiagXDist d (C function), 245ElHermitianTridiagXDist s (C function), 245ElHermitianTridiagXDist z (C function), 246ElHermitianTwoNorm c (C function), 361ElHermitianTwoNorm z (C function), 361ElHermitianTwoNormDist c (C function), 361ElHermitianTwoNormDist z (C function), 362ElHermitianTwoNormEstimate c (C func-

tion), 363ElHermitianTwoNormEstimate z (C func-

tion), 363ElHermitianTwoNormEstimateDist c (C func-

tion), 363ElHermitianTwoNormEstimateDist z (C

function), 363ElHermitianUniformSpectrum c (C function),

514

ElHermitianUniformSpectrum d (C function),514

ElHermitianUniformSpectrum s (C function),514

ElHermitianUniformSpectrum z (C function),514

ElHermitianUniformSpectrumDist c (C func-tion), 514

ElHermitianUniformSpectrumDist d (C func-tion), 514

ElHermitianUniformSpectrumDist s (C func-tion), 514

ElHermitianUniformSpectrumDist z (C func-tion), 514

ElHessenberg c (C function), 249ElHessenberg d (C function), 249ElHessenberg s (C function), 248ElHessenberg z (C function), 249ElHessenbergDist c (C function), 249ElHessenbergDist d (C function), 249ElHessenbergDist s (C function), 248ElHessenbergDist z (C function), 249ElHessenbergExplicitCondensed c (C func-

tion), 249ElHessenbergExplicitCondensed d (C func-

tion), 249ElHessenbergExplicitCondensed s (C func-

tion), 248ElHessenbergExplicitCondensed z (C func-

tion), 249ElHessenbergExplicitCondensedDist c (C

function), 249ElHessenbergExplicitCondensedDist d (C

function), 249ElHessenbergExplicitCondensedDist s (C

function), 248ElHessenbergExplicitCondensedDist z (C

function), 249ElHilbert c (C function), 491ElHilbert d (C function), 491ElHilbert s (C function), 491ElHilbert z (C function), 491ElHilbertDist c (C function), 491ElHilbertDist d (C function), 491ElHilbertDist s (C function), 491ElHilbertDist z (C function), 491ElHilbertSchmidt c (C function), 187ElHilbertSchmidt d (C function), 187ElHilbertSchmidt i (C function), 187ElHilbertSchmidt s (C function), 187ElHilbertSchmidt z (C function), 187

Index 559

Page 564: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElHilbertSchmidtDist c (C function), 187ElHilbertSchmidtDist d (C function), 187ElHilbertSchmidtDist i (C function), 187ElHilbertSchmidtDist s (C function), 187ElHilbertSchmidtDist z (C function), 187ElHingeLossProx d (C function), 440ElHingeLossProx s (C function), 440ElHingeLossProxDist d (C function), 440ElHingeLossProxDist s (C function), 440ElHPDDeterminant c (C function), 346ElHPDDeterminant d (C function), 346ElHPDDeterminant s (C function), 346ElHPDDeterminant z (C function), 346ElHPDDeterminantDist c (C function), 346ElHPDDeterminantDist d (C function), 346ElHPDDeterminantDist s (C function), 346ElHPDDeterminantDist z (C function), 346ElHPDInverse c (C function), 332ElHPDInverse d (C function), 332ElHPDInverse s (C function), 332ElHPDInverse z (C function), 332ElHPDInverseDist c (C function), 332ElHPDInverseDist d (C function), 332ElHPDInverseDist s (C function), 332ElHPDInverseDist z (C function), 332ElHPDSafeDeterminant c (C function), 347ElHPDSafeDeterminant d (C function), 347ElHPDSafeDeterminant s (C function), 347ElHPDSafeDeterminant z (C function), 347ElHPDSafeDeterminantDist c (C function),

347ElHPDSafeDeterminantDist d (C function),

347ElHPDSafeDeterminantDist s (C function),

347ElHPDSafeDeterminantDist z (C function),

347ElHPDSolve c (C function), 374ElHPDSolve d (C function), 374ElHPDSolve s (C function), 374ElHPDSolve z (C function), 374ElHPDSolveDist c (C function), 374ElHPDSolveDist d (C function), 374ElHPDSolveDist s (C function), 374ElHPDSolveDist z (C function), 374ElHPDSolveDistSparse c (C function), 374ElHPDSolveDistSparse d (C function), 374ElHPDSolveDistSparse s (C function), 374ElHPDSolveDistSparse z (C function), 375ElHPDSolveSparse c (C function), 374ElHPDSolveSparse d (C function), 374

ElHPDSolveSparse s (C function), 374ElHPDSolveSparse z (C function), 375ElHPSDCholesky c (C function), 256ElHPSDCholesky d (C function), 256ElHPSDCholesky s (C function), 255ElHPSDCholesky z (C function), 256ElHPSDCholeskyDist c (C function), 256ElHPSDCholeskyDist d (C function), 256ElHPSDCholeskyDist s (C function), 255ElHPSDCholeskyDist z (C function), 256ElHPSDSquareRoot c (C function), 337ElHPSDSquareRoot d (C function), 337ElHPSDSquareRoot s (C function), 337ElHPSDSquareRoot z (C function), 337ElHPSDSquareRootDist c (C function), 337ElHPSDSquareRootDist d (C function), 337ElHPSDSquareRootDist s (C function), 337ElHPSDSquareRootDist z (C function), 337ElID c (C function), 291ElID d (C function), 291ElID s (C function), 291ElID z (C function), 291ElIDDist c (C function), 291ElIDDist d (C function), 291ElIDDist s (C function), 291ElIDDist z (C function), 291ElIdentity c (C function), 491ElIdentity d (C function), 491ElIdentity i (C function), 491ElIdentity s (C function), 491ElIdentity z (C function), 491ElIdentityDist c (C function), 492ElIdentityDist d (C function), 492ElIdentityDist i (C function), 492ElIdentityDist s (C function), 492ElIdentityDist z (C function), 492ElImplicitHaar c (C function), 512ElImplicitHaar d (C function), 512ElImplicitHaar s (C function), 512ElImplicitHaar z (C function), 512ElImplicitHaarDist c (C function), 512ElImplicitHaarDist d (C function), 512ElImplicitHaarDist s (C function), 512ElImplicitHaarDist z (C function), 512ElIndexDependentFill c (C function), 188ElIndexDependentFill d (C function), 188ElIndexDependentFill i (C function), 188ElIndexDependentFill s (C function), 188ElIndexDependentFill z (C function), 188ElIndexDependentFillDist c (C function), 188ElIndexDependentFillDist d (C function), 188

560 Index

Page 565: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElIndexDependentFillDist i (C function), 188ElIndexDependentFillDist s (C function), 188ElIndexDependentFillDist z (C function), 188ElIndexDependentMap c (C function), 189ElIndexDependentMap d (C function), 188ElIndexDependentMap i (C function), 188ElIndexDependentMap s (C function), 188ElIndexDependentMap z (C function), 189ElIndexDependentMapDist c (C function),

189ElIndexDependentMapDist d (C function),

189ElIndexDependentMapDist i (C function),

189ElIndexDependentMapDist s (C function),

189ElIndexDependentMapDist z (C function),

189ElInertia c (C function), 348ElInertia d (C function), 348ElInertia s (C function), 348ElInertia z (C function), 348ElInertiaAfterLDL c (C function), 265ElInertiaAfterLDL d (C function), 265ElInertiaAfterLDL s (C function), 265ElInertiaAfterLDL z (C function), 265ElInertiaAfterLDLDist c (C function), 265ElInertiaAfterLDLDist d (C function), 265ElInertiaAfterLDLDist s (C function), 265ElInertiaAfterLDLDist z (C function), 265ElInertiaDist c (C function), 348ElInertiaDist d (C function), 348ElInertiaDist s (C function), 348ElInertiaDist z (C function), 348ElInertiaType (C type), 348ElInertiaType.numNegative (C member), 348ElInertiaType.numPositive (C member), 348ElInertiaType.numZero (C member), 348ElInfinityCondition c (C function), 341ElInfinityCondition d (C function), 341ElInfinityCondition s (C function), 341ElInfinityCondition z (C function), 341ElInfinityConditionDist c (C function), 341ElInfinityConditionDist d (C function), 341ElInfinityConditionDist s (C function), 341ElInfinityConditionDist z (C function), 341ElInfinityNorm c (C function), 355ElInfinityNorm d (C function), 355ElInfinityNorm s (C function), 355ElInfinityNorm z (C function), 355ElInfinityNormDist c (C function), 355

ElInfinityNormDist d (C function), 355ElInfinityNormDist s (C function), 355ElInfinityNormDist z (C function), 355ElInitialize (C function), 35ElInitialized (C function), 36ElInt (C type), 41ElInverse c (C function), 329ElInverse d (C function), 329ElInverse s (C function), 329ElInverse z (C function), 329ElInverseDist c (C function), 329ElInverseDist d (C function), 329ElInverseDist s (C function), 329ElInverseDist z (C function), 329ElJordan c (C function), 492ElJordan d (C function), 492ElJordan i (C function), 492ElJordan s (C function), 492ElJordan z (C function), 492ElJordanDist c (C function), 492ElJordanDist d (C function), 492ElJordanDist i (C function), 492ElJordanDist s (C function), 492ElJordanDist z (C function), 492ElKahan c (C function), 493ElKahan d (C function), 493ElKahan s (C function), 493ElKahan z (C function), 493ElKahanDist c (C function), 493ElKahanDist d (C function), 493ElKahanDist s (C function), 493ElKahanDist z (C function), 493ElKMS c (C function), 494ElKMS d (C function), 494ElKMS i (C function), 494ElKMS s (C function), 494ElKMS z (C function), 494ElKMSDist c (C function), 494ElKMSDist d (C function), 494ElKMSDist i (C function), 494ElKMSDist s (C function), 494ElKMSDist z (C function), 494ElKyFanNorm c (C function), 354ElKyFanNorm d (C function), 354ElKyFanNorm s (C function), 354ElKyFanNorm z (C function), 354ElKyFanNormDist c (C function), 354ElKyFanNormDist d (C function), 354ElKyFanNormDist s (C function), 354ElKyFanNormDist z (C function), 354ElLaplacian1D c (C function), 494

Index 561

Page 566: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLaplacian1D d (C function), 494ElLaplacian1D s (C function), 494ElLaplacian1D z (C function), 494ElLaplacian1DDist c (C function), 494ElLaplacian1DDist d (C function), 494ElLaplacian1DDist s (C function), 494ElLaplacian1DDist z (C function), 495ElLaplacian2D c (C function), 495ElLaplacian2D d (C function), 495ElLaplacian2D s (C function), 495ElLaplacian2D z (C function), 495ElLaplacian2DDist c (C function), 495ElLaplacian2DDist d (C function), 495ElLaplacian2DDist s (C function), 495ElLaplacian2DDist z (C function), 495ElLauchli c (C function), 495ElLauchli d (C function), 495ElLauchli i (C function), 495ElLauchli s (C function), 495ElLauchli z (C function), 495ElLauchliDist c (C function), 496ElLauchliDist d (C function), 495ElLauchliDist i (C function), 495ElLauchliDist s (C function), 495ElLauchliDist z (C function), 496ElLAV d (C function), 427ElLAV s (C function), 427ElLAVDist d (C function), 427ElLAVDist s (C function), 427ElLAVDistSparse d (C function), 427ElLAVDistSparse s (C function), 427ElLAVSparse d (C function), 427ElLAVSparse s (C function), 427ElLAVX d (C function), 427ElLAVX s (C function), 427ElLAVXDist d (C function), 427ElLAVXDist s (C function), 427ElLAVXDistSparse d (C function), 427ElLAVXDistSparse s (C function), 427ElLAVXSparse d (C function), 427ElLAVXSparse s (C function), 427ElLDLH c (C function), 266ElLDLH z (C function), 266ElLDLHDist c (C function), 266ElLDLHDist z (C function), 266ElLDLPiv c (C function), 262ElLDLPiv d (C function), 262ElLDLPiv s (C function), 261ElLDLPiv z (C function), 262ElLDLPivDist c (C function), 262ElLDLPivDist d (C function), 262

ElLDLPivDist s (C function), 262ElLDLPivDist z (C function), 262ElLDLPivot (C type), 261ElLDLPivot.nb (C member), 261ElLDLPivotCtrl d (C type), 261ElLDLPivotCtrl d.gamma (C member), 261ElLDLPivotCtrl d.pivotType (C member), 261ElLDLPivotCtrl s (C type), 261ElLDLPivotCtrl s.gamma (C member), 261ElLDLPivotCtrl s.pivotType (C member), 261ElLDLPivotType (C type), 261ElLDLT c (C function), 266ElLDLT d (C function), 266ElLDLT s (C function), 266ElLDLT z (C function), 266ElLDLTDist c (C function), 266ElLDLTDist d (C function), 266ElLDLTDist s (C function), 266ElLDLTDist z (C function), 266ElLeastSquares c (C function), 378ElLeastSquares d (C function), 378ElLeastSquares s (C function), 378ElLeastSquares z (C function), 379ElLeastSquaresDist c (C function), 378ElLeastSquaresDist d (C function), 378ElLeastSquaresDist s (C function), 378ElLeastSquaresDist z (C function), 379ElLeastSquaresDistSparse c (C function), 378ElLeastSquaresDistSparse d (C function), 378ElLeastSquaresDistSparse s (C function), 378ElLeastSquaresDistSparse z (C function), 379ElLeastSquaresSparse c (C function), 378ElLeastSquaresSparse d (C function), 378ElLeastSquaresSparse s (C function), 378ElLeastSquaresSparse z (C function), 379ElLeastSquaresXDistSparse c (C function),

379ElLeastSquaresXDistSparse d (C function),

379ElLeastSquaresXDistSparse s (C function),

379ElLeastSquaresXDistSparse z (C function),

379ElLeastSquaresXSparse c (C function), 379ElLeastSquaresXSparse d (C function), 379ElLeastSquaresXSparse s (C function), 379ElLeastSquaresXSparse z (C function), 379ElLeftOrRight (C type), 41ElLegendre c (C function), 496ElLegendre d (C function), 496ElLegendre s (C function), 496

562 Index

Page 567: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLegendre z (C function), 496ElLegendreDist c (C function), 496ElLegendreDist d (C function), 496ElLegendreDist s (C function), 496ElLegendreDist z (C function), 496ElLehmer c (C function), 497ElLehmer d (C function), 497ElLehmer s (C function), 497ElLehmer z (C function), 497ElLehmerDist c (C function), 497ElLehmerDist d (C function), 497ElLehmerDist s (C function), 497ElLehmerDist z (C function), 497ElLinearSolve c (C function), 368ElLinearSolve d (C function), 368ElLinearSolve s (C function), 367ElLinearSolve z (C function), 368ElLinearSolveDist c (C function), 368ElLinearSolveDist d (C function), 368ElLinearSolveDist s (C function), 367ElLinearSolveDist z (C function), 368ElLinearSolveDistSparse c (C function), 368ElLinearSolveDistSparse d (C function), 368ElLinearSolveDistSparse s (C function), 368ElLinearSolveDistSparse z (C function), 368ElLinearSolveSparse c (C function), 368ElLinearSolveSparse d (C function), 368ElLinearSolveSparse s (C function), 367ElLinearSolveSparse z (C function), 368ElLinearSolveXDistSparse c (C function), 368ElLinearSolveXDistSparse d (C function), 368ElLinearSolveXDistSparse s (C function), 368ElLinearSolveXDistSparse z (C function), 369ElLinearSolveXSparse c (C function), 368ElLinearSolveXSparse d (C function), 368ElLinearSolveXSparse s (C function), 368ElLinearSolveXSparse z (C function), 369ElLockedMerge1x2 c (C function), 140ElLockedMerge1x2 d (C function), 140ElLockedMerge1x2 i (C function), 140ElLockedMerge1x2 s (C function), 140ElLockedMerge1x2 z (C function), 140ElLockedMerge1x2Dist c (C function), 140ElLockedMerge1x2Dist d (C function), 140ElLockedMerge1x2Dist i (C function), 140ElLockedMerge1x2Dist s (C function), 140ElLockedMerge1x2Dist z (C function), 140ElLockedMerge2x1 c (C function), 141ElLockedMerge2x1 d (C function), 141ElLockedMerge2x1 i (C function), 141ElLockedMerge2x1 s (C function), 141

ElLockedMerge2x1 z (C function), 141ElLockedMerge2x1Dist c (C function), 141ElLockedMerge2x1Dist d (C function), 141ElLockedMerge2x1Dist i (C function), 141ElLockedMerge2x1Dist s (C function), 141ElLockedMerge2x1Dist z (C function), 141ElLockedMerge2x2 c (C function), 143ElLockedMerge2x2 d (C function), 143ElLockedMerge2x2 i (C function), 143ElLockedMerge2x2 s (C function), 143ElLockedMerge2x2 z (C function), 143ElLockedMerge2x2Dist c (C function), 143ElLockedMerge2x2Dist d (C function), 143ElLockedMerge2x2Dist i (C function), 143ElLockedMerge2x2Dist s (C function), 143ElLockedMerge2x2Dist z (C function), 143ElLockedPartitionDown c (C function), 109ElLockedPartitionDown d (C function), 109ElLockedPartitionDown i (C function), 109ElLockedPartitionDown s (C function), 109ElLockedPartitionDown z (C function), 109ElLockedPartitionDownDiagonal c (C func-

tion), 115ElLockedPartitionDownDiagonal d (C func-

tion), 115ElLockedPartitionDownDiagonal i (C func-

tion), 114ElLockedPartitionDownDiagonal s (C func-

tion), 115ElLockedPartitionDownDiagonal z (C func-

tion), 115ElLockedPartitionDownDiagonalDist c (C

function), 115ElLockedPartitionDownDiagonalDist d (C

function), 115ElLockedPartitionDownDiagonalDist i (C

function), 115ElLockedPartitionDownDiagonalDist s (C

function), 115ElLockedPartitionDownDiagonalDist z (C

function), 115ElLockedPartitionDownDist c (C function),

109ElLockedPartitionDownDist d (C function),

109ElLockedPartitionDownDist i (C function),

109ElLockedPartitionDownDist s (C function),

109ElLockedPartitionDownDist z (C function),

109

Index 563

Page 568: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLockedPartitionDownOffsetDiagonal c (Cfunction), 117

ElLockedPartitionDownOffsetDiagonal d (Cfunction), 117

ElLockedPartitionDownOffsetDiagonal i (Cfunction), 117

ElLockedPartitionDownOffsetDiagonal s (Cfunction), 117

ElLockedPartitionDownOffsetDiagonal z (Cfunction), 117

ElLockedPartitionDownOffsetDiagonalDist c(C function), 118

ElLockedPartitionDownOffsetDiagonalDist d(C function), 118

ElLockedPartitionDownOffsetDiagonalDist i(C function), 117

ElLockedPartitionDownOffsetDiagonalDist s(C function), 117

ElLockedPartitionDownOffsetDiagonalDist z(C function), 118

ElLockedPartitionLeft c (C function), 113ElLockedPartitionLeft d (C function), 113ElLockedPartitionLeft i (C function), 113ElLockedPartitionLeft s (C function), 113ElLockedPartitionLeft z (C function), 113ElLockedPartitionLeftDist c (C function), 113ElLockedPartitionLeftDist d (C function), 113ElLockedPartitionLeftDist i (C function), 113ElLockedPartitionLeftDist s (C function), 113ElLockedPartitionLeftDist z (C function), 113ElLockedPartitionRight c (C function), 112ElLockedPartitionRight d (C function), 112ElLockedPartitionRight i (C function), 111ElLockedPartitionRight s (C function), 111ElLockedPartitionRight z (C function), 112ElLockedPartitionRightDist c (C function),

112ElLockedPartitionRightDist d (C function),

112ElLockedPartitionRightDist i (C function),

112ElLockedPartitionRightDist s (C function),

112ElLockedPartitionRightDist z (C function),

112ElLockedPartitionUp c (C function), 110ElLockedPartitionUp d (C function), 110ElLockedPartitionUp i (C function), 110ElLockedPartitionUp s (C function), 110ElLockedPartitionUp z (C function), 110

ElLockedPartitionUpDiagonal c (C function),119

ElLockedPartitionUpDiagonal d (C function),119

ElLockedPartitionUpDiagonal i (C function),119

ElLockedPartitionUpDiagonal s (C function),119

ElLockedPartitionUpDiagonal z (C function),119

ElLockedPartitionUpDiagonalDist c (C func-tion), 120

ElLockedPartitionUpDiagonalDist d (C func-tion), 120

ElLockedPartitionUpDiagonalDist i (C func-tion), 119

ElLockedPartitionUpDiagonalDist s (C func-tion), 120

ElLockedPartitionUpDiagonalDist z (C func-tion), 120

ElLockedPartitionUpDist c (C function), 110ElLockedPartitionUpDist d (C function), 110ElLockedPartitionUpDist i (C function), 110ElLockedPartitionUpDist s (C function), 110ElLockedPartitionUpDist z (C function), 110ElLockedPartitionUpOffsetDiagonal c (C

function), 122ElLockedPartitionUpOffsetDiagonal d (C

function), 122ElLockedPartitionUpOffsetDiagonal i (C

function), 121ElLockedPartitionUpOffsetDiagonal s (C

function), 122ElLockedPartitionUpOffsetDiagonal z (C

function), 122ElLockedPartitionUpOffsetDiagonalDist c (C

function), 122ElLockedPartitionUpOffsetDiagonalDist d (C

function), 122ElLockedPartitionUpOffsetDiagonalDist i (C

function), 122ElLockedPartitionUpOffsetDiagonalDist s (C

function), 122ElLockedPartitionUpOffsetDiagonalDist z (C

function), 122ElLockedRepartitionDown c (C function), 124ElLockedRepartitionDown d (C function),

124ElLockedRepartitionDown i (C function), 124ElLockedRepartitionDown s (C function), 124ElLockedRepartitionDown z (C function), 124

564 Index

Page 569: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLockedRepartitionDownDiagonal c (Cfunction), 133

ElLockedRepartitionDownDiagonal d (Cfunction), 133

ElLockedRepartitionDownDiagonal i (Cfunction), 133

ElLockedRepartitionDownDiagonal s (Cfunction), 133

ElLockedRepartitionDownDiagonal z (Cfunction), 133

ElLockedRepartitionDownDiagonalDist c (Cfunction), 134

ElLockedRepartitionDownDiagonalDist d (Cfunction), 134

ElLockedRepartitionDownDiagonalDist i (Cfunction), 134

ElLockedRepartitionDownDiagonalDist s (Cfunction), 134

ElLockedRepartitionDownDiagonalDist z (Cfunction), 134

ElLockedRepartitionDownDist c (C function),124

ElLockedRepartitionDownDist d (C func-tion), 124

ElLockedRepartitionDownDist i (C function),124

ElLockedRepartitionDownDist s (C function),124

ElLockedRepartitionDownDist z (C func-tion), 124

ElLockedRepartitionLeft c (C function), 130ElLockedRepartitionLeft d (C function), 130ElLockedRepartitionLeft i (C function), 129ElLockedRepartitionLeft s (C function), 130ElLockedRepartitionLeft z (C function), 130ElLockedRepartitionLeftDist c (C function),

130ElLockedRepartitionLeftDist d (C function),

130ElLockedRepartitionLeftDist i (C function),

130ElLockedRepartitionLeftDist s (C function),

130ElLockedRepartitionLeftDist z (C function),

130ElLockedRepartitionRight c (C function), 128ElLockedRepartitionRight d (C function), 128ElLockedRepartitionRight i (C function), 128ElLockedRepartitionRight s (C function), 128ElLockedRepartitionRight z (C function), 128

ElLockedRepartitionRightDist c (C function),128

ElLockedRepartitionRightDist d (C function),128

ElLockedRepartitionRightDist i (C function),128

ElLockedRepartitionRightDist s (C function),128

ElLockedRepartitionRightDist z (C function),128

ElLockedRepartitionUp c (C function), 126ElLockedRepartitionUp d (C function), 126ElLockedRepartitionUp i (C function), 126ElLockedRepartitionUp s (C function), 126ElLockedRepartitionUp z (C function), 126ElLockedRepartitionUpDiagonal c (C func-

tion), 137ElLockedRepartitionUpDiagonal d (C func-

tion), 137ElLockedRepartitionUpDiagonal i (C func-

tion), 137ElLockedRepartitionUpDiagonal s (C func-

tion), 137ElLockedRepartitionUpDiagonal z (C func-

tion), 137ElLockedRepartitionUpDiagonalDist c (C

function), 138ElLockedRepartitionUpDiagonalDist d (C

function), 138ElLockedRepartitionUpDiagonalDist i (C

function), 137ElLockedRepartitionUpDiagonalDist s (C

function), 138ElLockedRepartitionUpDiagonalDist z (C

function), 138ElLockedRepartitionUpDist c (C function),

126ElLockedRepartitionUpDist d (C function),

126ElLockedRepartitionUpDist i (C function),

126ElLockedRepartitionUpDist s (C function),

126ElLockedRepartitionUpDist z (C function),

126ElLockedView c (C function), 103ElLockedView d (C function), 103ElLockedView i (C function), 103ElLockedView s (C function), 103ElLockedView z (C function), 103ElLockedViewDist c (C function), 104

Index 565

Page 570: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLockedViewDist d (C function), 103ElLockedViewDist i (C function), 103ElLockedViewDist s (C function), 103ElLockedViewDist z (C function), 104ElLockedViewFull c (C function), 106ElLockedViewFull d (C function), 106ElLockedViewFull i (C function), 106ElLockedViewFull s (C function), 106ElLockedViewFull z (C function), 106ElLockedViewFullDist c (C function), 106ElLockedViewFullDist d (C function), 106ElLockedViewFullDist i (C function), 106ElLockedViewFullDist s (C function), 106ElLockedViewFullDist z (C function), 106ElLockedViewOffset c (C function), 105ElLockedViewOffset d (C function), 105ElLockedViewOffset i (C function), 105ElLockedViewOffset s (C function), 105ElLockedViewOffset z (C function), 105ElLockedViewOffsetDist c (C function), 105ElLockedViewOffsetDist d (C function), 105ElLockedViewOffsetDist i (C function), 105ElLockedViewOffsetDist s (C function), 105ElLockedViewOffsetDist z (C function), 105ElLog c (C function), 49ElLog d (C function), 49ElLog s (C function), 49ElLog z (C function), 49ElLogBarrier c (C function), 463ElLogBarrier d (C function), 463ElLogBarrier s (C function), 463ElLogBarrier z (C function), 463ElLogBarrierDist c (C function), 463ElLogBarrierDist d (C function), 463ElLogBarrierDist s (C function), 463ElLogBarrierDist z (C function), 463ElLogDetDiv c (C function), 464ElLogDetDiv d (C function), 464ElLogDetDiv s (C function), 464ElLogDetDiv z (C function), 464ElLogDetDivDist c (C function), 464ElLogDetDivDist d (C function), 464ElLogDetDivDist s (C function), 464ElLogDetDivDist z (C function), 464ElLogisticProx d (C function), 441ElLogisticProx s (C function), 441ElLogisticProxDist d (C function), 441ElLogisticProxDist s (C function), 441ElLogisticRegression d (C function), 428ElLogisticRegression s (C function), 428ElLogisticRegressionDist d (C function), 428

ElLogisticRegressionDist s (C function), 428ElLotkin c (C function), 498ElLotkin d (C function), 498ElLotkin s (C function), 498ElLotkin z (C function), 498ElLotkinDist c (C function), 498ElLotkinDist d (C function), 498ElLotkinDist s (C function), 498ElLotkinDist z (C function), 498ElLowerClip d (C function), 439ElLowerClip s (C function), 439ElLowerClipDist d (C function), 439ElLowerClipDist s (C function), 439ElLPAffine d (C function), 402ElLPAffine s (C function), 402ElLPAffineDist d (C function), 402ElLPAffineDist s (C function), 402ElLPAffineDistSparse d (C function), 402ElLPAffineDistSparse s (C function), 402ElLPAffineSparse d (C function), 402ElLPAffineSparse s (C function), 402ElLPAffineX d (C function), 403ElLPAffineX s (C function), 403ElLPAffineXDist d (C function), 403ElLPAffineXDist s (C function), 403ElLPAffineXDistSparse d (C function), 403ElLPAffineXDistSparse s (C function), 403ElLPAffineXSparse d (C function), 403ElLPAffineXSparse s (C function), 403ElLPDirect d (C function), 400ElLPDirect s (C function), 400ElLPDirectDist d (C function), 400ElLPDirectDist s (C function), 400ElLPDirectDistSparse d (C function), 400ElLPDirectDistSparse s (C function), 400ElLPDirectSparse d (C function), 400ElLPDirectSparse s (C function), 400ElLPDirectX d (C function), 401ElLPDirectX s (C function), 401ElLPDirectXDist d (C function), 401ElLPDirectXDist s (C function), 401ElLPDirectXDistSparse d (C function), 401ElLPDirectXDistSparse s (C function), 401ElLPDirectXSparse d (C function), 401ElLPDirectXSparse s (C function), 401ElLQ c (C function), 274ElLQ d (C function), 274ElLQ s (C function), 274ElLQ z (C function), 274ElLQDist c (C function), 274ElLQDist d (C function), 274

566 Index

Page 571: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElLQDist s (C function), 274ElLQDist z (C function), 274ElLQExplicit c (C function), 274ElLQExplicit d (C function), 274ElLQExplicit s (C function), 274ElLQExplicit z (C function), 274ElLQExplicitDist c (C function), 274ElLQExplicitDist d (C function), 274ElLQExplicitDist s (C function), 274ElLQExplicitDist z (C function), 274ElLQExplicitTriang c (C function), 275ElLQExplicitTriang d (C function), 275ElLQExplicitTriang s (C function), 275ElLQExplicitTriang z (C function), 275ElLQExplicitTriangDist c (C function), 275ElLQExplicitTriangDist d (C function), 275ElLQExplicitTriangDist s (C function), 275ElLQExplicitTriangDist z (C function), 275ElLQExplicitUnitary c (C function), 275ElLQExplicitUnitary d (C function), 275ElLQExplicitUnitary s (C function), 275ElLQExplicitUnitary z (C function), 275ElLQExplicitUnitaryDist c (C function), 275ElLQExplicitUnitaryDist d (C function), 275ElLQExplicitUnitaryDist s (C function), 275ElLQExplicitUnitaryDist z (C function), 275ElLSE c (C function), 390ElLSE d (C function), 390ElLSE s (C function), 389ElLSE z (C function), 390ElLSEDist c (C function), 390ElLSEDist d (C function), 390ElLSEDist s (C function), 389ElLSEDist z (C function), 390ElLSEDistSparse c (C function), 390ElLSEDistSparse d (C function), 390ElLSEDistSparse s (C function), 390ElLSEDistSparse z (C function), 390ElLSESparse c (C function), 390ElLSESparse d (C function), 390ElLSESparse s (C function), 389ElLSESparse z (C function), 390ElLSEXDistSparse c (C function), 391ElLSEXDistSparse d (C function), 391ElLSEXDistSparse s (C function), 390ElLSEXDistSparse z (C function), 391ElLSEXSparse c (C function), 391ElLSEXSparse d (C function), 391ElLSEXSparse s (C function), 390ElLSEXSparse z (C function), 391ElLU c (C function), 272

ElLU d (C function), 272ElLU s (C function), 272ElLU z (C function), 272ElLUDist c (C function), 272ElLUDist d (C function), 272ElLUDist s (C function), 272ElLUDist z (C function), 272ElLUFullPiv c (C function), 270ElLUFullPiv d (C function), 270ElLUFullPiv s (C function), 270ElLUFullPiv z (C function), 270ElLUFullPivDist c (C function), 270ElLUFullPivDist d (C function), 270ElLUFullPivDist s (C function), 270ElLUFullPivDist z (C function), 271ElLUMod c (C function), 273ElLUMod d (C function), 273ElLUMod s (C function), 273ElLUMod z (C function), 273ElLUModDist c (C function), 273ElLUModDist d (C function), 273ElLUModDist s (C function), 273ElLUModDist z (C function), 273ElLUPartialPiv c (C function), 269ElLUPartialPiv d (C function), 269ElLUPartialPiv s (C function), 269ElLUPartialPiv z (C function), 269ElLUPartialPivDist c (C function), 269ElLUPartialPivDist d (C function), 269ElLUPartialPivDist s (C function), 269ElLUPartialPivDist z (C function), 269ElLyapunov c (C function), 467ElLyapunov d (C function), 467ElLyapunov s (C function), 467ElLyapunov z (C function), 468ElLyapunovDist c (C function), 467ElLyapunovDist d (C function), 467ElLyapunovDist s (C function), 467ElLyapunovDist z (C function), 468ElMakeTrapezoidal c (C function), 189ElMakeTrapezoidal d (C function), 189ElMakeTrapezoidal i (C function), 189ElMakeTrapezoidal s (C function), 189ElMakeTrapezoidal z (C function), 189ElMakeTrapezoidalDist c (C function), 189ElMakeTrapezoidalDist d (C function), 189ElMakeTrapezoidalDist i (C function), 189ElMakeTrapezoidalDist s (C function), 189ElMakeTrapezoidalDist z (C function), 189ElMakeTrapezoidalDistSparse c (C function),

190

Index 567

Page 572: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElMakeTrapezoidalDistSparse d (C function),190

ElMakeTrapezoidalDistSparse i (C function),190

ElMakeTrapezoidalDistSparse s (C function),190

ElMakeTrapezoidalDistSparse z (C function),190

ElMakeTrapezoidalSparse c (C function), 190ElMakeTrapezoidalSparse d (C function), 190ElMakeTrapezoidalSparse i (C function), 190ElMakeTrapezoidalSparse s (C function), 190ElMakeTrapezoidalSparse z (C function), 190ElMax d (C function), 191ElMax i (C function), 191ElMax s (C function), 191ElMaxAbs c (C function), 192ElMaxAbs d (C function), 192ElMaxAbs i (C function), 192ElMaxAbs s (C function), 192ElMaxAbs z (C function), 192ElMaxAbsDist c (C function), 192ElMaxAbsDist d (C function), 192ElMaxAbsDist i (C function), 192ElMaxAbsDist s (C function), 192ElMaxAbsDist z (C function), 192ElMaxCondition c (C function), 342ElMaxCondition d (C function), 342ElMaxCondition s (C function), 342ElMaxCondition z (C function), 342ElMaxConditionDist c (C function), 342ElMaxConditionDist d (C function), 342ElMaxConditionDist s (C function), 342ElMaxConditionDist z (C function), 342ElMaxDist d (C function), 191ElMaxDist i (C function), 191ElMaxDist s (C function), 191ElMaxNorm c (C function), 356ElMaxNorm d (C function), 356ElMaxNorm i (C function), 356ElMaxNorm s (C function), 356ElMaxNorm z (C function), 356ElMaxNormDist c (C function), 357ElMaxNormDist d (C function), 357ElMaxNormDist i (C function), 356ElMaxNormDist s (C function), 357ElMaxNormDist z (C function), 357ElMerge1x2 c (C function), 139ElMerge1x2 d (C function), 139ElMerge1x2 i (C function), 139ElMerge1x2 s (C function), 139

ElMerge1x2 z (C function), 139ElMerge1x2Dist c (C function), 140ElMerge1x2Dist d (C function), 140ElMerge1x2Dist i (C function), 139ElMerge1x2Dist s (C function), 139ElMerge1x2Dist z (C function), 140ElMerge2x1 c (C function), 141ElMerge2x1 d (C function), 141ElMerge2x1 i (C function), 141ElMerge2x1 s (C function), 141ElMerge2x1 z (C function), 141ElMerge2x1Dist c (C function), 141ElMerge2x1Dist d (C function), 141ElMerge2x1Dist i (C function), 141ElMerge2x1Dist s (C function), 141ElMerge2x1Dist z (C function), 141ElMerge2x2 c (C function), 142ElMerge2x2 d (C function), 142ElMerge2x2 i (C function), 142ElMerge2x2 s (C function), 142ElMerge2x2 z (C function), 142ElMerge2x2Dist c (C function), 142ElMerge2x2Dist d (C function), 142ElMerge2x2Dist i (C function), 142ElMerge2x2Dist s (C function), 142ElMerge2x2Dist z (C function), 143ElMin d (C function), 193ElMin i (C function), 193ElMin s (C function), 193ElMinAbs c (C function), 194ElMinAbs d (C function), 194ElMinAbs i (C function), 194ElMinAbs s (C function), 194ElMinAbs z (C function), 194ElMinAbsDist c (C function), 195ElMinAbsDist d (C function), 194ElMinAbsDist i (C function), 194ElMinAbsDist s (C function), 194ElMinAbsDist z (C function), 195ElMinDist d (C function), 193ElMinDist i (C function), 193ElMinDist s (C function), 193ELMinIJ c (C function), 498ELMinIJ d (C function), 498ELMinIJ i (C function), 498ELMinIJ s (C function), 498ELMinIJ z (C function), 498ELMinIJDist c (C function), 498ELMinIJDist d (C function), 498ELMinIJDist i (C function), 498ELMinIJDist s (C function), 498

568 Index

Page 573: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ELMinIJDist z (C function), 498ElModelFit d (C function), 429ElModelFit s (C function), 429ElModelFitDist d (C function), 429ElModelFitDist s (C function), 429ElMultiplyAfterLDL c (C function), 268ElMultiplyAfterLDL d (C function), 268ElMultiplyAfterLDL s (C function), 268ElMultiplyAfterLDL z (C function), 268ElMultiplyAfterLDLDist c (C function), 268ElMultiplyAfterLDLDist d (C function), 268ElMultiplyAfterLDLDist s (C function), 268ElMultiplyAfterLDLDist z (C function), 268ElMultiplyAfterLDLPiv c (C function), 264ElMultiplyAfterLDLPiv d (C function), 264ElMultiplyAfterLDLPiv s (C function), 264ElMultiplyAfterLDLPiv z (C function), 264ElMultiplyAfterLDLPivDist c (C function),

264ElMultiplyAfterLDLPivDist d (C function),

264ElMultiplyAfterLDLPivDist s (C function),

264ElMultiplyAfterLDLPivDist z (C function),

264ElMultiShiftHessSolve c (C function), 376ElMultiShiftHessSolve d (C function), 376ElMultiShiftHessSolve s (C function), 375ElMultiShiftHessSolve z (C function), 376ElMultiShiftHessSolveDist c (C function), 376ElMultiShiftHessSolveDist d (C function), 376ElMultiShiftHessSolveDist s (C function), 376ElMultiShiftHessSolveDist z (C function), 376ElMultiShiftQuasiTrsm c (C function), 226ElMultiShiftQuasiTrsm d (C function), 226ElMultiShiftQuasiTrsm s (C function), 226ElMultiShiftQuasiTrsm z (C function), 226ElMultiShiftQuasiTrsmDist c (C function),

226ElMultiShiftQuasiTrsmDist d (C function),

226ElMultiShiftQuasiTrsmDist s (C function),

226ElMultiShiftQuasiTrsmDist z (C function),

226ElMultiShiftTrsm c (C function), 228ElMultiShiftTrsm d (C function), 228ElMultiShiftTrsm s (C function), 227ElMultiShiftTrsm z (C function), 228ElMultiShiftTrsmDist c (C function), 228ElMultiShiftTrsmDist d (C function), 228

ElMultiShiftTrsmDist s (C function), 228ElMultiShiftTrsmDist z (C function), 228ElNMF d (C function), 430ElNMF s (C function), 430ElNMFDist d (C function), 430ElNMFDist s (C function), 430ElNMFX d (C function), 430ElNMFX s (C function), 430ElNMFXDist d (C function), 430ElNMFXDist s (C function), 430ElNNLS d (C function), 432ElNNLS s (C function), 431ElNNLSDist d (C function), 432ElNNLSDist s (C function), 431ElNNLSDistSparse d (C function), 432ElNNLSDistSparse s (C function), 431ElNNLSSparse d (C function), 432ElNNLSSparse s (C function), 431ElNNLSX d (C function), 432ElNNLSX s (C function), 432ElNNLSXDist d (C function), 432ElNNLSXDist s (C function), 432ElNNLSXDistSparse d (C function), 432ElNNLSXDistSparse s (C function), 432ElNNLSXSparse d (C function), 432ElNNLSXSparse s (C function), 432ElNorm c (C function), 364ElNorm d (C function), 364ElNorm s (C function), 364ElNorm z (C function), 364ElNormalFromEVD c (C function), 499ElNormalFromEVD z (C function), 499ElNormalFromEVDDist c (C function), 499ElNormalFromEVDDist z (C function), 499ElNormalUniformSpectrum c (C function),

514ElNormalUniformSpectrum z (C function),

514ElNormalUniformSpectrumDist c (C func-

tion), 515ElNormalUniformSpectrumDist z (C func-

tion), 515ElNormDist c (C function), 364ElNormDist d (C function), 364ElNormDist s (C function), 364ElNormDist z (C function), 364ElNormType (C type), 41ElNrm2 c (C function), 196ElNrm2 d (C function), 196ElNrm2 s (C function), 196ElNrm2 z (C function), 196

Index 569

Page 574: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElNrm2Dist c (C function), 196ElNrm2Dist d (C function), 196ElNrm2Dist s (C function), 196ElNrm2Dist z (C function), 196ElNuclearNorm c (C function), 358ElNuclearNorm d (C function), 358ElNuclearNorm s (C function), 358ElNuclearNorm z (C function), 358ElNuclearNormDist c (C function), 358ElNuclearNormDist d (C function), 358ElNuclearNormDist s (C function), 358ElNuclearNormDist z (C function), 358ElOneCondition c (C function), 342ElOneCondition d (C function), 342ElOneCondition s (C function), 342ElOneCondition z (C function), 342ElOneConditionDist c (C function), 342ElOneConditionDist d (C function), 342ElOneConditionDist s (C function), 342ElOneConditionDist z (C function), 342ElOneNorm c (C function), 359ElOneNorm d (C function), 359ElOneNorm s (C function), 359ElOneNorm z (C function), 359ElOneNormDist c (C function), 359ElOneNormDist d (C function), 359ElOneNormDist s (C function), 359ElOneNormDist z (C function), 359ElOnes c (C function), 499ElOnes d (C function), 499ElOnes i (C function), 499ElOnes s (C function), 499ElOnes z (C function), 499ElOnesDist c (C function), 500ElOnesDist d (C function), 500ElOnesDist i (C function), 500ElOnesDist s (C function), 500ElOnesDist z (C function), 500ElOneTwoOne c (C function), 500ElOneTwoOne d (C function), 500ElOneTwoOne i (C function), 500ElOneTwoOne s (C function), 500ElOneTwoOne z (C function), 500ElOneTwoOneDist c (C function), 500ElOneTwoOneDist d (C function), 500ElOneTwoOneDist i (C function), 500ElOneTwoOneDist s (C function), 500ElOneTwoOneDist z (C function), 500ElOrientation (C type), 42ElParter c (C function), 501ElParter d (C function), 501

ElParter s (C function), 501ElParter z (C function), 501ElParterDist c (C function), 501ElParterDist d (C function), 501ElParterDist s (C function), 501ElParterDist z (C function), 501ElPartitionDown c (C function), 108ElPartitionDown d (C function), 108ElPartitionDown i (C function), 108ElPartitionDown s (C function), 108ElPartitionDown z (C function), 108ElPartitionDownDiagonal c (C function), 114ElPartitionDownDiagonal d (C function), 114ElPartitionDownDiagonal i (C function), 114ElPartitionDownDiagonal s (C function), 114ElPartitionDownDiagonal z (C function), 114ElPartitionDownDiagonalDist c (C function),

114ElPartitionDownDiagonalDist d (C function),

114ElPartitionDownDiagonalDist i (C function),

114ElPartitionDownDiagonalDist s (C function),

114ElPartitionDownDiagonalDist z (C function),

114ElPartitionDownDist c (C function), 109ElPartitionDownDist d (C function), 109ElPartitionDownDist i (C function), 108ElPartitionDownDist s (C function), 108ElPartitionDownDist z (C function), 109ElPartitionDownOffsetDiagonal c (C func-

tion), 116ElPartitionDownOffsetDiagonal d (C func-

tion), 116ElPartitionDownOffsetDiagonal i (C func-

tion), 116ElPartitionDownOffsetDiagonal s (C func-

tion), 116ElPartitionDownOffsetDiagonal z (C func-

tion), 116ElPartitionDownOffsetDiagonalDist c (C

function), 117ElPartitionDownOffsetDiagonalDist d (C

function), 117ElPartitionDownOffsetDiagonalDist i (C

function), 117ElPartitionDownOffsetDiagonalDist s (C

function), 117ElPartitionDownOffsetDiagonalDist z (C

function), 117

570 Index

Page 575: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElPartitionLeft c (C function), 112ElPartitionLeft d (C function), 112ElPartitionLeft i (C function), 112ElPartitionLeft s (C function), 112ElPartitionLeft z (C function), 112ElPartitionLeftDist c (C function), 113ElPartitionLeftDist d (C function), 113ElPartitionLeftDist i (C function), 113ElPartitionLeftDist s (C function), 113ElPartitionLeftDist z (C function), 113ElPartitionRight c (C function), 111ElPartitionRight d (C function), 111ElPartitionRight i (C function), 111ElPartitionRight s (C function), 111ElPartitionRight z (C function), 111ElPartitionRightDist c (C function), 111ElPartitionRightDist d (C function), 111ElPartitionRightDist i (C function), 111ElPartitionRightDist s (C function), 111ElPartitionRightDist z (C function), 111ElPartitionUp c (C function), 110ElPartitionUp d (C function), 110ElPartitionUp i (C function), 110ElPartitionUp s (C function), 110ElPartitionUp z (C function), 110ElPartitionUpDiagonal c (C function), 119ElPartitionUpDiagonal d (C function), 119ElPartitionUpDiagonal i (C function), 119ElPartitionUpDiagonal s (C function), 119ElPartitionUpDiagonal z (C function), 119ElPartitionUpDiagonalDist c (C function), 119ElPartitionUpDiagonalDist d (C function),

119ElPartitionUpDiagonalDist i (C function), 119ElPartitionUpDiagonalDist s (C function), 119ElPartitionUpDiagonalDist z (C function),

119ElPartitionUpDist c (C function), 110ElPartitionUpDist d (C function), 110ElPartitionUpDist i (C function), 110ElPartitionUpDist s (C function), 110ElPartitionUpDist z (C function), 110ElPartitionUpOffsetDiagonal c (C function),

121ElPartitionUpOffsetDiagonal d (C function),

121ElPartitionUpOffsetDiagonal i (C function),

121ElPartitionUpOffsetDiagonal s (C function),

121

ElPartitionUpOffsetDiagonal z (C function),121

ElPartitionUpOffsetDiagonalDist c (C func-tion), 121

ElPartitionUpOffsetDiagonalDist d (C func-tion), 121

ElPartitionUpOffsetDiagonalDist i (C func-tion), 121

ElPartitionUpOffsetDiagonalDist s (C func-tion), 121

ElPartitionUpOffsetDiagonalDist z (C func-tion), 121

ElPei c (C function), 501ElPei d (C function), 501ElPei i (C function), 501ElPei s (C function), 501ElPei z (C function), 502ElPeiDist c (C function), 502ElPeiDist d (C function), 502ElPeiDist i (C function), 502ElPeiDist s (C function), 502ElPeiDist z (C function), 502ElPow c (C function), 49ElPow d (C function), 49ElPow s (C function), 49ElPow z (C function), 49ElPrint c (C function), 520ElPrint d (C function), 520ElPrint i (C function), 520ElPrint s (C function), 520ElPrint z (C function), 520ElPrintCCompilerInfo (C function), 45ElPrintConfig (C function), 44ElPrintCxxCompilerInfo (C function), 45ElPrintDist c (C function), 520ElPrintDist d (C function), 520ElPrintDist i (C function), 520ElPrintDist s (C function), 520ElPrintDist z (C function), 521ElPrintVersion (C function), 44ElPseudoinverse c (C function), 334ElPseudoinverse d (C function), 334ElPseudoinverse s (C function), 334ElPseudoinverse z (C function), 334ElPseudoinverseDist c (C function), 334ElPseudoinverseDist d (C function), 334ElPseudoinverseDist s (C function), 334ElPseudoinverseDist z (C function), 334ElPseudospecCtrl d (C type), 328ElPseudospecCtrl d.arnoldi (C member), 328

Index 571

Page 576: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElPseudospecCtrl d.basisSize (C member),328

ElPseudospecCtrl d.deflate (C member), 328ElPseudospecCtrl d.forceComplexPs (C

member), 328ElPseudospecCtrl d.forceComplexSchur (C

member), 328ElPseudospecCtrl d.maxIts (C member), 328ElPseudospecCtrl d.progress (C member), 328ElPseudospecCtrl d.reorthog (C member),

328ElPseudospecCtrl d.schurCtrl (C member),

328ElPseudospecCtrl d.snapCtrl (C member),

328ElPseudospecCtrl d.tol (C member), 328ElPseudospecCtrl s (C type), 327ElPseudospecCtrl s.arnoldi (C member), 327ElPseudospecCtrl s.basisSize (C member),

328ElPseudospecCtrl s.deflate (C member), 327ElPseudospecCtrl s.forceComplexPs (C mem-

ber), 327ElPseudospecCtrl s.forceComplexSchur (C

member), 327ElPseudospecCtrl s.maxIts (C member), 327ElPseudospecCtrl s.progress (C member), 328ElPseudospecCtrl s.reorthog (C member), 328ElPseudospecCtrl s.schurCtrl (C member),

327ElPseudospecCtrl s.snapCtrl (C member), 328ElPseudospecCtrl s.tol (C member), 327ElPseudospecCtrlDefault d (C function), 328ElPseudospecCtrlDefault s (C function), 328ElPseudospecCtrlDestroy d (C function), 328ElPseudospecCtrlDestroy s (C function), 328ElQPAffine d (C function), 407ElQPAffine s (C function), 407ElQPAffineDist d (C function), 407ElQPAffineDist s (C function), 407ElQPAffineDistSparse d (C function), 407ElQPAffineDistSparse s (C function), 407ElQPAffineSparse d (C function), 407ElQPAffineSparse s (C function), 407ElQPAffineX d (C function), 408ElQPAffineX s (C function), 407ElQPAffineXDist d (C function), 408ElQPAffineXDist s (C function), 408ElQPAffineXDistSparse d (C function), 408ElQPAffineXDistSparse s (C function), 408ElQPAffineXSparse d (C function), 408

ElQPAffineXSparse s (C function), 408ElQPBoxADMM d (C function), 409ElQPBoxADMM s (C function), 409ElQPBoxADMMDist d (C function), 409ElQPBoxADMMDist s (C function), 409ElQPDirect d (C function), 405ElQPDirect s (C function), 405ElQPDirectDist d (C function), 405ElQPDirectDist s (C function), 405ElQPDirectDistSparse d (C function), 405ElQPDirectDistSparse s (C function), 405ElQPDirectSparse d (C function), 405ElQPDirectSparse s (C function), 405ElQPDirectX d (C function), 406ElQPDirectX s (C function), 405ElQPDirectXDist d (C function), 406ElQPDirectXDist s (C function), 405ElQPDirectXDistSparse d (C function), 406ElQPDirectXDistSparse s (C function), 405ElQPDirectXSparse d (C function), 406ElQPDirectXSparse s (C function), 405ElQR c (C function), 279ElQR d (C function), 279ElQR s (C function), 279ElQR z (C function), 279ElQRColPiv c (C function), 279ElQRColPiv d (C function), 279ElQRColPiv s (C function), 279ElQRColPiv z (C function), 279ElQRColPivDist c (C function), 280ElQRColPivDist d (C function), 279ElQRColPivDist s (C function), 279ElQRColPivDist z (C function), 280ElQRColPivX c (C function), 280ElQRColPivX d (C function), 280ElQRColPivX s (C function), 280ElQRColPivX z (C function), 280ElQRColPivXDist c (C function), 280ElQRColPivXDist d (C function), 280ElQRColPivXDist s (C function), 280ElQRColPivXDist z (C function), 280ElQRDist c (C function), 279ElQRDist d (C function), 279ElQRDist s (C function), 279ElQRDist z (C function), 279ElQRExplicit c (C function), 280ElQRExplicit d (C function), 280ElQRExplicit s (C function), 280ElQRExplicit z (C function), 280ElQRExplicitColPiv c (C function), 280ElQRExplicitColPiv d (C function), 280

572 Index

Page 577: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElQRExplicitColPiv s (C function), 280ElQRExplicitColPiv z (C function), 280ElQRExplicitColPivDist c (C function), 280ElQRExplicitColPivDist d (C function), 280ElQRExplicitColPivDist s (C function), 280ElQRExplicitColPivDist z (C function), 281ElQRExplicitDist c (C function), 280ElQRExplicitDist d (C function), 280ElQRExplicitDist s (C function), 280ElQRExplicitDist z (C function), 280ElQRExplicitTriang c (C function), 281ElQRExplicitTriang d (C function), 281ElQRExplicitTriang s (C function), 281ElQRExplicitTriang z (C function), 281ElQRExplicitTriangDist c (C function), 281ElQRExplicitTriangDist d (C function), 281ElQRExplicitTriangDist s (C function), 281ElQRExplicitTriangDist z (C function), 281ElQRExplicitUnitary c (C function), 281ElQRExplicitUnitary d (C function), 281ElQRExplicitUnitary s (C function), 281ElQRExplicitUnitary z (C function), 281ElQRExplicitUnitaryDist c (C function), 281ElQRExplicitUnitaryDist d (C function), 281ElQRExplicitUnitaryDist s (C function), 281ElQRExplicitUnitaryDist z (C function), 281ElQuasiTrsm c (C function), 229ElQuasiTrsm d (C function), 229ElQuasiTrsm s (C function), 229ElQuasiTrsm z (C function), 229ElQuasiTrsmDist c (C function), 229ElQuasiTrsmDist d (C function), 229ElQuasiTrsmDist s (C function), 229ElQuasiTrsmDist z (C function), 229ElQuasiTrsv c (C function), 215ElQuasiTrsv d (C function), 215ElQuasiTrsv s (C function), 215ElQuasiTrsv z (C function), 215ElQuasiTrsvDist c (C function), 215ElQuasiTrsvDist d (C function), 215ElQuasiTrsvDist s (C function), 215ElQuasiTrsvDist z (C function), 216ElRademacher c (C function), 515ElRademacher d (C function), 515ElRademacher i (C function), 515ElRademacher s (C function), 515ElRademacher z (C function), 515ElRademacherDist c (C function), 515ElRademacherDist d (C function), 515ElRademacherDist i (C function), 515ElRademacherDist s (C function), 515

ElRademacherDist z (C function), 515ElRead c (C function), 524ElRead d (C function), 524ElRead i (C function), 524ElRead s (C function), 524ElRead z (C function), 524ElReadDist c (C function), 524ElReadDist d (C function), 524ElReadDist i (C function), 524ElReadDist s (C function), 524ElReadDist z (C function), 524ElRealHermitianFunction c (C function), 333ElRealHermitianFunction d (C function), 333ElRealHermitianFunction s (C function), 333ElRealHermitianFunction z (C function), 333ElRealHermitianFunctionDist c (C function),

333ElRealHermitianFunctionDist d (C function),

333ElRealHermitianFunctionDist s (C function),

333ElRealHermitianFunctionDist z (C function),

333ElRedheffer c (C function), 502ElRedheffer d (C function), 502ElRedheffer i (C function), 502ElRedheffer s (C function), 502ElRedheffer z (C function), 502ElRedhefferDist c (C function), 502ElRedhefferDist d (C function), 502ElRedhefferDist i (C function), 502ElRedhefferDist s (C function), 502ElRedhefferDist z (C function), 502ElRegularization (C type), 428ElRepartitionDown c (C function), 123ElRepartitionDown d (C function), 123ElRepartitionDown i (C function), 123ElRepartitionDown s (C function), 123ElRepartitionDown z (C function), 123ElRepartitionDownDiagonal c (C function),

132ElRepartitionDownDiagonal d (C function),

132ElRepartitionDownDiagonal i (C function),

131ElRepartitionDownDiagonal s (C function),

131ElRepartitionDownDiagonal z (C function),

132ElRepartitionDownDiagonalDist c (C func-

tion), 132

Index 573

Page 578: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElRepartitionDownDiagonalDist d (C func-tion), 132

ElRepartitionDownDiagonalDist i (C func-tion), 132

ElRepartitionDownDiagonalDist s (C func-tion), 132

ElRepartitionDownDiagonalDist z (C func-tion), 133

ElRepartitionDownDist c (C function), 124ElRepartitionDownDist d (C function), 124ElRepartitionDownDist i (C function), 124ElRepartitionDownDist s (C function), 124ElRepartitionDownDist z (C function), 124ElRepartitionLeft c (C function), 129ElRepartitionLeft d (C function), 129ElRepartitionLeft i (C function), 129ElRepartitionLeft s (C function), 129ElRepartitionLeft z (C function), 129ElRepartitionLeftDist c (C function), 129ElRepartitionLeftDist d (C function), 129ElRepartitionLeftDist i (C function), 129ElRepartitionLeftDist s (C function), 129ElRepartitionLeftDist z (C function), 129ElRepartitionRight c (C function), 127ElRepartitionRight d (C function), 127ElRepartitionRight i (C function), 127ElRepartitionRight s (C function), 127ElRepartitionRight z (C function), 127ElRepartitionRightDist c (C function), 127ElRepartitionRightDist d (C function), 127ElRepartitionRightDist i (C function), 127ElRepartitionRightDist s (C function), 127ElRepartitionRightDist z (C function), 128ElRepartitionUp c (C function), 125ElRepartitionUp d (C function), 125ElRepartitionUp i (C function), 125ElRepartitionUp s (C function), 125ElRepartitionUp z (C function), 125ElRepartitionUpDiagonal c (C function), 136ElRepartitionUpDiagonal d (C function), 136ElRepartitionUpDiagonal i (C function), 136ElRepartitionUpDiagonal s (C function), 136ElRepartitionUpDiagonal z (C function), 136ElRepartitionUpDiagonalDist c (C function),

136ElRepartitionUpDiagonalDist d (C function),

136ElRepartitionUpDiagonalDist i (C function),

136ElRepartitionUpDiagonalDist s (C function),

136

ElRepartitionUpDiagonalDist z (C function),137

ElRepartitionUpDist c (C function), 126ElRepartitionUpDist d (C function), 126ElRepartitionUpDist i (C function), 125ElRepartitionUpDist s (C function), 126ElRepartitionUpDist z (C function), 126ElReshape c (C function), 198ElReshape d (C function), 198ElReshape i (C function), 197ElReshape s (C function), 198ElReshape z (C function), 198ElReshapeDist c (C function), 198ElReshapeDist d (C function), 198ElReshapeDist i (C function), 197ElReshapeDist s (C function), 198ElReshapeDist z (C function), 198ElReshapeDistSparse c (C function), 198ElReshapeDistSparse d (C function), 198ElReshapeDistSparse i (C function), 198ElReshapeDistSparse s (C function), 198ElReshapeDistSparse z (C function), 198ElReshapeSparse c (C function), 198ElReshapeSparse d (C function), 198ElReshapeSparse i (C function), 198ElReshapeSparse s (C function), 198ElReshapeSparse z (C function), 198ElRicatti c (C function), 466ElRicatti d (C function), 466ElRicatti s (C function), 466ElRicatti z (C function), 466ElRicattiDist c (C function), 466ElRicattiDist d (C function), 466ElRicattiDist s (C function), 466ElRicattiDist z (C function), 466ElRicattiPreformed c (C function), 466ElRicattiPreformed d (C function), 466ElRicattiPreformed s (C function), 466ElRicattiPreformed z (C function), 466ElRicattiPreformedDist c (C function), 466ElRicattiPreformedDist d (C function), 466ElRicattiPreformedDist s (C function), 466ElRicattiPreformedDist z (C function), 466ElRidge c (C function), 384ElRidge d (C function), 384ElRidge s (C function), 383ElRidge z (C function), 384ElRidgeAlg (C type), 383ElRidgeDist c (C function), 384ElRidgeDist d (C function), 384ElRidgeDist s (C function), 383

574 Index

Page 579: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElRidgeDist z (C function), 384ElRidgeDistSparse c (C function), 384ElRidgeDistSparse d (C function), 384ElRidgeDistSparse s (C function), 383ElRidgeDistSparse z (C function), 384ElRidgeSparse c (C function), 384ElRidgeSparse d (C function), 384ElRidgeSparse s (C function), 383ElRidgeSparse z (C function), 384ElRiffle c (C function), 503ElRiffle d (C function), 503ElRiffle s (C function), 503ElRiffle z (C function), 503ElRiffleDecay c (C function), 504ElRiffleDecay d (C function), 504ElRiffleDecay s (C function), 504ElRiffleDecay z (C function), 504ElRiffleDist c (C function), 503ElRiffleDist d (C function), 503ElRiffleDist s (C function), 503ElRiffleDist z (C function), 503ElRiffleStationary c (C function), 503ElRiffleStationary d (C function), 503ElRiffleStationary s (C function), 503ElRiffleStationary z (C function), 504ElRiffleStationaryDist c (C function), 504ElRiffleStationaryDist d (C function), 504ElRiffleStationaryDist s (C function), 504ElRiffleStationaryDist z (C function), 504ElRis c (C function), 504ElRis d (C function), 504ElRis s (C function), 504ElRis z (C function), 504ElRisDist c (C function), 504ElRisDist d (C function), 504ElRisDist s (C function), 504ElRisDist z (C function), 505ElRowSwap c (C function), 204ElRowSwap d (C function), 204ElRowSwap i (C function), 204ElRowSwap s (C function), 204ElRowSwap z (C function), 204ElRowSwapDist c (C function), 204ElRowSwapDist d (C function), 204ElRowSwapDist i (C function), 204ElRowSwapDist s (C function), 204ElRowSwapDist z (C function), 204ElRPCADist c (C function), 433ElRPCADist d (C function), 433ElRPCADist s (C function), 433ElRPCADist z (C function), 433

ElRQ c (C function), 284ElRQ d (C function), 284ElRQ s (C function), 284ElRQ z (C function), 284ElRQDist c (C function), 284ElRQDist d (C function), 284ElRQDist s (C function), 284ElRQDist z (C function), 284ElRQExplicitTriang c (C function), 284ElRQExplicitTriang d (C function), 284ElRQExplicitTriang s (C function), 284ElRQExplicitTriang z (C function), 284ElSafeAbs c (C function), 48ElSafeAbs z (C function), 48ElSafeDeterminant c (C function), 345ElSafeDeterminant d (C function), 345ElSafeDeterminant s (C function), 345ElSafeDeterminant z (C function), 345ElSafeDeterminantDist c (C function), 345ElSafeDeterminantDist d (C function), 345ElSafeDeterminantDist s (C function), 345ElSafeDeterminantDist z (C function), 345ElScale c (C function), 199ElScale d (C function), 199ElScale i (C function), 199ElScale s (C function), 199ElScale z (C function), 199ElScaleDist c (C function), 199ElScaleDist d (C function), 199ElScaleDist i (C function), 199ElScaleDist s (C function), 199ElScaleDist z (C function), 199ElScaleDistSparse c (C function), 199ElScaleDistSparse d (C function), 199ElScaleDistSparse i (C function), 199ElScaleDistSparse s (C function), 199ElScaleDistSparse z (C function), 199ElScaleSparse c (C function), 199ElScaleSparse d (C function), 199ElScaleSparse i (C function), 199ElScaleSparse s (C function), 199ElScaleSparse z (C function), 199ElScaleTrapezoid c (C function), 200ElScaleTrapezoid d (C function), 200ElScaleTrapezoid i (C function), 200ElScaleTrapezoid s (C function), 200ElScaleTrapezoid z (C function), 200ElScaleTrapezoidDist c (C function), 200ElScaleTrapezoidDist d (C function), 200ElScaleTrapezoidDist i (C function), 200ElScaleTrapezoidDist s (C function), 200

Index 575

Page 580: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElScaleTrapezoidDist z (C function), 200ElScaleTrapezoidDistSparse c (C function),

201ElScaleTrapezoidDistSparse d (C function),

201ElScaleTrapezoidDistSparse i (C function),

201ElScaleTrapezoidDistSparse s (C function),

201ElScaleTrapezoidDistSparse z (C function),

201ElScaleTrapezoidSparse c (C function), 200ElScaleTrapezoidSparse d (C function), 200ElScaleTrapezoidSparse i (C function), 200ElScaleTrapezoidSparse s (C function), 200ElScaleTrapezoidSparse z (C function), 200ElSchattenNorm c (C function), 360ElSchattenNorm d (C function), 360ElSchattenNorm s (C function), 360ElSchattenNorm z (C function), 360ElSchattenNormDist c (C function), 360ElSchattenNormDist d (C function), 360ElSchattenNormDist s (C function), 360ElSchattenNormDist z (C function), 360ElSgn d (C function), 48ElSgn i (C function), 48ElSgn s (C function), 48ElShiftDiagonal c (C function), 202ElShiftDiagonal d (C function), 202ElShiftDiagonal i (C function), 202ElShiftDiagonal s (C function), 202ElShiftDiagonal z (C function), 202ElShiftDiagonalDist c (C function), 203ElShiftDiagonalDist d (C function), 203ElShiftDiagonalDist i (C function), 202ElShiftDiagonalDist s (C function), 203ElShiftDiagonalDist z (C function), 203ElShiftDiagonalDistSparse c (C function), 203ElShiftDiagonalDistSparse d (C function), 203ElShiftDiagonalDistSparse i (C function), 203ElShiftDiagonalDistSparse s (C function), 203ElShiftDiagonalDistSparse z (C function), 203ElShiftDiagonalSparse c (C function), 203ElShiftDiagonalSparse d (C function), 203ElShiftDiagonalSparse i (C function), 203ElShiftDiagonalSparse s (C function), 203ElShiftDiagonalSparse z (C function), 203ElSign c (C function), 338ElSign d (C function), 338ElSign s (C function), 338ElSign z (C function), 338

ElSignCtrl d (C type), 339ElSignCtrl d.maxIts (C member), 339ElSignCtrl d.power (C member), 339ElSignCtrl d.progress (C member), 339ElSignCtrl d.scaling (C member), 339ElSignCtrl d.tol (C member), 339ElSignCtrl s (C type), 339ElSignCtrl s.maxIts (C member), 339ElSignCtrl s.power (C member), 339ElSignCtrl s.progress (C member), 339ElSignCtrl s.scaling (C member), 339ElSignCtrl s.tol (C member), 339ElSignDecomp c (C function), 338ElSignDecomp d (C function), 338ElSignDecomp s (C function), 338ElSignDecomp z (C function), 338ElSignDecompDist c (C function), 338ElSignDecompDist d (C function), 338ElSignDecompDist s (C function), 338ElSignDecompDist z (C function), 338ElSignDist c (C function), 338ElSignDist d (C function), 338ElSignDist s (C function), 338ElSignDist z (C function), 338ElSignScaling (C type), 339ElSin c (C function), 50ElSin d (C function), 50ElSin s (C function), 50ElSin z (C function), 50ElSingularValues c (C function), 312ElSingularValues d (C function), 312ElSingularValues s (C function), 312ElSingularValues z (C function), 312ElSingularValuesDist c (C function), 312ElSingularValuesDist d (C function), 312ElSingularValuesDist s (C function), 312ElSingularValuesDist z (C function), 312ElSinh c (C function), 51ElSinh d (C function), 51ElSinh s (C function), 51ElSinh z (C function), 51ElSkeleton c (C function), 292ElSkeleton d (C function), 292ElSkeleton s (C function), 292ElSkeleton z (C function), 292ElSkeletonDist c (C function), 292ElSkeletonDist d (C function), 292ElSkeletonDist s (C function), 292ElSkeletonDist z (C function), 292ElSkewHermitianEig c (C function), 303ElSkewHermitianEig d (C function), 303

576 Index

Page 581: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSkewHermitianEig s (C function), 303ElSkewHermitianEig z (C function), 303ElSkewHermitianEigDist c (C function), 303ElSkewHermitianEigDist d (C function), 303ElSkewHermitianEigDist s (C function), 303ElSkewHermitianEigDist z (C function), 303ElSkewHermitianEigPair c (C function), 305ElSkewHermitianEigPair d (C function), 305ElSkewHermitianEigPair s (C function), 305ElSkewHermitianEigPair z (C function), 305ElSkewHermitianEigPairDist c (C function),

305ElSkewHermitianEigPairDist d (C function),

305ElSkewHermitianEigPairDist s (C function),

305ElSkewHermitianEigPairDist z (C function),

305ElSkewHermitianEigPairPartial c (C func-

tion), 305ElSkewHermitianEigPairPartial d (C func-

tion), 305ElSkewHermitianEigPairPartial s (C func-

tion), 305ElSkewHermitianEigPairPartial z (C func-

tion), 305ElSkewHermitianEigPairPartialDist c (C

function), 305ElSkewHermitianEigPairPartialDist d (C

function), 305ElSkewHermitianEigPairPartialDist s (C

function), 305ElSkewHermitianEigPairPartialDist z (C

function), 305ElSkewHermitianEigPartial c (C function),

304ElSkewHermitianEigPartial d (C function),

303ElSkewHermitianEigPartial s (C function),

303ElSkewHermitianEigPartial z (C function),

304ElSkewHermitianEigPartialDist c (C func-

tion), 304ElSkewHermitianEigPartialDist d (C func-

tion), 304ElSkewHermitianEigPartialDist s (C func-

tion), 304ElSkewHermitianEigPartialDist z (C func-

tion), 304

ElSlideLockedPartitionDown c (C function),145

ElSlideLockedPartitionDown i (C function),144

ElSlideLockedPartitionDown s (C function),144

ElSlideLockedPartitionDown z (C function),145

ElSlideLockedPartitionDownDiagonal c (Cfunction), 154

ElSlideLockedPartitionDownDiagonal d (Cfunction), 154

ElSlideLockedPartitionDownDiagonal i (Cfunction), 153

ElSlideLockedPartitionDownDiagonal s (Cfunction), 154

ElSlideLockedPartitionDownDiagonal z (Cfunction), 154

ElSlideLockedPartitionDownDiagonalDist c(C function), 155

ElSlideLockedPartitionDownDiagonalDist d(C function), 155

ElSlideLockedPartitionDownDiagonalDist i(C function), 154

ElSlideLockedPartitionDownDiagonalDist s(C function), 155

ElSlideLockedPartitionDownDiagonalDist z(C function), 155

ElSlideLockedPartitionDownDist c (C func-tion), 145

ElSlideLockedPartitionDownDist d (C func-tion), 145

ElSlideLockedPartitionDownDist i (C func-tion), 145

ElSlideLockedPartitionDownDist s (C func-tion), 145

ElSlideLockedPartitionDownDist z (C func-tion), 145

ElSlideLockedPartitionLeft c (C function), 150ElSlideLockedPartitionLeft d (C function),

150ElSlideLockedPartitionLeft i (C function), 150ElSlideLockedPartitionLeft s (C function), 150ElSlideLockedPartitionLeft z (C function),

150ElSlideLockedPartitionLeftDist c (C func-

tion), 150ElSlideLockedPartitionLeftDist d (C func-

tion), 150ElSlideLockedPartitionLeftDist i (C function),

150

Index 577

Page 582: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSlideLockedPartitionLeftDist s (C func-tion), 150

ElSlideLockedPartitionLeftDist z (C func-tion), 150

ElSlideLockedPartitionRight c (C function),148

ElSlideLockedPartitionRight d (C function),148

ElSlideLockedPartitionRight i (C function),148

ElSlideLockedPartitionRight s (C function),148

ElSlideLockedPartitionRight z (C function),148

ElSlideLockedPartitionRightDist c (C func-tion), 148

ElSlideLockedPartitionRightDist d (C func-tion), 148

ElSlideLockedPartitionRightDist i (C func-tion), 148

ElSlideLockedPartitionRightDist s (C func-tion), 148

ElSlideLockedPartitionRightDist z (C func-tion), 149

ElSlideLockedPartitionUp c (C function), 146ElSlideLockedPartitionUp i (C function), 146ElSlideLockedPartitionUp s (C function), 146ElSlideLockedPartitionUp z (C function), 146ElSlideLockedPartitionUpDiagonal c (C func-

tion), 159ElSlideLockedPartitionUpDiagonal d (C

function), 159ElSlideLockedPartitionUpDiagonal i (C func-

tion), 158ElSlideLockedPartitionUpDiagonal s (C func-

tion), 158ElSlideLockedPartitionUpDiagonal z (C func-

tion), 159ElSlideLockedPartitionUpDiagonalDist c (C

function), 160ElSlideLockedPartitionUpDiagonalDist d (C

function), 160ElSlideLockedPartitionUpDiagonalDist i (C

function), 159ElSlideLockedPartitionUpDiagonalDist s (C

function), 159ElSlideLockedPartitionUpDiagonalDist z (C

function), 160ElSlideLockedPartitionUpDist c (C function),

147

ElSlideLockedPartitionUpDist d (C function),147

ElSlideLockedPartitionUpDist i (C function),146

ElSlideLockedPartitionUpDist s (C function),147

ElSlideLockedPartitionUpDist z (C function),147

ElSlidePartitionDown c (C function), 144ElSlidePartitionDown d (C function), 144, 145ElSlidePartitionDown i (C function), 144ElSlidePartitionDown s (C function), 144ElSlidePartitionDown z (C function), 144ElSlidePartitionDownDiagonal c (C func-

tion), 152ElSlidePartitionDownDiagonal d (C func-

tion), 152ElSlidePartitionDownDiagonal i (C function),

152ElSlidePartitionDownDiagonal s (C func-

tion), 152ElSlidePartitionDownDiagonal z (C func-

tion), 152ElSlidePartitionDownDiagonalDist c (C func-

tion), 153ElSlidePartitionDownDiagonalDist d (C

function), 153ElSlidePartitionDownDiagonalDist i (C func-

tion), 153ElSlidePartitionDownDiagonalDist s (C func-

tion), 153ElSlidePartitionDownDiagonalDist z (C func-

tion), 153ElSlidePartitionDownDist c (C function), 144ElSlidePartitionDownDist d (C function), 144ElSlidePartitionDownDist i (C function), 144ElSlidePartitionDownDist s (C function), 144ElSlidePartitionDownDist z (C function), 144ElSlidePartitionLeft c (C function), 149ElSlidePartitionLeft d (C function), 149ElSlidePartitionLeft i (C function), 149ElSlidePartitionLeft s (C function), 149ElSlidePartitionLeft z (C function), 149ElSlidePartitionLeftDist c (C function), 150ElSlidePartitionLeftDist d (C function), 150ElSlidePartitionLeftDist i (C function), 149ElSlidePartitionLeftDist s (C function), 150ElSlidePartitionLeftDist z (C function), 150ElSlidePartitionRight c (C function), 148ElSlidePartitionRight d (C function), 148ElSlidePartitionRight i (C function), 147

578 Index

Page 583: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSlidePartitionRight s (C function), 148ElSlidePartitionRight z (C function), 148ElSlidePartitionRightDist c (C function), 148ElSlidePartitionRightDist d (C function), 148ElSlidePartitionRightDist i (C function), 148ElSlidePartitionRightDist s (C function), 148ElSlidePartitionRightDist z (C function), 148ElSlidePartitionUp c (C function), 146ElSlidePartitionUp d (C function), 146ElSlidePartitionUp i (C function), 146ElSlidePartitionUp s (C function), 146ElSlidePartitionUp z (C function), 146ElSlidePartitionUpDiagonal c (C function),

157ElSlidePartitionUpDiagonal d (C function),

157ElSlidePartitionUpDiagonal i (C function),

157ElSlidePartitionUpDiagonal s (C function),

157ElSlidePartitionUpDiagonal z (C function),

157ElSlidePartitionUpDiagonalDist c (C func-

tion), 158ElSlidePartitionUpDiagonalDist d (C func-

tion), 158ElSlidePartitionUpDiagonalDist i (C func-

tion), 157ElSlidePartitionUpDiagonalDist s (C func-

tion), 158ElSlidePartitionUpDiagonalDist z (C func-

tion), 158ElSlidePartitionUpDist c (C function), 146ElSlidePartitionUpDist d (C function), 146ElSlidePartitionUpDist i (C function), 146ElSlidePartitionUpDist s (C function), 146ElSlidePartitionUpDist z (C function), 146ElSnapshotCtrl (C type), 327ElSnapshotCtrl.imagSize (C member), 327ElSnapshotCtrl.imgBase (C member), 327ElSnapshotCtrl.imgDispCount (C member),

327ElSnapshotCtrl.imgDispFreq (C member), 327ElSnapshotCtrl.imgFormat (C member), 327ElSnapshotCtrl.imgSaveCount (C member),

327ElSnapshotCtrl.imgSaveFreq (C member), 327ElSnapshotCtrl.numBase (C member), 327ElSnapshotCtrl.numFormat (C member), 327ElSnapshotCtrl.numSaveCount (C member),

327

ElSnapshotCtrl.numSaveFreq (C member),327

ElSnapshotCtrl.realSize (C member), 327ElSnapshotCtrlDefault (C function), 327ElSnapshotCtrlDestroy (C function), 327ElSOCPAffine d (C function), 413ElSOCPAffine s (C function), 413ElSOCPAffineDist d (C function), 413ElSOCPAffineDist s (C function), 413ElSOCPAffineDistSparse d (C function), 413ElSOCPAffineDistSparse s (C function), 413ElSOCPAffineSparse d (C function), 413ElSOCPAffineSparse s (C function), 413ElSOCPAffineX d (C function), 414ElSOCPAffineX s (C function), 413ElSOCPAffineXDist d (C function), 414ElSOCPAffineXDist s (C function), 414ElSOCPAffineXDistSparse d (C function), 414ElSOCPAffineXDistSparse s (C function), 414ElSOCPAffineXSparse d (C function), 414ElSOCPAffineXSparse s (C function), 414ElSOCPDirect d (C function), 411ElSOCPDirect s (C function), 410ElSOCPDirectDist d (C function), 411ElSOCPDirectDist s (C function), 410ElSOCPDirectDistSparse d (C function), 411ElSOCPDirectDistSparse s (C function), 410ElSOCPDirectSparse d (C function), 411ElSOCPDirectSparse s (C function), 410ElSOCPDirectX d (C function), 411ElSOCPDirectX s (C function), 411ElSOCPDirectXDist d (C function), 411ElSOCPDirectXDist s (C function), 411ElSOCPDirectXDistSparse d (C function), 411ElSOCPDirectXDistSparse s (C function), 411ElSOCPDirectXSparse d (C function), 411ElSOCPDirectXSparse s (C function), 411ElSoftThreshold c (C function), 443ElSoftThreshold d (C function), 443ElSoftThreshold s (C function), 443ElSoftThreshold z (C function), 443ElSoftThresholdDist c (C function), 443ElSoftThresholdDist d (C function), 443ElSoftThresholdDist s (C function), 443ElSoftThresholdDist z (C function), 443ElSolveAfterCholesky c (C function), 258ElSolveAfterCholesky d (C function), 257ElSolveAfterCholesky s (C function), 257ElSolveAfterCholesky z (C function), 258ElSolveAfterCholeskyDist c (C function), 258ElSolveAfterCholeskyDist d (C function), 257

Index 579

Page 584: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSolveAfterCholeskyDist s (C function), 257ElSolveAfterCholeskyDist z (C function), 258ElSolveAfterCholeskyPiv c (C function), 258ElSolveAfterCholeskyPiv d (C function), 257ElSolveAfterCholeskyPiv s (C function), 257ElSolveAfterCholeskyPiv z (C function), 258ElSolveAfterCholeskyPivDist c (C function),

258ElSolveAfterCholeskyPivDist d (C function),

257ElSolveAfterCholeskyPivDist s (C function),

257ElSolveAfterCholeskyPivDist z (C function),

258ElSolveAfterLDL c (C function), 267ElSolveAfterLDL d (C function), 267ElSolveAfterLDL s (C function), 267ElSolveAfterLDL z (C function), 267ElSolveAfterLDLDist c (C function), 267ElSolveAfterLDLDist d (C function), 267ElSolveAfterLDLDist s (C function), 267ElSolveAfterLDLDist z (C function), 267ElSolveAfterLDLPiv c (C function), 263ElSolveAfterLDLPiv d (C function), 263ElSolveAfterLDLPiv s (C function), 263ElSolveAfterLDLPiv z (C function), 263ElSolveAfterLDLPivDist c (C function), 263ElSolveAfterLDLPivDist d (C function), 263ElSolveAfterLDLPivDist s (C function), 263ElSolveAfterLDLPivDist z (C function), 263ElSolveAfterLQ c (C function), 276ElSolveAfterLQ d (C function), 276ElSolveAfterLQ s (C function), 276ElSolveAfterLQ z (C function), 276ElSolveAfterLQDist c (C function), 277ElSolveAfterLQDist d (C function), 277ElSolveAfterLQDist s (C function), 277ElSolveAfterLQDist z (C function), 277ElSolveAfterLU c (C function), 272ElSolveAfterLU d (C function), 272ElSolveAfterLU s (C function), 272ElSolveAfterLU z (C function), 272ElSolveAfterLUDist c (C function), 272ElSolveAfterLUDist d (C function), 272ElSolveAfterLUDist s (C function), 272ElSolveAfterLUDist z (C function), 272ElSolveAfterLUFullPiv c (C function), 271ElSolveAfterLUFullPiv d (C function), 271ElSolveAfterLUFullPiv s (C function), 271ElSolveAfterLUFullPiv z (C function), 271

ElSolveAfterLUFullPivDist c (C function),271

ElSolveAfterLUFullPivDist d (C function),271

ElSolveAfterLUFullPivDist s (C function), 271ElSolveAfterLUFullPivDist z (C function),

271ElSolveAfterLUPartialPiv c (C function), 270ElSolveAfterLUPartialPiv d (C function), 270ElSolveAfterLUPartialPiv s (C function), 270ElSolveAfterLUPartialPiv z (C function), 270ElSolveAfterLUPartialPivDist c (C function),

270ElSolveAfterLUPartialPivDist d (C function),

270ElSolveAfterLUPartialPivDist s (C function),

270ElSolveAfterLUPartialPivDist z (C function),

270ElSolveAfterQR c (C function), 283ElSolveAfterQR d (C function), 283ElSolveAfterQR s (C function), 283ElSolveAfterQR z (C function), 283ElSolveAfterQRDist c (C function), 283ElSolveAfterQRDist d (C function), 283ElSolveAfterQRDist s (C function), 283ElSolveAfterQRDist z (C function), 283ElSolveAfterRQ c (C function), 286ElSolveAfterRQ d (C function), 286ElSolveAfterRQ s (C function), 286ElSolveAfterRQ z (C function), 286ElSolveAfterRQDist c (C function), 286ElSolveAfterRQDist d (C function), 286ElSolveAfterRQDist s (C function), 286ElSolveAfterRQDist z (C function), 286ElSortType (C type), 41ElSparseInvCov c (C function), 434ElSparseInvCov d (C function), 434ElSparseInvCov s (C function), 434ElSparseInvCov z (C function), 434ElSparseInvCovDist c (C function), 434ElSparseInvCovDist d (C function), 434ElSparseInvCovDist s (C function), 434ElSparseInvCovDist z (C function), 434ElSpectralCloud c (C function), 325ElSpectralCloud d (C function), 325ElSpectralCloud s (C function), 324ElSpectralCloud z (C function), 325ElSpectralCloudDist c (C function), 325ElSpectralCloudDist d (C function), 325ElSpectralCloudDist s (C function), 324

580 Index

Page 585: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSpectralCloudDist z (C function), 325ElSpectralCloudX c (C function), 325ElSpectralCloudX d (C function), 325ElSpectralCloudX s (C function), 324ElSpectralCloudX z (C function), 325ElSpectralCloudXDist c (C function), 325ElSpectralCloudXDist d (C function), 325ElSpectralCloudXDist s (C function), 325ElSpectralCloudXDist z (C function), 325ElSpectralPortrait c (C function), 320ElSpectralPortrait d (C function), 320ElSpectralPortrait s (C function), 319ElSpectralPortrait z (C function), 320ElSpectralPortraitDist c (C function), 320ElSpectralPortraitDist d (C function), 320ElSpectralPortraitDist s (C function), 320ElSpectralPortraitDist z (C function), 320ElSpectralPortraitX c (C function), 320ElSpectralPortraitX d (C function), 320ElSpectralPortraitX s (C function), 320ElSpectralPortraitX z (C function), 320ElSpectralPortraitXDist c (C function), 320ElSpectralPortraitXDist d (C function), 320ElSpectralPortraitXDist s (C function), 320ElSpectralPortraitXDist z (C function), 320ElSpectralWindow c (C function), 322ElSpectralWindow d (C function), 322ElSpectralWindow s (C function), 322ElSpectralWindow z (C function), 323ElSpectralWindowDist c (C function), 323ElSpectralWindowDist d (C function), 322ElSpectralWindowDist s (C function), 322ElSpectralWindowDist z (C function), 323ElSpectralWindowX c (C function), 323ElSpectralWindowX d (C function), 322ElSpectralWindowX s (C function), 322ElSpectralWindowX z (C function), 323ElSpectralWindowXDist c (C function), 323ElSpectralWindowXDist d (C function), 322ElSpectralWindowXDist s (C function), 322ElSpectralWindowXDist z (C function), 323ElSpy c (C function), 522ElSpy d (C function), 522ElSpy i (C function), 522ElSpy s (C function), 522ElSpy z (C function), 522ElSpyDist c (C function), 522ElSpyDist d (C function), 522ElSpyDist i (C function), 522ElSpyDist s (C function), 522ElSpyDist z (C function), 522

ElSqrt c (C function), 49ElSqrt d (C function), 49ElSqrt s (C function), 49ElSqrt z (C function), 49ElSquareRoot c (C function), 336ElSquareRoot d (C function), 336ElSquareRoot s (C function), 336ElSquareRoot z (C function), 336ElSquareRootDist c (C function), 336ElSquareRootDist d (C function), 336ElSquareRootDist s (C function), 336ElSquareRootDist z (C function), 336ElSVD c (C function), 313ElSVD d (C function), 313ElSVD s (C function), 313ElSVD z (C function), 313ElSVDCtrl d (C type), 314ElSVDCtrl d.fullChanRatio (C member), 314ElSVDCtrl d.relative (C member), 314ElSVDCtrl d.seqQR (C member), 314ElSVDCtrl d.thresholded (C member), 314ElSVDCtrl d.tol (C member), 314ElSVDCtrl d.valChanRatio (C member), 314ElSVDCtrl s (C type), 314ElSVDCtrl s.fullChanRatio (C member), 314ElSVDCtrl s.relative (C member), 314ElSVDCtrl s.seqQR (C member), 314ElSVDCtrl s.thresholded (C member), 314ElSVDCtrl s.tol (C member), 314ElSVDCtrl s.valChanRatio (C member), 314ElSVDCtrlDefault d (C function), 314ElSVDCtrlDefault s (C function), 314ElSVDDist c (C function), 313ElSVDDist d (C function), 313ElSVDDist s (C function), 313ElSVDDist z (C function), 313ElSVM d (C function), 436ElSVM s (C function), 435ElSVMDist d (C function), 436ElSVMDist s (C function), 436ElSVMDistSparse d (C function), 436ElSVMDistSparse s (C function), 436ElSVMSparse d (C function), 436ElSVMSparse s (C function), 436ElSVMX d (C function), 436ElSVMX s (C function), 436ElSVMXDist d (C function), 436ElSVMXDist s (C function), 436ElSVMXDistSparse d (C function), 436ElSVMXDistSparse s (C function), 436ElSVMXSparse d (C function), 436

Index 581

Page 586: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSVMXSparse s (C function), 436ElSVT c (C function), 441ElSVT d (C function), 441ElSVT s (C function), 441ElSVT z (C function), 441ElSVTDist c (C function), 441ElSVTDist d (C function), 441ElSVTDist s (C function), 441ElSVTDist z (C function), 442ElSwap c (C function), 203ElSwap d (C function), 203ElSwap i (C function), 203ElSwap s (C function), 203ElSwap z (C function), 204ElSwapDist c (C function), 204ElSwapDist d (C function), 204ElSwapDist i (C function), 204ElSwapDist s (C function), 204ElSwapDist z (C function), 204ElSylvester c (C function), 469ElSylvester d (C function), 469ElSylvester s (C function), 468ElSylvester z (C function), 469ElSylvesterDist c (C function), 469ElSylvesterDist d (C function), 469ElSylvesterDist s (C function), 468ElSylvesterDist z (C function), 469ElSylvesterPreformed c (C function), 469ElSylvesterPreformed d (C function), 469ElSylvesterPreformed s (C function), 468ElSylvesterPreformed z (C function), 469ElSylvesterPreformedDist c (C function), 469ElSylvesterPreformedDist d (C function), 469ElSylvesterPreformedDist s (C function), 469ElSylvesterPreformedDist z (C function), 469ElSymm c (C function), 230ElSymm d (C function), 230ElSymm s (C function), 230ElSymm z (C function), 230ElSymmDist c (C function), 230ElSymmDist d (C function), 230ElSymmDist s (C function), 230ElSymmDist z (C function), 230ElSymmetricEntrywiseNorm c (C function),

350ElSymmetricEntrywiseNorm d (C function),

350ElSymmetricEntrywiseNorm s (C function),

350ElSymmetricEntrywiseNorm z (C function),

350

ElSymmetricEntrywiseNormDist c (C func-tion), 350

ElSymmetricEntrywiseNormDist d (C func-tion), 350

ElSymmetricEntrywiseNormDist s (C func-tion), 350

ElSymmetricEntrywiseNormDist z (C func-tion), 350

ElSymmetricEntrywiseNormDistSparse c (Cfunction), 351

ElSymmetricEntrywiseNormDistSparse d (Cfunction), 351

ElSymmetricEntrywiseNormDistSparse s (Cfunction), 351

ElSymmetricEntrywiseNormDistSparse z (Cfunction), 351

ElSymmetricEntrywiseNormSparse c (Cfunction), 350

ElSymmetricEntrywiseNormSparse d (Cfunction), 350

ElSymmetricEntrywiseNormSparse s (Cfunction), 350

ElSymmetricEntrywiseNormSparse z (Cfunction), 350

ElSymmetricFrobeniusNorm c (C function),353

ElSymmetricFrobeniusNorm d (C function),353

ElSymmetricFrobeniusNorm s (C function),353

ElSymmetricFrobeniusNorm z (C function),353

ElSymmetricFrobeniusNormDist c (C func-tion), 353

ElSymmetricFrobeniusNormDist d (C func-tion), 353

ElSymmetricFrobeniusNormDist s (C func-tion), 353

ElSymmetricFrobeniusNormDist z (C func-tion), 353

ElSymmetricInfinityNorm c (C function), 355ElSymmetricInfinityNorm d (C function), 355ElSymmetricInfinityNorm s (C function), 355ElSymmetricInfinityNorm z (C function), 355ElSymmetricInfinityNormDist c (C function),

355ElSymmetricInfinityNormDist d (C function),

355ElSymmetricInfinityNormDist s (C function),

355

582 Index

Page 587: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSymmetricInfinityNormDist z (C function),355

ElSymmetricInverse c (C function), 331ElSymmetricInverse d (C function), 331ElSymmetricInverse s (C function), 331ElSymmetricInverse z (C function), 331ElSymmetricInverseDist c (C function), 331ElSymmetricInverseDist d (C function), 331ElSymmetricInverseDist s (C function), 331ElSymmetricInverseDist z (C function), 331ElSymmetricKyFanNorm c (C function), 354ElSymmetricKyFanNorm d (C function), 354ElSymmetricKyFanNorm s (C function), 354ElSymmetricKyFanNorm z (C function), 354ElSymmetricKyFanNormDist c (C function),

354ElSymmetricKyFanNormDist d (C function),

354ElSymmetricKyFanNormDist s (C function),

354ElSymmetricKyFanNormDist z (C function),

354ElSymmetricMax d (C function), 191ElSymmetricMax i (C function), 191ElSymmetricMax s (C function), 191ElSymmetricMaxAbs c (C function), 192ElSymmetricMaxAbs d (C function), 192ElSymmetricMaxAbs i (C function), 192ElSymmetricMaxAbs s (C function), 192ElSymmetricMaxAbs z (C function), 192ElSymmetricMaxAbsDist c (C function), 192ElSymmetricMaxAbsDist d (C function), 192ElSymmetricMaxAbsDist i (C function), 192ElSymmetricMaxAbsDist s (C function), 192ElSymmetricMaxAbsDist z (C function), 192ElSymmetricMaxDist d (C function), 191ElSymmetricMaxDist i (C function), 191ElSymmetricMaxDist s (C function), 191ElSymmetricMaxNorm c (C function), 357ElSymmetricMaxNorm d (C function), 357ElSymmetricMaxNorm i (C function), 357ElSymmetricMaxNorm s (C function), 357ElSymmetricMaxNorm z (C function), 357ElSymmetricMaxNormDist c (C function),

357ElSymmetricMaxNormDist d (C function),

357ElSymmetricMaxNormDist i (C function), 357ElSymmetricMaxNormDist s (C function),

357

ElSymmetricMaxNormDist z (C function),357

ElSymmetricMin d (C function), 193ElSymmetricMin i (C function), 193ElSymmetricMin s (C function), 193ElSymmetricMinAbs c (C function), 195ElSymmetricMinAbs d (C function), 195ElSymmetricMinAbs i (C function), 195ElSymmetricMinAbs s (C function), 195ElSymmetricMinAbs z (C function), 195ElSymmetricMinAbsDist c (C function), 195ElSymmetricMinAbsDist d (C function), 195ElSymmetricMinAbsDist i (C function), 195ElSymmetricMinAbsDist s (C function), 195ElSymmetricMinAbsDist z (C function), 195ElSymmetricMinDist d (C function), 194ElSymmetricMinDist i (C function), 193ElSymmetricMinDist s (C function), 194ElSymmetricNorm c (C function), 364ElSymmetricNorm d (C function), 364ElSymmetricNorm s (C function), 364ElSymmetricNorm z (C function), 364ElSymmetricNormDist c (C function), 365ElSymmetricNormDist d (C function), 365ElSymmetricNormDist s (C function), 365ElSymmetricNormDist z (C function), 365ElSymmetricNuclearNorm c (C function), 358ElSymmetricNuclearNorm d (C function),

358ElSymmetricNuclearNorm s (C function), 358ElSymmetricNuclearNorm z (C function), 358ElSymmetricNuclearNormDist c (C function),

358ElSymmetricNuclearNormDist d (C func-

tion), 358ElSymmetricNuclearNormDist s (C function),

358ElSymmetricNuclearNormDist z (C func-

tion), 358ElSymmetricOneNorm c (C function), 359ElSymmetricOneNorm d (C function), 359ElSymmetricOneNorm s (C function), 359ElSymmetricOneNorm z (C function), 359ElSymmetricOneNormDist c (C function), 359ElSymmetricOneNormDist d (C function),

359ElSymmetricOneNormDist s (C function), 359ElSymmetricOneNormDist z (C function),

359ElSymmetricSolve c (C function), 371ElSymmetricSolve d (C function), 370

Index 583

Page 588: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSymmetricSolve s (C function), 370ElSymmetricSolve z (C function), 371ElSymmetricSolveDist c (C function), 371ElSymmetricSolveDist d (C function), 370ElSymmetricSolveDist s (C function), 370ElSymmetricSolveDist z (C function), 371ElSymmetricSolveDistSparse c (C function),

371ElSymmetricSolveDistSparse d (C function),

370ElSymmetricSolveDistSparse s (C function),

370ElSymmetricSolveDistSparse z (C function),

371ElSymmetricSolveSparse c (C function), 371ElSymmetricSolveSparse d (C function), 370ElSymmetricSolveSparse s (C function), 370ElSymmetricSolveSparse z (C function), 371ElSymmetricSwap c (C function), 205ElSymmetricSwap d (C function), 205ElSymmetricSwap i (C function), 205ElSymmetricSwap s (C function), 205ElSymmetricSwap z (C function), 205ElSymmetricSwapDist c (C function), 205ElSymmetricSwapDist d (C function), 205ElSymmetricSwapDist i (C function), 205ElSymmetricSwapDist s (C function), 205ElSymmetricSwapDist z (C function), 206ElSymmetricTwoNorm c (C function), 361ElSymmetricTwoNorm d (C function), 361ElSymmetricTwoNorm s (C function), 361ElSymmetricTwoNorm z (C function), 361ElSymmetricTwoNormDist c (C function),

361ElSymmetricTwoNormDist d (C function),

361ElSymmetricTwoNormDist s (C function),

361ElSymmetricTwoNormDist z (C function),

361ElSymmetricTwoNormEstimate c (C func-

tion), 362ElSymmetricTwoNormEstimate d (C func-

tion), 362ElSymmetricTwoNormEstimate s (C func-

tion), 362ElSymmetricTwoNormEstimate z (C func-

tion), 362ElSymmetricTwoNormEstimateDist c (C

function), 363

ElSymmetricTwoNormEstimateDist d (Cfunction), 363

ElSymmetricTwoNormEstimateDist s (Cfunction), 363

ElSymmetricTwoNormEstimateDist z (Cfunction), 363

ElSymv c (C function), 216ElSymv d (C function), 216ElSymv i (C function), 216ElSymv s (C function), 216ElSymv z (C function), 216ElSymvDist c (C function), 216ElSymvDist d (C function), 216ElSymvDist i (C function), 216ElSymvDist s (C function), 216ElSymvDist z (C function), 216ElSyr2 c (C function), 218ElSyr2 d (C function), 217ElSyr2 i (C function), 217ElSyr2 s (C function), 217ElSyr2 z (C function), 218ElSyr2Dist c (C function), 218ElSyr2Dist d (C function), 218ElSyr2Dist i (C function), 218ElSyr2Dist s (C function), 218ElSyr2Dist z (C function), 218ElSyr2k c (C function), 232ElSyr2k d (C function), 232ElSyr2k s (C function), 232ElSyr2k z (C function), 232ElSyr2kDist c (C function), 232ElSyr2kDist d (C function), 232ElSyr2kDist s (C function), 232ElSyr2kDist z (C function), 232ElSyr c (C function), 217ElSyr d (C function), 217ElSyr i (C function), 217ElSyr s (C function), 217ElSyr z (C function), 217ElSyrDist c (C function), 217ElSyrDist d (C function), 217ElSyrDist i (C function), 217ElSyrDist s (C function), 217ElSyrDist z (C function), 217ElSyrk c (C function), 231ElSyrk d (C function), 231ElSyrk s (C function), 231ElSyrk z (C function), 231ElSyrkDist c (C function), 231ElSyrkDist d (C function), 231ElSyrkDist s (C function), 231

584 Index

Page 589: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElSyrkDist z (C function), 231ElTan c (C function), 50ElTan d (C function), 50ElTan s (C function), 50ElTan z (C function), 50ElTanh c (C function), 51ElTanh d (C function), 51ElTanh s (C function), 51ElTanh z (C function), 51ElThreeValued c (C function), 516ElThreeValued d (C function), 516ElThreeValued i (C function), 516ElThreeValued s (C function), 516ElThreeValued z (C function), 516ElThreeValuedDist c (C function), 516ElThreeValuedDist d (C function), 516ElThreeValuedDist i (C function), 516ElThreeValuedDist s (C function), 516ElThreeValuedDist z (C function), 516ElTikhonov c (C function), 382ElTikhonov d (C function), 381ElTikhonov s (C function), 381ElTikhonov z (C function), 382ElTikhonovAlg (C type), 381ElTikhonovDist c (C function), 382ElTikhonovDist d (C function), 381ElTikhonovDist s (C function), 381ElTikhonovDist z (C function), 382ElTikhonovDistSparse c (C function), 382ElTikhonovDistSparse d (C function), 381ElTikhonovDistSparse s (C function), 381ElTikhonovDistSparse z (C function), 382ElTikhonovSparse c (C function), 382ElTikhonovSparse d (C function), 381ElTikhonovSparse s (C function), 381ElTikhonovSparse z (C function), 382ElToeplitz c (C function), 505ElToeplitz d (C function), 505ElToeplitz i (C function), 505ElToeplitz s (C function), 505ElToeplitz z (C function), 505ElToeplitzDist c (C function), 505ElToeplitzDist d (C function), 505ElToeplitzDist i (C function), 505ElToeplitzDist s (C function), 505ElToeplitzDist z (C function), 505ElTrace c (C function), 366ElTrace d (C function), 366ElTrace i (C function), 366ElTrace s (C function), 366ElTrace z (C function), 366

ElTraceDist c (C function), 366ElTraceDist d (C function), 366ElTraceDist i (C function), 366ElTraceDist s (C function), 366ElTraceDist z (C function), 366ElTranspose c (C function), 207ElTranspose d (C function), 207ElTranspose i (C function), 207ElTranspose s (C function), 207ElTranspose z (C function), 207ElTransposeDist c (C function), 207ElTransposeDist d (C function), 207ElTransposeDist i (C function), 207ElTransposeDist s (C function), 207ElTransposeDist z (C function), 207ElTransposeDistSparse c (C function), 208ElTransposeDistSparse d (C function), 208ElTransposeDistSparse i (C function), 207ElTransposeDistSparse s (C function), 207ElTransposeDistSparse z (C function), 208ElTransposeSparse c (C function), 207ElTransposeSparse d (C function), 207ElTransposeSparse i (C function), 207ElTransposeSparse s (C function), 207ElTransposeSparse z (C function), 207ElTrdtrmm c (C function), 233ElTrdtrmm d (C function), 233ElTrdtrmm s (C function), 233ElTrdtrmm z (C function), 233ElTrdtrmmDist c (C function), 233ElTrdtrmmDist d (C function), 233ElTrdtrmmDist s (C function), 233ElTrdtrmmDist z (C function), 233ElTrdtrmmQuasi c (C function), 233ElTrdtrmmQuasi d (C function), 233ElTrdtrmmQuasi s (C function), 233ElTrdtrmmQuasi z (C function), 233ElTrdtrmmQuasiDist c (C function), 233ElTrdtrmmQuasiDist d (C function), 233ElTrdtrmmQuasiDist s (C function), 233ElTrdtrmmQuasiDist z (C function), 233ElTrefethenEmbree c (C function), 506ElTrefethenEmbree z (C function), 506ElTrefethenEmbreeDist c (C function), 506ElTrefethenEmbreeDist z (C function), 506ElTriangle c (C function), 506ElTriangle d (C function), 506ElTriangle s (C function), 506ElTriangle z (C function), 506ElTriangleDist c (C function), 506ElTriangleDist d (C function), 506

Index 585

Page 590: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElTriangleDist s (C function), 506ElTriangleDist z (C function), 506ElTriangularInverse c (C function), 330ElTriangularInverse d (C function), 330ElTriangularInverse s (C function), 330ElTriangularInverse z (C function), 330ElTriangularInverseDist c (C function), 330ElTriangularInverseDist d (C function), 330ElTriangularInverseDist s (C function), 330ElTriangularInverseDist z (C function), 330ElTriW c (C function), 507ElTriW d (C function), 507ElTriW i (C function), 507ElTriW s (C function), 507ElTriW z (C function), 507ElTriWDist c (C function), 507ElTriWDist d (C function), 507ElTriWDist i (C function), 507ElTriWDist s (C function), 507ElTriWDist z (C function), 507ElTrmm c (C function), 234ElTrmm d (C function), 234ElTrmm s (C function), 234ElTrmm z (C function), 234ElTrmmDist c (C function), 234ElTrmmDist d (C function), 234ElTrmmDist s (C function), 234ElTrmmDist z (C function), 234ElTrmv c (C function), 218ElTrmv d (C function), 218ElTrmv s (C function), 218ElTrmv z (C function), 218ElTrr2 c (C function), 220ElTrr2 d (C function), 220ElTrr2 i (C function), 220ElTrr2 s (C function), 220ElTrr2 z (C function), 220ElTrr2Dist c (C function), 220ElTrr2Dist d (C function), 220ElTrr2Dist i (C function), 220ElTrr2Dist s (C function), 220ElTrr2Dist z (C function), 220ElTrr2k c (C function), 236ElTrr2k d (C function), 236ElTrr2k s (C function), 236ElTrr2k z (C function), 236ElTrr2kDist c (C function), 237ElTrr2kDist d (C function), 236ElTrr2kDist s (C function), 236ElTrr2kDist z (C function), 237ElTrr c (C function), 219

ElTrr d (C function), 219ElTrr i (C function), 219ElTrr s (C function), 219ElTrr z (C function), 219ElTrrDist c (C function), 219ElTrrDist d (C function), 219ElTrrDist i (C function), 219ElTrrDist s (C function), 219ElTrrDist z (C function), 219ElTrrk c (C function), 235ElTrrk d (C function), 235ElTrrk s (C function), 235ElTrrk z (C function), 235ElTrrkDist c (C function), 235ElTrrkDist d (C function), 235ElTrrkDist s (C function), 235ElTrrkDist z (C function), 235ElTrsm c (C function), 237ElTrsm d (C function), 237ElTrsm s (C function), 237ElTrsm z (C function), 237ElTrsmDist c (C function), 238ElTrsmDist d (C function), 238ElTrsmDist s (C function), 238ElTrsmDist z (C function), 238ElTrstrm c (C function), 239ElTrstrm d (C function), 239ElTrstrm s (C function), 239ElTrstrm z (C function), 239ElTrstrmDist c (C function), 239ElTrstrmDist d (C function), 239ElTrstrmDist s (C function), 239ElTrstrmDist z (C function), 239ElTrsv c (C function), 220ElTrsv d (C function), 220ElTrsv s (C function), 220ElTrsv z (C function), 221ElTrsvDist c (C function), 221ElTrsvDist d (C function), 221ElTrsvDist s (C function), 221ElTrsvDist z (C function), 221ElTrtrmm c (C function), 238ElTrtrmm d (C function), 238ElTrtrmm s (C function), 238ElTrtrmm z (C function), 238ElTrtrmmDist c (C function), 238ElTrtrmmDist d (C function), 238ElTrtrmmDist s (C function), 238ElTrtrmmDist z (C function), 238ElTV d (C function), 438ElTV s (C function), 437

586 Index

Page 591: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElTVDist d (C function), 438ElTVDist s (C function), 437ElTVDistSparse d (C function), 438ElTVDistSparse s (C function), 437ElTVSparse d (C function), 438ElTVSparse s (C function), 437ElTVX d (C function), 438ElTVX s (C function), 438ElTVXDist d (C function), 438ElTVXDist s (C function), 438ElTVXDistSparse d (C function), 438ElTVXDistSparse s (C function), 438ElTVXSparse d (C function), 438ElTVXSparse s (C function), 438ElTwoCondition c (C function), 343ElTwoCondition d (C function), 343ElTwoCondition s (C function), 343ElTwoCondition z (C function), 343ElTwoConditionDist c (C function), 343ElTwoConditionDist d (C function), 343ElTwoConditionDist s (C function), 343ElTwoConditionDist z (C function), 343ElTwoNorm c (C function), 361ElTwoNorm d (C function), 361ElTwoNorm s (C function), 361ElTwoNorm z (C function), 361ElTwoNormDist c (C function), 361ElTwoNormDist d (C function), 361ElTwoNormDist s (C function), 361ElTwoNormDist z (C function), 361ElTwoNormEstimate c (C function), 362ElTwoNormEstimate d (C function), 362ElTwoNormEstimate s (C function), 362ElTwoNormEstimate z (C function), 362ElTwoNormEstimateDist c (C function), 362ElTwoNormEstimateDist d (C function), 362ElTwoNormEstimateDist s (C function), 362ElTwoNormEstimateDist z (C function), 362ElTwoSidedTrmm c (C function), 240ElTwoSidedTrmm d (C function), 240ElTwoSidedTrmm s (C function), 240ElTwoSidedTrmm z (C function), 240ElTwoSidedTrmmDist c (C function), 240ElTwoSidedTrmmDist d (C function), 240ElTwoSidedTrmmDist s (C function), 240ElTwoSidedTrmmDist z (C function), 240ElTwoSidedTrsm c (C function), 241ElTwoSidedTrsm d (C function), 241ElTwoSidedTrsm s (C function), 241ElTwoSidedTrsm z (C function), 241ElTwoSidedTrsmDist c (C function), 241

ElTwoSidedTrsmDist d (C function), 241ElTwoSidedTrsmDist s (C function), 241ElTwoSidedTrsmDist z (C function), 241ElUniform c (C function), 516ElUniform d (C function), 516ElUniform i (C function), 516ElUniform s (C function), 516ElUniform z (C function), 516ElUniformDist c (C function), 517ElUniformDist d (C function), 517ElUniformDist i (C function), 517ElUniformDist s (C function), 517ElUniformDist z (C function), 517ElUniformHelmholtzGreens c (C function),

517ElUniformHelmholtzGreens z (C function),

517ElUniformHelmholtzGreensDist c (C func-

tion), 517ElUniformHelmholtzGreensDist z (C func-

tion), 517ElUnitOrNonUnit (C type), 42ElUnsigned (C type), 41ElUpperClip d (C function), 439ElUpperClip s (C function), 439ElUpperClipDist d (C function), 439ElUpperClipDist s (C function), 439ElUpperOrLower (C type), 42ElVectorMax d (C function), 191ElVectorMax i (C function), 191ElVectorMax s (C function), 191ElVectorMaxAbs c (C function), 193ElVectorMaxAbs d (C function), 192ElVectorMaxAbs i (C function), 192ElVectorMaxAbs s (C function), 192ElVectorMaxAbs z (C function), 193ElVectorMaxAbsDist c (C function), 193ElVectorMaxAbsDist d (C function), 193ElVectorMaxAbsDist i (C function), 193ElVectorMaxAbsDist s (C function), 193ElVectorMaxAbsDist z (C function), 193ElVectorMaxDist d (C function), 191ElVectorMaxDist i (C function), 191ElVectorMaxDist s (C function), 191ElVectorMin d (C function), 194ElVectorMin i (C function), 194ElVectorMin s (C function), 194ElVectorMinAbs c (C function), 195ElVectorMinAbs d (C function), 195ElVectorMinAbs i (C function), 195ElVectorMinAbs s (C function), 195

Index 587

Page 592: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElVectorMinAbs z (C function), 195ElVectorMinAbsDist c (C function), 195ElVectorMinAbsDist d (C function), 195ElVectorMinAbsDist i (C function), 195ElVectorMinAbsDist s (C function), 195ElVectorMinAbsDist z (C function), 195ElVectorMinDist d (C function), 194ElVectorMinDist i (C function), 194ElVectorMinDist s (C function), 194ElVerticalOrHorizontal (C type), 42ElView c (C function), 103ElView d (C function), 103ElView i (C function), 103ElView s (C function), 103ElView z (C function), 103ElViewDist c (C function), 103ElViewDist d (C function), 103ElViewDist i (C function), 103ElViewDist s (C function), 103ElViewDist z (C function), 103ElViewFull c (C function), 106ElViewFull d (C function), 106ElViewFull i (C function), 106ElViewFull s (C function), 106ElViewFull z (C function), 106ElViewFullDist c (C function), 106ElViewFullDist d (C function), 106ElViewFullDist i (C function), 106ElViewFullDist s (C function), 106ElViewFullDist z (C function), 106ElViewOffset c (C function), 104ElViewOffset d (C function), 104ElViewOffset i (C function), 104ElViewOffset s (C function), 104ElViewOffset z (C function), 104ElViewOffsetDist c (C function), 105ElViewOffsetDist d (C function), 105ElViewOffsetDist i (C function), 104ElViewOffsetDist s (C function), 104ElViewOffsetDist z (C function), 105ElWalsh c (C function), 508ElWalsh d (C function), 508ElWalsh i (C function), 508ElWalsh s (C function), 508ElWalsh z (C function), 508ElWalshDist c (C function), 508ElWalshDist d (C function), 508ElWalshDist i (C function), 508ElWalshDist s (C function), 508ElWalshDist z (C function), 508ElWhale c (C function), 508

ElWhale z (C function), 508ElWhaleDist c (C function), 508ElWhaleDist z (C function), 508ElWigner c (C function), 518ElWigner d (C function), 518ElWigner s (C function), 518ElWigner z (C function), 518ElWignerDist c (C function), 518ElWignerDist d (C function), 518ElWignerDist s (C function), 518ElWignerDist z (C function), 518ElWilkinson c (C function), 509ElWilkinson d (C function), 509ElWilkinson i (C function), 509ElWilkinson s (C function), 509ElWilkinson z (C function), 509ElWilkinsonDist c (C function), 509ElWilkinsonDist d (C function), 509ElWilkinsonDist i (C function), 509ElWilkinsonDist s (C function), 509ElWilkinsonDist z (C function), 509ElWrite c (C function), 525ElWrite d (C function), 525ElWrite i (C function), 525ElWrite s (C function), 525ElWrite z (C function), 525ElWriteDist c (C function), 525ElWriteDist d (C function), 525ElWriteDist i (C function), 525ElWriteDist s (C function), 525ElWriteDist z (C function), 525ElZero c (C function), 211ElZero d (C function), 211ElZero i (C function), 211ElZero s (C function), 211ElZero z (C function), 211ElZeroDist c (C function), 211ElZeroDist d (C function), 211ElZeroDist i (C function), 211ElZeroDist s (C function), 211ElZeroDist z (C function), 211ElZeroNorm c (C function), 363ElZeroNorm d (C function), 363ElZeroNorm i (C function), 363ElZeroNorm s (C function), 363ElZeroNorm z (C function), 363ElZeroNormDist c (C function), 363ElZeroNormDist d (C function), 363ElZeroNormDist i (C function), 363ElZeroNormDist s (C function), 363ElZeroNormDist z (C function), 363

588 Index

Page 593: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

ElZeros c (C function), 510ElZeros d (C function), 510ElZeros i (C function), 510ElZeros s (C function), 510ElZeros z (C function), 510ElZerosDist c (C function), 510ElZerosDist d (C function), 510ElZerosDist i (C function), 510ElZerosDist s (C function), 510ElZerosDist z (C function), 510EN (C++ function), 424, 425EN() (built-in function), 424EntrywiseFill (C++ function), 178EntrywiseFill() (built-in function), 179EntrywiseMap (C++ function), 179, 180EntrywiseMap() (built-in function), 181EntrywiseNorm (C++ function), 349EntrywiseNorm() (built-in function), 351Exp (C++ function), 48ExpandPackedReflectors (C++ function), 396ExplicitPermutation (C++ function), 392ExtendedKahan (C++ function), 479ExtendedKahan() (built-in function), 479

FFastAbs (C++ function), 48Fiedler (C++ function), 479Fiedler() (built-in function), 480FileFormat (C++ enum), 522FileFormat::ASCII (C++ enumerator), 522FileFormat::ASCII MATLAB (C++ enumera-

tor), 522FileFormat::AUTO (C++ enumerator), 522FileFormat::BINARY (C++ enumerator), 522FileFormat::BINARY FLAT (C++ enumera-

tor), 522FileFormat::BMP (C++ enumerator), 523FileFormat::JPEG (C++ enumerator), 523FileFormat::JPG (C++ enumerator), 523FileFormat::MATRIX MARKET (C++ enu-

merator), 523FileFormat::PNG (C++ enumerator), 523FileFormat::PPM (C++ enumerator), 523FileFormat::XBM (C++ enumerator), 523FileFormat::XPM (C++ enumerator), 523Fill (C++ function), 181Fill() (built-in function), 181FillDesc (C++ function), 32FillDiagonal (C++ function), 182FillDiagonal() (built-in function), 182Finalize (C++ function), 35

FLA Bsvd v opd var1 (C++ function), 32Forsythe (C++ function), 480Forsythe() (built-in function), 481ForwardOrBackward (C++ enum), 39ForwardOrBackward::BACKWARD (C++

enumerator), 39ForwardOrBackward::FORWARD (C++ enu-

merator), 39Fourier (C++ function), 481Fourier() (built-in function), 481FourierIdentity (C++ function), 481FourierIdentity() (built-in function), 482FrobeniusCondition (C++ function), 340FrobeniusCondition() (built-in function), 341FrobeniusNorm (C++ function), 352FrobeniusNorm() (built-in function), 353FrobeniusProx (C++ function), 440fullChanRatio (C++ member), 313

GGaussian (C++ function), 511Gaussian() (built-in function), 511GCD (C++ function), 43GCDMatrix (C++ function), 482GCDMatrix() (built-in function), 482Gear (C++ function), 483Gear() (built-in function), 483Gemm (C++ function), 221Gemm() (built-in function), 223GemmAlgorithm (built-in variable), 223GemmAlgorithm (C++ enum), 221GemmAlgorithm::GEMM CANNON (C++

enumerator), 221GemmAlgorithm::GEMM DEFAULT (C++

enumerator), 221GemmAlgorithm::GEMM SUMMA A (C++

enumerator), 221GemmAlgorithm::GEMM SUMMA B (C++

enumerator), 221GemmAlgorithm::GEMM SUMMA C (C++

enumerator), 221GemmAlgorithm::GEMM SUMMA DOT

(C++ enumerator), 221Gemv (C++ function), 211GEPPGrowth (C++ function), 483GEPPGrowth() (built-in function), 484Ger (C++ function), 212Geru (C++ function), 213GetDiagonal (C++ function), 182GetImagPartOfDiagonal (C++ function), 182,

183

Index 589

Page 594: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

GetMappedDiagonal (C++ function), 183GetRealPartOfDiagonal (C++ function), 182,

183GetSubmatrix (C++ function), 184GetSubmatrix() (built-in function), 183GKS (C++ function), 484GKS() (built-in function), 484GLM (C++ function), 385, 386GLM() (built-in function), 385glm::Overwrite (C++ function), 386GQR (C++ function), 287GQR() (built-in function), 287gqr::ExplicitTriang (C++ function), 287Graph (C++ class), 90Graph::˜Graph (C++ function), 91Graph::Capacity (C++ function), 92Graph::Connect (C++ function), 91Graph::Consistent (C++ function), 92Graph::Disconnect (C++ function), 91Graph::EdgeOffset (C++ function), 92Graph::Empty (C++ function), 91Graph::Graph (C++ function), 91Graph::LockedSourceBuffer (C++ function),

92Graph::LockedTargetBuffer (C++ function), 92Graph::NumConnections (C++ function), 92Graph::NumEdges (C++ function), 92Graph::NumSources (C++ function), 92Graph::NumTargets (C++ function), 92Graph::operator() (C++ function), 91Graph::operator= (C++ function), 91Graph::ProcessQueues (C++ function), 92Graph::QueueConnection (C++ function), 92Graph::QueueDisconnection (C++ function),

92Graph::Reserve (C++ function), 91Graph::Resize (C++ function), 91Graph::Source (C++ function), 92Graph::SourceBuffer (C++ function), 92Graph::Target (C++ function), 92Graph::TargetBuffer (C++ function), 92Grcar (C++ function), 485Grcar() (built-in function), 485Grid (C++ class), 56Grid::Col (C++ function), 57Grid::ColComm (C++ function), 57Grid::Comm (C++ function), 57Grid::Diag (C++ function), 59Grid::DiagRank (C++ function), 59Grid::GCD (C++ function), 58Grid::Grid (C++ function), 56, 58

Grid::HaveViewers (C++ function), 58Grid::Height (C++ function), 57Grid::InGrid (C++ function), 58Grid::LCM (C++ function), 58Grid::MCComm (C++ function), 58Grid::MCRank (C++ function), 57Grid::MCSize (C++ function), 57Grid::MRComm (C++ function), 58Grid::MRRank (C++ function), 57Grid::MRSize (C++ function), 58Grid::Order (C++ function), 57Grid::OwningComm (C++ function), 59Grid::OwningGroup (C++ function), 59Grid::OwningRank (C++ function), 59Grid::Rank (C++ function), 57Grid::Row (C++ function), 57Grid::RowComm (C++ function), 57Grid::Size (C++ function), 57Grid::VCComm (C++ function), 58Grid::VCRank (C++ function), 57Grid::VCSize (C++ function), 58Grid::VCToViewing (C++ function), 59Grid::VCToVR (C++ function), 59Grid::ViewingComm (C++ function), 59Grid::ViewingRank (C++ function), 59Grid::VRComm (C++ function), 58Grid::VRRank (C++ function), 57Grid::VRSize (C++ function), 58Grid::VRToVC (C++ function), 59Grid::Width (C++ function), 57GridOrder (C++ enum), 39GridOrder::COLUMN MAJOR (C++ enumer-

ator), 39GridOrder::ROW MAJOR (C++ enumerator),

39GRQ (C++ function), 289grq::ExplicitTriang (C++ function), 289

HHaar (C++ function), 512Haar() (built-in function), 512Hadamard (C++ function), 186Hankel (C++ function), 485Hankel() (built-in function), 486Hanowa (C++ function), 486Hanowa() (built-in function), 487HatanoNelson (C++ function), 513HatanoNelson() (built-in function), 513Helmholtz (C++ function), 487Helmholtz1D() (built-in function), 488Helmholtz2D() (built-in function), 488

590 Index

Page 595: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Helmholtz3D() (built-in function), 488HelmholtzPML (C++ function), 488, 489HelmholtzPML1D() (built-in function), 489HelmholtzPML2D() (built-in function), 489HelmholtzPML3D() (built-in function), 490Hemm (C++ function), 223Hemm() (built-in function), 224Hemv (C++ function), 213Her (C++ function), 214Her2 (C++ function), 214Her2k (C++ function), 225Her2k() (built-in function), 225Herk (C++ function), 224Herk() (built-in function), 224herm solve::Overwrite (C++ function), 372herm tridiag::ApplyQ (C++ function), 247herm tridiag::ExplicitCondensed (C++ func-

tion), 244, 245herm tridiag eig::Eig (C++ function), 31herm tridiag eig::EigEstimate (C++ function),

31herm tridiag eig::Estimate (C++ class), 30herm tridiag eig::Estimate::numGlobalEigenvalues

(C++ member), 30herm tridiag eig::Estimate::numLocalEigenvalues

(C++ member), 30herm tridiag eig::Info (C++ class), 30herm tridiag eig::Info::firstLocalEigenvalue

(C++ member), 31herm tridiag eig::Info::numGlobalEigenvalues

(C++ member), 31herm tridiag eig::Info::numLocalEigenvalues

(C++ member), 31HermitianEig (C++ function), 297, 299HermitianEigCtrl (C++ function), 300HermitianEigCtrl d (C type), 301HermitianEigCtrl d.sdcCtrl (C member), 301HermitianEigCtrl d.tridiagCtrl (C member),

301HermitianEigCtrl d.useSDC (C member), 301HermitianEigCtrl s (C type), 301HermitianEigCtrl s.sdcCtrl (C member), 301HermitianEigCtrl s.tridiagCtrl (C member),

301HermitianEigCtrl s.useSDC (C member), 301HermitianEigCtrl<Base<F>> (C++ type),

301HermitianEigCtrl<Real> (C++ type), 300HermitianEigSubset d (C type), 296HermitianEigSubset d.indexSubset (C mem-

ber), 296

HermitianEigSubset d.lowerBound (C mem-ber), 297

HermitianEigSubset d.lowerIndex (C mem-ber), 296

HermitianEigSubset d.rangeSubset (C mem-ber), 297

HermitianEigSubset d.upperBound (C mem-ber), 297

HermitianEigSubset d.upperIndex (C mem-ber), 296

HermitianEigSubset s (C type), 296HermitianEigSubset s.indexSubset (C mem-

ber), 296HermitianEigSubset s.lowerBound (C mem-

ber), 296HermitianEigSubset s.lowerIndex (C mem-

ber), 296HermitianEigSubset s.rangeSubset (C mem-

ber), 296HermitianEigSubset s.upperBound (C mem-

ber), 296HermitianEigSubset s.upperIndex (C mem-

ber), 296HermitianEigSubset<Base<F>> (C++ type),

296HermitianEigSubset<Real> (C++ type), 296HermitianEntrywiseNorm (C++ function),

349HermitianEntrywiseNorm() (built-in func-

tion), 351HermitianFrobeniusNorm (C++ function),

352HermitianFrobeniusNorm() (built-in func-

tion), 353HermitianFromEVD (C++ function), 490HermitianFromEVD() (built-in function), 490HermitianFunction (C++ function), 333HermitianGenDefEig (C++ function), 306, 308HermitianInfinityNorm (C++ function), 355HermitianInfinityNorm() (built-in function),

356HermitianInverse (C++ function), 331HermitianInverse() (built-in function), 330HermitianKyFanNorm (C++ function), 354HermitianMaxNorm (C++ function), 356HermitianNorm (C++ function), 364HermitianNorm() (built-in function), 365HermitianNuclearNorm (C++ function), 358HermitianOneNorm (C++ function), 359HermitianPolar (C++ function), 315HermitianPseudoinverse (C++ function), 335

Index 591

Page 596: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

HermitianSchattenNorm (C++ function), 360HermitianSDCCtrl (C++ function), 301HermitianSDCCtrl<Base<F>> (C++ type),

301HermitianSDCCtrl<Real> (C++ type), 301HermitianSign (C++ function), 339HermitianSolve (C++ function), 372HermitianSolve() (built-in function), 371HermitianSVD (C++ function), 310, 311HermitianSwap (C++ function), 205HermitianTridiag (C++ function), 244HermitianTridiag() (built-in function), 244HermitianTridiagApproach (C++ enum), 244HermitianTridiagApproach::HERMITIAN TRIDIAG DEFAULT

(C++ enumerator), 244HermitianTridiagApproach::HERMITIAN TRIDIAG NORMAL

(C++ enumerator), 244HermitianTridiagApproach::HERMITIAN TRIDIAG SQUARE

(C++ enumerator), 244HermitianTridiagCtrl (C++ class), 245HermitianTridiagCtrl::approach (C++ mem-

ber), 245HermitianTridiagCtrl::HermitianTridiagCtrl

(C++ function), 245HermitianTridiagCtrl::order (C++ member),

245HermitianTridiagEig (C++ function), 293, 294HermitianTwoNorm (C++ function), 361HermitianTwoNormEstimate (C++ function),

362HermitianUniformSpectrum (C++ function),

514HermitianUniformSpectrum() (built-in func-

tion), 514Hessenberg (C++ function), 248Hessenberg() (built-in function), 248hessenberg::ApplyQ (C++ function), 249hessenberg::ExplicitCondensed (C++ func-

tion), 248HessenbergSpectralCloud (C++ function), 324HessenbergSpectralPortrait (C++ function),

319HessenbergSpectralWindow (C++ function),

321, 322HessQRCtrl (C++ type), 316Hilbert (C++ function), 491Hilbert() (built-in function), 491HilbertSchmidt (C++ function), 187HingeLossProx (C++ function), 440hpd solve::Overwrite (C++ function), 374HPDDeterminant (C++ function), 346

HPDInverse (C++ function), 332HPDInverse() (built-in function), 332HPDSolve (C++ function), 373HPDSolve() (built-in function), 373HPSDCholesky (C++ function), 255HPSDCholesky() (built-in function), 255HPSDSquareRoot (C++ function), 336hyp reflector::Col (C++ function), 396hyp reflector::Row (C++ function), 396

IID (C++ function), 290Identity (C++ function), 491Identity() (built-in function), 492ImagPart (C++ function), 46ImplicitHaar (C++ function), 512ImplicitHaar() (built-in function), 512IndexDependentFill (C++ function), 188IndexDependentMap (C++ function), 188indexSubset (C++ member), 296Inertia (C++ function), 348Inertia() (built-in function), 347InertiaAfterLDL() (built-in function), 264InertiaType (C++ class), 348InertiaType::numNegative (C++ member),

348InertiaType::numPositive (C++ member), 348InertiaType::numZero (C++ member), 348InfinityCondition (C++ function), 341InfinityCondition() (built-in function), 341InfinityNorm (C++ function), 355InfinityNorm() (built-in function), 356Initialize (C++ function), 35Initialized (C++ function), 35Int (C++ type), 38Inverse (C++ function), 329Inverse() (built-in function), 329InversePermuteCols (C++ function), 392InversePermuteRows (C++ function), 392InvertPermutation (C++ function), 392IR (C++ type), 102

JJordan (C++ function), 492Jordan() (built-in function), 492

KKahan (C++ function), 493Kahan() (built-in function), 493kappa (C++ member), 345KMS (C++ function), 493KMS() (built-in function), 494

592 Index

Page 597: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

KyFanNorm (C++ function), 353

Llapack::BidiagQRAlg (C++ function), 22lapack::DivideAndConquerSVD (C++ func-

tion), 22lapack::Eig (C++ function), 23lapack::Givens (C++ function), 21lapack::HermitianEig (C++ function), 22lapack::HessenbergEig (C++ function), 23lapack::HessenbergSchur (C++ function), 22lapack::MachineEpsilon<Real> (C++ func-

tion), 21lapack::MachineOverflowExponent<Real>

(C++ function), 21lapack::MachineOverflowThreshold<Real>

(C++ function), 21lapack::MachinePrecision<Real> (C++ func-

tion), 21lapack::MachineSafeMin<Real> (C++ func-

tion), 21lapack::MachineUnderflowExponent<Real>

(C++ function), 21lapack::MachineUnderflowThreshold<Real>

(C++ function), 21lapack::QRSVD (C++ function), 22lapack::SafeNorm (C++ function), 21lapack::Schur (C++ function), 23lapack::SVD (C++ function), 22Laplacian (C++ function), 494Laplacian1D() (built-in function), 495Laplacian2D() (built-in function), 495Laplacian3D() (built-in function), 495Lauchli (C++ function), 495Lauchli() (built-in function), 496LAV (C++ function), 426, 427LAV() (built-in function), 426LDL (C++ function), 261LDL() (built-in function), 260ldl::Inertia (C++ function), 265ldl::MultiplyAfter (C++ function), 264, 268ldl::SolveAfter (C++ function), 262, 267LDL WITHOUT PIVOTING (built-in vari-

able), 260LDLH (C++ function), 266LDLPivot (C++ class), 261LDLPivot::from (C++ member), 261LDLPivot::nb (C++ member), 261LDLPivotConstant<Real> (C++ function),

260LDLPivotCtrl<Real> (C++ class), 260

LDLPivotCtrl<Real>::gamma (C++ mem-ber), 261

LDLPivotCtrl<Real>::LDLPivotCtrl (C++function), 261

LDLPivotCtrl<Real>::pivotType (C++ mem-ber), 260

LDLPivotType (C++ enum), 260LDLPivotType::BUNCH KAUFMAN A (C++

enumerator), 260LDLPivotType::BUNCH KAUFMAN BOUNDED

(C++ enumerator), 260LDLPivotType::BUNCH KAUFMAN C (C++

enumerator), 260LDLPivotType::BUNCH KAUFMAN D (C++

enumerator), 260LDLPivotType::BUNCH PARLETT (C++ enu-

merator), 260LDLPivotType::LDL WITHOUT PIVOTING

(C++ enumerator), 260LDLT (C++ function), 266LeastSquares (C++ function), 377LeastSquares() (built-in function), 377LeftHyperbolicReflector (C++ function), 396LeftOrRight (C++ enum), 39LeftOrRight::LEFT (C++ enumerator), 39LeftOrRight::RIGHT (C++ enumerator), 39LeftReflector (C++ function), 395Legendre (C++ function), 496Legendre() (built-in function), 496Lehmer (C++ function), 497Lehmer() (built-in function), 497Length (C++ function), 43lin solve::Overwrite (C++ function), 367LinearSolve (C++ function), 367LinearSolve() (built-in function), 367LocalSymvBlocksize<T> (C++ function), 242LocalTrr2kBlocksize<T> (C++ function), 242LocalTrrkBlocksize<T> (C++ function), 242LockedMerge1x2 (C++ function), 139LockedMerge2x1 (C++ function), 140, 141LockedMerge2x2 (C++ function), 142LockedPartitionDown (C++ function), 108LockedPartitionDownDiagonal (C++ func-

tion), 114LockedPartitionDownOffsetDiagonal (C++

function), 116LockedPartitionLeft (C++ function), 112LockedPartitionRight (C++ function), 111LockedPartitionUp (C++ function), 109LockedPartitionUpDiagonal (C++ function),

118

Index 593

Page 598: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

LockedPartitionUpOffsetDiagonal (C++ func-tion), 120

LockedRepartitionDown (C++ function), 123LockedRepartitionDownDiagonal (C++ func-

tion), 131LockedRepartitionLeft (C++ function), 129LockedRepartitionRight (C++ function), 127LockedRepartitionUp (C++ function), 125LockedRepartitionUpDiagonal (C++ func-

tion), 135LockedView (C++ function), 103–106Log (C++ function), 48Log2 (C++ function), 43LogBarrier (C++ function), 463LogDetDiv (C++ function), 463LogisticProx (C++ function), 441LogisticRegression (C++ function), 428Lotkin (C++ function), 497Lotkin() (built-in function), 498lowerBound (C++ member), 296LowerClip (C++ function), 439lowerIndex (C++ member), 296LP (C++ function), 400–402LPAffine() (built-in function), 401LPDirect() (built-in function), 400LQ (C++ function), 274lq::ApplyQ (C++ function), 275lq::Explicit (C++ function), 274lq::ExplicitTriang (C++ function), 274lq::ExplicitUnitary (C++ function), 274lq::SolveAfter (C++ function), 276ls::Overwrite (C++ function), 378LSE (C++ function), 389LSE() (built-in function), 389lse::Overwrite (C++ function), 389LU (C++ function), 269, 270, 272lu::SolveAfter (C++ function), 269, 271, 272LUMod (C++ function), 273Lyapunov (C++ function), 467Lyapunov() (built-in function), 467

MMakeGaussian (C++ function), 511MakeIdentity (C++ function), 491MakeTrapezoidal (C++ function), 189MakeTrapezoidal() (built-in function), 190MakeUniform (C++ function), 516Matrix<Complex<Real>> (C++ class), 56Matrix<F> (C++ class), 56Matrix<Int> (C++ class), 56Matrix<Real> (C++ class), 56

Matrix<scalarType> (C++ class), 53Matrix<scalarType>::˜Matrix (C++ function),

53Matrix<scalarType>::Attach (C++ function),

54Matrix<scalarType>::Buffer (C++ function),

55Matrix<scalarType>::Conjugate (C++ func-

tion), 55Matrix<scalarType>::Control (C++ function),

54Matrix<scalarType>::DiagonalLength (C++

function), 55Matrix<scalarType>::Empty (C++ function),

54Matrix<scalarType>::FixedSize (C++ func-

tion), 55Matrix<scalarType>::Get (C++ function), 55Matrix<scalarType>::GetImagPart (C++

function), 55Matrix<scalarType>::GetRealPart (C++ func-

tion), 55Matrix<scalarType>::Height (C++ function),

54Matrix<scalarType>::LDim (C++ function),

54Matrix<scalarType>::Locked (C++ function),

55Matrix<scalarType>::LockedAttach (C++

function), 54Matrix<scalarType>::LockedBuffer (C++

function), 55Matrix<scalarType>::MakeReal (C++ func-

tion), 55Matrix<scalarType>::Matrix (C++ function),

53Matrix<scalarType>::MemorySize (C++

function), 54Matrix<scalarType>::operator() (C++ func-

tion), 54Matrix<scalarType>::operator= (C++ func-

tion), 54Matrix<scalarType>::Resize (C++ function),

54Matrix<scalarType>::Set (C++ function), 55Matrix<scalarType>::SetImagPart (C++ func-

tion), 55Matrix<scalarType>::SetRealPart (C++ func-

tion), 55Matrix<scalarType>::Update (C++ function),

55

594 Index

Page 599: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Matrix<scalarType>::UpdateImagPart (C++function), 55

Matrix<scalarType>::UpdateRealPart (C++function), 55

Matrix<scalarType>::Viewing (C++ func-tion), 55

Matrix<scalarType>::Width (C++ function),54

Max (C++ function), 190, 193MaxAbs (C++ function), 191MaxCondition (C++ function), 342MaxCondition() (built-in function), 342maxInnerIts (C++ member), 301, 317maxIts (C++ member), 315, 336, 338MaxLength (C++ function), 43MaxNorm (C++ function), 356maxOuterIts (C++ member), 301, 317maxRank (C++ member), 278MaxStep (C++ function), 456Median (C++ function), 397Merge1x2 (C++ function), 139Merge2x1 (C++ function), 140, 141Merge2x2 (C++ function), 142MinAbs (C++ function), 194MinIJ (C++ function), 498MinIJ() (built-in function), 498Mod (C++ function), 43ModelFit (C++ function), 429mpi::AllGather (C++ function), 29mpi::AllReduce (C++ function), 30mpi::AllToAll (C++ function), 30mpi::ANY SOURCE (C++ member), 24mpi::ANY TAG (C++ member), 24mpi::Barrier (C++ function), 28mpi::BINARY AND (C++ member), 25mpi::BINARY OR (C++ member), 25mpi::BINARY XOR (C++ member), 25mpi::Broadcast (C++ function), 29mpi::CartCreate (C++ function), 27mpi::CartSub (C++ function), 27mpi::Comm (C++ class), 23mpi::Comm::Comm (C++ function), 23mpi::Comm::comm (C++ member), 23mpi::COMM NULL (C++ member), 25mpi::COMM SELF (C++ member), 25mpi::COMM WORLD (C++ member), 25mpi::CommGroup (C++ function), 27mpi::Congruent (C++ function), 27mpi::Create (C++ function), 26, 27mpi::Datatype (C++ type), 24mpi::Difference (C++ function), 28

mpi::Dup (C++ function), 27mpi::ErrorHandler (C++ type), 24mpi::ErrorHandlerSet (C++ function), 27mpi::ERRORS ARE FATAL (C++ member), 25mpi::ERRORS RETURN (C++ member), 25mpi::Finalize (C++ function), 26mpi::Finalized (C++ function), 26mpi::Free (C++ function), 26–28mpi::Gather (C++ function), 29mpi::GetCount<T> (C++ function), 29mpi::Group (C++ class), 24mpi::Group::Group (C++ function), 24mpi::Group::group (C++ member), 24mpi::GROUP EMPTY (C++ member), 25mpi::GROUP NULL (C++ member), 25mpi::Incl (C++ function), 28mpi::Initialize (C++ function), 26mpi::Initialized (C++ function), 26mpi::InitializeThread (C++ function), 26mpi::IProbe (C++ function), 28mpi::IRecv (C++ function), 29mpi::ISend (C++ function), 29mpi::ISSend (C++ function), 29mpi::LOGICAL AND (C++ member), 25mpi::LOGICAL OR (C++ member), 25mpi::LOGICAL XOR (C++ member), 25mpi::MAX (C++ member), 25mpi::MIN (C++ member), 25mpi::MIN COLL MSG (C++ member), 25mpi::Op (C++ class), 24mpi::Op::Op (C++ function), 24mpi::Op::op (C++ member), 24mpi::PROD (C++ member), 25mpi::Rank (C++ function), 27mpi::Recv (C++ function), 29mpi::Reduce (C++ function), 30mpi::ReduceScatter (C++ function), 30mpi::Request (C++ type), 24mpi::REQUEST NULL (C++ member), 25mpi::Scatter (C++ function), 29mpi::Send (C++ function), 29mpi::SendRecv (C++ function), 29mpi::Size (C++ function), 27mpi::Split (C++ function), 27mpi::Status (C++ type), 24mpi::SUM (C++ member), 25mpi::Test (C++ function), 28mpi::THREAD FUNNELED (C++ member),

24mpi::THREAD MULTIPLE (C++ member), 24

Index 595

Page 600: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

mpi::THREAD SERIALIZED (C++ member),24

mpi::THREAD SINGLE (C++ member), 24mpi::Time (C++ function), 26mpi::Translate (C++ function), 28mpi::UNDEFINED (C++ member), 24mpi::Union (C++ function), 28mpi::UserFunction (C++ type), 24mpi::Wait (C++ function), 28MultiplyAfterLDL() (built-in function), 268MultiplyAfterLDLPiv() (built-in function),

263MultiShiftHessSolve (C++ function), 375MultiShiftHessSolve() (built-in function), 375MultiShiftQuasiTrsm (C++ function), 226MultiShiftQuasiTrsm() (built-in function), 227MultiShiftTrsm (C++ function), 227MultiShiftTrsm() (built-in function), 228

Nn (C++ member), 345NMF (C++ function), 430NMF() (built-in function), 430NNLS (C++ function), 431NNLS() (built-in function), 431NonHPDMatrixException (C++ class), 36NonHPDMatrixException::NonHPDMatrixException

(C++ function), 36NonHPSDMatrixException (C++ class), 36NonHPSDMatrixException::NonHPSDMatrixException

(C++ function), 37Norm (C++ function), 364Norm() (built-in function), 365NormalFromEVD (C++ function), 499NormalFromEVD() (built-in function), 499NormalUniformSpectrum (C++ function), 514NormalUniformSpectrum() (built-in func-

tion), 515NormType (C++ enum), 39NormType::ENTRYWISE ONE NORM (C++

enumerator), 40NormType::FROBENIUS NORM (C++ enu-

merator), 40NormType::INFINITY NORM (C++ enumer-

ator), 40NormType::MAX NORM (C++ enumerator),

40NormType::NUCLEAR NORM (C++ enu-

merator), 40NormType::ONE NORM (C++ enumerator),

39

NormType::TWO NORM (C++ enumerator),40

Nrm2 (C++ function), 196NuclearNorm (C++ function), 358numIts (C++ member), 315

OOneCondition (C++ function), 342OneCondition() (built-in function), 342OneNorm (C++ function), 359Ones (C++ function), 499Ones() (built-in function), 500OneTwoOne (C++ function), 500OneTwoOne() (built-in function), 500operator

= (C++ function), 24, 59operator== (C++ function), 23, 24, 59operator<< (C++ function), 42order (C++ member), 245Orientation (C++ enum), 40Orientation::ADJOINT (C++ enumerator), 40Orientation::NORMAL (C++ enumerator), 40Orientation::TRANSPOSE (C++ enumerator),

40

PParter (C++ function), 501Parter() (built-in function), 501PartitionDown (C++ function), 108PartitionDownDiagonal (C++ function), 114PartitionDownOffsetDiagonal (C++ function),

116PartitionLeft (C++ function), 112PartitionRight (C++ function), 111PartitionUp (C++ function), 109PartitionUpDiagonal (C++ function), 118PartitionUpOffsetDiagonal (C++ function),

120pblas::Gemm (C++ function), 33pblas::Gemv (C++ function), 32pblas::Hemv (C++ function), 33pblas::Symv (C++ function), 33pblas::Trmm (C++ function), 33pblas::Trmv (C++ function), 33pblas::Trsm (C++ function), 33pblas::Trsv (C++ function), 33Pei (C++ function), 501Pei() (built-in function), 502Pencil (C++ enum), 306Pencil::ABX (C++ enumerator), 306Pencil::AXBX (C++ enumerator), 306Pencil::BAX (C++ enumerator), 306

596 Index

Page 601: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

PermutationMeta (C++ function), 393PermutationMeta (C++ type), 393PermutationParity (C++ function), 393PermuteCols (C++ function), 391PermuteRows (C++ function), 392PivotParity (C++ function), 394PivotsToInversePermutation (C++ function),

395PivotsToPartialPermutation (C++ function),

395PivotsToPermutation (C++ function), 395Polar (C++ function), 47, 314, 315PolarCtrl (C++ type), 315PopBlocksizeStack (C++ function), 38PopCallStack (C++ function), 37pos orth::ComplementRatio (C++ function),

447pos orth::MaxStep (C++ function), 447pos orth::NesterovTodd (C++ function), 448pos orth::NumOutside (C++ function), 448pos orth::PushPairInto (C++ function), 449Pow (C++ function), 48power (C++ member), 336, 338PowerOfTwo (C++ function), 43Print (C++ function), 520, 521PrintCCompilerInfo (C++ function), 45PrintCCompilerInfo() (built-in function), 45PrintConfig (C++ function), 44PrintConfig() (built-in function), 44PrintCxxCompilerInfo (C++ function), 45PrintCxxCompilerInfo() (built-in function), 45PrintLocal (C++ function), 521PrintVersion (C++ function), 43PrintVersion() (built-in function), 44progress (C++ member), 301, 317, 336, 338ProxyCtrl (C++ class), 107ProxyCtrl::colAlign (C++ member), 107ProxyCtrl::colConstrain (C++ member), 107ProxyCtrl::ProxyCtrl (C++ function), 107ProxyCtrl::root (C++ member), 107ProxyCtrl::rootConstrain (C++ member), 107ProxyCtrl::rowAlign (C++ member), 107ProxyCtrl::rowConstrain (C++ member), 107Pseudoinverse (C++ function), 334PseudospecCtrl<Base<F>> (C++ class), 327PseudospecCtrl<Real> (C++ class), 326PseudospecCtrl<Real>::arnoldi (C++ mem-

ber), 326PseudospecCtrl<Real>::basisSize (C++ mem-

ber), 326

PseudospecCtrl<Real>::deflate (C++ mem-ber), 326

PseudospecCtrl<Real>::forceComplexPs(C++ member), 326

PseudospecCtrl<Real>::forceComplexSchur(C++ member), 326

PseudospecCtrl<Real>::maxIts (C++ mem-ber), 326

PseudospecCtrl<Real>::progress (C++ mem-ber), 327

PseudospecCtrl<Real>::reorthog (C++ mem-ber), 327

PseudospecCtrl<Real>::schurCtrl (C++member), 326

PseudospecCtrl<Real>::snapCtrl (C++ mem-ber), 327

PseudospecCtrl<Real>::tol (C++ member),326

PseudospecNorm (C++ enum), 325PseudospecNorm::PS ONE NORM (C++

enumerator), 326PseudospecNorm::PS TWO NORM (C++

enumerator), 325PushBlocksizeStack (C++ function), 38PushCallStack (C++ function), 37

Qqdwh (C++ member), 315QP (C++ function), 404, 406qp::ADMM (C++ function), 409QPAffine() (built-in function), 406QPDirect() (built-in function), 404QR (C++ function), 277QR0 (C++ member), 279qr::ApplyQ (C++ function), 282qr::Cholesky (C++ function), 278qr::Explicit (C++ function), 278qr::ExplicitTriang (C++ function), 278qr::ExplicitTS (C++ function), 278qr::ExplicitUnitary (C++ function), 278qr::SolveAfter (C++ function), 283qr::TS (C++ function), 278qr::ts::FormQ (C++ function), 278qr::ts::FormR (C++ function), 278QRCtrl (C++ function), 279qrCtrl (C++ member), 316QRCtrl<Real> (C++ type), 278QRList (C++ member), 279QuasiDiagonalScale (C++ function), 196QuasiDiagonalSolve (C++ function), 197

Index 597

Page 602: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

QuasiTriangularSpectralCloud (C++ func-tion), 324

QuasiTriangularSpectralPortrait (C++ func-tion), 319

QuasiTriangularSpectralWindow (C++ func-tion), 321

QuasiTrsm (C++ function), 229QuasiTrsm() (built-in function), 229QuasiTrsv (C++ function), 215

RRademacher (C++ function), 515Rademacher() (built-in function), 515random (C++ member), 301, 317Range d (C type), 102Range d.beg (C member), 102Range d.end (C member), 102Range i (C type), 102Range i.beg (C member), 102Range i.end (C member), 102Range s (C type), 102Range s.beg (C member), 102Range s.end (C member), 102Range<double> (C++ class), 102Range<float> (C++ class), 102Range<Int> (C++ class), 102Range<T> (C++ class), 102Range<T>::beg (C++ member), 102Range<T>::end (C++ member), 102Range<T>::operator+ (C++ function), 102Range<T>::operator- (C++ function), 102Range<T>::Range (C++ function), 102rangeSubset (C++ member), 296Read (C++ function), 524ReadProxy (C++ function), 107ReadWriteProxy (C++ function), 107RealPart (C++ function), 46recvCounts (C++ member), 393recvDispls (C++ member), 393recvIdx (C++ member), 393recvRanks (C++ member), 393Redheffer (C++ function), 502Redheffer() (built-in function), 503reflector::Col (C++ function), 395reflector::Row (C++ function), 395, 396Regularization (C type), 428relative (C++ member), 313RepartitionDown (C++ function), 123RepartitionDownDiagonal (C++ function),

131RepartitionLeft (C++ function), 129

RepartitionRight (C++ function), 127RepartitionUp (C++ function), 125RepartitionUpDiagonal (C++ function), 135ReportException (C++ function), 36Reshape (C++ function), 197Reshape() (built-in function), 197rho (C++ member), 345Ricatti (C++ function), 465Ricatti() (built-in function), 465RicattiPreformed() (built-in function), 465Ridge (C++ function), 383Ridge() (built-in function), 382RidgeAlg (C++ enum), 383RidgeAlg::RIDGE CHOLESKY (C++ enumer-

ator), 383RidgeAlg::RIDGE QR (C++ enumerator), 383RidgeAlg::RIDGE SVD (C++ enumerator),

383Riffle (C++ function), 503Riffle() (built-in function), 504RiffleDecay (C++ function), 503RiffleDecay() (built-in function), 504RiffleStationary (C++ function), 503RiffleStationary() (built-in function), 504RightHyperbolicReflector (C++ function), 396RightReflector (C++ function), 395Ris (C++ function), 504Ris() (built-in function), 505RowSwap (C++ function), 204RPCA (C++ function), 433RPCA() (built-in function), 433RPCACtrl (C++ class), 433RPCACtrl::beta (C++ member), 433RPCACtrl::maxIts (C++ member), 433RPCACtrl::numPivSteps (C++ member), 433RPCACtrl::progress (C++ member), 433RPCACtrl::rho (C++ member), 433RPCACtrl::RPCACtrl (C++ function), 433RPCACtrl::tau (C++ member), 433RPCACtrl::tol (C++ member), 433RPCACtrl::useALM (C++ member), 433RPCACtrl::usePivQR (C++ member), 433RQ (C++ function), 284rq::ApplyQ (C++ function), 284rq::ExplicitTriang (C++ function), 284rq::SolveAfter (C++ function), 285

SSafeAbs (C++ function), 48SafeDeterminant (C++ function), 344, 345SafeHPDDeterminant (C++ function), 346

598 Index

Page 603: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

SafeProduct<F> (C++ type), 345scalapack::Cholesky (C++ function), 33scalapack::HessenbergEig (C++ function), 34scalapack::HessenbergSchur (C++ function),

34Scale (C++ function), 199Scale() (built-in function), 199ScaleDown (C++ function), 393ScaleTrapezoid (C++ function), 200ScaleTrapezoid() (built-in function), 201ScaleUp (C++ function), 393scaling (C++ member), 338SchattenNorm (C++ function), 360Schur (C++ function), 315, 316schur::CheckRealSchur (C++ function), 317schur::QuasiTriangEig (C++ function), 317schur::RealToComplex (C++ function), 317SchurCtrl<Base<F>> (C++ type), 316SchurCtrl<Real> (C++ type), 316scomplex (C++ type), 42sdcCtrl (C++ member), 300, 316SDCCtrl<Base<F>> (C++ type), 317SDCCtrl<Real> (C++ type), 316sendCounts (C++ member), 393sendDispls (C++ member), 393sendIdx (C++ member), 393sendRanks (C++ member), 393seqQR (C++ member), 313SetBlocksize (C++ function), 38SetDefaultBlockHeight (C++ function), 38SetDefaultBlockWidth (C++ function), 38SetDiagonal (C++ function), 201SetImagPart (C++ function), 46SetImagPartOfDiagonal (C++ function), 201SetImagPartOfSubmatrix (C++ function), 202SetLocalSymvBlocksize<T> (C++ function),

242SetLocalTrr2kBlocksize<T> (C++ function),

242SetLocalTrrkBlocksize<T> (C++ function),

242SetRealPart (C++ function), 46SetRealPartOfDiagonal (C++ function), 201SetRealPartOfSubmatrix (C++ function), 202SetSubmatrix (C++ function), 202Sgn (C++ function), 48Shift (C++ function), 43ShiftDiagonal (C++ function), 202ShiftDiagonal() (built-in function), 203Sign (C++ function), 337, 338SignCtrl<Base<F>> (C++ type), 338

SignCtrl<Real> (C++ type), 338SignScaling (C++ type), 338Sin (C++ function), 49SingularMatrixException (C++ class), 36SingularMatrixException::SingularMatrixException

(C++ function), 36Sinh (C++ function), 50Skeleton (C++ function), 291SkewHermitianEig (C++ function), 303, 304SlideLockedPartitionDown (C++ function),

144SlideLockedPartitionDownDiagonal (C++

function), 151SlideLockedPartitionLeft (C++ function), 149SlideLockedPartitionRight (C++ function),

147SlideLockedPartitionUp (C++ function), 145,

146SlideLockedPartitionUpDiagonal (C++ func-

tion), 156, 157SlidePartitionDown (C++ function), 144SlidePartitionDownDiagonal (C++ function),

151SlidePartitionLeft (C++ function), 149SlidePartitionRight (C++ function), 147SlidePartitionUp (C++ function), 145SlidePartitionUpDiagonal (C++ function), 156SnapshotCtrl (C++ class), 326SnapshotCtrl::imagSize (C++ member), 326SnapshotCtrl::imgBase (C++ member), 326SnapshotCtrl::imgDispCount (C++ member),

326SnapshotCtrl::imgDispFreq (C++ member),

326SnapshotCtrl::imgFormat (C++ member), 326SnapshotCtrl::imgSaveCount (C++ member),

326SnapshotCtrl::imgSaveFreq (C++ member),

326SnapshotCtrl::Iterate (C++ function), 326SnapshotCtrl::numBase (C++ member), 326SnapshotCtrl::numFormat (C++ member), 326SnapshotCtrl::numSaveCount (C++ member),

326SnapshotCtrl::numSaveFreq (C++ member),

326SnapshotCtrl::realSize (C++ member), 326SnapshotCtrl::ResetCounts (C++ function),

326SnapshotCtrl::SnapshotCtrl (C++ function),

326

Index 599

Page 604: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

soc::Apply (C++ function), 449, 450soc::ApplyQuadratic (C++ function), 450soc::Degree (C++ function), 451soc::Dets (C++ function), 451, 452soc::Dots (C++ function), 452soc::EmbeddingMaps (C++ function), 453soc::Identity (C++ function), 453soc::Inverse (C++ function), 454soc::LowerNorms (C++ function), 455soc::MaxEig (C++ function), 455soc::MinEig (C++ function), 456, 457soc::NesterovTodd (C++ function), 457soc::NumOutside (C++ function), 458soc::PushInto (C++ function), 458soc::PushPairInto (C++ function), 459soc::Reflect (C++ function), 460soc::Shift (C++ function), 460soc::SquareRoot (C++ function), 461SOCP (C++ function), 410, 412SOCPAffine() (built-in function), 412SOCPDirect() (built-in function), 410SoftThreshold (C++ function), 443SolveAfterCholesky() (built-in function), 257SolveAfterLDL() (built-in function), 267SolveAfterLDLPiv() (built-in function), 262Sort (C++ function), 397SortType (C++ enum), 39SortType::ASCENDING (C++ enumerator), 39SortType::DESCENDING (C++ enumerator),

39SortType::UNSORTED (C++ enumerator), 39SparseInvCov (C++ function), 434SparseMatrix<Complex<Real>> (C++

class), 94SparseMatrix<F> (C++ class), 95SparseMatrix<Int> (C++ class), 95SparseMatrix<Real> (C++ class), 94SparseMatrix<T> (C++ class), 93SparseMatrix<T>::˜SparseMatrix (C++ func-

tion), 93SparseMatrix<T>::Capacity (C++ function),

94SparseMatrix<T>::Col (C++ function), 94SparseMatrix<T>::Consistent (C++ function),

94SparseMatrix<T>::Empty (C++ function), 93SparseMatrix<T>::EntryOffset (C++ func-

tion), 94SparseMatrix<T>::Graph (C++ function), 94SparseMatrix<T>::Height (C++ function), 94

SparseMatrix<T>::LockedGraph (C++ func-tion), 94

SparseMatrix<T>::LockedSourceBuffer (C++function), 94

SparseMatrix<T>::LockedTargetBuffer (C++function), 94

SparseMatrix<T>::LockedValueBuffer (C++function), 94

SparseMatrix<T>::NumConnections (C++function), 94

SparseMatrix<T>::NumEntries (C++ func-tion), 94

SparseMatrix<T>::operator() (C++ function),93

SparseMatrix<T>::operator= (C++ function),93

SparseMatrix<T>::ProcessQueues (C++ func-tion), 94

SparseMatrix<T>::QueueUpdate (C++ func-tion), 94

SparseMatrix<T>::QueueZero (C++ func-tion), 94

SparseMatrix<T>::Reserve (C++ function), 94SparseMatrix<T>::Resize (C++ function), 94SparseMatrix<T>::Row (C++ function), 94SparseMatrix<T>::SourceBuffer (C++ func-

tion), 94SparseMatrix<T>::SparseMatrix (C++ func-

tion), 93SparseMatrix<T>::TargetBuffer (C++ func-

tion), 94SparseMatrix<T>::Update (C++ function), 94SparseMatrix<T>::Value (C++ function), 94SparseMatrix<T>::ValueBuffer (C++ func-

tion), 94SparseMatrix<T>::Width (C++ function), 94SparseMatrix<T>::Zero (C++ function), 94SpectralCloud (C++ function), 323SpectralCloud() (built-in function), 323SpectralPortrait (C++ function), 319SpectralPortrait() (built-in function), 319SpectralWindow (C++ function), 321SpectralWindow() (built-in function), 321spreadFactor (C++ member), 301, 317Spy (C++ function), 522Sqrt (C++ function), 48SquareRoot (C++ function), 336SquareRootCtrl (C++ function), 336SquareRootCtrl<Real> (C++ type), 336SVD (C++ function), 312SVDCtrl (C++ function), 313

600 Index

Page 605: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

SVDCtrl<Base<F>> (C++ type), 314SVDCtrl<Real> (C++ type), 313SVM (C++ function), 435SVM() (built-in function), 435SVT (C++ function), 441, 442svt::Cross (C++ function), 442svt::Normal (C++ function), 442svt::PivotedQR (C++ function), 442svt::TSQR (C++ function), 443Swap (C++ function), 203Sylvester (C++ function), 468Sylvester() (built-in function), 468SylvesterPreformed() (built-in function), 468Symm (C++ function), 229, 230Symm() (built-in function), 230symm solve::Overwrite (C++ function), 370Symmetric2x2Scale (C++ function), 206Symmetric2x2Solve (C++ function), 206SymmetricEntrywiseNorm (C++ function),

349SymmetricEntrywiseNorm() (built-in func-

tion), 351SymmetricFrobeniusNorm (C++ function),

352SymmetricFrobeniusNorm() (built-in func-

tion), 353SymmetricInfinityNorm (C++ function), 355SymmetricInfinityNorm() (built-in function),

356SymmetricInverse (C++ function), 331SymmetricInverse() (built-in function), 330SymmetricKyFanNorm (C++ function), 353SymmetricMax (C++ function), 190, 193SymmetricMaxAbs (C++ function), 191, 192SymmetricMaxNorm (C++ function), 356SymmetricMinAbs (C++ function), 194SymmetricNorm (C++ function), 364SymmetricNorm() (built-in function), 365SymmetricNuclearNorm (C++ function), 358SymmetricOneNorm (C++ function), 359SymmetricSchattenNorm (C++ function), 360SymmetricSolve (C++ function), 369, 370SymmetricSolve() (built-in function), 369SymmetricSwap (C++ function), 205SymmetricTwoNorm (C++ function), 361SymmetricTwoNormEstimate (C++ function),

362Symv (C++ function), 216Syr (C++ function), 217Syr2 (C++ function), 217Syr2k (C++ function), 231

Syr2k() (built-in function), 232Syrk (C++ function), 230Syrk() (built-in function), 231

Tt0 (C++ member), 279TaggedSort (C++ function), 397Tan (C++ function), 49Tanh (C++ function), 50ThreeValued (C++ function), 516ThreeValued() (built-in function), 516thresholded (C++ member), 313Tikhonov (C++ function), 380, 381Tikhonov() (built-in function), 380TikhonovAlg (C++ type), 380tList (C++ member), 279Toeplitz (C++ function), 505Toeplitz() (built-in function), 505tol (C++ member), 279, 301, 313, 317, 336, 338TotalRecv (C++ function), 393TotalSend (C++ function), 393Trace (C++ function), 365Transpose (C++ function), 207Transpose() (built-in function), 208TransposeAxpyContract (C++ function), 208TransposeContract (C++ function), 209Trdtrmm (C++ function), 232Trdtrmm() (built-in function), 233TrdtrmmQuasi() (built-in function), 233TreeData<F> (C++ type), 279TrefethenEmbree (C++ function), 506TrefethenEmbree() (built-in function), 506Triangle (C++ function), 506Triangle() (built-in function), 507TriangularInverse (C++ function), 330TriangularInverse() (built-in function), 330TriangularSpectralCloud (C++ function), 324TriangularSpectralPortrait (C++ function), 319TriangularSpectralWindow (C++ function),

321tridiagCtrl (C++ member), 300TriW (C++ function), 507TriW() (built-in function), 507Trmm (C++ function), 234Trmm() (built-in function), 234Trmv (C++ function), 218Trr (C++ function), 219Trr2 (C++ function), 219Trr2k (C++ function), 236Trr2k() (built-in function), 237Trrk (C++ function), 235

Index 601

Page 606: Elemental Manuallibelemental.org/documentation/elem-dev.pdf · CHAPTER ONE INTRODUCTION 1.1Overview Elemental is a library for distributed-memory “direct” linear algebra and optimization,

Elemental Manual, Release 0.86-dev

Trrk() (built-in function), 235Trsm (C++ function), 237Trsm() (built-in function), 238Trstrm (C++ function), 239Trstrm() (built-in function), 240Trsv (C++ function), 220Trtrmm (C++ function), 238Trtrmm() (built-in function), 239TV (C++ function), 437TV() (built-in function), 437TwoCondition (C++ function), 343TwoCondition() (built-in function), 343TwoNorm (C++ function), 361TwoNormEstimate (C++ function), 362TwoSidedTrmm (C++ function), 34, 240TwoSidedTrmm() (built-in function), 240TwoSidedTrsm (C++ function), 34, 241TwoSidedTrsm() (built-in function), 241

UUniform (C++ function), 516Uniform() (built-in function), 517UniformHelmholtzGreens (C++ function),

517UniformHelmholtzGreens() (built-in func-

tion), 517UnitOrNonUnit (C++ enum), 40UnitOrNonUnit::NON UNIT (C++ enumera-

tor), 40UnitOrNonUnit::UNIT (C++ enumerator), 40Unsigned (C++ type), 38UpdateDiagonal (C++ function), 209UpdateImagPart (C++ function), 46UpdateImagPartOfDiagonal (C++ function),

209UpdateImagPartOfSubmatrix (C++ function),

210UpdateRealPart (C++ function), 46UpdateRealPartOfDiagonal (C++ function),

209UpdateRealPartOfSubmatrix (C++ function),

210UpdateSubmatrix (C++ function), 210upperBound (C++ member), 296UpperClip (C++ function), 439upperIndex (C++ member), 296UpperOrLower (C++ enum), 40UpperOrLower::LOWER (C++ enumerator),

40UpperOrLower::UPPER (C++ enumerator),

41

useSDC (C++ member), 300, 316

VvalChanRatio (C++ member), 313VectorMax (C++ function), 190, 193VectorMaxAbs (C++ function), 192VectorMinAbs (C++ function), 194VerticalOrHorizontal (C++ enum), 41VerticalOrHorizontal::HORIZONTAL (C++

enumerator), 41VerticalOrHorizontal::VERTICAL (C++ enu-

merator), 41View (C++ function), 103–106

WWalsh (C++ function), 508Walsh() (built-in function), 508Whale (C++ function), 508Whale() (built-in function), 509Wigner (C++ function), 518Wigner() (built-in function), 518Wilkinson (C++ function), 509Wilkinson() (built-in function), 509Write (C++ function), 524WriteProxy (C++ function), 107

ZZero (C++ function), 211ZeroNorm (C++ function), 363Zeros (C++ function), 509Zeros() (built-in function), 510

602 Index