Cleanup block_structure.h/cc
1. Remove obsolete Proto conversion functions.
2. Fix a strict weak ordering bug.
Change-Id: I1ce6d4b06e29cf475df1d5bd37c79f66f20f8d93
diff --git a/internal/ceres/block_structure.cc b/internal/ceres/block_structure.cc
index 5a1a5e1..00c4ce2 100644
--- a/internal/ceres/block_structure.cc
+++ b/internal/ceres/block_structure.cc
@@ -34,6 +34,9 @@
namespace internal {
bool CellLessThan(const Cell& lhs, const Cell& rhs) {
+ if (lhs.block_id == rhs.block_id) {
+ return (lhs.position < rhs.position);
+ }
return (lhs.block_id < rhs.block_id);
}
diff --git a/internal/ceres/block_structure.h b/internal/ceres/block_structure.h
index 2abb36a..656716e 100644
--- a/internal/ceres/block_structure.h
+++ b/internal/ceres/block_structure.h
@@ -45,8 +45,6 @@
namespace ceres {
namespace internal {
-class BlockStructureProto;
-
typedef int32 BlockSize;
struct Block {
@@ -89,16 +87,6 @@
vector<CompressedColumn> cols;
};
-// Deserialize the given block structure proto to the given block structure.
-// Destroys previous contents of block_structure.
-void ProtoToBlockStructure(const BlockStructureProto &proto,
- CompressedRowBlockStructure *block_structure);
-
-// Serialize the given block structure to the given proto. Destroys previous
-// contents of proto.
-void BlockStructureToProto(const CompressedRowBlockStructure &block_structure,
- BlockStructureProto *proto);
-
} // namespace internal
} // namespace ceres