MCPcopy Create free account
hub / github.com/pybind/pybind11 / Matrix

Method Matrix

tests/test_buffers.cpp:54–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 class Matrix {
53 public:
54 Matrix(py::ssize_t rows, py::ssize_t cols) : m_rows(rows), m_cols(cols) {
55 print_created(this, std::to_string(m_rows) + "x" + std::to_string(m_cols) + " matrix");
56 // NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
57 m_data = new float[(size_t) (rows * cols)];
58 memset(m_data, 0, sizeof(float) * (size_t) (rows * cols));
59 }
60
61 Matrix(const Matrix &s) : m_rows(s.m_rows), m_cols(s.m_cols) {
62 print_copy_created(this,

Callers 4

test_from_pythonFunction · 0.80
test_to_pythonFunction · 0.80

Calls 3

print_createdFunction · 0.85
print_copy_createdFunction · 0.85
print_move_createdFunction · 0.85

Tested by

no test coverage detected