Module element_op

Module element_op 

Source
Expand description

Element-wise operations applied lazily to strided views.

Julia’s StridedViews.jl supports four element operations that form a group:

  • identity: No transformation
  • conj: Complex conjugate
  • transpose: Element-wise transpose (for matrix elements)
  • adjoint: Element-wise adjoint (conj + transpose)

These operations are composed at the type level to avoid runtime dispatch.

§Key Design: ElementOp<T> is Generic Over T

Identity implements ElementOp<T> for any T: Copy, requiring no additional bounds. Conj, Transpose, and Adjoint require T: ElementOpApply. This allows custom scalar types (e.g., tropical semiring types) to use Identity views without implementing ElementOpApply.

Composition associated types (Inverse, ComposeConj, etc.) are separated into ComposableElementOp<T>, only available when T: ElementOpApply.

Structs§

Adjoint
Adjoint operation: f(x) = adjoint(x) = conj(transpose(x)) For scalar numbers, this is conj.
Conj
Complex conjugate operation: f(x) = conj(x)
Identity
Identity operation: f(x) = x
Transpose
Transpose operation: f(x) = transpose(x) For scalar numbers, this is identity. For matrix elements, this would transpose each element.

Traits§

ComposableElementOp
Trait for element operations that support type-level composition.
Compose
Helper trait for composing two ElementOp types.
ElementOp
Trait for element-wise operations applied to strided views.
ElementOpApply
Trait for types that support element operations (conj, transpose, adjoint).