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

◆ PB_Clastnb()

Int PB_Clastnb ( Int  N,
Int  I,
Int  INB,
Int  NB 
)

Definition at line 22 of file PB_Clastnb.c.

28{
29/*
30* Purpose
31* =======
32*
33* PB_Clastnb returns the global number of matrix rows or columns of the
34* last block, if N rows or columns are given out starting from the glo-
35* bal index I. Note that if N is equal 0, this routine returns 0.
36*
37* Arguments
38* =========
39*
40* N (global input) INTEGER
41* On entry, N specifies the number of rows/columns being dealt
42* out. N must be at least zero.
43*
44* I (global input) INTEGER
45* On entry, I specifies the global index of the matrix entry.
46* I must be at least zero.
47*
48* INB (global input) INTEGER
49* On entry, INB specifies the size of the first block of the
50* global matrix distribution. INB must be at least one.
51*
52* NB (global input) INTEGER
53* On entry, NB specifies the size of the blocks used to parti-
54* tion the matrix. NB must be at least one.
55*
56* -- Written on April 1, 1998 by
57* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
58*
59* ---------------------------------------------------------------------
60*/
61/*
62* .. Local Scalars ..
63*/
64 Int lnbt;
65/* ..
66* .. Executable Statements ..
67*
68*/
69 if( ( lnbt = I + N - INB ) > 0 )
70 {
71 lnbt = lnbt - NB * ( ( NB + lnbt - 1 ) / NB - 1 );
72 return( MIN( lnbt, N ) );
73 }
74 else
75 {
76 return( N );
77 }
78/*
79* End of PB_Clastnb
80*/
81}
#define Int
Definition Bconfig.h:22
#define MIN(a_, b_)
Definition PBtools.h:76