Stop being the product.
Become the owner.
or
sign uplog in

how to get pivoting efficiently hey so ur in row-major…

how to get pivoting efficiently

hey so ur in row-major form and this works
\`\`\`
for k in 0..n {
let krow = k \* n;
let mut p = k;
let mut scl = m\krow + k\];
{
let mut irow = krow;
for i in k + 1..n {
irow += n;
let cur\_s = m\[irow + k\];
if cur\_s.abs() > scl.abs() {
p = i;
scl = cur\_s;
}
}
}
\`\`\`

but lets abstract out a little bit, u get like \~ 8 numbers in as u scan as u go down the rows, u essentially want to find a way to find the orders, for the pivots dependent upon their values in that column...
so something like this would work
\`\`\`
type Row: usize;
type Val: usize;
let mut super\_heap: Vec<MaxHeap<(Row, Val)>>;
let mut seen = HashSet<Row>;

for p in thing {
let r = super\_heap.pop().unwrap();
if super\_heap.insert(r) {
// do processing else already contains
}
}

\`\`\`

is there something better than super-heap? where i can jump row offsets in row-major form but utilize other vals for rankings that isn't as oof as my super-heap alternative?

i'm optimizing my LU, but i hate the pivoting code, is there something i'm not seeing (besides my obvious ikj cache locality issues i'm still fixing with workspace, like specifically with pivoting?)

[ https://github.com/cyancirrus/stellar-math/blob/f37a8ac8f94574c0548959cf84ffa2ede2ec1b1b/tests/lower\_upper.rs#L2 ttps://github.com/cyancirrus/stellar-math/blob/f37a8ac8f94574c0548959cf84ffa2ede2ec1b1b/tests/lower_upper.rs#L2
#technology
source h
earnings
3,000 mlx total
$0  total
engagement
4 views
0 reactions

0 comments