Skip to content

Quick Start: Utilities

Xinlei Wang edited this page Jul 18, 2021 · 1 revision

Introduction

ZPC provides some useful constructs to make physics-based simulation programming more simple.

Iterator

/// ranged-for way
for (auto &&e : a)
    e...;

/// indexed range-for loop
for (auto &&[id, e] : enumerate(a))
    id, e...;

/// zipped range-for loop
for (auto &&[ea, eb] : zip(a, b))
    ea, eb...;

/// indexed-way
for (auto iter = a.begin(), ed = a.end(); iter != ed; ++iter)
    *iter...;

Stencil Iteration

Wrangler

Clone this wiki locally