QR_MUMPS
 All Classes Files Functions Variables Enumerations Enumerator Pages
qrm_utils_mod.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 
37  use iso_c_binding
38 
41  interface qrm_readmat
42  subroutine _qrm_readmat(matfile, qrm_mat, fakec)
43  use _qrm_spmat_mod
44  character, intent(in) :: matfile*30
45  type(_qrm_spmat_type), intent(inout) :: qrm_mat
46  logical, optional :: fakec
47  end subroutine _qrm_readmat
48  end interface
49 
52  interface _qrm_matmul
53  module procedure _qrm_matmul2dw, _qrm_matmul1dw
54  end interface _qrm_matmul
55 
58  interface qrm_matmul
59  subroutine _qrm_matmul2d(qrm_mat, transp, alpha, x, beta, y)
60  use _qrm_spmat_mod
61  type(_qrm_spmat_type), target :: qrm_mat
62  _qrm_data, intent(out) :: y(:,:)
63  _qrm_data, intent(in) :: x(:,:)
64  _qrm_data, intent(in) :: alpha, beta
65  character(len=*) :: transp
66  end subroutine _qrm_matmul2d
67  subroutine _qrm_matmul1d(qrm_mat, transp, alpha, x, beta, y)
68  use _qrm_spmat_mod
69  type(_qrm_spmat_type) :: qrm_mat
70  _qrm_data, intent(out) :: y(:)
71  _qrm_data, intent(in) :: x(:)
72  _qrm_data, intent(in) :: alpha, beta
73  character(len=*) :: transp
74  end subroutine _qrm_matmul1d
75  end interface
76 
77 
80  interface _qrm_vecnrm
81  module procedure _qrm_vecnrm2dw, _qrm_vecnrm1dw
82  end interface _qrm_vecnrm
83 
86  interface qrm_vecnrm
87  subroutine _qrm_vecnrm2d(vec, n, ntype, nrm)
88  _qrm_data, intent(in) :: vec(:,:)
89  _qrm_real :: nrm(:)
90  integer, intent(in) :: n
91  character :: ntype
92  end subroutine _qrm_vecnrm2d
93  subroutine _qrm_vecnrm1d(vec, n, ntype, nrm)
94  _qrm_data, intent(in) :: vec(:)
95  _qrm_real :: nrm
96  integer, intent(in) :: n
97  character :: ntype
98  end subroutine _qrm_vecnrm1d
99  end interface
100 
103  interface qrm_remap_pnt
104  subroutine _qrm_remap_pnt(arr1d, pnt2d, n)
105  integer :: n
106  _qrm_data, target :: arr1d(1:n)
107  _qrm_data, pointer :: pnt2d(:,:)
108  end subroutine _qrm_remap_pnt
109  end interface
110 
111 
112 
113  interface qrm_matnrm
114  subroutine _qrm_matnrm(qrm_mat, ntype, nrm)
115  use _qrm_spmat_mod
116  type(_qrm_spmat_type), intent(in) :: qrm_mat
117  _qrm_real :: nrm
118  character :: ntype
119  end subroutine _qrm_matnrm
120  end interface qrm_matnrm
121 
122 
123 
124 contains
125 
126  subroutine _qrm_matmul2dw(qrm_mat, transp, alpha, x, beta, y)
127  use _qrm_spmat_mod
128  type(_qrm_spmat_type), target :: qrm_mat
129  _qrm_data, intent(out) :: y(:,:)
130  _qrm_data, intent(in) :: x(:,:)
131  _qrm_data, intent(in) :: alpha, beta
132  character(len=*) :: transp
133  call _qrm_matmul2d(qrm_mat, transp, alpha, x, beta, y)
134  return
135  end subroutine _qrm_matmul2dw
136 
137  subroutine _qrm_matmul1dw(qrm_mat, transp, alpha, x, beta, y)
138  use _qrm_spmat_mod
139  type(_qrm_spmat_type) :: qrm_mat
140  _qrm_data, intent(out) :: y(:)
141  _qrm_data, intent(in) :: x(:)
142  _qrm_data, intent(in) :: alpha, beta
143  character(len=*) :: transp
144  call _qrm_matmul1d(qrm_mat, transp, alpha, x, beta, y)
145  return
146  end subroutine _qrm_matmul1dw
147 
148 
149  subroutine _qrm_vecnrm2dw(vec, n, ntype, nrm)
150  _qrm_data, intent(in) :: vec(:,:)
151  _qrm_real :: nrm(:)
152  integer, intent(in) :: n
153  character :: ntype
154  call _qrm_vecnrm2d(vec, n, ntype, nrm)
155  return
156  end subroutine _qrm_vecnrm2dw
157 
158  subroutine _qrm_vecnrm1dw(vec, n, ntype, nrm)
159  _qrm_data, intent(in) :: vec(:)
160  _qrm_real :: nrm
161  integer, intent(in) :: n
162  character :: ntype
163  call _qrm_vecnrm1d(vec, n, ntype, nrm)
164  return
165  end subroutine _qrm_vecnrm1dw
166 
167 end module _qrm_utils_mod
subroutine _qrm_matmul1dw(qrm_mat, transp, alpha, x, beta, y)
Generic interface for the ::_qrm_vecnrm2d and ::_qrm_vecnrm1d routines.
subroutine _qrm_matmul2d(qrm_mat, transp, alpha, x, beta, y)
This subroutine computes the product y=beta*y+alpha*op(A)*x where op(A) is either A or A' depending o...
Definition: qrm_matmul.F90:51
subroutine _qrm_vecnrm2dw(vec, n, ntype, nrm)
subroutine _qrm_remap_pnt(arr1d, pnt2d, n)
This function makes a 2D pointer point to a 1D array.
Generic interface for the ::_qrm_remap_pnt routine.
subroutine _qrm_vecnrm1d(vec, n, ntype, nrm)
This subroutine computes the norm of a vector.
Definition: qrm_vecnrm.F90:118
This module contains generic interfaces for a number of auxiliary tools.
Generic interface for the ::_qrm_vecnrm2d and ::_qrm_vecnrm1d routines.
subroutine _qrm_matnrm(qrm_mat, ntype, nrm)
This subroutine computes the matrix norm. The return value is a real scalar.
Definition: qrm_matnrm.F90:47
Generic interface for the ::_qrm_readmat routine.
subroutine _qrm_vecnrm2d(vec, n, ntype, nrm)
This subroutine computes the norm of multiple vectors.
Definition: qrm_vecnrm.F90:50
This type defines the data structure used to store a matrix.
subroutine _qrm_readmat(matfile, qrm_mat, fakec)
This subroutine reads a Matrix Market matrix from a file and stores it on the host processor...
Definition: qrm_readmat.F90:53
subroutine _qrm_matmul1d(qrm_mat, transp, alpha, x, beta, y)
This subroutine computes the product y=beta*y+alpha*op(A)*x where op(A) is either A or A' depending o...
Definition: qrm_matmul.F90:122
This module contains the definition of the basic sparse matrix type and of the associated methods...
subroutine _qrm_vecnrm1dw(vec, n, ntype, nrm)
Generic interface for the ::_qrm_matmul2d and ::_qrm_matmul1d routines.
subroutine _qrm_matmul2dw(qrm_mat, transp, alpha, x, beta, y)
Generic interface for the ::_qrm_matmul2d and ::_qrm_matmul1d routines.