mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
Add ParameterBlock::ToString() to aid debugging.
Change-Id: Id3f5cb27b855c536dd65a986f345bd8eb2799dfa
This commit is contained in:
@@ -32,13 +32,15 @@
|
||||
#define CERES_INTERNAL_PARAMETER_BLOCK_H_
|
||||
|
||||
#include <cstdlib>
|
||||
#include <glog/logging.h>
|
||||
#include <string>
|
||||
#include "ceres/array_utils.h"
|
||||
#include "ceres/integral_types.h"
|
||||
#include "ceres/internal/eigen.h"
|
||||
#include "ceres/internal/port.h"
|
||||
#include "ceres/internal/scoped_ptr.h"
|
||||
#include "ceres/local_parameterization.h"
|
||||
#include "ceres/stringprintf.h"
|
||||
#include "glog/logging.h"
|
||||
|
||||
namespace ceres {
|
||||
namespace internal {
|
||||
@@ -172,6 +174,19 @@ class ParameterBlock {
|
||||
return local_parameterization_->Plus(x, delta, x_plus_delta);
|
||||
}
|
||||
|
||||
string ToString() const {
|
||||
return StringPrintf("{ user_state=%p, state=%p, size=%d, "
|
||||
"constant=%d, index=%d, state_offset=%d, "
|
||||
"delta_offset=%d }",
|
||||
user_state_,
|
||||
state_,
|
||||
size_,
|
||||
is_constant_,
|
||||
index_,
|
||||
state_offset_,
|
||||
delta_offset_);
|
||||
}
|
||||
|
||||
private:
|
||||
void Init(double* user_state,
|
||||
int size,
|
||||
|
||||
Reference in New Issue
Block a user