mirror of
https://github.com/odin-lang/Odin.git
synced 2026-01-01 10:52:19 +00:00
Add hadamard_product
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user