⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testmap.c

📁 spice中支持多层次元件模型仿真的可单独运行的插件源码
💻 C
字号:
/* $Header: /home/harrison/c/tcgmsg/ipcv4.0/RCS/testmap.c,v 1.1 91/12/06 17:27:49 harrison Exp Locker: harrison $ */#include <stdio.h>long ncols;long nrows;/* Given the col and row no. return the actual process no. */#define MAP(Row,Col) (ncols*(Row) + (Col))/* Given the node return the row no. */#define ROW(Node) ((Node) / ncols)/* Given the node return the column no. */#define COL(Node) ((Node) - ncols*((Node)/ncols))int main(argc, argv)     int argc;     char **argv;{  long row, col, node, data, type, len, me;  (void) printf("Input nrows, ncols ");  (void) scanf("%d %d",&nrows, &ncols);    node = 0;  type = 1;  len = 4;  for (me=0; me<(nrows*ncols); me++)    (void) printf(" me=%d row=%d col=%d map=%d\n",me,		  ROW(me),COL(me),MAP(ROW(me),COL(me)));  return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -