QR_MUMPS
dqrm_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 dqrm_readmat(matfile, qrm_mat, fakec)
44  character, intent(in) :: matfile*30
45  type(dqrm_spmat_type), intent(inout) :: qrm_mat
46  logical, optional :: fakec
47  end subroutine dqrm_readmat
48  end interface
49 
52  interface dqrm_matmul
53  module procedure dqrm_matmul2dw, dqrm_matmul1dw
54  end interface dqrm_matmul
55 
58  interface qrm_matmul
59  subroutine dqrm_matmul2d(qrm_mat, transp, alpha, x, beta, y)
61  type(dqrm_spmat_type), target :: qrm_mat
62  real(kind(1.d0)), intent(out) :: y(:,:)
63  real(kind(1.d0)), intent(in) :: x(:,:)
64  real(kind(1.d0)), intent(in) :: alpha, beta
65  character(len=*) :: transp
66  end subroutine dqrm_matmul2d
67  subroutine dqrm_matmul1d(qrm_mat, transp, alpha, x, beta, y)
69  type(dqrm_spmat_type) :: qrm_mat
70  real(kind(1.d0)), intent(out) :: y(:)
71  real(kind(1.d0)), intent(in) :: x(:)
72  real(kind(1.d0)), intent(in) :: alpha, beta
73  character(len=*) :: transp
74  end subroutine dqrm_matmul1d
75  end interface
76 
77 
80  interface dqrm_vecnrm
81  module procedure dqrm_vecnrm2dw, dqrm_vecnrm1dw
82  end interface dqrm_vecnrm
83 
86  interface qrm_vecnrm
87  subroutine dqrm_vecnrm2d(vec, n, ntype, nrm)
88  real(kind(1.d0)), intent(in) :: vec(:,:)
89  real(kind(1.d0)) :: nrm(:)
90  integer, intent(in) :: n
91  character :: ntype
92  end subroutine dqrm_vecnrm2d
93  subroutine dqrm_vecnrm1d(vec, n, ntype, nrm)
94  real(kind(1.d0)), intent(in) :: vec(:)
95  real(kind(1.d0)) :: nrm
96  integer, intent(in) :: n
97  character :: ntype
98  end subroutine dqrm_vecnrm1d
99  end interface
100 
103  interface qrm_remap_pnt
104  subroutine dqrm_remap_pnt(arr1d, pnt2d, n)
105  integer :: n
106  real(kind(1.d0)), target :: arr1d(1:n)
107  real(kind(1.d0)), pointer :: pnt2d(:,:)
108  end subroutine dqrm_remap_pnt
109  end interface
110 
111 
112 
113  interface qrm_matnrm
114  subroutine dqrm_matnrm(qrm_mat, ntype, nrm)
116  type(dqrm_spmat_type), intent(in) :: qrm_mat
117  real(kind(1.d0)) :: nrm
118  character :: ntype
119  end subroutine dqrm_matnrm
120  end interface qrm_matnrm
121 
122 
123 
124 contains
125 
126  subroutine dqrm_matmul2dw(qrm_mat, transp, alpha, x, beta, y)
128  type(dqrm_spmat_type), target :: qrm_mat
129  real(kind(1.d0)), intent(out) :: y(:,:)
130  real(kind(1.d0)), intent(in) :: x(:,:)
131  real(kind(1.d0)), intent(in) :: alpha, beta
132  character(len=*) :: transp
133  call dqrm_matmul2d(qrm_mat, transp, alpha, x, beta, y)
134  return
135  end subroutine dqrm_matmul2dw
136 
137  subroutine dqrm_matmul1dw(qrm_mat, transp, alpha, x, beta, y)
139  type(dqrm_spmat_type) :: qrm_mat
140  real(kind(1.d0)), intent(out) :: y(:)
141  real(kind(1.d0)), intent(in) :: x(:)
142  real(kind(1.d0)), intent(in) :: alpha, beta
143  character(len=*) :: transp
144  call dqrm_matmul1d(qrm_mat, transp, alpha, x, beta, y)
145  return
146  end subroutine dqrm_matmul1dw
147 
148 
149  subroutine dqrm_vecnrm2dw(vec, n, ntype, nrm)
150  real(kind(1.d0)), intent(in) :: vec(:,:)
151  real(kind(1.d0)) :: nrm(:)
152  integer, intent(in) :: n
153  character :: ntype
154  call dqrm_vecnrm2d(vec, n, ntype, nrm)
155  return
156  end subroutine dqrm_vecnrm2dw
157 
158  subroutine dqrm_vecnrm1dw(vec, n, ntype, nrm)
159  real(kind(1.d0)), intent(in) :: vec(:)
160  real(kind(1.d0)) :: nrm
161  integer, intent(in) :: n
162  character :: ntype
163  call dqrm_vecnrm1d(vec, n, ntype, nrm)
164  return
165  end subroutine dqrm_vecnrm1dw
166 
167 end module dqrm_utils_mod
This module contains generic interfaces for a number of auxiliary tools.
subroutine dqrm_readmat(matfile, qrm_mat, fakec)
This subroutine reads a Matrix Market matrix from a file and stores it on the host processor...
Generic interface for the ::dqrm_matmul2d and ::dqrm_matmul1d routines.
Generic interface for the ::dqrm_remap_pnt routine.
subroutine dqrm_matmul1dw(qrm_mat, transp, alpha, x, beta, y)
Generic interface for the ::dqrm_vecnrm2d and ::dqrm_vecnrm1d routines.
subroutine dqrm_matmul2dw(qrm_mat, transp, alpha, x, beta, y)
subroutine dqrm_vecnrm2d(vec, n, ntype, nrm)
This subroutine computes the norm of multiple vectors.
Definition: dqrm_vecnrm.F90:51
Generic interface for the ::dqrm_vecnrm2d and ::dqrm_vecnrm1d routines.
This module contains the definition of the basic sparse matrix type and of the associated methods...
subroutine dqrm_vecnrm2dw(vec, n, ntype, nrm)
Generic interface for the ::dqrm_matmul2d and ::dqrm_matmul1d routines.
subroutine dqrm_vecnrm1d(vec, n, ntype, nrm)
This subroutine computes the norm of a vector.
subroutine dqrm_vecnrm1dw(vec, n, ntype, nrm)
subroutine dqrm_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: dqrm_matmul.F90:52
This type defines the data structure used to store a matrix.
subroutine dqrm_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...
Generic interface for the ::dqrm_readmat routine.
subroutine dqrm_remap_pnt(arr1d, pnt2d, n)
This function makes a 2D pointer point to a 1D array.
subroutine dqrm_matnrm(qrm_mat, ntype, nrm)
This subroutine computes the matrix norm. The return value is a real scalar.
Definition: dqrm_matnrm.F90:48