aboutsummaryrefslogtreecommitdiffstats
path: root/methods
diff options
context:
space:
mode:
authorastrojhgu <astrojhgu@gmail.com>2013-01-30 23:00:33 +0800
committerastrojhgu <astrojhgu@gmail.com>2013-01-30 23:00:33 +0800
commit844950c94bfa87132bef00a698c1ba485602a131 (patch)
treef722c7dcc31da70edca5b6d71c0ccf6bea3d2db9 /methods
parentf181503af2c41daa1126062cd44cb4133e0c5d79 (diff)
downloadopt-utilities-844950c94bfa87132bef00a698c1ba485602a131.tar.bz2
0=>NULL_PTR
modified: methods/linmin/linmin.hpp modified: methods/powell/powell_method.hpp
Diffstat (limited to 'methods')
-rw-r--r--methods/linmin/linmin.hpp2
-rw-r--r--methods/powell/powell_method.hpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/methods/linmin/linmin.hpp b/methods/linmin/linmin.hpp
index ecfd0d6..fe5e58c 100644
--- a/methods/linmin/linmin.hpp
+++ b/methods/linmin/linmin.hpp
@@ -24,7 +24,7 @@ namespace opt_utilities
const func_obj<rT,pT>* pfoo;
func_adaptor(){}
func_adaptor(const func_adaptor&)
- :func_obj<rT,rT>(),p1(),xi1(),pfoo(0)
+ :func_obj<rT,rT>(),p1(),xi1(),pfoo(NULL_PTR)
{}
public:
diff --git a/methods/powell/powell_method.hpp b/methods/powell/powell_method.hpp
index 7646e1d..381ffe1 100644
--- a/methods/powell/powell_method.hpp
+++ b/methods/powell/powell_method.hpp
@@ -54,7 +54,7 @@ namespace opt_utilities
private:
rT func(const pT& x)
{
- assert(p_fo!=0);
+ assert(p_fo!=NULL_PTR);
return p_fo->eval(x);
}
@@ -62,11 +62,11 @@ namespace opt_utilities
private:
void clear_xi()
{
- if(xi_1d!=0)
+ if(xi_1d!=NULL_PTR)
{
delete[] xi_1d;
}
- if(xi!=0)
+ if(xi!=NULL_PTR)
{
delete[] xi;
}
@@ -174,7 +174,7 @@ namespace opt_utilities
public:
powell_method()
- :threshold(1e-4),xi(0),xi_1d(0)
+ :threshold(1e-4),xi(NULL_PTR),xi_1d(NULL_PTR)
{}
virtual ~powell_method()
@@ -187,7 +187,7 @@ namespace opt_utilities
start_point(rhs.start_point),
end_point(rhs.end_point),
ncom(rhs.ncom),
- threshold(rhs.threshold),xi(0),xi_1d(0)
+ threshold(rhs.threshold),xi(NULL_PTR),xi_1d(NULL_PTR)
{
}