Changeset c44f1f9 for src


Ignore:
Timestamp:
Jan 10, 2025, 7:02:09 PM (10 days ago)
Author:
Fangren Yu <f37yu@…>
Branches:
master
Children:
c309af1
Parents:
299bd989
Message:

attempt to fix complex float conversion cost

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/BasicTypes-gen.cpp

    r299bd989 rc44f1f9  
    177177                int i = graph[col].left;
    178178                if ( i == -1 ) continue;
    179                 q.emplace( i, cost + 1, scost + ! (graph[col].sign & graph[i].sign) );
     179                q.emplace( i, cost + max(1, graph[i].rank-graph[col].rank), scost + ! (graph[col].sign & graph[i].sign) );
    180180
    181181                i = graph[col].middle;
    182182                if ( i == -1 ) continue;
    183                 q.emplace( i, cost + 1, scost + !(graph[col].sign & graph[i].sign) );
     183                q.emplace( i, cost + max(1, graph[i].rank-graph[col].rank), scost + !(graph[col].sign & graph[i].sign) );
    184184
    185185                i = graph[col].right;
    186186                if ( i == -1 ) continue;
    187                 q.emplace( i, cost + 1, scost + !(graph[col].sign & graph[i].sign) );
     187                q.emplace( i, cost + max(1, graph[i].rank-graph[col].rank), scost + !(graph[col].sign & graph[i].sign) );
    188188        } while ( ! q.empty() );
    189189} // generateCosts
Note: See TracChangeset for help on using the changeset viewer.