Skip to content
Branch: main
Go to file

Latest commit


Failed to load latest commit information.
Latest commit message
Commit time

HAPOD - Hierarchical Approximate Proper Orthogonal Decomposition

  • HAPOD - Hierarchical Approximate POD
  • version: 3.0 (2020-01-24)
  • by: C. Himpe (0000-0003-2194-6754), S. Rave (0000-0003-0439-7212)
  • under: BSD 2-Clause License (
  • summary: Fast distributed or incremental POD computation.


  • Proper Orthogonal Decomposition (POD)
  • Singular Value Decomposition (SVD)
  • Principal Component Analysis (PCA)
  • Empirical Orthogonal Functions (EOF)
  • Karhunen-Loeve Transformation (KLT)
  • Empirical Eigenfunctions (EEF)


  • Dimension Reduction
  • Model Reduction
  • Low-Rank Approximation
  • Data Compression


  • Error-driven
  • Single pass (each data vector is needed only once)
  • Column-wise data partition
  • Custom SVD backends


  • Standard POD
  • Incremental HAPOD -> for memory-limited environments: single-board-computers
  • Distributed HAPOD -> for distributd memory environments: super-computers
  • Distributed-of-Incremental HAPOD


C. Himpe, T. Leibner and S. Rave. "Hierarchical Approximate Proper Orthogonal Decomposition". SIAM Journal on Scientific Computing, 40(5): A3267--A3292, 2018.


  • GNU Octave >= 4.2
  • Mathworks MATLAB >= 2013b

Basic Usage

[svec,sval,meta] = hapod(data,bound,topo,relax,meta,depth,mysvd)


  • data {cell} - snapshot data set, partitioned by column (blocks)
  • bound {scalar} - mean L_2 projection error bound
  • topo {string} - tree topology (see Topology)
  • relax {scalar} - relaxation parameter in (0,1] (see Relaxation)
  • depth {scalar} - total number of levels in tree (only required for incr_1)
  • meta {struct} - meta information structure (see Meta-Information)
  • mysvd {handle} - custom SVD backend (see Custom SVD)

Return Values

  • svec {matrix} POD modes (column vectors)
  • sval {vector} Singular values (column vector)
  • meta {struct} Meta-information structure


The HAPOD is computed based on a tree topology topo, with the data partitions at the tree's leafs. The following topologies are available:

  • 'none' Standard POD
  • 'incr' Incremental HAPOD (Complete)
  • 'incr_1' Incremental HAPOD (Child nodes)
  • 'incr_r' Incremental HAPOD (Root node)
  • 'dist' Distributed HAPOD (Complete)
  • 'dist_1' Distributed HAPOD (Child nodes)
  • 'dist_r' Distributed HAPOD (Root node)

If all data partitions can be passed as the data argument, the types: none (standard POD), incr(emental) HAPOD or dist(ributed) HAPOD are applicable. In case only a single partition is passed, the types: incr_1 and dist_1 should be used for the child nodes of the associated HAPOD tree, while the types: incr_r and dist_r should be used for the root nodes. The returned meta-information structure (or a cell-array thereof) has to be passed to the parent node in the associated HAPOD tree.


The relaxation parameter w (0 < w < 1) balances accuracy versus speed. Larger w near one means be more accurate, while w near zero means faster computation. The default value is w = 0.5.


The meta structure contains the following meta-information of the completed sub-tree:

  • nSnapshots - Number of data columns passed to this hapod and its children.
  • nModes - Number of intermediate modes
  • tNode - Computational time at this hapod's branch

The argument meta only needs to be passed for topology argument incr_r, dist_r and incr_1 unless it is first leaf. This means especially the user never has to create such a structure, as if it is required it is given as a previous return value.

Custom SVD

Via the mysvd argument a custom SVD function can be provided via a function handle with the following signature:

[U,d] = mysvd(X)

for a data matrix X, and return left singular vectors in matrix U and singular values in column vector d. By default (or mysvd = eco) a standard rank-revealing SVD is used. Additionally, by mysvd = mos the method of snapshots can be selected.

Getting Started

Run the sample code:


which demonstrates the different implemented HAPOD variants and can be used as a template.

Cite As

C. Himpe, T. Leibner and S. Rave. "Hierarchical Approximate Proper Orthogonal Decomposition". SIAM Journal on Scientific Computing, 40(5): A3267--A3292, 2018.

Used In

See Also

You can’t perform that action at this time.