QR_MUMPS
 All Classes Files Functions Variables Enumerations Enumerator Pages
dqrm_solve_sing_front.F90
Go to the documentation of this file.
1 !! ##############################################################################################
2 !!
3 !! Copyright 2012 CNRS, INPT
4 !!
5 !! This file is part of qr_mumps.
6 !!
7 !! qr_mumps is free software: you can redistribute it and/or modify
8 !! it under the terms of the GNU Lesser General Public License as
9 !! published by the Free Software Foundation, either version 3 of
10 !! the License, or (at your option) any later version.
11 !!
12 !! qr_mumps is distributed in the hope that it will be useful,
13 !! but WITHOUT ANY WARRANTY; without even the implied warranty of
14 !! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 !! GNU Lesser General Public License for more details.
16 !!
17 !! You can find a copy of the GNU Lesser General Public License
18 !! in the qr_mumps/doc directory.
19 !!
20 !! ##############################################################################################
21 
22 
23 !! ##############################################################################################
33 
34 
35 #include "qrm_common.h"
36 
49 subroutine dqrm_solve_sing_front(qrm_mat, b, x, trans)
50 
51  use dqrm_spmat_mod
52  use qrm_string_mod
53  use dqrm_fdata_mod
54  implicit none
55 
56  type(dqrm_spmat_type), target :: qrm_mat
57  real(kind(1.d0)), intent(inout) :: b(:,:)
58  real(kind(1.d0)), intent(inout) :: x(:,:)
59  character :: trans
60 
61  type(dqrm_front_type), pointer :: front
62  integer :: i, j, row, col
63  real(kind(1.d0)) :: d
64 
65  ! the front with the singletons is always the first one
66  front => qrm_mat%fdata%front_list(1)
67 
68  ! do the computations.
69  !
70  ! THIS ROUTINE ASSUMES THAT THE DIAGONAL ELEMENTS IN FRONT%AVAL AND
71  ! FRONT%AJCN ALWAYS COME BEFORE THE OTHERS ALONG THEIR ROW. THIS IS
72  ! ENFORCED INSIDE QRM_FACTORIZATION_INIT
73  !
74  if(qrm_str_tolower(trans) .eq. 'n') then
75  do i=front%anrows, 1, -1
76  row =qrm_mat%adata%rperm(i)
77  do j=front%aiptr(i+1)-1, front%aiptr(i)+1,-1
78  col = front%ajcn(j)
79  b(row,:) = b(row,:) - front%aval(j)*x(col,:)
80  end do
81  x(qrm_mat%adata%cperm(i),:) = b(row,:)/front%aval(front%aiptr(i))
82  end do
83 
84  else if(qrm_str_tolower(trans) .eq. 't') then
85 
86  do j=1, front%anrows
87  col = qrm_mat%adata%rperm(j)
88  x(col,:) = b(qrm_mat%adata%cperm(j),:)/(front%aval(front%aiptr(j)))
89  do i=front%aiptr(j)+1, front%aiptr(j+1)-1
90  row = front%ajcn(i)
91  b(row,:) = b(row,:)-(front%aval(i))*x(col,:)
92  end do
93  end do
94  else
95 
96  end if
97 
98  return
99 
100 end subroutine dqrm_solve_sing_front
101 
subroutine dqrm_solve_sing_front(qrm_mat, b, x, trans)
This function handles the front containing the singletons during the solve for R or R'...
This module contains the definition of the basic sparse matrix type and of the associated methods...
This module contains the definition of all the data related to the factorization phase.
This type defines the data structure used to store a matrix.
This type defines a data structure containing all the data related to a front.
This module contains various string handling routines.
int i
Definition: secs.c:40