pub fn step_columns_f64<M>(
model: &M,
columns: &mut [Vec<f64>],
n: usize,
walls: &[WallSegment],
params: &M::Params,
dt: f64,
scratch: &mut Scratch,
peds_buf: &mut Vec<Pedestrian>,
)where
M: CrowdStep,Expand description
Zero-alloc SoA step over CrowdAgent columns.
Consumes parallel Vec<f64> columns in the 8-column CrowdAgent
layout, runs one zero-alloc tick of model, and writes the columns
back in place. peds_buf and scratch are caller-owned and reused
across ticks.
This is the shape that matches rustsim::cpu_batch_step_f64’s
closure signature and is the direct transliteration target for a
future .cu kernel: the SoA column contract here (names, order,
precision) is identical to what a CUDA launch would receive as its
column pointers. On CPU today it is a thin glue layer on top of
CrowdStep::step — the physics live in the model modules and are
bit-exactly the same as the AoS hot path.
§Example
ⓘ
use rustsim::cpu_batch_step_f64;
use rustsim_crowd::prelude::*;
use rustsim_crowd::integration::{step_columns_f64, SocialForceModel};
use rustsim_crowd::social_force;
let params = social_force::Params::default();
let mut scratch = Scratch::with_capacity(n, social_force::neighbor_cutoff(¶ms));
let mut peds_buf: Vec<Pedestrian> = Vec::with_capacity(n);
cpu_batch_step_f64::<CrowdAgent, _, _>(&store, |cols, n| {
step_columns_f64(
&SocialForceModel,
cols,
n,
&[],
¶ms,
0.05,
&mut scratch,
&mut peds_buf,
);
});