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

◆ PB_Cfirstnb()

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

Definition at line 22 of file PB_Cfirstnb.c.

28{
29/*
30* Purpose
31* =======
32*
33* PB_Cfirstnb returns the global number of matrix rows or columns of the
34* first block, if N rows or columns are given out starting from the
35* global 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 inbt;
65/* ..
66* .. Executable Statements ..
67*
68*/
69 inbt = ( ( INB -= I ) <= 0 ? ( (-INB) / NB + 1 ) * NB + INB : INB );
70 return( MIN( inbt, N ) );
71/*
72* End of PB_Cfirstnb
73*/
74}
#define Int
Definition Bconfig.h:22
#define MIN(a_, b_)
Definition PBtools.h:76