Add hadamard_product

This commit is contained in:
gingerBill
2021-10-20 02:18:30 +01:00
parent 68afbb37f4
commit cee45c1b15
6 changed files with 84 additions and 13 deletions

View File

@@ -1333,6 +1333,17 @@ i64 matrix_indices_to_offset(Type *t, i64 row_index, i64 column_index) {
return stride_elems*column_index + row_index;
}
bool is_type_valid_for_matrix_elems(Type *t) {
if (is_type_integer(t)) {
return true;
} else if (is_type_float(t)) {
return true;
} else if (is_type_complex(t)) {
return true;
}
return false;
}
bool is_type_dynamic_array(Type *t) {
t = base_type(t);
return t->kind == Type_DynamicArray;