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

◆ pb_lmul()

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

Definition at line 5153 of file pblastim.f.

5154*
5155* -- PBLAS test routine (version 2.0) --
5156* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
5157* and University of California, Berkeley.
5158* April 1, 1998
5159*
5160* .. Array Arguments ..
5161 INTEGER I( 2 ), J( 2 ), K( 2 )
5162* ..
5163*
5164* Purpose
5165* =======
5166*
5167* PB_LMUL multiplies without carry two long positive integers K and J
5168* and put the result into I. The long integers I, J, K are encoded on
5169* 31 bits using an array of 2 integers. The 16-lower bits are stored in
5170* the first entry of each array, the 15-higher bits in the second entry
5171* of each array. For efficiency purposes, the intrisic modulo function
5172* is inlined.
5173*
5174* Arguments
5175* =========
5176*
5177* K (local input) INTEGER array
5178* On entry, K is an array of dimension 2 containing the encoded
5179* long integer K.
5180*
5181* J (local input) INTEGER array
5182* On entry, J is an array of dimension 2 containing the encoded
5183* long integer J.
5184*
5185* I (local output) INTEGER array
5186* On entry, I is an array of dimension 2. On exit, this array
5187* contains the encoded long integer I.
5188*
5189* Further Details
5190* ===============
5191*
5192* K( 2 ) K( 1 )
5193* 0XXXXXXX XXXXXXXX K I( 1 ) = MOD( K( 1 ) + J( 1 ), 2**16 )
5194* * carry = ( K( 1 ) + J( 1 ) ) / 2**16
5195* J( 2 ) J( 1 )
5196* 0XXXXXXX XXXXXXXX J I( 2 ) = K( 2 ) + J( 2 ) + carry
5197* ---------------------- I( 2 ) = MOD( I( 2 ), 2**15 )
5198* I( 2 ) I( 1 )
5199* 0XXXXXXX XXXXXXXX I
5200*
5201* -- Written on April 1, 1998 by
5202* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
5203*
5204* =====================================================================
5205*
5206* .. Parameters ..
5207 INTEGER IPOW15, IPOW16, IPOW30
5208 parameter( ipow15 = 2**15, ipow16 = 2**16,
5209 $ ipow30 = 2**30 )
5210* ..
5211* .. Local Scalars ..
5212 INTEGER ITMP1, ITMP2
5213* ..
5214* .. Executable Statements ..
5215*
5216 itmp1 = k( 1 ) * j( 1 )
5217 IF( itmp1.LT.0 )
5218 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
5219*
5220* I( 1 ) = MOD( ITMP1, IPOW16 )
5221*
5222 itmp2 = itmp1 / ipow16
5223 i( 1 ) = itmp1 - itmp2 * ipow16
5224*
5225 itmp1 = k( 1 ) * j( 2 ) + k( 2 ) * j( 1 )
5226 IF( itmp1.LT.0 )
5227 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
5228*
5229 itmp1 = itmp2 + itmp1
5230 IF( itmp1.LT.0 )
5231 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
5232*
5233* I( 2 ) = MOD( ITMP1, IPOW15 )
5234*
5235 i( 2 ) = itmp1 - ( itmp1 / ipow15 ) * ipow15
5236*
5237 RETURN
5238*
5239* End of PB_LMUL
5240*