aboutsummaryrefslogtreecommitdiff
path: root/src/types.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-10-20 02:18:30 +0100
committergingerBill <bill@gingerbill.org>2021-10-20 02:18:30 +0100
commitcee45c1b155fcc917c2b0f9cfdbfa060304255e1 (patch)
treeadb7cf8841ca8523e14e3c276580b9905777059f /src/types.cpp
parent68afbb37f40b10fd01dda9e5640cc7ae2535a371 (diff)
Add `hadamard_product`
Diffstat (limited to 'src/types.cpp')
-rw-r--r--src/types.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp
index eaf1bac74..32e26bcc6 100644
--- a/src/types.cpp
+++ b/src/types.cpp
@@ -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;