You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We already have multiple algorithms defined on arrays of factors and arrays of variable values that may be implementable in terms of map or reduce algorithms:
We probably want to write more such algorithms in the future.
It is currently very tedious and boilerplatey to implement these algorithms. You have to implement the algorithm on the ArrayStorage, then you have to add a method to the appropriate dispatch classes, and finally you need to write a method on the heterogeneous collection that invokes the algorithm on all its homogeneous collections.
It would probably be easier to implement these algorithms if we could write them in terms of generic "map" or "reduce" algorithms on the heterogeneous collections.
The text was updated successfully, but these errors were encountered:
Also possibly relevant: A few weeks ago I experimented with eliminating ensureUniqueStorage() from add and scale in AnyArrayBuffer where Dispatch: VectorArrayDispatch. This gave a 5-10% performance boost in the benchmarks, but it was a lot of extra code. I thought that a generic "in place map" might be able to handle this, so I decided to wait until we investigated that possibility before adding all the extra code. Therefore, it might make sense to investigate that while working on this.
We already have multiple algorithms defined on arrays of factors and arrays of variable values that may be implementable in terms of map or reduce algorithms:
errorVectors(at x: VariableAssignments)
is almostfactors.map { $0.errorVector(at: x) }
.linearized(at x: VariableAssignments)
is almostfactors.map { $0.linearized(at: x) }
.addScalarJacobians(_ lambda: Double)
is almostfactors += zeroValues.map { _: T in ScalarJacobianFactor<T>(lambda) }
.We probably want to write more such algorithms in the future.
It is currently very tedious and boilerplatey to implement these algorithms. You have to implement the algorithm on the
ArrayStorage
, then you have to add a method to the appropriate dispatch classes, and finally you need to write a method on the heterogeneous collection that invokes the algorithm on all its homogeneous collections.It would probably be easier to implement these algorithms if we could write them in terms of generic "map" or "reduce" algorithms on the heterogeneous collections.
The text was updated successfully, but these errors were encountered: