• R/O
  • SSH
  • HTTPS

particle-filter: 提交


Commit MetaInfo

修订版8 (tree)
时间2010-04-19 14:00:21
作者(del#42041)

Log Message

fixed runtime exceptions

更改概述

差异

--- test/Makefile.in (revision 7)
+++ test/Makefile.in (revision 8)
@@ -3,7 +3,7 @@
33 SRCS=test_particle.cc test_particles.cc test_filter.cc
44 OBJS=$(SRCS:.cc=.o)
55 TARGETS=$(SRCS:.cc=)
6-CFLAGS=-I/usr/local/include/cutter -I. -I../src -g
6+CFLAGS=-I/usr/local/include/cutter -I. -I../src -g -Wall
77 LDFLAGS=@LDFLAGS@ -L. -L../src -lparticle -lcppcutter
88 all: $(TARGETS)
99
--- test/test_filter.cc (revision 7)
+++ test/test_filter.cc (revision 8)
@@ -4,7 +4,7 @@
44 #include <filter.h>
55 using namespace std;
66
7-static Particles func(Particles &p)
7+Particles func(Particles &p)
88 {
99 // Particles a(5,3);
1010 // Particles a;
@@ -30,7 +30,7 @@
3030 a.createInitialParticles();
3131 a.dump_predict_particles();
3232 a.set_state_func(&func);
33- Particles b;
33+ Particles b(5,3);
3434 a.get_next_state(b);
3535 }
3636 }
--- src/Makefile.in (revision 7)
+++ src/Makefile.in (revision 8)
@@ -5,7 +5,7 @@
55 HEADS=$(SRCS:.cc=.h)
66 TARGETS=libparticle.so
77 AR=@AR@
8-CFLAGS=-I. -g
8+CFLAGS=-I. -g -Wall
99 all: $(TARGETS)
1010
1111 libparticle.so: $(OBJS)
--- src/filter.cc (revision 7)
+++ src/filter.cc (revision 8)
@@ -9,16 +9,18 @@
99 }
1010 Filter::~Filter()
1111 {
12-// if(x) delete x;
12+ if(x) delete x;
1313 }
1414
1515 bool Filter::setNumber(int n)
1616 {
1717 number = n;
18+ return(true);
1819 }
1920 bool Filter::setDimension(int d)
2021 {
2122 dimension = d;
23+ return(true);
2224 }
2325 bool Filter::createInitialParticles()
2426 {
@@ -36,9 +38,10 @@
3638 state_func = func;
3739 return(true);
3840 }
39-Particles Filter::get_next_state(Particles &p)
41+Filter & Filter::get_next_state(Particles &p)
4042 {
4143 cout<<"go..."<<endl;
4244 (*state_func)(p);
4345 cout<<"ok..."<<endl;
46+ return(*this);
4447 }
--- src/filter.h (revision 7)
+++ src/filter.h (revision 8)
@@ -20,7 +20,7 @@
2020 bool createInitialParticles();
2121 int dump_predict_particles();
2222 bool set_state_func(Particles (*func)(Particles &p));
23- Particles get_next_state(Particles &p);
23+ Filter & get_next_state(Particles &p);
2424 };
2525
2626 #endif
--- src/Makefile (revision 7)
+++ src/Makefile (revision 8)
@@ -5,7 +5,7 @@
55 HEADS=$(SRCS:.cc=.h)
66 TARGETS=libparticle.so
77 AR=ar
8-CFLAGS=-I. -g
8+CFLAGS=-I. -g -Wall
99 all: $(TARGETS)
1010
1111 libparticle.so: $(OBJS)
Show on old repository browser