   @differentiable
   public func errorVector(_ val: Matrix3) -> ErrorVector {
     (val - prior).vec
-  }
-  
-  // Note: All the remaining code in this factor is boilerplate that we can eventually eliminate
-  // with sugar.
-  
-  public func error(at x: Variables) -> Double {
-    return 0.5 * errorVector(at: x).squaredNorm
-  }
-  
-  @differentiable
-  public func errorVector(at x: Variables) -> ErrorVector {
-    return errorVector(x.head)
   }
 }
 

    let R1h = matmul(R12, R2.transposed()).transposed()
    return (R1h - R1).vec
  }
  
  // Note: All the remaining code in this factor is boilerplate that we can eventually eliminate
  // with sugar.
  
  public func error(at x: Variables) -> Double {
    return 0.5 * errorVector(at: x).squaredNorm
  }
  
  @differentiable
  public func errorVector(at x: Variables) -> ErrorVector {
    return errorVector(x.head, x.tail.head)
  }
}

/// A factor for the anchor in chordal initialization
public struct RelaxedAnchorFactorRot3: LinearizableFactor
{
  public typealias Variables = Tuple1<Matrix3>
  public typealias JacobianRows = Array9<Tuple1<Matrix3.TangentVector>>
  
  public let edges: Variables.Indices
  public let prior: Matrix3
  

/// A relaxed version of the Rot3 between that uses the Chordal (Frobenious) norm on rotation
/// Please refer to Carlone15icra (Initialization Techniques for 3D SLAM: a Survey on Rotation Estimation and its Use in Pose Graph Optimization)
/// for explanation.
public struct RelaxedRotationFactorRot3: LinearizableFactor2
{
  public let edges: Variables.Indices
  public let difference: Matrix3
  
