Skip to content
Snippets Groups Projects

Feature/get distance manyto many

Merged Louison Fresnais requested to merge feature/getDistanceManytoMany into develop

Add getDistances method to the shortestPath class and use it in the DistanceMatrix app.

Edited by Louison Fresnais

Merge request reports

Checking pipeline status.

Merged by Clement FrainayClement Frainay 2 years ago (Dec 7, 2022 11:16am UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
266 267 public HashMap<String, E> getMapView() {
267 268 return new HashMap<>(this.entities);
268 269 }
269
270 public Set<E> asSet() {
  • added 1 commit

    Compare with previous version

  • 406 408 public List<BioPath<V,E>> getAllShortestPaths(){
    407 409 return getShortestPathsUnionList(g.vertexSet());
    408 410 }
    409
    411 /**
    412 * Return the distance matrix of all the paiwise distances in the graph
    413 *
    414 * @return the distance matrix
    415 */
    416 public BioMatrix getDistances(){
  • 431 j++;
    432 }
    433 i++;
    434 }
    435 //get the label-index matching
    436 HashMap<String,Integer> rowLabelMap = distMatrix.getRowLabelMap();
    437 HashMap<String,Integer> columnLabelMap = distMatrix.getColumnLabelMap();
    438 //compute all sps in the graph
    439 List<BioPath<V,E>> allShortest = getShortestPathsUnionList(nodeSet);
    440 //fill the biomatrix
    441 try {
    442 for(BioPath bp:allShortest) {
    443 distMatrix.set(rowLabelMap.get(bp.getStartVertex().toString()), columnLabelMap.get(bp.getEndVertex().toString()), bp.getLength());
    444 }
    445 } catch (NullPointerException e ) {
    446 System.err.println("Null pointer exception raised, no BioPath computed");
  • 424 distMatrix.setColumnLabel(i,r1.getId());
    425 int j = 0;
    426 for(V r2:nodeSet){
    427 //init value in matrix to inf if r1!=r2
    428 if(r1!=r2) {
    429 distMatrix.set(i, j, Double.POSITIVE_INFINITY);
    430 }
    431 j++;
    432 }
    433 i++;
    434 }
    435 //get the label-index matching
    436 HashMap<String,Integer> rowLabelMap = distMatrix.getRowLabelMap();
    437 HashMap<String,Integer> columnLabelMap = distMatrix.getColumnLabelMap();
    438 //compute all sps in the graph
    439 List<BioPath<V,E>> allShortest = getShortestPathsUnionList(nodeSet);
  • added 1 commit

    • eb7688dc - remove asSet usage in DistanceMatrix app

    Compare with previous version

  • added 1 commit

    • 173ee9f0 - getDistances to getDistancesFromSPs

    Compare with previous version

  • added 1 commit

    • 3f7d722f - Rename path to matrix conversion method, handle non-square matrix, add option for weighted case

    Compare with previous version

  • Clement Frainay added 3 commits

    added 3 commits

    • 1fc18d3a - fix: imporve handling of empty biopath
    • 43ab870b - Create full square distance matrix or "versus" distance matrix (different set...
    • 8dcb5da6 - update app, move path to matrix conversion in biopath utils, add...

    Compare with previous version

  • added 1 commit

    • 297166b3 - [fix] DefaultWeightPolicy class renamed UnweightedPolicy.

    Compare with previous version

  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 00d85e4c - Add new unit tests to TestBioPathUtils

    Compare with previous version

  • added 1 commit

    • be220f8d - fix and expand BioPath tests

    Compare with previous version

  • Clement Frainay approved this merge request

    approved this merge request

  • added 1 commit

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading