Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Actualization to Ceres-solver changes. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions cyres/src/ceres.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ from libcpp.vector cimport vector
from libcpp.string cimport string
from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t

cdef extern from "types.h" namespace "ceres":
ctypedef short int16
cdef extern from "ceres/types.h" namespace "ceres":
ctypedef int int32
ctypedef enum Ownership:
DO_NOT_TAKE_OWNERSHIP
Expand Down Expand Up @@ -278,12 +277,12 @@ cdef extern from "types.h" namespace "ceres":
FORWARD


cdef extern from "ordered_groups.h" namespace "ceres":
cdef extern from "ceres/ordered_groups.h" namespace "ceres":
cdef cppclass OrderedGroups[T]:
pass
ctypedef OrderedGroups[double*] ParameterBlockOrdering

cdef extern from "iteration_callback.h" namespace "ceres":
cdef extern from "ceres/iteration_callback.h" namespace "ceres":
cdef struct IterationSummary:
IterationSummary()

Expand Down Expand Up @@ -370,7 +369,7 @@ cdef extern from "iteration_callback.h" namespace "ceres":
cdef cppclass IterationCallback:
CallbackReturnType operator()(const IterationSummary& summary)

cdef extern from "crs_matrix.h" namespace "ceres":
cdef extern from "ceres/crs_matrix.h" namespace "ceres":
ctypedef struct CRSMatrix:
CRSMatrix()

Expand All @@ -381,7 +380,7 @@ cdef extern from "crs_matrix.h" namespace "ceres":
vector[int] rows
vector[double] values

cdef extern from "local_parameterization.h" namespace "ceres":
cdef extern from "ceres/local_parameterization.h" namespace "ceres":
cdef cppclass LocalParameterization:
bool Plus(const double* x,
const double* delta,
Expand All @@ -392,7 +391,7 @@ cdef extern from "local_parameterization.h" namespace "ceres":

LocalSize() const

cdef extern from "problem.h" namespace "ceres::internal":
cdef extern from "ceres/problem.h" namespace "ceres::internal":

cdef cppclass Preprocessor:
pass
Expand All @@ -403,7 +402,7 @@ cdef extern from "problem.h" namespace "ceres::internal":
cdef cppclass ResidualBlock:
pass

cdef extern from "loss_function.h" namespace "ceres":
cdef extern from "ceres/loss_function.h" namespace "ceres":

cdef cppclass LossFunction:
void Evaluate(double sq_norm, double out[3]) const
Expand Down Expand Up @@ -431,17 +430,17 @@ cdef extern from "loss_function.h" namespace "ceres":
ScaledLoss(const LossFunction* rho, double a, Ownership ownership)


cdef extern from "cost_function.h" namespace "ceres":
cdef extern from "ceres/cost_function.h" namespace "ceres":
cdef cppclass CostFunction:
bool Evaluate(double** parameters,
double* residuals,
double** jacobians) const

const vector[int16]& parameter_block_sizes() const
const vector[int32]& parameter_block_sizes() const

int num_residuals() const

cdef extern from "solver.h" namespace "ceres::Solver":
cdef extern from "ceres/solver.h" namespace "ceres::Solver":
cdef cppclass SolverOptions "ceres::Solver::Options":
MinimizerType minimizer_type

Expand Down Expand Up @@ -956,13 +955,13 @@ cdef extern from "solver.h" namespace "ceres::Solver":
vector[int] inner_iteration_ordering_given
vector[int] inner_iteration_ordering_used

cdef extern from "solver.h" namespace "ceres":
cdef extern from "ceres/solver.h" namespace "ceres":

void Solve(const SolverOptions& options,
Problem* problem,
Summary* summary)

cdef extern from "problem.h" namespace "ceres::Problem":
cdef extern from "ceres/problem.h" namespace "ceres::Problem":

ctypedef ResidualBlock* ResidualBlockId

Expand All @@ -982,7 +981,7 @@ cdef extern from "problem.h" namespace "ceres::Problem":
bool apply_loss_function
int num_threads

cdef extern from "problem.h" namespace "ceres":
cdef extern from "ceres/problem.h" namespace "ceres":

ctypedef ResidualBlock* ResidualBlockId

Expand Down
2 changes: 1 addition & 1 deletion cyres/src/cyres.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cdef class CostFunction:

cpdef parameter_block_sizes(self):
block_sizes = []
cdef vector[ceres.int16] _parameter_block_sizes = self._cost_function.parameter_block_sizes()
cdef vector[ceres.int32] _parameter_block_sizes = self._cost_function.parameter_block_sizes()
for i in range(_parameter_block_sizes.size()):
block_sizes.append(_parameter_block_sizes[i])
return block_sizes
Expand Down