diff --git a/Changelog b/Changelog index d80ad994..2dcb965b 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,6 @@ Changelog. A lot less detailed than usual, at least for past history. +2013/04/20: Fix add-by-one for unit triangular matrices. 2013/03/31: Implement CLONE method for vectors, maps and preconditioners. Make base_prec abstract. diff --git a/base/serial/impl/psb_c_coo_impl.f90 b/base/serial/impl/psb_c_coo_impl.f90 index d675785b..b86184b0 100644 --- a/base/serial/impl/psb_c_coo_impl.f90 +++ b/base/serial/impl/psb_c_coo_impl.f90 @@ -1788,6 +1788,12 @@ subroutine psb_c_coo_rowsum(d,a) d(i) = d(i) + a%val(j) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + cone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1836,6 +1842,12 @@ subroutine psb_c_coo_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1883,6 +1895,12 @@ subroutine psb_c_coo_colsum(d,a) k = a%ja(j) d(k) = d(k) + a%val(j) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + cone + end do + end if return call psb_erractionrestore(err_act) @@ -1931,6 +1949,12 @@ subroutine psb_c_coo_aclsum(d,a) k = a%ja(j) d(k) = d(k) + abs(a%val(j)) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_c_csc_impl.f90 b/base/serial/impl/psb_c_csc_impl.f90 index dd9dbf96..6799fdf2 100644 --- a/base/serial/impl/psb_c_csc_impl.f90 +++ b/base/serial/impl/psb_c_csc_impl.f90 @@ -1192,6 +1192,12 @@ subroutine psb_c_csc_colsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + cone + end do + end if return call psb_erractionrestore(err_act) @@ -1241,6 +1247,12 @@ subroutine psb_c_csc_aclsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + sone + end do + end if call psb_erractionrestore(err_act) return @@ -1292,6 +1304,12 @@ subroutine psb_c_csc_rowsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + cone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1335,7 +1353,6 @@ subroutine psb_c_csc_arwsum(d,a) end if d = szero - do i=1, m do j=a%icp(i),a%icp(i+1)-1 k = a%ia(j) @@ -1343,6 +1360,12 @@ subroutine psb_c_csc_arwsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return diff --git a/base/serial/impl/psb_c_csr_impl.f90 b/base/serial/impl/psb_c_csr_impl.f90 index f7edbf54..be6f0441 100644 --- a/base/serial/impl/psb_c_csr_impl.f90 +++ b/base/serial/impl/psb_c_csr_impl.f90 @@ -1397,6 +1397,12 @@ subroutine psb_c_csr_rowsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + cone + end do + end if return call psb_erractionrestore(err_act) @@ -1446,6 +1452,12 @@ subroutine psb_c_csr_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if call psb_erractionrestore(err_act) return @@ -1496,6 +1508,12 @@ subroutine psb_c_csr_colsum(d,a) d(k) = d(k) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + cone + end do + end if return call psb_erractionrestore(err_act) @@ -1547,6 +1565,12 @@ subroutine psb_c_csr_aclsum(d,a) d(k) = d(k) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_d_coo_impl.f90 b/base/serial/impl/psb_d_coo_impl.f90 index ddf322d6..1238ad93 100644 --- a/base/serial/impl/psb_d_coo_impl.f90 +++ b/base/serial/impl/psb_d_coo_impl.f90 @@ -1788,6 +1788,12 @@ subroutine psb_d_coo_rowsum(d,a) d(i) = d(i) + a%val(j) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return @@ -1836,6 +1842,12 @@ subroutine psb_d_coo_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return @@ -1883,6 +1895,12 @@ subroutine psb_d_coo_colsum(d,a) k = a%ja(j) d(k) = d(k) + a%val(j) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) @@ -1931,6 +1949,12 @@ subroutine psb_d_coo_aclsum(d,a) k = a%ja(j) d(k) = d(k) + abs(a%val(j)) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_d_csc_impl.f90 b/base/serial/impl/psb_d_csc_impl.f90 index b6aedd49..febab98c 100644 --- a/base/serial/impl/psb_d_csc_impl.f90 +++ b/base/serial/impl/psb_d_csc_impl.f90 @@ -1192,6 +1192,12 @@ subroutine psb_d_csc_colsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) @@ -1241,6 +1247,12 @@ subroutine psb_d_csc_aclsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + done + end do + end if call psb_erractionrestore(err_act) return @@ -1292,6 +1304,12 @@ subroutine psb_d_csc_rowsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return @@ -1335,7 +1353,6 @@ subroutine psb_d_csc_arwsum(d,a) end if d = dzero - do i=1, m do j=a%icp(i),a%icp(i+1)-1 k = a%ia(j) @@ -1343,6 +1360,12 @@ subroutine psb_d_csc_arwsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return diff --git a/base/serial/impl/psb_d_csr_impl.f90 b/base/serial/impl/psb_d_csr_impl.f90 index 6d20a8f2..9ad2db78 100644 --- a/base/serial/impl/psb_d_csr_impl.f90 +++ b/base/serial/impl/psb_d_csr_impl.f90 @@ -1397,6 +1397,12 @@ subroutine psb_d_csr_rowsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) @@ -1446,6 +1452,12 @@ subroutine psb_d_csr_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if call psb_erractionrestore(err_act) return @@ -1496,6 +1508,12 @@ subroutine psb_d_csr_colsum(d,a) d(k) = d(k) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) @@ -1547,6 +1565,12 @@ subroutine psb_d_csr_aclsum(d,a) d(k) = d(k) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_s_coo_impl.f90 b/base/serial/impl/psb_s_coo_impl.f90 index c26eb9ab..38a8fa76 100644 --- a/base/serial/impl/psb_s_coo_impl.f90 +++ b/base/serial/impl/psb_s_coo_impl.f90 @@ -1788,6 +1788,12 @@ subroutine psb_s_coo_rowsum(d,a) d(i) = d(i) + a%val(j) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1836,6 +1842,12 @@ subroutine psb_s_coo_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1883,6 +1895,12 @@ subroutine psb_s_coo_colsum(d,a) k = a%ja(j) d(k) = d(k) + a%val(j) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) @@ -1931,6 +1949,12 @@ subroutine psb_s_coo_aclsum(d,a) k = a%ja(j) d(k) = d(k) + abs(a%val(j)) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_s_csc_impl.f90 b/base/serial/impl/psb_s_csc_impl.f90 index 5c9e977e..769670f3 100644 --- a/base/serial/impl/psb_s_csc_impl.f90 +++ b/base/serial/impl/psb_s_csc_impl.f90 @@ -1192,6 +1192,12 @@ subroutine psb_s_csc_colsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) @@ -1241,6 +1247,12 @@ subroutine psb_s_csc_aclsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + sone + end do + end if call psb_erractionrestore(err_act) return @@ -1292,6 +1304,12 @@ subroutine psb_s_csc_rowsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1335,7 +1353,6 @@ subroutine psb_s_csc_arwsum(d,a) end if d = szero - do i=1, m do j=a%icp(i),a%icp(i+1)-1 k = a%ia(j) @@ -1343,6 +1360,12 @@ subroutine psb_s_csc_arwsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + sone + end do + end if + return call psb_erractionrestore(err_act) return diff --git a/base/serial/impl/psb_s_csr_impl.f90 b/base/serial/impl/psb_s_csr_impl.f90 index 0088fead..68f0535a 100644 --- a/base/serial/impl/psb_s_csr_impl.f90 +++ b/base/serial/impl/psb_s_csr_impl.f90 @@ -1397,6 +1397,12 @@ subroutine psb_s_csr_rowsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) @@ -1446,6 +1452,12 @@ subroutine psb_s_csr_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + sone + end do + end if call psb_erractionrestore(err_act) return @@ -1496,6 +1508,12 @@ subroutine psb_s_csr_colsum(d,a) d(k) = d(k) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) @@ -1547,6 +1565,12 @@ subroutine psb_s_csr_aclsum(d,a) d(k) = d(k) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + sone + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_z_coo_impl.f90 b/base/serial/impl/psb_z_coo_impl.f90 index e43f52dd..7cbc1739 100644 --- a/base/serial/impl/psb_z_coo_impl.f90 +++ b/base/serial/impl/psb_z_coo_impl.f90 @@ -1788,6 +1788,12 @@ subroutine psb_z_coo_rowsum(d,a) d(i) = d(i) + a%val(j) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + zone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1836,6 +1842,12 @@ subroutine psb_z_coo_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return @@ -1883,6 +1895,12 @@ subroutine psb_z_coo_colsum(d,a) k = a%ja(j) d(k) = d(k) + a%val(j) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + zone + end do + end if return call psb_erractionrestore(err_act) @@ -1931,6 +1949,12 @@ subroutine psb_z_coo_aclsum(d,a) k = a%ja(j) d(k) = d(k) + abs(a%val(j)) end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act) diff --git a/base/serial/impl/psb_z_csc_impl.f90 b/base/serial/impl/psb_z_csc_impl.f90 index 40a267fe..dff25d0c 100644 --- a/base/serial/impl/psb_z_csc_impl.f90 +++ b/base/serial/impl/psb_z_csc_impl.f90 @@ -1192,6 +1192,12 @@ subroutine psb_z_csc_colsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + zone + end do + end if return call psb_erractionrestore(err_act) @@ -1241,6 +1247,12 @@ subroutine psb_z_csc_aclsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_ncols() + d(i) = d(i) + done + end do + end if call psb_erractionrestore(err_act) return @@ -1292,6 +1304,12 @@ subroutine psb_z_csc_rowsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + zone + end do + end if + return call psb_erractionrestore(err_act) return @@ -1335,7 +1353,6 @@ subroutine psb_z_csc_arwsum(d,a) end if d = dzero - do i=1, m do j=a%icp(i),a%icp(i+1)-1 k = a%ia(j) @@ -1343,6 +1360,12 @@ subroutine psb_z_csc_arwsum(d,a) end do end do + if (a%is_triangle().and.a%is_unit()) then + do i=1, a%get_nrows() + d(i) = d(i) + done + end do + end if + return call psb_erractionrestore(err_act) return diff --git a/base/serial/impl/psb_z_csr_impl.f90 b/base/serial/impl/psb_z_csr_impl.f90 index 65d5fcac..2b7cc374 100644 --- a/base/serial/impl/psb_z_csr_impl.f90 +++ b/base/serial/impl/psb_z_csr_impl.f90 @@ -1397,6 +1397,12 @@ subroutine psb_z_csr_rowsum(d,a) d(i) = d(i) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + zone + end do + end if return call psb_erractionrestore(err_act) @@ -1446,6 +1452,12 @@ subroutine psb_z_csr_arwsum(d,a) d(i) = d(i) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, m + d(i) = d(i) + done + end do + end if call psb_erractionrestore(err_act) return @@ -1496,6 +1508,12 @@ subroutine psb_z_csr_colsum(d,a) d(k) = d(k) + (a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + zone + end do + end if return call psb_erractionrestore(err_act) @@ -1547,6 +1565,12 @@ subroutine psb_z_csr_aclsum(d,a) d(k) = d(k) + abs(a%val(j)) end do end do + + if (a%is_triangle().and.a%is_unit()) then + do i=1, n + d(i) = d(i) + done + end do + end if return call psb_erractionrestore(err_act)