Skip to main content

SubGrid

Struct SubGrid 

Source
pub struct SubGrid {
Show 15 fields pub xs: Array1<f64>, pub q2s: Array1<f64>, pub kts: Array1<f64>, pub xis: Array1<f64>, pub deltas: Array1<f64>, pub grid: GridData, pub nucleons: Array1<f64>, pub alphas: Array1<f64>, pub nucleons_range: ParamRange, pub alphas_range: ParamRange, pub xi_range: ParamRange, pub delta_range: ParamRange, pub kt_range: ParamRange, pub x_range: ParamRange, pub q2_range: ParamRange,
}
Expand description

Stores the PDF grid data for a single subgrid.

A subgrid represents a region of the phase space with a consistent grid of x and Q2 values.

Fields§

§xs: Array1<f64>

Array of x values (momentum fraction).

§q2s: Array1<f64>

Array of values (energy scale squared).

§kts: Array1<f64>

Array of kT values (transverse momentum).

§xis: Array1<f64>

Array of xi values.

§deltas: Array1<f64>

Array of delta values.

§grid: GridData

Grid data (either 6D or 7D for backward compatibility).

§nucleons: Array1<f64>

Array of nucleon number values.

§alphas: Array1<f64>

Array of alpha_s values.

§nucleons_range: ParamRange

The valid range for the nucleons parameter in this subgrid.

§alphas_range: ParamRange

The valid range for the AlphaS parameter in this subgrid.

§xi_range: ParamRange

The valid range for the xi parameter in this subgrid.

§delta_range: ParamRange

The valid range for the delta parameter in this subgrid.

§kt_range: ParamRange

The valid range for the kT parameter in this subgrid.

§x_range: ParamRange

The valid range for the x parameter in this subgrid.

§q2_range: ParamRange

The valid range for the q2 parameter in this subgrid.

Implementations§

Source§

impl SubGrid

Source

pub fn new( nucleon_numbers: Vec<f64>, alphas_values: Vec<f64>, kt_subgrid: Vec<f64>, x_subgrid: Vec<f64>, q2_subgrid: Vec<f64>, nflav: usize, grid_data: Vec<f64>, ) -> Self

Creates a new 6D SubGrid from raw data (for backward compatibility).

§Arguments
  • nucleon_numbers - A vector of nucleon numbers.
  • alphas_values - A vector of alpha_s values.
  • kt_subgrid - A vector of kT values.
  • x_subgrid - A vector of x values.
  • q2_subgrid - A vector of q2 values.
  • nflav - The number of quark flavors.
  • grid_data - A flat vector of grid data points.
§Panics

Panics if the grid data cannot be reshaped to the expected dimensions.

Source

pub fn new_8d( nucleon_numbers: Vec<f64>, alphas_values: Vec<f64>, xi_values: Vec<f64>, delta_values: Vec<f64>, kt_subgrid: Vec<f64>, x_subgrid: Vec<f64>, q2_subgrid: Vec<f64>, nflav: usize, grid_data: Vec<f64>, ) -> Self

Creates a new 8D SubGrid from raw data.

§Arguments
  • nucleon_numbers - A vector of nucleon numbers.
  • alphas_values - A vector of alpha_s values.
  • xi_values - A vector of xi values.
  • delta_values - A vector of delta values.
  • kt_subgrid - A vector of kT values.
  • x_subgrid - A vector of x values.
  • q2_subgrid - A vector of q2 values.
  • nflav - The number of quark flavors.
  • grid_data - A flat vector of grid data points.
§Panics

Panics if the grid data cannot be reshaped to the expected dimensions.

Source

pub fn contains_point(&self, points: &[f64]) -> bool

Checks if a point (…, x, q2) is within the boundaries of this subgrid.

§Arguments
  • points - A slice of coordinates. The order is assumed to be (A, alpha_s, kT, x, Q2), with dimensions only present if they are part of the grid.
§Returns

true if the point is within the subgrid, false otherwise.

Source

pub fn distance_to_point(&self, points: &[f64]) -> f64

Calculates the squared distance from a point to the subgrid’s bounding box.

Source

pub fn interpolation_config(&self) -> InterpolationConfig

Gets the interpolation configuration for this subgrid.

Source

pub fn ranges(&self) -> RangeParameters

Gets the parameter ranges for this subgrid.

Source

pub fn grid_slice(&self, pid_index: usize) -> ArrayView2<'_, f64>

Gets a 2D slice of the grid for interpolation.

This method is only valid for 2D interpolation configurations.

§Arguments
  • pid_index - The index of the particle ID (flavor).
§Panics

Panics if called on a subgrid that is not 2D.

Source

pub fn grid_6d(&self) -> &Array6<f64>

Returns a reference to the underlying grid (6D).

§Panics

Panics if the grid is 8D.

Source

pub fn grid_8d(&self) -> &ArrayD<f64>

Returns a reference to the underlying grid (8D).

§Panics

Panics if the grid is 6D.

Source

pub fn is_8d(&self) -> bool

Returns true if this is an 8D grid.

Trait Implementations§

Source§

impl Clone for SubGrid

Source§

fn clone(&self) -> SubGrid

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubGrid

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SubGrid

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SubGrid

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.