dsdotsub.f (1498B)
1 !> 2 ! @license Apache-2.0 3 ! 4 ! Copyright (c) 2020 The Stdlib Authors. 5 ! 6 ! Licensed under the Apache License, Version 2.0 (the "License"); 7 ! you may not use this file except in compliance with the License. 8 ! You may obtain a copy of the License at 9 ! 10 ! http://www.apache.org/licenses/LICENSE-2.0 11 ! 12 ! Unless required by applicable law or agreed to in writing, software 13 ! distributed under the License is distributed on an "AS IS" BASIS, 14 ! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 ! See the License for the specific language governing permissions and 16 ! limitations under the License. 17 !< 18 19 !> Wraps `dsdot` as a subroutine. 20 ! 21 ! @param {integer} N - number of values over which to compute the dot product 22 ! @param {Array<real>} sx - first array 23 ! @param {integer} strideX - `sx` stride length 24 ! @param {Array<real>} sy - second array 25 ! @param {integer} strideY - `sy` stride length 26 ! @param {double} dot - output variable reference 27 !< 28 subroutine dsdotsub( N, sx, strideX, sy, strideY, dot ) 29 implicit none 30 ! .. 31 ! External functions: 32 interface 33 double precision function dsdot( N, sx, strideX, sy, strideY ) 34 integer :: strideX, strideY, N 35 real :: sx(*), sy(*) 36 end function dsdot 37 end interface 38 ! .. 39 ! Scalar arguments: 40 integer :: strideX, strideY, N 41 double precision :: dot 42 ! .. 43 ! Array arguments: 44 real :: sx(*), sy(*) 45 ! .. 46 ! Compute the dot product: 47 dot = dsdot( N, sx, strideX, sy, strideY ) 48 return 49 end subroutine dsdotsub