Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds an array reference type #1440

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
99722fa
Adds an array reference type.
akern40 Oct 4, 2024
44079cc
Adds some documentation
akern40 Oct 4, 2024
3d32c08
Fixes some CI/CD issues
akern40 Oct 5, 2024
8bf86df
More CI/CD fixes
akern40 Oct 5, 2024
dda4b66
Last CI/CD fix?
akern40 Oct 5, 2024
3c75150
Switches to the "same-repr" approach to allow array views to still be…
akern40 Oct 6, 2024
28fea66
Changes back to Copy-capable ArrayBase and unchanged ArrayBase internals
akern40 Oct 6, 2024
3a180c1
Removes unused import
akern40 Oct 6, 2024
6b64678
Introduces LayoutRef and starts to move functionality from ArrayBase …
akern40 Oct 11, 2024
4c440a8
Working version of the conversion to reference types
akern40 Oct 13, 2024
c183903
Uses a new design with two reference types
akern40 Oct 13, 2024
476dac5
Satisfying CI/CD
akern40 Oct 13, 2024
68d6f53
Adds Index, equality, IntoIterator, and Hash traits, plus approximates
akern40 Oct 13, 2024
2fde998
Finishes conversions of all possible ArrayBase impls to ArrayRef
akern40 Oct 14, 2024
d63d26e
Satisfying CI/CD
akern40 Oct 14, 2024
b7281f5
Adds some aliases to avoid breaking changes, and adds an example of h…
akern40 Oct 14, 2024
663e2f9
Adds Borrow and ToOwned
akern40 Oct 14, 2024
5204f68
Tests that the *Assign operators work for slices via deref
akern40 Oct 14, 2024
6a3d131
Somehow missed a `use` for `ToOwned`
akern40 Oct 14, 2024
289130d
Implicitly use deref
akern40 Oct 14, 2024
db52eab
Adds documentation and aliases for `LayoutRef`
akern40 Oct 20, 2024
2b34bf8
Fixes doc links
akern40 Oct 20, 2024
a40307b
Adds formatting for ArrayRef
akern40 Oct 20, 2024
5adbb31
Change some examples over to ArrayRef
akern40 Oct 20, 2024
6e61e83
Adds missed #[repr(transparent)] for RawRef
akern40 Oct 20, 2024
0cd4334
Simplifies deref logic and avoids null check
akern40 Oct 20, 2024
f77ad96
Adds documentation to ArrayRef
akern40 Oct 20, 2024
3888399
Adds missing aliases to ArrayBase from RawRef and LayoutRef
akern40 Oct 21, 2024
0a3cad3
Adds a short snippet of documentation for `RawRef` and some top-level…
akern40 Oct 21, 2024
cbed837
Makes as_ref more explicit through methods on ArrayBase
akern40 Oct 26, 2024
945f70d
Restore remove_index to DataOwned
akern40 Oct 26, 2024
93dfb38
Fixes unused imports
akern40 Oct 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change some examples over to ArrayRef
  • Loading branch information
akern40 committed Oct 20, 2024
commit 5adbb313849eefcdd4af20eb0267c2b09a5e3dd6
2 changes: 1 addition & 1 deletion examples/axis_ops.rs
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ use ndarray::prelude::*;
/// it corresponds to their order in memory.
///
/// Errors if array has a 0-stride axis
fn regularize<A, D>(a: &mut Array<A, D>) -> Result<(), &'static str>
fn regularize<A, D>(a: &mut ArrayRef<A, D>) -> Result<(), &'static str>
where
D: Dimension,
A: ::std::fmt::Debug,
2 changes: 1 addition & 1 deletion examples/convo.rs
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ type Kernel3x3<A> = [[A; 3]; 3];

#[inline(never)]
#[cfg(feature = "std")]
fn conv_3x3<F>(a: &ArrayView2<'_, F>, out: &mut ArrayViewMut2<'_, F>, kernel: &Kernel3x3<F>)
fn conv_3x3<F>(a: &ArrayRef2<F>, out: &mut ArrayRef2<F>, kernel: &Kernel3x3<F>)
where F: Float
{
let (n, m) = a.dim();
3 changes: 3 additions & 0 deletions src/prelude.rs
Original file line number Diff line number Diff line change
@@ -35,6 +35,9 @@ pub use crate::{
#[doc(no_inline)]
pub use crate::{Axis, Dim, Dimension};

#[doc(no_inline)]
pub use crate::{ArrayRef0, ArrayRef1, ArrayRef2, ArrayRef3, ArrayRef4, ArrayRef5, ArrayRef6, ArrayRefD};

#[doc(no_inline)]
pub use crate::{Array0, Array1, Array2, Array3, Array4, Array5, Array6, ArrayD};