ext/broadcasting.c
void broadcast_matrices(nmatrix* nmat1, nmatrix* nmat2) {
  size_t ndims1 = nmat1->ndims;
  size_t ndims2 = nmat2->ndims;

  size_t broadcast_dims = max(ndims1, ndims2);
  size_t* broadcast_shape = ALLOC_N(size_t, broadcast_dims);

  //check for broadcasting compatibilty
  //and raise error if incompatible

  get_broadcast_shape(nmat1, nmat2, broadcast_shape);

  broadcast_matrix(nmat1, broadcast_shape, broadcast_dims);
  broadcast_matrix(nmat2, broadcast_shape, broadcast_dims);
}
/*
 * broadcast_matrices takes two matrices nmat1, nmat2
 * and broadcasts them against each other.
 * Raises error if matrices are incompatible
 * for broadcasting
 */
broadcast_matrices takes two matrices nmat1, nmat2
and broadcasts them against each other.
Raises error if matrices are incompatible
for broadcasting
broadcast_matrices takes two matrices nmat1 nmat2 and broadcasts them against each other . Raises error if matrices are incompatible for broadcasting
void broadcast_matrices(nmatrix* nmat1, nmatrix* nmat2) {
  size_t ndims1 = nmat1->ndims;
  size_t ndims2 = nmat2->ndims;
  size_t broadcast_dims = max(ndims1, ndims2);
  size_t* broadcast_shape = ALLOC_N(size_t, broadcast_dims);
  get_broadcast_shape(nmat1, nmat2, broadcast_shape);
  broadcast_matrix(nmat1, broadcast_shape, broadcast_dims);
  broadcast_matrix(nmat2, broadcast_shape, broadcast_dims);
}
void broadcast_matrices ( nmatrix * nmat1 , nmatrix * nmat2 ) { size_t ndims1 = nmat1 -> ndims ; size_t ndims2 = nmat2 -> ndims ; size_t broadcast_dims = max ( ndims1 , ndims2 ) ; size_t * broadcast_shape = ALLOC_N ( size_t , broadcast_dims ) ; get_broadcast_shape ( nmat1 , nmat2 , broadcast_shape ) ; broadcast_matrix ( nmat1 , broadcast_shape , broadcast_dims ) ; broadcast_matrix ( nmat2 , broadcast_shape , broadcast_dims ) ; }
broadcast_matrices takes two matrices nmat1, nmat2
 and broadcasts them against each other.
broadcast_matrices takes two matrices nmat1 nmat2 and broadcasts them against each other .
//check for broadcasting compatibilty //and raise error if incompatible