~ubuntu-branches/ubuntu/trusty/blender/trusty-proposed

« back to all changes in this revision

Viewing changes to extern/libmv/third_party/ceres/internal/ceres/corrector.cc

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2013-08-14 10:43:49 UTC
  • mfrom: (14.2.19 sid)
  • Revision ID: package-import@ubuntu.com-20130814104349-t1d5mtwkphp12dyj
Tags: 2.68a-3
* Upload to unstable
* debian/: python3.3 Depends simplified
  - debian/control: python3.3 Depends dropped
    for blender-data package
  - 0001-blender_thumbnailer.patch refreshed
* debian/control: libavcodec b-dep versioning dropped

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
                                double* residuals, double* jacobian) {
114
114
  DCHECK(residuals != NULL);
115
115
  DCHECK(jacobian != NULL);
116
 
  ConstVectorRef r_ref(residuals, nrow);
117
 
  MatrixRef j_ref(jacobian, nrow, ncol);
118
 
 
119
 
  // Equation 11 in BANS.
120
 
  j_ref = sqrt_rho1_ * (j_ref - alpha_sq_norm_ *
121
 
                        r_ref * (r_ref.transpose() * j_ref));
 
116
 
 
117
  if (nrow == 1) {
 
118
    // Specialization for the case where the residual is a scalar.
 
119
    VectorRef j_ref(jacobian, ncol);
 
120
    j_ref *= sqrt_rho1_ * (1.0 - alpha_sq_norm_ * pow(*residuals, 2));
 
121
  } else {
 
122
    ConstVectorRef r_ref(residuals, nrow);
 
123
    MatrixRef j_ref(jacobian, nrow, ncol);
 
124
 
 
125
    // Equation 11 in BANS.
 
126
    j_ref = sqrt_rho1_ * (j_ref - alpha_sq_norm_ *
 
127
                          r_ref * (r_ref.transpose() * j_ref));
 
128
  }
122
129
}
123
130
 
124
131
}  // namespace internal