From 47d576fc763fbade0e19ff41e1688f8a7e2caaba Mon Sep 17 00:00:00 2001 From: conrad Date: Sat, 24 May 2025 15:40:07 +1000 Subject: [PATCH] add debug info --- include/armadillo_bits/Cube_meat.hpp | 4 ++++ include/armadillo_bits/MapMat_meat.hpp | 7 ++++++- include/armadillo_bits/Mat_meat.hpp | 4 ++++ include/armadillo_bits/SpMat_meat.hpp | 7 ++++++- include/armadillo_bits/field_meat.hpp | 7 ++++++- 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/armadillo_bits/Cube_meat.hpp b/include/armadillo_bits/Cube_meat.hpp index 0e21606c..41c6b30a 100644 --- a/include/armadillo_bits/Cube_meat.hpp +++ b/include/armadillo_bits/Cube_meat.hpp @@ -784,6 +784,10 @@ Cube::operator=(const Cube& x) arrayops::copy( memptr(), x.mem, n_elem ); } + else + { + arma_debug_print("Cube::operator=(): copy omitted"); + } return *this; } diff --git a/include/armadillo_bits/MapMat_meat.hpp b/include/armadillo_bits/MapMat_meat.hpp index 5a99578c..8a767138 100644 --- a/include/armadillo_bits/MapMat_meat.hpp +++ b/include/armadillo_bits/MapMat_meat.hpp @@ -106,7 +106,12 @@ MapMat::operator=(const MapMat& x) { arma_debug_sigprint(); - if(this == &x) { return; } + if(this == &x) + { + arma_debug_print("MapMat::operator=(): copy omitted"); + + return; + } access::rw(n_rows) = x.n_rows; access::rw(n_cols) = x.n_cols; diff --git a/include/armadillo_bits/Mat_meat.hpp b/include/armadillo_bits/Mat_meat.hpp index fac13bbc..5dc3dbce 100644 --- a/include/armadillo_bits/Mat_meat.hpp +++ b/include/armadillo_bits/Mat_meat.hpp @@ -915,6 +915,10 @@ Mat::operator=(const Mat& in_mat) arrayops::copy( memptr(), in_mat.mem, in_mat.n_elem ); } + else + { + arma_debug_print("Mat::operator=(): copy omitted"); + } return *this; } diff --git a/include/armadillo_bits/SpMat_meat.hpp b/include/armadillo_bits/SpMat_meat.hpp index 34d92024..9f381b27 100644 --- a/include/armadillo_bits/SpMat_meat.hpp +++ b/include/armadillo_bits/SpMat_meat.hpp @@ -5124,7 +5124,12 @@ SpMat::init(const SpMat& x) { arma_debug_sigprint(); - if(this == &x) { return; } + if(this == &x) + { + arma_debug_print("SpMat::init(): copy omitted"); + + return; + } bool init_done = false; diff --git a/include/armadillo_bits/field_meat.hpp b/include/armadillo_bits/field_meat.hpp index de613be9..6f7903d0 100644 --- a/include/armadillo_bits/field_meat.hpp +++ b/include/armadillo_bits/field_meat.hpp @@ -2120,7 +2120,12 @@ field::init(const field& x) { arma_debug_sigprint(); - if(this == &x) { return; } + if(this == &x) + { + arma_debug_print("field::init(): copy omitted"); + + return; + } field& t = (*this);