SCIP-SDP
2.1.0
|
adds the main functionality to fix/unfix/(multi-)aggregate variables by merging two three-tuple-arrays of row/col/val together More...
Go to the source code of this file.
Functions | |
EXTERN void | SCIPsdpVarfixerSortRowCol (int *row, int *col, SCIP_Real *val, int length) |
SCIP_RETCODE | SCIPsdpVarfixerMergeArrays (BMS_BLKMEM *blkmem, SCIP_Real feastol, int *originrow, int *origincol, SCIP_Real *originval, int originlength, SCIP_Bool originsorted, SCIP_Real scalar, int *targetrow, int *targetcol, SCIP_Real *targetval, int *targetlength, int targetmemory) |
EXTERN SCIP_RETCODE | SCIPsdpVarfixerMergeArraysIntoNew (BMS_BLKMEM *blkmem, SCIP_Real feastol, int *firstrow, int *firstcol, SCIP_Real *firstval, int firstlength, int *secondrow, int *secondcol, SCIP_Real *secondval, int secondlength, int *targetrow, int *targetcol, SCIP_Real *targetval, int *targetlength) |
adds the main functionality to fix/unfix/(multi-)aggregate variables by merging two three-tuple-arrays of row/col/val together
Definition in file SdpVarfixer.h.
EXTERN void SCIPsdpVarfixerSortRowCol | ( | int * | row, |
int * | col, | ||
SCIP_Real * | val, | ||
int | length | ||
) |
sort the given row, col and val arrays first by non-decreasing row-indices, then for those with identical row-indices by non-decreasing col-indices
row | row indices |
col | column indices |
val | values |
length | length of the given arrays |
Definition at line 50 of file SdpVarfixer.c.
Referenced by multiaggrVar(), SCIPsdpVarfixerMergeArrays(), and SCIPsdpVarfixerMergeArraysIntoNew().
SCIP_RETCODE SCIPsdpVarfixerMergeArrays | ( | BMS_BLKMEM * | blkmem, |
SCIP_Real | feastol, | ||
int * | originrow, | ||
int * | origincol, | ||
SCIP_Real * | originval, | ||
int | originlength, | ||
SCIP_Bool | originsorted, | ||
SCIP_Real | scalar, | ||
int * | targetrow, | ||
int * | targetcol, | ||
SCIP_Real * | targetval, | ||
int * | targetlength, | ||
int | targetmemory | ||
) |
merges two three-tuple-arrays together
The original arrays (which may have multiple entries for the same row and col) will be mulitplied with scalar and then merged into the target arrays (which may not have multiple entries for the same row and col). If there is already an entry for a row/col combination, these two entries will be combined (their values added together), if they cancel each other out the nonzero entry will be removed. If you think of the matrices described by the two arrays, this is a matrix addition (but only working on the nonzeros for efficiency). The target arrays need to be long enough, otherwise targetlength returns the needed amount and a corresponding debug message is thrown.
blkmem | block memory |
feastol | only values bigger than this are counted as nonzeros |
originrow | original row-index-array that is going to be merged, may be NULL if originlength = 0 |
origincol | original column-index-array that is going to be merged, may be NULL if originlength = 0 |
originval | original nonzero-values-array that is going to be merged, may be NULL if originlength = 0 |
originlength | length of the original arrays |
originsorted | are the origin arrays already sorted by non-decreasing row and in case of ties col |
scalar | scalar that the original nonzero-values will be multiplied with before merging |
targetrow | row-index-array the original array will be merged into |
targetcol | column-index-array the original array will be merged into |
targetval | nonzero-values-array the original array will be merged into |
targetlength | length of the target arrays the original arrays will be merged into, this will be updated to the new length after the mergings |
targetmemory | amount of memory allocated for targetrow, -col, -val, if this isn't sufficient targetlength will return the needed amount and a corresponding debug message will be thrown |
Definition at line 88 of file SdpVarfixer.c.
References SCIPsdpVarfixerSortRowCol().
Referenced by fixAndAggrVars(), and multiaggrVar().
EXTERN SCIP_RETCODE SCIPsdpVarfixerMergeArraysIntoNew | ( | BMS_BLKMEM * | blkmem, |
SCIP_Real | feastol, | ||
int * | firstrow, | ||
int * | firstcol, | ||
SCIP_Real * | firstval, | ||
int | firstlength, | ||
int * | secondrow, | ||
int * | secondcol, | ||
SCIP_Real * | secondval, | ||
int | secondlength, | ||
int * | targetrow, | ||
int * | targetcol, | ||
SCIP_Real * | targetval, | ||
int * | targetlength | ||
) |
merges two three-tuple-arrays together
If there are multiple entries for a row/col combination, these will be combined (their values added together), if they cancel each other out the nonzero entry will be removed. The first arrays are assumed to have unique row/col-combinations, the second arrays may have duplicates of the same row/col-combination. In constrast to MergeArrays, here the combined arrays will be inserted in the new targetarrays, and not overwrite one of the old arrays. targetlength should give the length of the target arrays, if this is not sufficient, the needed length is returned there and a debug message is thrown.
blkmem | block memory |
feastol | only values bigger than this are counted as nonzeros |
firstrow | first row-index-array that is going to be merged, may be NULL if firstlength = 0 |
firstcol | first column-index-array that is going to be merged, may be NULL if firstlength = 0 |
firstval | first nonzero-values-array that is going to be merged, may be NULL if firstlength = 0 |
firstlength | length of the first arrays |
secondrow | second row-index-array that is going to be merged, may be NULL if secondlength = 0 |
secondcol | second column-index-array that is going to be merged, may be NULL if secondlength = 0 |
secondval | second nonzero-values-array that is going to be merged, may be NULL if secondlength = 0 |
secondlength | length of the second arrays |
targetrow | row-index-array the original arrays will be merged into |
targetcol | column-index-array the original arrays will be merged into |
targetval | nonzero-values-array the original arrays will be merged into |
targetlength | length of the target arrays the original arrays will be merged into, this will be updated to the new length after the mergings |
Definition at line 255 of file SdpVarfixer.c.
References SCIPsdpVarfixerSortRowCol().
Referenced by compConstMatAfterFixings().