Skip to content

Instantly share code, notes, and snippets.

@msaroufim
Created March 2, 2019 22:53
Show Gist options
  • Save msaroufim/cf942320f6388384cc2db532b52bdeea to your computer and use it in GitHub Desktop.
Save msaroufim/cf942320f6388384cc2db532b52bdeea to your computer and use it in GitHub Desktop.
#[no_mangle]
pub unsafe extern fn mr_MatrixIsZero(
mut m : *const f64, n1 : i32, n2 : i32
) -> i32 {
let mut _currentBlock;
let mut i : i32;
let mut n : i32 = n1 * n2;
i = 0i32;
'loop1: loop {
if !(i < n) {
_currentBlock = 2;
break;
}
if mr_NearZero(
*{
let _old = m;
m = m.offset(1isize);
_old
}
) == 0 {
_currentBlock = 5;
break;
}
i = i + 1;
}
if _currentBlock == 2 { 1i32 } else { 0i32 }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment