Skip to content

Commit

Permalink
update dynstack
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah-quinones committed Sep 29, 2024
1 parent 301dc23 commit 0d5bba0
Show file tree
Hide file tree
Showing 46 changed files with 200 additions and 200 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dbgf = "0.1.2"
paste = "1.0.14"
reborrow = "0.5.5"

dyn-stack = { version = "0.10.0", default-features = false }
dyn-stack = { version = "0.11.0", default-features = false }
equator = "0.4.1"
faer-entity = { version ="0.19.2", default-features = false, path = "./faer-entity" }

Expand Down
4 changes: 2 additions & 2 deletions src/linalg/cholesky/bunch_kaufman/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ pub mod compute {
perm: &'out mut [I],
perm_inv: &'out mut [I],
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: BunchKaufmanParams,
) -> (BunchKaufmanInfo, PermRef<'out, I>) {
let truncate = <I::Signed as SignedIndex>::truncate;
Expand Down Expand Up @@ -926,7 +926,7 @@ pub mod solve {
perm: PermRef<'_, I>,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let n = lb_factors.nrows();
let k = rhs.ncols();
Expand Down
12 changes: 6 additions & 6 deletions src/linalg/cholesky/ldlt_diagonal/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ impl<'a, E: ComplexField> ProcessDiag<E> for LdltRegularization<'a, E> {
pub(crate) fn new_cholesky<E: ComplexField, P: ProcessDiag<E>>(
A: MatMut<'_, E>,
process: &P,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> Result<usize, P::Error> {
struct Impl<'a, E: ComplexField, P> {
A: MatMut<'a, E>,
stack: PodStack<'a>,
stack: &'a mut PodStack,
process: &'a P,
}
impl<E: ComplexField, P: ProcessDiag<E>> pulp::WithSimd for Impl<'_, E, P> {
Expand Down Expand Up @@ -643,7 +643,7 @@ fn cholesky_in_place_left_looking_impl<E: ComplexField>(
regularization: LdltRegularization<'_, E>,
parallelism: Parallelism,
params: LdltDiagParams,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> usize {
_ = params;
_ = parallelism;
Expand Down Expand Up @@ -672,7 +672,7 @@ fn cholesky_in_place_impl<E: ComplexField>(
matrix: MatMut<'_, E>,
regularization: LdltRegularization<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: LdltDiagParams,
) {
// right looking cholesky
Expand Down Expand Up @@ -725,7 +725,7 @@ fn cholesky_in_place_impl<E: ComplexField>(

{
// reserve space for L10×D0
let (mut l10xd0, _) = temp_mat_uninit::<E>(rem, block_size, stack.rb_mut());
let (mut l10xd0, _) = temp_mat_uninit::<E>(rem, block_size, stack);
let mut l10xd0 = l10xd0.as_mut();

for j in 0..block_size {
Expand Down Expand Up @@ -836,7 +836,7 @@ pub fn raw_cholesky_in_place<E: ComplexField>(
matrix: MatMut<'_, E>,
regularization: LdltRegularization<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: LdltDiagParams,
) -> LdltInfo {
assert!(matrix.ncols() == matrix.nrows());
Expand Down
8 changes: 4 additions & 4 deletions src/linalg/cholesky/ldlt_diagonal/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn solve_in_place_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let n = cholesky_factors.nrows();
let k = rhs.ncols();
Expand Down Expand Up @@ -141,7 +141,7 @@ pub fn solve_transpose_in_place_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
// (L D L.*).T = conj(L D L.*)
solve_in_place_with_conj(
Expand Down Expand Up @@ -181,7 +181,7 @@ pub fn solve_transpose_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let mut dst = dst;
zipped!(dst.rb_mut(), rhs).for_each(|unzipped!(mut dst, src)| dst.write(src.read()));
Expand Down Expand Up @@ -213,7 +213,7 @@ pub fn solve_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let mut dst = dst;
zipped!(dst.rb_mut(), rhs).for_each(|unzipped!(mut dst, src)| dst.write(src.read()));
Expand Down
4 changes: 2 additions & 2 deletions src/linalg/cholesky/ldlt_diagonal/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ pub fn delete_rows_and_cols_clobber<E: ComplexField>(
cholesky_factors: MatMut<'_, E>,
indices: &mut [usize],
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let _ = parallelism;
let n = cholesky_factors.nrows();
Expand Down Expand Up @@ -898,7 +898,7 @@ pub fn insert_rows_and_cols_clobber<E: ComplexField>(
insertion_index: usize,
inserted_matrix: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let new_n = cholesky_factors_extended.nrows();
let r = inserted_matrix.ncols();
Expand Down
6 changes: 3 additions & 3 deletions src/linalg/cholesky/llt/compute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ fn cholesky_in_place_left_looking_impl<E: ComplexField>(
matrix: MatMut<'_, E>,
regularization: LltRegularization<E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: LltParams,
) -> Result<usize, CholeskyError> {
_ = params;
Expand Down Expand Up @@ -80,7 +80,7 @@ fn cholesky_in_place_impl<E: ComplexField>(
matrix: MatMut<'_, E>,
regularization: LltRegularization<E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: LltParams,
) -> Result<(), CholeskyError> {
// right looking cholesky
Expand Down Expand Up @@ -193,7 +193,7 @@ pub fn cholesky_in_place<E: ComplexField>(
matrix: MatMut<'_, E>,
regularization: LltRegularization<E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: LltParams,
) -> Result<LltInfo, CholeskyError> {
let _ = params;
Expand Down
6 changes: 3 additions & 3 deletions src/linalg/cholesky/llt/inverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn invert_lower_impl<E: ComplexField>(
dst: MatMut<'_, E>,
cholesky_factor: Option<MatRef<'_, E>>,
parallelism: Parallelism,
stack: PodStack,
stack: &mut PodStack,
) {
// (L L.*).inv() = L.inv().* L.inv()
//
Expand Down Expand Up @@ -75,7 +75,7 @@ pub fn invert_lower_in_place_req<E: Entity>(
pub fn invert_lower_in_place<E: ComplexField>(
cholesky_factor: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack,
stack: &mut PodStack,
) {
assert!(cholesky_factor.nrows() == cholesky_factor.ncols());
invert_lower_impl(cholesky_factor, None, parallelism, stack);
Expand All @@ -96,7 +96,7 @@ pub fn invert_lower<E: ComplexField>(
dst: MatMut<'_, E>,
cholesky_factor: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack,
stack: &mut PodStack,
) {
assert!(all(
cholesky_factor.nrows() == cholesky_factor.ncols(),
Expand Down
4 changes: 2 additions & 2 deletions src/linalg/cholesky/llt/reconstruct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn reconstruct_lower<E: ComplexField>(
dst: MatMut<'_, E>,
cholesky_factor: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
assert!(cholesky_factor.nrows() == cholesky_factor.ncols());
assert!((dst.nrows(), dst.ncols()) == (cholesky_factor.nrows(), cholesky_factor.ncols()));
Expand Down Expand Up @@ -72,7 +72,7 @@ pub fn reconstruct_lower<E: ComplexField>(
pub fn reconstruct_lower_in_place<E: ComplexField>(
cholesky_factor: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let n = cholesky_factor.nrows();
let (mut tmp, stack) = temp_mat_uninit::<E>(n, n, stack);
Expand Down
8 changes: 4 additions & 4 deletions src/linalg/cholesky/llt/solve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub fn solve_in_place_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let _ = &stack;
let n = cholesky_factor.nrows();
Expand Down Expand Up @@ -132,7 +132,7 @@ pub fn solve_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let mut dst = dst;
zipped!(dst.rb_mut(), rhs).for_each(|unzipped!(mut dst, src)| dst.write(src.read()));
Expand Down Expand Up @@ -162,7 +162,7 @@ pub fn solve_transpose_in_place_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
// (L L.*).T = conj(L L.*)
solve_in_place_with_conj(
Expand Down Expand Up @@ -199,7 +199,7 @@ pub fn solve_transpose_with_conj<E: ComplexField>(
conj_lhs: Conj,
rhs: MatRef<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let mut dst = dst;
zipped!(dst.rb_mut(), rhs).for_each(|unzipped!(mut dst, src)| dst.write(src.read()));
Expand Down
4 changes: 2 additions & 2 deletions src/linalg/cholesky/llt/update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ pub fn delete_rows_and_cols_clobber<E: ComplexField>(
cholesky_factor: MatMut<'_, E>,
indices: &mut [usize],
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let _ = parallelism;
let n = cholesky_factor.nrows();
Expand Down Expand Up @@ -1051,7 +1051,7 @@ pub fn insert_rows_and_cols_clobber<E: ComplexField>(
insertion_index: usize,
inserted_matrix: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) -> Result<(), CholeskyError> {
let new_n = cholesky_factor_extended.nrows();
let r = inserted_matrix.ncols();
Expand Down
8 changes: 4 additions & 4 deletions src/linalg/evd/hessenberg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ pub fn make_hessenberg_in_place<E: ComplexField>(
a: MatMut<'_, E>,
householder: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
assert!(a.nrows() == a.ncols());
assert!(a.row_stride() == 1);
Expand All @@ -441,7 +441,7 @@ fn make_hessenberg_in_place_basic<E: ComplexField>(
a: MatMut<'_, E>,
householder: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
assert!(a.nrows() == a.ncols());
assert!(a.row_stride() == 1);
Expand Down Expand Up @@ -671,7 +671,7 @@ fn make_hessenberg_in_place_qgvdg_unblocked<E: ComplexField>(
t: MatMut<'_, E>,
bs: usize,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
assert!(a.nrows() == a.ncols());
assert!(a.row_stride() == 1);
Expand Down Expand Up @@ -854,7 +854,7 @@ fn make_hessenberg_in_place_qgvdg_blocked<E: ComplexField>(
z: MatMut<'_, E>,
t: MatMut<'_, E>,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let mut z = z;
let mut a = a;
Expand Down
6 changes: 3 additions & 3 deletions src/linalg/evd/hessenberg_cplx_evd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ fn aggressive_early_deflation<E: ComplexField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
mut stack: PodStack<'_>,
mut stack: &mut PodStack,
params: EvdParams,
) -> (usize, usize) {
let n = a.nrows();
Expand Down Expand Up @@ -1237,7 +1237,7 @@ pub fn multishift_qr<E: ComplexField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: EvdParams,
) -> (isize, usize, usize) {
assert!(a.nrows() == a.ncols());
Expand Down Expand Up @@ -1618,7 +1618,7 @@ fn multishift_qr_sweep<E: ComplexField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let n = a.nrows();

Expand Down
6 changes: 3 additions & 3 deletions src/linalg/evd/hessenberg_real_evd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1403,7 +1403,7 @@ fn aggressive_early_deflation<E: RealField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
mut stack: PodStack<'_>,
mut stack: &mut PodStack,
params: EvdParams,
) -> (usize, usize) {
let n = a.nrows();
Expand Down Expand Up @@ -1988,7 +1988,7 @@ fn multishift_qr_sweep<E: RealField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
) {
let n = a.nrows();

Expand Down Expand Up @@ -3167,7 +3167,7 @@ pub fn multishift_qr<E: RealField>(
epsilon: E::Real,
zero_threshold: E::Real,
parallelism: Parallelism,
stack: PodStack<'_>,
stack: &mut PodStack,
params: EvdParams,
) -> (isize, usize, usize) {
assert!(a.nrows() == a.ncols());
Expand Down
Loading

0 comments on commit 0d5bba0

Please sign in to comment.