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 4479 of file pblastst.f.

4480*
4481* -- PBLAS test routine (version 2.0) --
4482* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
4483* and University of California, Berkeley.
4484* April 1, 1998
4485*
4486* .. Array Arguments ..
4487 INTEGER I( 2 ), J( 2 ), K( 2 )
4488* ..
4489*
4490* Purpose
4491* =======
4492*
4493* PB_LADD adds without carry two long positive integers K and J and put
4494* the result into I. The long integers I, J, K are encoded on 31 bits
4495* using an array of 2 integers. The 16-lower bits are stored in the
4496* first entry of each array, the 15-higher bits in the second entry.
4497* For efficiency purposes, the intrisic modulo function is inlined.
4498*
4499* Arguments
4500* =========
4501*
4502* J (local input) INTEGER array
4503* On entry, J is an array of dimension 2 containing the encoded
4504* long integer J.
4505*
4506* K (local input) INTEGER array
4507* On entry, K is an array of dimension 2 containing the encoded
4508* long integer K.
4509*
4510* I (local output) INTEGER array
4511* On entry, I is an array of dimension 2. On exit, this array
4512* contains the encoded long integer I.
4513*
4514* Further Details
4515* ===============
4516*
4517* K( 2 ) K( 1 )
4518* 0XXXXXXX XXXXXXXX K I( 1 ) = MOD( K( 1 ) + J( 1 ), 2**16 )
4519* + carry = ( K( 1 ) + J( 1 ) ) / 2**16
4520* J( 2 ) J( 1 )
4521* 0XXXXXXX XXXXXXXX J I( 2 ) = K( 2 ) + J( 2 ) + carry
4522* ---------------------- I( 2 ) = MOD( I( 2 ), 2**15 )
4523* I( 2 ) I( 1 )
4524* 0XXXXXXX XXXXXXXX I
4525*
4526* -- Written on April 1, 1998 by
4527* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
4528*
4529* =====================================================================
4530*
4531* .. Parameters ..
4532 INTEGER IPOW15, IPOW16
4533 parameter( ipow15 = 2**15, ipow16 = 2**16 )
4534* ..
4535* .. Local Scalars ..
4536 INTEGER ITMP1, ITMP2
4537* ..
4538* .. Executable Statements ..
4539*
4540* I( 1 ) = MOD( K( 1 ) + J( 1 ), IPOW16 )
4541*
4542 itmp1 = k( 1 ) + j( 1 )
4543 itmp2 = itmp1 / ipow16
4544 i( 1 ) = itmp1 - itmp2 * ipow16
4545*
4546* I( 2 ) = MOD( ( K( 1 ) + J( 1 ) ) / IPOW16 + K( 2 ) + J( 2 ),
4547* IPOW15 )
4548*
4549 itmp1 = itmp2 + k( 2 ) + j( 2 )
4550 itmp2 = itmp1 / ipow15
4551 i( 2 ) = itmp1 - itmp2 * ipow15
4552*
4553 RETURN
4554*
4555* End of PB_LADD
4556*
Here is the caller graph for this function: