From 74a54254f2b566b56f358dd1dc96b52e7028f0b9 Mon Sep 17 00:00:00 2001 From: William Dawson Date: Wed, 17 Apr 2024 14:36:31 +0900 Subject: [PATCH] Fix API --- Source/C/SMatrix_c.h | 4 ++-- Source/CPlusPlus/SMatrix.cc | 4 ++-- Source/Fortran/SMatrixAlgebraModule.F90 | 18 +++++++++--------- Source/Wrapper/SMatrixAlgebraModule_wrp.F90 | 20 ++++++++++---------- 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Source/C/SMatrix_c.h b/Source/C/SMatrix_c.h index 4a49f801..9307c931 100644 --- a/Source/C/SMatrix_c.h +++ b/Source/C/SMatrix_c.h @@ -34,7 +34,7 @@ void PrintMatrix_lsr_wrp(const int *ih_this); void PrintMatrixF_lsr_wrp(const int *ih_this, const char *file_name, const int *name_size); void MatrixToTripletList_lsr_wrp(const int *ih_this, int *ih_triplet_list); -void DiagonalScale_lsr_wrp(int *ih_mat, const int *ih_tlist); +void MatrixDiagonalScale_lsr_wrp(int *ih_mat, const int *ih_tlist); void ConstructMatrixFromFile_lsc_wrp(int *ih_this, const char *file_name, const int *name_size); @@ -71,6 +71,6 @@ void PrintMatrix_lsc_wrp(const int *ih_this); void PrintMatrixF_lsc_wrp(const int *ih_this, const char *file_name, const int *name_size); void MatrixToTripletList_lsc_wrp(const int *ih_this, int *ih_triplet_list); -void DiagonalScale_lsc_wrp(int *ih_mat, const int *ih_tlist); +void MatrixDiagonalScale_lsc_wrp(int *ih_mat, const int *ih_tlist); #endif diff --git a/Source/CPlusPlus/SMatrix.cc b/Source/CPlusPlus/SMatrix.cc index 48dbbe8d..588677f6 100644 --- a/Source/CPlusPlus/SMatrix.cc +++ b/Source/CPlusPlus/SMatrix.cc @@ -177,12 +177,12 @@ void Matrix_lsc::Gemm(const Matrix_lsc &matA, const Matrix_lsc &matB, //////////////////////////////////////////////////////////////////////////////// void Matrix_lsr::DiagonalScale(const TripletList_r &tlist) { - DiagonalScale_lsr_wrp(ih_this, tlist.ih_this); + MatrixDiagonalScale_lsr_wrp(ih_this, tlist.ih_this); } //////////////////////////////////////////////////////////////////////////////// void Matrix_lsc::DiagonalScale(const TripletList_c &tlist, double threshold) { - DiagonalScale_lsc_wrp(ih_this, tlist.ih_this); + MatrixDiagonalScale_lsc_wrp(ih_this, tlist.ih_this); } //////////////////////////////////////////////////////////////////////////////// diff --git a/Source/Fortran/SMatrixAlgebraModule.F90 b/Source/Fortran/SMatrixAlgebraModule.F90 index ace4bbc9..ce6415c4 100644 --- a/Source/Fortran/SMatrixAlgebraModule.F90 +++ b/Source/Fortran/SMatrixAlgebraModule.F90 @@ -25,7 +25,7 @@ MODULE SMatrixAlgebraModule PUBLIC :: MatrixColumnNorm PUBLIC :: MatrixNorm PUBLIC :: MatrixGrandSum - PUBLIC :: DiagonalScale + PUBLIC :: MatrixDiagonalScale !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! INTERFACE ScaleMatrix MODULE PROCEDURE ScaleMatrix_lsr @@ -76,10 +76,10 @@ MODULE SMatrixAlgebraModule MODULE PROCEDURE DenseBranch_lsr MODULE PROCEDURE DenseBranch_lsc END INTERFACE DenseBranch - INTERFACE DiagonalScale - MODULE PROCEDURE DiagonalScale_lsr - MODULE PROCEDURE DiagonalScale_lsc - END INTERFACE DiagonalScale + INTERFACE MatrixDiagonalScale + MODULE PROCEDURE MatrixDiagonalScale_lsr + MODULE PROCEDURE MatrixDiagonalScale_lsc + END INTERFACE MatrixDiagonalScale CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Will scale a sparse matrix by a constant. PURE SUBROUTINE ScaleMatrix_lsr(matA,constant) @@ -533,7 +533,7 @@ PURE SUBROUTINE PruneList_lsc(memorypool,alpha,threshold, & END SUBROUTINE PruneList_lsc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Scale a matrix using a diagonal matrix (triplet list form). - SUBROUTINE DiagonalScale_lsr(mat, tlist) + SUBROUTINE MatrixDiagonalScale_lsr(mat, tlist) !> The matrix to scale. TYPE(Matrix_lsr), INTENT(INOUT) :: mat !> The diagonal matrix. @@ -542,10 +542,10 @@ SUBROUTINE DiagonalScale_lsr(mat, tlist) REAL(NTREAL) :: val #include "sparse_includes/DiagonalScale.f90" - END SUBROUTINE DiagonalScale_lsr + END SUBROUTINE MatrixDiagonalScale_lsr !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Scale a matrix using a diagonal matrix (triplet list form). - SUBROUTINE DiagonalScale_lsc(mat, tlist) + SUBROUTINE MatrixDiagonalScale_lsc(mat, tlist) !> The matrix to scale. TYPE(Matrix_lsc), INTENT(INOUT) :: mat !> The diagonal matrix. @@ -554,6 +554,6 @@ SUBROUTINE DiagonalScale_lsc(mat, tlist) COMPLEX(NTCOMPLEX) :: val #include "sparse_includes/DiagonalScale.f90" - END SUBROUTINE DiagonalScale_lsc + END SUBROUTINE MatrixDiagonalScale_lsc !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! END MODULE SMatrixAlgebraModule diff --git a/Source/Wrapper/SMatrixAlgebraModule_wrp.F90 b/Source/Wrapper/SMatrixAlgebraModule_wrp.F90 index 405bd326..03b5d0ed 100644 --- a/Source/Wrapper/SMatrixAlgebraModule_wrp.F90 +++ b/Source/Wrapper/SMatrixAlgebraModule_wrp.F90 @@ -18,14 +18,14 @@ MODULE SMatrixAlgebraModule_wrp PUBLIC :: DotMatrix_lsr_wrp PUBLIC :: PairwiseMultiplyMatrix_lsr_wrp PUBLIC :: MatrixMultiply_lsr_wrp - PUBLIC :: DiagonalScale_lsr_wrp + PUBLIC :: MatrixDiagonalScale_lsr_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PUBLIC :: ScaleMatrix_lsc_wrp PUBLIC :: IncrementMatrix_lsc_wrp PUBLIC :: DotMatrix_lsc_wrp PUBLIC :: PairwiseMultiplyMatrix_lsc_wrp PUBLIC :: MatrixMultiply_lsc_wrp - PUBLIC :: DiagonalScale_lsc_wrp + PUBLIC :: MatrixDiagonalScale_lsc_wrp CONTAINS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Wrap the scale a sparse matrix by a constant routine. SUBROUTINE ScaleMatrix_lsr_wrp(ih_this, constant) & @@ -114,8 +114,8 @@ SUBROUTINE MatrixMultiply_lsr_wrp(ih_matA, ih_matB, ih_matC, IsATransposed, & END SUBROUTINE MatrixMultiply_lsr_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Scale a matrix using a diagonal matrix (triplet list form). - SUBROUTINE DiagonalScale_lsr_wrp(ih_mat, ih_tlist) & - & BIND(c,name="DiagonalScale_lsr_wrp") + SUBROUTINE MatrixDiagonalScale_lsr_wrp(ih_mat, ih_tlist) & + & BIND(c,name="MatrixDiagonalScale_lsr_wrp") INTEGER(kind=c_int), INTENT(INOUT) :: ih_mat(SIZE_wrp) INTEGER(kind=c_int), INTENT(IN) :: ih_tlist(SIZE_wrp) TYPE(Matrix_lsr_wrp) :: h_mat @@ -124,8 +124,8 @@ SUBROUTINE DiagonalScale_lsr_wrp(ih_mat, ih_tlist) & h_mat = TRANSFER(ih_mat, h_mat) h_tlist = TRANSFER(ih_tlist, h_tlist) - CALL DiagonalScale(h_mat%DATA, h_tlist%DATA) - END SUBROUTINE DiagonalScale_lsr_wrp + CALL MatrixDiagonalScale(h_mat%DATA, h_tlist%DATA) + END SUBROUTINE MatrixDiagonalScale_lsr_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Wrap the scale a sparse matrix by a constant routine. SUBROUTINE ScaleMatrix_lsc_wrp(ih_this, constant) & @@ -219,8 +219,8 @@ SUBROUTINE MatrixMultiply_lsc_wrp(ih_matA, ih_matB, ih_matC, IsATransposed, & END SUBROUTINE MatrixMultiply_lsc_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !> Scale a matrix using a diagonal matrix (triplet list form). - SUBROUTINE DiagonalScale_lsc_wrp(ih_mat, ih_tlist) & - & BIND(c,name="DiagonalScale_lsc_wrp") + SUBROUTINE MatrixDiagonalScale_lsc_wrp(ih_mat, ih_tlist) & + & BIND(c,name="MatrixDiagonalScale_lsc_wrp") INTEGER(kind=c_int), INTENT(INOUT) :: ih_mat(SIZE_wrp) INTEGER(kind=c_int), INTENT(IN) :: ih_tlist(SIZE_wrp) TYPE(Matrix_lsc_wrp) :: h_mat @@ -229,7 +229,7 @@ SUBROUTINE DiagonalScale_lsc_wrp(ih_mat, ih_tlist) & h_mat = TRANSFER(ih_mat, h_mat) h_tlist = TRANSFER(ih_tlist, h_tlist) - CALL DiagonalScale(h_mat%DATA, h_tlist%DATA) - END SUBROUTINE DiagonalScale_lsc_wrp + CALL MatrixDiagonalScale(h_mat%DATA, h_tlist%DATA) + END SUBROUTINE MatrixDiagonalScale_lsc_wrp !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! END MODULE SMatrixAlgebraModule_wrp