Skip to main content

copy_conj_into

Function copy_conj_into 

Source
pub fn copy_conj_into<T: ElementOpApply + Send + Sync + 'static>(
    dest: &mut StridedViewMut<'_, T>,
    src: &StridedView<'_, T>,
    exec: Exec<'_>,
) -> Result<()>
Expand description

Overwriting copy with complex conjugation: dest[i] = conj(src[i]).

A non-contiguous copy of a complex element type is handed to the permutation engine’s conjugating store (strided_perm::copy_conj_into, HPTT’s conjA) when that engine is measured to beat the element map for the shape; every other copy keeps the element map. The engine conjugates each element as it stores it, so the operation costs no extra pass over memory. Which route is taken is measured, not guessed: benches/conj_route_467.rs reproduces the table and docs/worklogs/2026-11-15-issue-467-conj-route.md records it, with the bound and the rows that fix it. A real element type’s conj is the identity, so it always keeps the element map; use copy_into for those.

§Errors

The rejection set of copy_into: StridedError::RankMismatch or StridedError::ShapeMismatch when the views describe different extents, StridedError::OffsetOverflow when the element count of the shape does not fit in usize, and StridedError::NonInjectiveOutputLayout when the destination layout cannot be proven representable and injective. Nothing is written unless validation succeeds.

The engine route reports one of those differently: it plans the permutation before it checks the destination for injectivity, so an unrepresentable destination keeps reporting StridedError::OffsetOverflow (issue #263) where copy_into reports StridedError::NonInjectiveOutputLayout under its “cannot be proven representable and injective” case. Nothing is written on either route.