export function sgemm ( m , n , k , alpha , a , b , beta = 0.0 , c ? ) { if ( beta !== 0.0 ) { throw new Error ( 'beta !== 0.0 is not yet supported' ) ; } const result = new Float32Array ( m * n ) ; for ( let row = 0 ; row < m ; row ++ ) { for ( let col = 0 ; col < n ; col ++ ) { let sum = 0.0 ; for ( let j = 0 ; j < k ; j ++ ) { sum += a [ row * k + j ] * b [ j * n + col ] ; } result [ row * n + col ] = sum * alpha ; } } return result ; }