Skip to content

Commit

Permalink
Add CERES_ prefix to macros in public headers
Browse files Browse the repository at this point in the history
Change-Id: Ie4f4311d5a669c03746e8f00426f4d7cbef20ad0
  • Loading branch information
keir committed Mar 21, 2015
1 parent 649f5c2 commit 3fafa3c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
48 changes: 24 additions & 24 deletions include/ceres/numeric_diff_cost_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,25 +250,25 @@ class NumericDiffCostFunction
if (N8) parameters_reference_copy[8] = parameters_reference_copy[7] + N7;
if (N9) parameters_reference_copy[9] = parameters_reference_copy[8] + N8;

#define COPY_PARAMETER_BLOCK(block) \
#define CERES_COPY_PARAMETER_BLOCK(block) \
if (N ## block) memcpy(parameters_reference_copy[block], \
parameters[block], \
sizeof(double) * N ## block); // NOLINT

COPY_PARAMETER_BLOCK(0);
COPY_PARAMETER_BLOCK(1);
COPY_PARAMETER_BLOCK(2);
COPY_PARAMETER_BLOCK(3);
COPY_PARAMETER_BLOCK(4);
COPY_PARAMETER_BLOCK(5);
COPY_PARAMETER_BLOCK(6);
COPY_PARAMETER_BLOCK(7);
COPY_PARAMETER_BLOCK(8);
COPY_PARAMETER_BLOCK(9);
CERES_COPY_PARAMETER_BLOCK(0);
CERES_COPY_PARAMETER_BLOCK(1);
CERES_COPY_PARAMETER_BLOCK(2);
CERES_COPY_PARAMETER_BLOCK(3);
CERES_COPY_PARAMETER_BLOCK(4);
CERES_COPY_PARAMETER_BLOCK(5);
CERES_COPY_PARAMETER_BLOCK(6);
CERES_COPY_PARAMETER_BLOCK(7);
CERES_COPY_PARAMETER_BLOCK(8);
CERES_COPY_PARAMETER_BLOCK(9);

#undef COPY_PARAMETER_BLOCK
#undef CERES_COPY_PARAMETER_BLOCK

#define EVALUATE_JACOBIAN_FOR_BLOCK(block) \
#define CERES_EVALUATE_JACOBIAN_FOR_BLOCK(block) \
if (N ## block && jacobians[block] != NULL) { \
if (!NumericDiff<CostFunctor, \
method, \
Expand All @@ -288,18 +288,18 @@ class NumericDiffCostFunction
} \
}

EVALUATE_JACOBIAN_FOR_BLOCK(0);
EVALUATE_JACOBIAN_FOR_BLOCK(1);
EVALUATE_JACOBIAN_FOR_BLOCK(2);
EVALUATE_JACOBIAN_FOR_BLOCK(3);
EVALUATE_JACOBIAN_FOR_BLOCK(4);
EVALUATE_JACOBIAN_FOR_BLOCK(5);
EVALUATE_JACOBIAN_FOR_BLOCK(6);
EVALUATE_JACOBIAN_FOR_BLOCK(7);
EVALUATE_JACOBIAN_FOR_BLOCK(8);
EVALUATE_JACOBIAN_FOR_BLOCK(9);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(0);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(1);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(2);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(3);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(4);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(5);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(6);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(7);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(8);
CERES_EVALUATE_JACOBIAN_FOR_BLOCK(9);

#undef EVALUATE_JACOBIAN_FOR_BLOCK
#undef CERES_EVALUATE_JACOBIAN_FOR_BLOCK

return true;
}
Expand Down
24 changes: 12 additions & 12 deletions include/ceres/sized_cost_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@ class SizedCostFunction : public CostFunction {

set_num_residuals(kNumResiduals);

#define ADD_PARAMETER_BLOCK(N) \
#define CERES_ADD_PARAMETER_BLOCK(N) \
if (N) mutable_parameter_block_sizes()->push_back(N);
ADD_PARAMETER_BLOCK(N0);
ADD_PARAMETER_BLOCK(N1);
ADD_PARAMETER_BLOCK(N2);
ADD_PARAMETER_BLOCK(N3);
ADD_PARAMETER_BLOCK(N4);
ADD_PARAMETER_BLOCK(N5);
ADD_PARAMETER_BLOCK(N6);
ADD_PARAMETER_BLOCK(N7);
ADD_PARAMETER_BLOCK(N8);
ADD_PARAMETER_BLOCK(N9);
#undef ADD_PARAMETER_BLOCK
CERES_ADD_PARAMETER_BLOCK(N0);
CERES_ADD_PARAMETER_BLOCK(N1);
CERES_ADD_PARAMETER_BLOCK(N2);
CERES_ADD_PARAMETER_BLOCK(N3);
CERES_ADD_PARAMETER_BLOCK(N4);
CERES_ADD_PARAMETER_BLOCK(N5);
CERES_ADD_PARAMETER_BLOCK(N6);
CERES_ADD_PARAMETER_BLOCK(N7);
CERES_ADD_PARAMETER_BLOCK(N8);
CERES_ADD_PARAMETER_BLOCK(N9);
#undef CERES_ADD_PARAMETER_BLOCK
}

virtual ~SizedCostFunction() { }
Expand Down

0 comments on commit 3fafa3c

Please sign in to comment.