From: ametama Date: Wed, 17 Dec 2025 23:15:28 +0000 (+0100) Subject: doc(params): parameter annotation X-Git-Url: https://git.wafflesoft.org/?a=commitdiff_plain;h=6a6070c6fe9eab2acce00f70c09e1974d7f15687;p=cgo.git doc(params): parameter annotation --- diff --git a/include/swarm.h b/include/swarm.h index 25cbe0b..169bc0e 100644 --- a/include/swarm.h +++ b/include/swarm.h @@ -12,12 +12,12 @@ typedef struct { typedef struct { int dim; - double (*f)(double*); int particlec; - double eps; - double w; - double c; - double s; + double (*f)(double*); // fitness function + double eps; // convergence tolerance + double w; // inertia + double c; // cognitive factor + double s; // social factor } swarm_parameters; typedef struct { diff --git a/src/main.c b/src/main.c index 3ba6629..62965ae 100644 --- a/src/main.c +++ b/src/main.c @@ -25,8 +25,8 @@ double f(double *x) { int main(int argc, char *argv[]) { swarm sw = { 2, - f, 100, + f, pow(2, 40), 0.8, 2.05,