MCPcopy Create free account
hub / github.com/Singular/Singular / compare

Method compare

kernel/linear_algebra/Minor.cc:412–439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412int MinorKey::compare (const MinorKey& that) const
413{
414 /* compare by rowKeys first; in case of equality, use columnKeys */
415 if (this->getNumberOfRowBlocks() < that.getNumberOfRowBlocks())
416 return -1;
417 if (this->getNumberOfRowBlocks() > that.getNumberOfRowBlocks())
418 return 1;
419 /* Here, numbers of rows are equal. */
420 for (int r = this->getNumberOfRowBlocks() - 1; r >= 0; r--)
421 {
422 if (this->getRowKey(r) < that.getRowKey(r)) return -1;
423 if (this->getRowKey(r) > that.getRowKey(r)) return 1;
424 }
425 /* Here, this and that encode ecaxtly the same sets of rows.
426 Now, we take a look at the columns. */
427 if (this->getNumberOfColumnBlocks() < that.getNumberOfColumnBlocks())
428 return -1;
429 if (this->getNumberOfColumnBlocks() > that.getNumberOfColumnBlocks())
430 return 1;
431 /* Here, numbers of columns are equal. */
432 for (int c = this->getNumberOfColumnBlocks() - 1; c >= 0; c--)
433 {
434 if (this->getColumnKey(c) < that.getColumnKey(c)) return -1;
435 if (this->getColumnKey(c) > that.getColumnKey(c)) return 1;
436 }
437 /* Here, this and that encode exactly the same sets of rows and columns. */
438 return 0;
439}
440
441/* just to make the compiler happy;
442 this method should never be called */

Callers 10

operator==Method · 0.95
operator<Method · 0.95
insertMethod · 0.45
hasKeyMethod · 0.45
deleteLastMethod · 0.45
putMethod · 0.45
setNextKeysMethod · 0.45
khCheckLocInhomFunction · 0.45
hPrintHilbFunction · 0.45
hLookSeriesFunction · 0.45

Calls 4

getNumberOfRowBlocksMethod · 0.95
getRowKeyMethod · 0.95
getColumnKeyMethod · 0.95

Tested by

no test coverage detected