MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / UpdateState

Method UpdateState

src/polypartition/polypartition.cpp:908–935  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

906}
907
908void TPPLPartition::UpdateState(long a, long b, long w, long i, long j, DPState2** dpstates) {
909 Diagonal newdiagonal;
910 DiagonalList* pairs = NULL;
911 long w2;
912
913 w2 = dpstates[a][b].weight;
914 if (w > w2) {
915 return;
916 }
917
918 pairs = &(dpstates[a][b].pairs);
919 newdiagonal.index1 = i;
920 newdiagonal.index2 = j;
921
922 if (w < w2) {
923 pairs->clear();
924 pairs->push_front(newdiagonal);
925 dpstates[a][b].weight = w;
926 } else {
927 if ((!pairs->empty()) && (i <= pairs->begin()->index1)) {
928 return;
929 }
930 while ((!pairs->empty()) && (pairs->begin()->index2 >= j)) {
931 pairs->pop_front();
932 }
933 pairs->push_front(newdiagonal);
934 }
935}
936
937void TPPLPartition::TypeA(long i, long j, long k, PartitionVertex* vertices, DPState2** dpstates) {
938 DiagonalList* pairs = NULL;

Callers

nothing calls this directly

Calls 3

beginMethod · 0.80
clearMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected