diff --git a/src/Matrix.cpp b/src/Matrix.cpp index 932ebd8..f143d24 100644 --- a/src/Matrix.cpp +++ b/src/Matrix.cpp @@ -476,11 +476,15 @@ namespace Aurora { double& Matrix::operator[](size_t index) { return getData()[index];} double Matrix::operator[](size_t index) const { return getData()[index];} - Matrix Matrix::block(int aDim,int aBeginIndex, int aEndIndex){ + Matrix Matrix::block(int aDim,int aBeginIndex, int aEndIndex) const{ if(aDim>2 ){ std::cerr<<"block only support 1D-3D data!"<1){ + aDim = 1; + } if (aBeginIndex>=getDimSize(aDim) || aBeginIndex<0){ std::cerr<<"block BeginIndx error!BeginIndx:"<