sdsdotsub.f (1560B)
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 `sdsdot` as a subroutine. 20 ! 21 ! @param {integer} N - number of values over which to compute the dot product 22 ! @param {real} sb - scalar constant added to the dot product 23 ! @param {Array<real>} sx - first array 24 ! @param {integer} strideX - `sx` stride length 25 ! @param {Array<real>} sy - second array 26 ! @param {integer} strideY - `sy` stride length 27 ! @param {real} dot - output variable reference 28 !< 29 subroutine sdsdotsub( N, sb, sx, strideX, sy, strideY, dot ) 30 implicit none 31 ! .. 32 ! External functions: 33 interface 34 real function sdsdot( N, sb, sx, strideX, sy, strideY ) 35 integer :: strideX, strideY, N 36 real :: sb, sx(*), sy(*) 37 end function sdsdot 38 end interface 39 ! .. 40 ! Scalar arguments: 41 integer :: strideX, strideY, N 42 real :: dot, sb 43 ! .. 44 ! Array arguments: 45 real :: sx(*), sy(*) 46 ! .. 47 ! Compute the dot product: 48 dot = sdsdot( N, sb, sx, strideX, sy, strideY ) 49 return 50 end subroutine sdsdotsub