diff options
author | Sascha Haeberling <haeberling@google.com> | 2013-07-23 19:00:21 -0700 |
---|---|---|
committer | Sascha Haeberling <haeberling@google.com> | 2013-07-24 12:00:09 -0700 |
commit | 1d2624a10e2c559f8ba9ef89eaa30832c0a83a96 (patch) | |
tree | f43667ef858dd0f377b15a58a9d5c9a126762c55 /internal/ceres/triplet_sparse_matrix.cc | |
parent | 0ae28bd5885b5daa526898fcf7c323dc2c3e1963 (diff) | |
download | ceres-solver-1d2624a10e2c559f8ba9ef89eaa30832c0a83a96.tar.gz |
Update ceres to the latest version in google3.
Change-Id: I0165fffa55f60714f23e0096eac89fa68df75a05
Diffstat (limited to 'internal/ceres/triplet_sparse_matrix.cc')
-rw-r--r-- | internal/ceres/triplet_sparse_matrix.cc | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/internal/ceres/triplet_sparse_matrix.cc b/internal/ceres/triplet_sparse_matrix.cc index a09f38e..824b123 100644 --- a/internal/ceres/triplet_sparse_matrix.cc +++ b/internal/ceres/triplet_sparse_matrix.cc @@ -35,7 +35,6 @@ #include "ceres/internal/eigen.h" #include "ceres/internal/port.h" #include "ceres/internal/scoped_ptr.h" -#include "ceres/matrix_proto.h" #include "ceres/types.h" #include "glog/logging.h" @@ -83,32 +82,6 @@ TripletSparseMatrix::TripletSparseMatrix(const TripletSparseMatrix& orig) CopyData(orig); } -#ifndef CERES_NO_PROTOCOL_BUFFERS -TripletSparseMatrix::TripletSparseMatrix(const SparseMatrixProto& outer_proto) { - CHECK(outer_proto.has_triplet_matrix()); - - const TripletSparseMatrixProto& proto = outer_proto.triplet_matrix(); - CHECK(proto.has_num_rows()); - CHECK(proto.has_num_cols()); - CHECK_EQ(proto.rows_size(), proto.cols_size()); - CHECK_EQ(proto.cols_size(), proto.values_size()); - - // Initialize the matrix with the appropriate size and capacity. - max_num_nonzeros_ = 0; - set_num_nonzeros(0); - Reserve(proto.num_nonzeros()); - Resize(proto.num_rows(), proto.num_cols()); - set_num_nonzeros(proto.num_nonzeros()); - - // Copy the entries in. - for (int i = 0; i < proto.num_nonzeros(); ++i) { - rows_[i] = proto.rows(i); - cols_[i] = proto.cols(i); - values_[i] = proto.values(i); - } -} -#endif - TripletSparseMatrix& TripletSparseMatrix::operator=( const TripletSparseMatrix& rhs) { num_rows_ = rhs.num_rows_; @@ -215,22 +188,6 @@ void TripletSparseMatrix::ToDenseMatrix(Matrix* dense_matrix) const { } } -#ifndef CERES_NO_PROTOCOL_BUFFERS -void TripletSparseMatrix::ToProto(SparseMatrixProto *proto) const { - proto->Clear(); - - TripletSparseMatrixProto* tsm_proto = proto->mutable_triplet_matrix(); - tsm_proto->set_num_rows(num_rows_); - tsm_proto->set_num_cols(num_cols_); - tsm_proto->set_num_nonzeros(num_nonzeros_); - for (int i = 0; i < num_nonzeros_; ++i) { - tsm_proto->add_rows(rows_[i]); - tsm_proto->add_cols(cols_[i]); - tsm_proto->add_values(values_[i]); - } -} -#endif - void TripletSparseMatrix::AppendRows(const TripletSparseMatrix& B) { CHECK_EQ(B.num_cols(), num_cols_); Reserve(num_nonzeros_ + B.num_nonzeros_); |