Skip to content

Commit

Permalink
Minor corrections here and there
Browse files Browse the repository at this point in the history
  • Loading branch information
kkentzo committed Mar 13, 2013
1 parent ae51f3c commit 5a992b3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
Binary file removed demo
Binary file not shown.
21 changes: 21 additions & 0 deletions demo.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
/* An implementation of the Particle Swarm Optimization algorithm
=== DEMONSTRATION CODE ===
Copyright 2010 Kyriakos Kentzoglanakis
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License version
3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
<http://www.gnu.org/licenses/>.
*/


#include <math.h>
#include <string.h>
#include <gsl/gsl_rng.h>
Expand Down
6 changes: 4 additions & 2 deletions pso.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* An implementation of the Particle Swarm Optimization algorithm
Copyright 2010 Kyriakos Kentzoglanakis
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License version
Expand All @@ -18,7 +20,7 @@

#include <time.h> // for time()
#include <math.h> // for cos(), pow(), sqrt() etc.
#include <float.h> // for FLT_MAX
#include <float.h> // for DBL_MAX
#include <string.h> // for mem*

#include <gsl/gsl_rng.h>
Expand Down Expand Up @@ -295,7 +297,7 @@ void pso_solve(pso_obj_fun_t obj_fun, void *obj_fun_params,
}

// INITIALIZE SOLUTION
solution->error = FLT_MAX;
solution->error = DBL_MAX;

// SWARM INITIALIZATION
// for each particle
Expand Down
2 changes: 2 additions & 0 deletions pso.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* An implementation of the Particle Swarm Optimization algorithm
Copyright 2010 Kyriakos Kentzoglanakis
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License version
3 as published by the Free Software Foundation.
Expand Down

0 comments on commit 5a992b3

Please sign in to comment.