time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

ddotsub.f (1520B)


      1 !>
      2 ! @license Apache-2.0
      3 !
      4 ! Copyright (c) 2019 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 `ddot` as a subroutine.
     20 !
     21 ! @param {integer} N - number of values over which to compute the dot product
     22 ! @param {Array<double>} dx - first array
     23 ! @param {integer} strideX - `dx` stride length
     24 ! @param {Array<double>} dy - second array
     25 ! @param {integer} strideY - `dy` stride length
     26 ! @param {double} dot - output variable reference
     27 !<
     28 subroutine ddotsub( N, dx, strideX, dy, strideY, dot )
     29   implicit none
     30   ! ..
     31   ! External functions:
     32   interface
     33     double precision function ddot( N, dx, strideX, dy, strideY )
     34       double precision :: dx(*), dy(*)
     35       integer :: strideX, strideY, N
     36     end function ddot
     37   end interface
     38   ! ..
     39   ! Scalar arguments:
     40   integer :: strideX, strideY, N
     41   double precision :: dot
     42   ! ..
     43   ! Array arguments:
     44   double precision :: dx(*), dy(*)
     45   ! ..
     46   ! Compute the dot product:
     47   dot = ddot( N, dx, strideX, dy, strideY )
     48   return
     49 end subroutine ddotsub