From 2e3591c6bb4aff4b54a69b9ca38542562f8069e2 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 22 Jan 2024 14:13:33 +0100 Subject: Julia: Add asymmetricindices() --- julia/CrystFEL/src/CrystFEL.jl | 2 +- julia/CrystFEL/src/symmetry.jl | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'julia') diff --git a/julia/CrystFEL/src/CrystFEL.jl b/julia/CrystFEL/src/CrystFEL.jl index 1b1ee52b..daea5284 100644 --- a/julia/CrystFEL/src/CrystFEL.jl +++ b/julia/CrystFEL/src/CrystFEL.jl @@ -42,7 +42,7 @@ export Panel, DetGeom include("symmetry.jl") using .Symmetry -export SymOpList +export SymOpList, asymmetricindices include("datatemplates.jl") using .DataTemplates diff --git a/julia/CrystFEL/src/symmetry.jl b/julia/CrystFEL/src/symmetry.jl index fd3ce7b2..d6d2e477 100644 --- a/julia/CrystFEL/src/symmetry.jl +++ b/julia/CrystFEL/src/symmetry.jl @@ -2,7 +2,7 @@ module Symmetry import ..CrystFEL: libcrystfel export SymOpList, InternalSymOpList, InternalIntegerMatrix -export symmetry_name +export symmetry_name, asymmetricindices # Types for pointers returned by libcrystfel @@ -100,6 +100,17 @@ function Base.iterate(sym::SymOpList, i) end +function asymmetricindices(sym::SymOpList, h, k, l) + ho = Ref{Cint}(0) + ko = Ref{Cint}(0) + lo = Ref{Cint}(0) + @ccall libcrystfel.get_asymm(sym.internalptr::Ptr{InternalSymOpList}, + h::Cint, k::Cint, l::Cint, + ho::Ref{Cint}, ko::Ref{Cint}, lo::Ref{Cint})::Cvoid + (ho[], ko[], lo[]) +end + + function Base.show(io::IO, ::MIME"text/plain", sym::SymOpList) print(io, length(sym), "-element SymOpList (\"", symmetry_name(sym), "\")") for op in sym -- cgit v1.2.3