Commit 4fcfcda2 by Francois Gygi

Fixed init_size() for the case of m=0 or n=0


git-svn-id: http://qboxcode.org/svn/qb/trunk@219 cba15fb0-1239-40c8-b417-11db7ca47a34
parent d404b5cf
......@@ -3,7 +3,7 @@
// Matrix.C
//
////////////////////////////////////////////////////////////////////////////////
// $Id: Matrix.C,v 1.11 2004-04-17 01:17:05 fgygi Exp $
// $Id: Matrix.C,v 1.12 2004-05-06 20:40:31 fgygi Exp $
#include <cassert>
#include <iostream>
......@@ -348,6 +348,8 @@ void DoubleMatrix::init_size(int m, int n, int mb, int nb)
mb_ = m;
nb_ = n;
#endif
if ( mb_ == 0 ) mb_ = 1;
if ( nb_ == 0 ) nb_ = 1;
ictxt_ = ctxt_.ictxt();
nprow_ = ctxt_.nprow();
npcol_ = ctxt_.npcol();
......@@ -355,6 +357,8 @@ void DoubleMatrix::init_size(int m, int n, int mb, int nb)
mycol_ = ctxt_.mycol();
active_ = myrow_ >= 0;
int isrcproc=0;
mloc_ = 0;
nloc_ = 0;
if ( m_ != 0 )
mloc_ = numroc(&m_,&mb_,&myrow_,&isrcproc,&nprow_);
if ( n_ != 0 )
......@@ -378,9 +382,6 @@ void DoubleMatrix::init_size(int m, int n, int mb, int nb)
n_incomplete_ = nloc_ % nb_ != 0;
}
m_incomplete_ = mloc_ % mb_ != 0;
n_incomplete_ = nloc_ % nb_ != 0;
if ( active_ )
{
desc_[0] = 1;
......@@ -416,6 +417,8 @@ void ComplexMatrix::init_size(int m, int n, int mb, int nb)
mb_ = m;
nb_ = n;
#endif
if ( mb_ == 0 ) mb_ = 1;
if ( nb_ == 0 ) nb_ = 1;
ictxt_ = ctxt_.ictxt();
nprow_ = ctxt_.nprow();
npcol_ = ctxt_.npcol();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment