From 493b84e4d17240eaa274207e4484f85dac608a17 Mon Sep 17 00:00:00 2001 From: sunwen Date: Tue, 25 Apr 2023 15:07:12 +0800 Subject: [PATCH] Fix null matrix printf bug. --- src/Matrix.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Matrix.cpp b/src/Matrix.cpp index 2094229..0d9f346 100644 --- a/src/Matrix.cpp +++ b/src/Matrix.cpp @@ -423,12 +423,14 @@ namespace Aurora { Matrix Matrix::operator^(int times) const { return operatorMxA(&vdPowI, times, *this);} Matrix operator^( Matrix &&matrix,int times) { return operatorMxA(&vdPowI, times, std::forward(matrix)); - } - - - + } void Matrix::printf() { + if(isNull()) + { + ::printf("null matrix\n"); + return; + } int k_count = getDimSize(2); int j_count = getDimSize(1); int complexstep = 1;