Skip to content

Commit

Permalink
Fix API
Browse files Browse the repository at this point in the history
  • Loading branch information
william-dawson committed Apr 17, 2024
1 parent 42a94c6 commit 74a5425
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions Source/C/SMatrix_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions Source/CPlusPlus/SMatrix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

////////////////////////////////////////////////////////////////////////////////
Expand Down
18 changes: 9 additions & 9 deletions Source/Fortran/SMatrixAlgebraModule.F90
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ MODULE SMatrixAlgebraModule
PUBLIC :: MatrixColumnNorm
PUBLIC :: MatrixNorm
PUBLIC :: MatrixGrandSum
PUBLIC :: DiagonalScale
PUBLIC :: MatrixDiagonalScale
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
INTERFACE ScaleMatrix
MODULE PROCEDURE ScaleMatrix_lsr
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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
20 changes: 10 additions & 10 deletions Source/Wrapper/SMatrixAlgebraModule_wrp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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) &
Expand Down Expand Up @@ -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
Expand All @@ -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) &
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 74a5425

Please sign in to comment.