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

4559*
4560* -- PBLAS test routine (version 2.0) --
4561* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
4562* and University of California, Berkeley.
4563* April 1, 1998
4564*
4565* .. Array Arguments ..
4566 INTEGER I( 2 ), J( 2 ), K( 2 )
4567* ..
4568*
4569* Purpose
4570* =======
4571*
4572* PB_LMUL multiplies without carry two long positive integers K and J
4573* and put the result into I. The long integers I, J, K are encoded on
4574* 31 bits using an array of 2 integers. The 16-lower bits are stored in
4575* the first entry of each array, the 15-higher bits in the second entry
4576* of each array. For efficiency purposes, the intrisic modulo function
4577* is inlined.
4578*
4579* Arguments
4580* =========
4581*
4582* K (local input) INTEGER array
4583* On entry, K is an array of dimension 2 containing the encoded
4584* long integer K.
4585*
4586* J (local input) INTEGER array
4587* On entry, J is an array of dimension 2 containing the encoded
4588* long integer J.
4589*
4590* I (local output) INTEGER array
4591* On entry, I is an array of dimension 2. On exit, this array
4592* contains the encoded long integer I.
4593*
4594* Further Details
4595* ===============
4596*
4597* K( 2 ) K( 1 )
4598* 0XXXXXXX XXXXXXXX K I( 1 ) = MOD( K( 1 ) + J( 1 ), 2**16 )
4599* * carry = ( K( 1 ) + J( 1 ) ) / 2**16
4600* J( 2 ) J( 1 )
4601* 0XXXXXXX XXXXXXXX J I( 2 ) = K( 2 ) + J( 2 ) + carry
4602* ---------------------- I( 2 ) = MOD( I( 2 ), 2**15 )
4603* I( 2 ) I( 1 )
4604* 0XXXXXXX XXXXXXXX I
4605*
4606* -- Written on April 1, 1998 by
4607* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
4608*
4609* =====================================================================
4610*
4611* .. Parameters ..
4612 INTEGER IPOW15, IPOW16, IPOW30
4613 parameter( ipow15 = 2**15, ipow16 = 2**16,
4614 $ ipow30 = 2**30 )
4615* ..
4616* .. Local Scalars ..
4617 INTEGER ITMP1, ITMP2
4618* ..
4619* .. Executable Statements ..
4620*
4621 itmp1 = k( 1 ) * j( 1 )
4622 IF( itmp1.LT.0 )
4623 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
4624*
4625* I( 1 ) = MOD( ITMP1, IPOW16 )
4626*
4627 itmp2 = itmp1 / ipow16
4628 i( 1 ) = itmp1 - itmp2 * ipow16
4629*
4630 itmp1 = k( 1 ) * j( 2 ) + k( 2 ) * j( 1 )
4631 IF( itmp1.LT.0 )
4632 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
4633*
4634 itmp1 = itmp2 + itmp1
4635 IF( itmp1.LT.0 )
4636 $ itmp1 = ( itmp1 + ipow30 ) + ipow30
4637*
4638* I( 2 ) = MOD( ITMP1, IPOW15 )
4639*
4640 i( 2 ) = itmp1 - ( itmp1 / ipow15 ) * ipow15
4641*
4642 RETURN
4643*
4644* End of PB_LMUL
4645*
Here is the caller graph for this function: