Commit 93f66040 by Francois Gygi

added iglobal and jglobal functions


git-svn-id: http://qboxcode.org/svn/qb/trunk@508 cba15fb0-1239-40c8-b417-11db7ca47a34
parent b3b25b6a
......@@ -3,7 +3,7 @@
// Matrix.h
//
////////////////////////////////////////////////////////////////////////////////
// $Id: Matrix.h,v 1.12 2007-03-17 01:14:00 fgygi Exp $
// $Id: Matrix.h,v 1.13 2007-09-30 04:46:35 fgygi Exp $
#ifndef MATRIX_H
#define MATRIX_H
......@@ -93,6 +93,11 @@ class DoubleMatrix
// (i,j) is the global index of element (x,y) of block (l,m)
int i(int l, int x) const { return (l * nprow_ + myrow_) * mb_ + x; }
int j(int m, int y) const { return (m * npcol_ + mycol_) * nb_ + y; }
int iglobal(int ilocal) const
{ return mb_*(nprow_*(ilocal/mb_)+myrow_)+ilocal%mb_; }
int jglobal(int jlocal) const
{ return nb_*(npcol_*(jlocal/nb_)+mycol_)+jlocal%nb_; }
// store element a(ii,jj) (where ii,jj are global indices)
// in array val:
......
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