2023-01-26 16:02:45 +01:00
|
|
|
|
|
|
|
#include "mlpp_matrix.h"
|
|
|
|
|
2023-01-27 02:57:33 +01:00
|
|
|
String MLPPMatrix::to_string() {
|
|
|
|
String str;
|
|
|
|
|
|
|
|
str += "[MLPPMatrix: \n";
|
|
|
|
|
|
|
|
for (int y = 0; y < _size.y; ++y) {
|
|
|
|
str += " [ ";
|
|
|
|
|
|
|
|
for (int x = 0; x < _size.x; ++x) {
|
|
|
|
str += String::num(_data[_size.x * y + x]);
|
|
|
|
str += " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
str += "]\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
str += "]";
|
|
|
|
|
|
|
|
return str;
|
|
|
|
}
|
|
|
|
|
2023-01-26 17:12:02 +01:00
|
|
|
void MLPPMatrix::_bind_methods() {
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("add_row", "row"), &MLPPMatrix::add_row_pool_vector);
|
|
|
|
ClassDB::bind_method(D_METHOD("remove_row", "index"), &MLPPMatrix::remove_row);
|
2023-01-28 01:02:57 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("remove_row_unordered", "index"), &MLPPMatrix::remove_row_unordered);
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("swap_row", "index_1", "index_2"), &MLPPMatrix::swap_row);
|
|
|
|
|
2023-01-26 17:12:02 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("clear"), &MLPPMatrix::clear);
|
|
|
|
ClassDB::bind_method(D_METHOD("reset"), &MLPPMatrix::reset);
|
|
|
|
ClassDB::bind_method(D_METHOD("empty"), &MLPPMatrix::empty);
|
2023-01-26 16:02:45 +01:00
|
|
|
|
2023-01-26 17:25:26 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("data_size"), &MLPPMatrix::data_size);
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("size"), &MLPPMatrix::size);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("resize", "size"), &MLPPMatrix::resize);
|
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("get_element", "index_x", "index_y"), &MLPPMatrix::get_element_bind);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_element", "index_x", "index_y", "val"), &MLPPMatrix::set_element_bind);
|
2023-01-26 16:02:45 +01:00
|
|
|
|
2023-01-28 01:02:57 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("get_row_pool_vector", "index_y"), &MLPPMatrix::get_row_pool_vector);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_row_mlpp_vector", "index_y"), &MLPPMatrix::get_row_mlpp_vector);
|
|
|
|
ClassDB::bind_method(D_METHOD("get_row_into_mlpp_vector", "index_y", "target"), &MLPPMatrix::get_row_into_mlpp_vector);
|
|
|
|
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("set_row_pool_vector", "index_y", "row"), &MLPPMatrix::set_row_pool_vector);
|
2023-01-28 01:02:57 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("set_row_mlpp_vector", "index_y", "row"), &MLPPMatrix::set_row_mlpp_vector);
|
2023-01-26 17:12:02 +01:00
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("fill", "val"), &MLPPMatrix::fill);
|
|
|
|
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("to_flat_pool_vector"), &MLPPMatrix::to_flat_pool_vector);
|
|
|
|
ClassDB::bind_method(D_METHOD("to_flat_byte_array"), &MLPPMatrix::to_flat_byte_array);
|
2023-01-26 17:12:02 +01:00
|
|
|
|
|
|
|
ClassDB::bind_method(D_METHOD("duplicate"), &MLPPMatrix::duplicate);
|
|
|
|
|
2023-01-27 02:07:01 +01:00
|
|
|
ClassDB::bind_method(D_METHOD("set_from_mlpp_vectors_array", "from"), &MLPPMatrix::set_from_mlpp_vectors_array);
|
|
|
|
ClassDB::bind_method(D_METHOD("set_from_arrays", "from"), &MLPPMatrix::set_from_arrays);
|
2023-01-26 16:02:45 +01:00
|
|
|
}
|