Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metric concepts #791

Closed
wants to merge 2 commits into from
Closed

Conversation

dcoeurjo
Copy link
Member

@dcoeurjo dcoeurjo commented Mar 9, 2014

Simplification of Metric concepts:

  • CLocalPremetric removed (does not make sense, even for path based norms)
  • Code cleanup in models of CMetric (to remove CLocalMetric concept requirements, the local method).

@JacquesOlivierLachaud
Copy link
Member

It is not exactly related, but I remember when using metrics that I miss a "squaredLength" method to speed up things. It is possible to add this (like in CGAL) in Metric ?

@dcoeurjo
Copy link
Member Author

There is this sort of things in DistanceTransformation (to get error free DT values) but I agree that it could be useful in CMetric. How would you name this method ?

  • exactDistance
  • exactDistanceValue
  • exactRepresentation
    ?

(in all cases, the exactmeans exact w.r.t. a given model of CEucldienRing)

@dcoeurjo dcoeurjo closed this Mar 16, 2014
@dcoeurjo dcoeurjo reopened this Mar 16, 2014
@dcoeurjo
Copy link
Member Author

@JacquesOlivierLachaud, any advice for the "exact..." function name ?

@JacquesOlivierLachaud
Copy link
Member

In fact, I was more proposing to add another method that returns the squared length ("squaredLength" ?). So the exactness is one aspect, the computation speed is another.
I am of course not against an "exact*" method. Certainly, there must be some specific type here.

@dcoeurjo
Copy link
Member Author

dcoeurjo commented Apr 1, 2014

ok but 'squared' won't make sense for l_p nor path based metrics.

@JacquesOlivierLachaud
Copy link
Member

You are right. However, 99% of distance computation are with Euclidean distance (or power metric with also squares). Therefore, such a method induces a lot of computation savings at many places (for instance in DistanceBreadthFirstVisitor). So two options:

  • either specialize EuclideanDistance with squaredLength
  • or give a "pLength" or "unnormalizeLength" method.

@dcoeurjo
Copy link
Member Author

dcoeurjo commented Apr 1, 2014

For l_p models, such function already exists under the name exactDistanceRepresentation. At this point, it is not required in the concept. My comment was: should we add this to CMetric (why not) ? how the function should be named ?

@dcoeurjo
Copy link
Member Author

dcoeurjo commented Apr 1, 2014

( exactDistanceRepresentation is private at this point for l_p stuff)

@dcoeurjo
Copy link
Member Author

Working on it.. I'll reopen it when ready

@dcoeurjo dcoeurjo closed this Jun 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants