SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pb_ladd()

subroutine pb_ladd ( integer, dimension( 2 )  j,
integer, dimension( 2 )  k,
integer, dimension( 2 )  i 
)

Definition at line 5074 of file pblastim.f.

5075*
5076* -- PBLAS test routine (version 2.0) --
5077* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5078* and University of California, Berkeley.
5079* April 1, 1998
5080*
5081* .. Array Arguments ..
5082 INTEGER I( 2 ), J( 2 ), K( 2 )
5083* ..
5084*
5085* Purpose
5086* =======
5087*
5088* PB_LADD adds without carry two long positive integers K and J and put
5089* the result into I. The long integers I, J, K are encoded on 31 bits
5090* using an array of 2 integers. The 16-lower bits are stored in the
5091* first entry of each array, the 15-higher bits in the second entry.
5092* For efficiency purposes, the intrisic modulo function is inlined.
5093*
5094* Arguments
5095* =========
5096*
5097* J (local input) INTEGER array
5098* On entry, J is an array of dimension 2 containing the encoded
5099* long integer J.
5100*
5101* K (local input) INTEGER array
5102* On entry, K is an array of dimension 2 containing the encoded
5103* long integer K.
5104*
5105* I (local output) INTEGER array
5106* On entry, I is an array of dimension 2. On exit, this array
5107* contains the encoded long integer I.
5108*
5109* Further Details
5110* ===============
5111*
5112* K( 2 ) K( 1 )
5113* 0XXXXXXX XXXXXXXX K I( 1 ) = MOD( K( 1 ) + J( 1 ), 2**16 )
5114* + carry = ( K( 1 ) + J( 1 ) ) / 2**16
5115* J( 2 ) J( 1 )
5116* 0XXXXXXX XXXXXXXX J I( 2 ) = K( 2 ) + J( 2 ) + carry
5117* ---------------------- I( 2 ) = MOD( I( 2 ), 2**15 )
5118* I( 2 ) I( 1 )
5119* 0XXXXXXX XXXXXXXX I
5120*
5121* -- Written on April 1, 1998 by
5122* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
5123*
5124* =====================================================================
5125*
5126* .. Parameters ..
5127 INTEGER IPOW15, IPOW16
5128 parameter( ipow15 = 2**15, ipow16 = 2**16 )
5129* ..
5130* .. Local Scalars ..
5131 INTEGER ITMP1, ITMP2
5132* ..
5133* .. Executable Statements ..
5134*
5135* I( 1 ) = MOD( K( 1 ) + J( 1 ), IPOW16 )
5136*
5137 itmp1 = k( 1 ) + j( 1 )
5138 itmp2 = itmp1 / ipow16
5139 i( 1 ) = itmp1 - itmp2 * ipow16
5140*
5141* I( 2 ) = MOD( ( K( 1 ) + J( 1 ) ) / IPOW16 + K( 2 ) + J( 2 ),
5142* IPOW15 )
5143*
5144 itmp1 = itmp2 + k( 2 ) + j( 2 )
5145 itmp2 = itmp1 / ipow15
5146 i( 2 ) = itmp1 - itmp2 * ipow15
5147*
5148 RETURN
5149*
5150* End of PB_LADD
5151*