Commit b813b111 authored by David Bommes's avatar David Bommes

renamed MatrixType

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@63 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent f1726817
......@@ -120,7 +120,7 @@ public:
int n = _np->n_unknowns();
std::vector<double> x(n);
NProblemGmmInterface::SMatrixNS H(n,n);
NProblemGmmInterface::SMatrixNP H(n,n);
for(int i=0; i<conf_.n_iters; ++i)
{
......
......@@ -91,10 +91,10 @@ public:
this->transform_gradient( P(vtemp_), _g);
}
virtual void eval_hessian ( const double* _x, SMatrixNS& _H)
virtual void eval_hessian ( const double* _x, SMatrixNP& _H)
{
update_x(_x);
SMatrixNS H;
SMatrixNP H;
base_->eval_hessian(P(x_), H);
this->transform_hessian(H,_H);
}
......@@ -204,7 +204,7 @@ public:
this->add_penalty_gradient((double*)_x, _g);
}
virtual void eval_hessian ( const double* _x, SMatrixNS& _H)
virtual void eval_hessian ( const double* _x, SMatrixNP& _H)
{
base_->eval_hessian(_x, _H);
this->add_penalty_hessian(_H);
......
......@@ -71,7 +71,7 @@ public:
timing_eval_gradient_ += sw_.stop();
}
virtual void eval_hessian ( const double* _x, SMatrixNS& _H)
virtual void eval_hessian ( const double* _x, SMatrixNP& _H)
{
++n_eval_hessian_;
sw_.start();
......
......@@ -34,7 +34,7 @@ class NProblemGmmInterface
public:
// ToDo: appropriate MatrixType ???
typedef gmm::row_matrix< gmm::wsvector<double> > SMatrixNS;
typedef gmm::row_matrix< gmm::wsvector<double> > SMatrixNP;
/// Default constructor
NProblemGmmInterface() {}
......@@ -46,7 +46,7 @@ public:
virtual void initial_x ( double* _x ) = 0;
virtual double eval_f ( const double* _x ) = 0;
virtual void eval_gradient( const double* _x, double* _g) = 0;
virtual void eval_hessian ( const double* _x, SMatrixNS& _H) = 0;
virtual void eval_hessian ( const double* _x, SMatrixNP& _H) = 0;
virtual void store_result ( const double* _x ) = 0;
};
......
......@@ -25,7 +25,7 @@ solve(NProblemGmmInterface* _problem)
int n = _problem->n_unknowns();
// hesse matrix
NProblemGmmInterface::SMatrixNS H;
NProblemGmmInterface::SMatrixNP H;
// gradient
std::vector<double> x(n), x_new(n), dx(n), g(n);
......
......@@ -203,12 +203,12 @@ hessian(TAO_APPLICATION _app, Vec _x, Mat* _H, Mat* _H_pre, MatStructure* _H_str
info = MatZeroEntries(*_H); CHKERRQ(info);
// iterate over non-zero elements
NProblemGmmInterface::SMatrixNS H;
NProblemGmmInterface::SMatrixNP H;
base->eval_hessian( x, H);
for (unsigned int i = 0; i < gmm::mat_nrows(H); ++i)
{
typedef gmm::linalg_traits<NProblemGmmInterface::SMatrixNS>::const_sub_row_type
typedef gmm::linalg_traits<NProblemGmmInterface::SMatrixNP>::const_sub_row_type
CRow;
CRow row = gmm::mat_const_row(H, i);
......
......@@ -63,7 +63,7 @@ public:
_g[0] = 2.0*(_x[0]-2.4);
}
virtual void eval_hessian( const double* _x, SMatrixNS& _H)
virtual void eval_hessian( const double* _x, SMatrixNP& _H)
{
gmm::resize(_H,1,1);
_H(0,0) = 2.0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment