An implementation of Ruhe & Wedin's Algorithm II.

A non-linear generalization of Ruhe & Wedin's algorithm
for separable non-linear least squares problem. It is implemented
as coordinate descent on an independent subset of the parameter
blocks at the end of every successful Newton step. The resulting
algorithm has much improved convergence at the cost of some
execution time.

Change-Id: I8fdc5edbd0ba1e702c9658b98041b2c2ae705402
diff --git a/internal/ceres/parameter_block.h b/internal/ceres/parameter_block.h
index dd69cd6..f20805c 100644
--- a/internal/ceres/parameter_block.h
+++ b/internal/ceres/parameter_block.h
@@ -112,6 +112,10 @@
   int index() const { return index_; }
   void set_index(int index) { index_ = index; }
 
+  // This parameter offset inside a larger state vector.
+  int state_offset() const { return state_offset_; }
+  void set_state_offset(int state_offset) { state_offset_ = state_offset; }
+
   // This parameter offset inside a larger delta vector.
   int delta_offset() const { return delta_offset_; }
   void set_delta_offset(int delta_offset) { delta_offset_ = delta_offset; }
@@ -172,13 +176,14 @@
 
   string ToString() const {
     return StringPrintf("{ user_state=%p, state=%p, size=%d, "
-                        "constant=%d, index=%d, "
+                        "constant=%d, index=%d, state_offset=%d, "
                         "delta_offset=%d }",
                         user_state_,
                         state_,
                         size_,
                         is_constant_,
                         index_,
+                        state_offset_,
                         delta_offset_);
   }
 
@@ -197,6 +202,7 @@
     }
 
     index_ = -1;
+    state_offset_ = -1;
     delta_offset_ = -1;
   }
 
@@ -249,6 +255,9 @@
   // permit switching from a ParameterBlock* to an index in another array.
   int32 index_;
 
+  // The offset of this parameter block inside a larger state vector.
+  int32 state_offset_;
+
   // The offset of this parameter block inside a larger delta vector.
   int32 delta_offset_;