猿代码 — 科研/AI模型/高性能计算
0

Conjugate-Gradient-C-implementation-master,错误信息

摘要: 1)2)cg.c:void axpy(double *dest, double a, double *x, double *y, int n)cg.c: axpy(x, alpha, s, x, n); //xk+1 = xk + ak*pkcg.c: axpy(r, -alpha, z, r, n); //rk+1 = rk - ak*A*pkcg.c: axpy(s, -be ...
1)


2)

cg.c:void axpy(double *dest, double a, double *x, double *y, int n)
cg.c:        axpy(x, alpha, s, x, n);   //xk+1 = xk + ak*pk
cg.c:        axpy(r, -alpha, z, r, n);  //rk+1 = rk - ak*A*pk
cg.c:        axpy(s, -beta, s, z, n);   //pk+1 = zk+1+βk*pk
cg.h:void axpy(double *dest, double alpha, double *x, double *y, int n);



3)
solve_cg.c:62:13: error: too few arguments to function ‘precond_cg’
   62 |  int iter = precond_cg(matvec, psolve, Adata, Mdata,
      |             ^~~~~~~~~~
4)
./a.out
Segmentation fault

6)

      |            ^~~~~~~~~~~~~
/usr/include/time.h:251:12: error: storage class specified for parameter ‘timer_getoverrun’
  251 | extern int timer_getoverrun (timer_t __timerid) __THROW;
      |            ^~~~~~~~~~~~~~~~
/usr/include/time.h:257:12: error: storage class specified for parameter ‘timespec_get’
  257 | extern int timespec_get (struct timespec *__ts, int __base)
      |            ^~~~~~~~~~~~
solve_cg.c:12:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
   12 | {
      | ^
In file included from solve_cg.c:6:
cg.h:10:5: error: old-style parameter declarations in prototyped function definition
   10 | int precond_cg( double **Adata, double *Mdata, double *b,
      |     ^~~~~~~~~~
solve_cg.c:85: error: expected ‘{’ at end of input

7)

      |                                               ~~~~~~~~^~~~~
solve_cg.c:62:13: error: too few arguments to function ‘precond_cg’
   62 |  int iter = precond_cg(matvec, psolve, Adata, Mdata, b, cg_x, rtol, n, maxiter);
      |             ^~~~~~~~~~




说点什么...

已有0条评论

最新评论...

本文作者
2024-2-19 00:53
  • 0
    粉丝
  • 555
    阅读
  • 0
    回复
资讯幻灯片
热门评论
热门专题
排行榜
Copyright   ©2015-2023   猿代码-超算人才智造局 高性能计算|并行计算|人工智能      ( 京ICP备2021026424号-2 )