由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - A tough pointer concept
相关主题
哪位帮忙看一个极为简单的 MPI 程序,感谢拉!把一个function pointer作为参数传入一个function的语法是什么?
pointer to override function?请教一个const pointer的问题
another tougth pointer example请教一个pointer的问题
How to run Message Passing Interface C file?Why do I need to use "plain" pointer?
一道面试题一个简单的小问题
Question about data member offset请问可以这样定义struct吗?
aws EMR能设置一个mapper吗? how to do it ?=======Problem – coding in c++
关于malloc/free和循环is smart_ptr really that good?
相关话题的讨论汇总
话题: nca话题: pointer话题: mpi话题: double话题: matrix
进入Programming版参与讨论
1 (共1页)
E******T
发帖数: 59
1
Here is part of MPI code, a is a matrix with column NCA, offset is the start
point of row number of matrix a. The confusing part is ((double (*)[NCA])a)
, does it denote NCA number of pointer in matrix a?
any comments? Thanks
MPI_Send(&((double (*)[NCA])a)[offset][0], rows*NCA, MPI_DOUBLE, dest
, mtype,
MPI_COMM_WORLD);
h**i
发帖数: 712
2
a is a pointer point to an array with NCA elements which are double type.

start
a)
dest

【在 E******T 的大作中提到】
: Here is part of MPI code, a is a matrix with column NCA, offset is the start
: point of row number of matrix a. The confusing part is ((double (*)[NCA])a)
: , does it denote NCA number of pointer in matrix a?
: any comments? Thanks
: MPI_Send(&((double (*)[NCA])a)[offset][0], rows*NCA, MPI_DOUBLE, dest
: , mtype,
: MPI_COMM_WORLD);

E******T
发帖数: 59
3

type.
((double (*)[NCA])a)
you are right and a is a pointer, such as definition: double *a;
the confusing part is how we define the array with NCA elements which a
pointer points to.
is this right like ([NCA])a
Thanks

【在 h**i 的大作中提到】
: a is a pointer point to an array with NCA elements which are double type.
:
: start
: a)
: dest

P********e
发帖数: 2610
4
that is wrong.
a is a two dimentional array pointer, point to NCA elements of pointer to
double type.
double* a[NCA];

【在 E******T 的大作中提到】
:
: type.
: ((double (*)[NCA])a)
: you are right and a is a pointer, such as definition: double *a;
: the confusing part is how we define the array with NCA elements which a
: pointer points to.
: is this right like ([NCA])a
: Thanks

1 (共1页)
进入Programming版参与讨论
相关主题
is smart_ptr really that good?一道面试题
[合集] pointer in CQuestion about data member offset
pointer overflowaws EMR能设置一个mapper吗?
about STL functor and function pointers关于malloc/free和循环
哪位帮忙看一个极为简单的 MPI 程序,感谢拉!把一个function pointer作为参数传入一个function的语法是什么?
pointer to override function?请教一个const pointer的问题
another tougth pointer example请教一个pointer的问题
How to run Message Passing Interface C file?Why do I need to use "plain" pointer?
相关话题的讨论汇总
话题: nca话题: pointer话题: mpi话题: double话题: matrix