15 void pbchkvect( n, npos0, ix, jx, desc_X, incx, dpos0, iix, jjx, ixrow,
16 ixcol, nprow, npcol, myrow, mycol, info )
20 int dpos0, * iix, incx, * info, ix, * ixcol, * ixrow, * jjx,
21 jx, myrow, mycol, npcol, nprow, n, npos0;
117 int descpos, ExtraColBlock, ExtraRowBlock, icpos, ixpos,
118 jxpos, MyColBlock, MyColDist, MyRowBlock, MyRowDist,
119 NColBlock, np, npos, nq, NRowBlock;
150 *info =
MIN( *info, npos );
152 *info =
MIN( *info, ixpos );
154 *info =
MIN( *info, jxpos );
155 else if( desc_X[
MB_] < 1 )
156 *info =
MIN( *info, descpos +
MB_ );
157 else if( desc_X[
NB_] < 1 )
158 *info =
MIN( *info, descpos +
NB_ );
159 else if( ( desc_X[
RSRC_] < 0 ) || ( desc_X[
RSRC_] >= nprow ) )
160 *info =
MIN( *info, descpos +
RSRC_ );
161 else if( ( desc_X[
CSRC_] < 0 ) || ( desc_X[
CSRC_] >= npcol ) )
162 *info =
MIN( *info, descpos +
CSRC_ );
163 else if( incx != 1 && incx != desc_X[
M_] )
164 *info =
MIN( *info, icpos );
165 else if( desc_X[
LLD_] < 1 )
166 *info =
MIN( *info, descpos +
LLD_ );
174 *info =
MIN( *info, descpos +
M_ );
176 *info =
MIN( *info, descpos +
N_ );
184 *info =
MIN( *info, descpos +
M_ );
185 else if( desc_X[
N_] < 1 )
186 *info =
MIN( *info, descpos +
N_ );
187 else if( ( incx == desc_X[
M_] ) && ( jx+n-1 > desc_X[
N_] ) )
188 *info =
MIN( *info, jxpos );
189 else if( ( incx == 1 ) && ( incx != desc_X[
M_] ) &&
190 ( ix+n-1 > desc_X[
M_] ) )
191 *info =
MIN( *info, ixpos );
194 if( ix > desc_X[
M_] )
195 *info =
MIN( *info, ixpos );
196 else if( jx > desc_X[
N_] )
197 *info =
MIN( *info, jxpos );
207 MyRowDist = ( myrow + nprow - desc_X[
RSRC_] ) % nprow;
208 MyColDist = ( mycol + npcol - desc_X[
CSRC_] ) % npcol;
209 NRowBlock = desc_X[
M_] / desc_X[
MB_];
210 NColBlock = desc_X[
N_] / desc_X[
NB_];
211 np = ( NRowBlock / nprow ) * desc_X[
MB_];
212 nq = ( NColBlock / npcol ) * desc_X[
NB_];
213 ExtraRowBlock = NRowBlock % nprow;
214 ExtraColBlock = NColBlock % npcol;
218 MyRowBlock = ix / desc_X[
MB_];
219 MyColBlock = jx / desc_X[
NB_];
220 *ixrow = ( MyRowBlock + desc_X[
RSRC_] ) % nprow;
221 *ixcol = ( MyColBlock + desc_X[
CSRC_] ) % npcol;
223 *iix = ( MyRowBlock / nprow + 1 ) * desc_X[
MB_] + 1;
224 *jjx = ( MyColBlock / npcol + 1 ) * desc_X[
NB_] + 1;
226 if( MyRowDist >= ( MyRowBlock % nprow ) )
228 if( myrow == *ixrow )
229 *iix += ix % desc_X[
MB_];
232 if( MyRowDist < ExtraRowBlock )
234 else if( MyRowDist == ExtraRowBlock )
235 np += ( desc_X[
M_] % desc_X[
MB_] );
238 if( MyColDist >= ( MyColBlock % npcol ) )
240 if( mycol == *ixcol )
241 *jjx += jx % desc_X[
NB_];
244 if( MyColDist < ExtraColBlock )
246 else if( MyColDist == ExtraColBlock )
247 nq += ( desc_X[
N_] % desc_X[
NB_] );
250 *iix =
MIN( *iix, np );
251 *jjx =
MIN( *jjx, nq );
253 if( desc_X[
LLD_] < np )
255 if( numroc_(&desc_X[
N_], &desc_X[
NB_], &mycol, &desc_X[
CSRC_], &npcol) )
256 *info = -( descpos +
LLD_ );