From 46ccfb376ac52ac159f9187e0f7384ef68c1cbdd Mon Sep 17 00:00:00 2001 From: Sameer Agarwal Date: Sat, 12 Apr 2014 21:56:51 -0700 Subject: [PATCH] Cleanup block_structure.h/cc 1. Remove obsolete Proto conversion functions. 2. Fix a strict weak ordering bug. Change-Id: I1ce6d4b06e29cf475df1d5bd37c79f66f20f8d93 --- internal/ceres/block_structure.cc | 3 +++ internal/ceres/block_structure.h | 12 ------------ 2 files changed, 3 insertions(+), 12 deletions(-) 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 ceres { 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 @@ struct CompressedColumnBlockStructure { vector 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