30 #define SOPLEX_FACTOR_MARKER 1e-100 60 for ( i = 1; i < *size; ++i )
61 for ( j = 0; j < i; ++j )
62 assert( heap[i] != heap[j] );
74 e = heap[s = --( *size )];
77 for ( j = 0, i = 1; i < s; i = 2 * j + 1 )
110 if ( i < *size && e < heap[i] )
131 if ( elem < heap[i] )
144 for ( i = 1; i < *size; ++i )
145 for ( j = 0; j < i; ++j )
146 assert( heap[i] != heap[j] );
158 e = heap[s = --( *size )];
161 for ( j = 0, i = 1; i < s; i = 2 * j + 1 )
194 if ( i < *size && e > heap[i] )
258 for (
int i = 0; i <
thedim; ++i )
281 <<
"LU pivot element is almost zero (< " 283 <<
") - Basis is numerically singular" 312 for ( ring = list->
next; ring != list; ring = ring->
next )
316 if ( l_rbeg[l_row] != n )
322 assert( l_rlen[l_row] <= l_rmax[l_row] );
324 l_rmax[l_row] = l_rlen[l_row];
325 j = i + l_rlen[l_row];
327 for ( ; i < j; ++i, ++n )
330 l_ridx[n] = l_ridx[i];
331 l_rval[n] = l_rval[i];
336 while ( ring != list );
338 goto terminatePackRows;
343 l_rmax[l_row] = l_rlen[l_row];
370 for ( ring = list->
next; ring != list; ring = ring->
next )
374 if ( cbeg[colno] != n )
381 cmax[colno] = clen[colno];
392 while ( ring != list );
394 goto terminatePackColumns;
399 cmax[colno] = clen[colno];
402 terminatePackColumns :
413 assert(
u.
row.
max[p_row] < len );
417 int delta = len -
u.
row.
max[p_row];
422 delta = len -
u.
row.
max[p_row];
432 &&
"ERROR: could not allocate memory for row file" );
456 &&
"ERROR: could not allocate memory for row file" );
473 for ( ; i < k; ++i, ++j )
502 for ( ring = list->
next; ring != list; ring = ring->
next )
506 if ( l_cbeg[l_col] != n )
513 l_cmax[l_col] = l_clen[l_col];
514 j = i + l_clen[l_col];
517 l_cidx[n++] = l_cidx[i];
521 while ( ring != list );
523 goto terminatePackColumns;
528 l_cmax[l_col] = l_clen[l_col];
531 terminatePackColumns :
542 assert(
u.
col.
max[p_col] < len );
546 int delta = len -
u.
col.
max[p_col];
551 delta = len -
u.
col.
max[p_col];
561 &&
"ERROR: could not allocate memory for column file" );
585 &&
"ERROR: could not allocate memory for column file" );
611 assert(
u.
col.
max[p_col] < len );
615 int delta = len -
u.
col.
max[p_col];
620 delta = len -
u.
col.
max[p_col];
628 &&
"ERROR: could not allocate memory for column file" );
651 &&
"ERROR: could not allocate memory for column file" );
710 int i, j, k, h, m, n;
744 for ( i += j - 1; i >= j; --i )
748 h = --( rlen[m] ) + k;
750 while ( ridx[k] != p_col )
775 if ( num > cmax[p_col] )
786 for ( j = 0; j < num; ++j )
794 if (
spxAbs( x ) > l_maxabs )
798 assert( k - cbeg[p_col] < cmax[p_col] );
805 if ( rmax[i] <= rlen[i] )
812 h = rbeg[i] + ( rlen[i] )++;
824 nzCnt += ( clen[p_col] = k - cbeg[p_col] );
841 for ( i = 0; i < dim; ++i )
848 if (
spxAbs( x ) > l_maxabs )
854 clen[p_col] = k - cbeg[p_col];
863 assert( k - cbeg[p_col] < cmax[p_col] );
870 if ( rmax[i] <= rlen[i] )
877 h = rbeg[i] + ( rlen[i] )++;
889 nzCnt += ( clen[p_col] = k - cbeg[p_col] );
891 if ( cbeg[p_col] + cmax[p_col] ==
u.
col.
used )
894 cmax[p_col] = clen[p_col];
910 memmove(&rorig[c], &rorig[c + 1], (
unsigned int)(r - c) *
sizeof(
int));
914 for ( i = c; i <= r; ++i )
922 memmove(&corig[c], &corig[c + 1], (
unsigned int)(r - c) *
sizeof(
int));
926 for ( i = c; i <= r; ++i )
938 if ( i < verySparseFactor * ( dim - c ) )
955 for ( i += j - 1; i >= j; --i )
960 m = --( clen[k] ) + cbeg[k];
962 for ( h = m; cidx[h] != rowno; --h )
979 assert(( num == 0 ) || ( nonz != 0 ) );
987 for ( i = 0; i < num; ++i )
988 assert( p_work[corig[nonz[i]]] != 0.0 );
998 assert( p_work[k] != 0.0 );
1002 x = p_work[k] *
diag[n];
1012 if (
spxAbs( x ) > l_maxabs )
1019 for ( ; j < m; ++j )
1022 Real y = p_work[jj];
1050 diag[rowno] = 1 / x;
1057 if ( rmax[rowno] < num )
1071 for ( i = 0; i < num; ++i )
1084 if (
spxAbs( x ) > l_maxabs )
1095 if ( clen[j] >= cmax[j] )
1102 cval[cbeg[j] + clen[j]] = x;
1104 cidx[cbeg[j] + clen[j]++] = rowno;
1108 rlen[rowno] = n - rbeg[rowno];
1114 for ( i += j - 1; i >= j; --i )
1117 p_work[k] = rval[i];
1118 m = --( clen[k] ) + cbeg[k];
1120 for ( h = m; cidx[h] != rowno; --h )
1137 for ( i = c; i < r; ++i )
1141 if ( p_work[k] != 0.0 )
1144 x = p_work[k] *
diag[n];
1150 if (
spxAbs( x ) > l_maxabs )
1157 for ( ; j < m; ++j )
1158 p_work[ridx[j]] -= x * rval[j];
1181 diag[rowno] = 1 / x;
1191 for ( i = r + 1; i < dim; ++i )
1192 if ( p_work[corig[i]] != 0.0 )
1195 if ( rmax[rowno] < n )
1209 for ( i = r + 1; i < dim; ++i )
1216 if (
spxAbs( x ) > l_maxabs )
1227 if ( clen[j] >= cmax[j] )
1234 cval[cbeg[j] + clen[j]] = x;
1236 cidx[cbeg[j] + clen[j]++] = rowno;
1240 rlen[rowno] = n - rbeg[rowno];
1251 i = rbeg[rowno] + --( rlen[rowno] );
1252 diag[rowno] = 1 / rval[i];
1254 for ( j = i = --( clen[p_col] ) + cbeg[p_col]; cidx[i] != rowno; --i )
1281 assert( p_work[p_col] != 0.0 );
1282 rezi = 1 / p_work[p_col];
1283 p_work[p_col] = 0.0;
1290 for ( i = num - 1; ( j = p_idx[i] ) != p_col; --i )
1293 lval[ll] = rezi * p_work[j];
1300 lval[ll] = 1 - rezi;
1303 for ( --i; i >= 0; --i )
1307 lval[ll] = x = rezi * p_work[j];
1329 assert( p_work[p_col] != 0.0 );
1330 rezi = 1 / p_work[p_col];
1336 for ( i = num - 1; ( j = p_idx[i] ) != p_col; --i )
1339 lval[ll] = rezi * p_work[j];
1345 lval[ll] = 1 - rezi;
1348 for ( --i; i >= 0; --i )
1352 lval[ll] = x = rezi * p_work[j];
1394 Dring *rring, *lastrring;
1395 Dring *cring, *lastcring;
1405 for (
int i = 0; i <
thedim; i++ )
1410 for (
int i = 0; i <
thedim; i++ )
1421 for (
int j = 0; j < k; ++j )
1454 lastrring->
next = rring;
1462 lastcring->
next = cring;
1466 for (
int i = 0; i <
thedim; i++ )
1472 rring->
prev = lastrring;
1473 lastrring->
next = rring;
1478 cring->
prev = lastcring;
1479 lastcring->
next = cring;
1503 for (
int i = 0; i <
thedim; i++ )
1513 for (
int j = 0; j < psv->
size() && nnonzeros <= 1; j++ )
1520 if ( nnonzeros == 0 )
1528 if ( nnonzeros == 1 )
1534 for ( j = 0;
isZero( psv->
value( j ), eps ); j++ )
1537 assert( j < psv->size() );
1547 x = psv->
value( j );
1570 assert( nnonzeros >= 2 );
1573 for (
int j = 0; j < psv->
size(); j++ )
1575 x = psv->
value( j );
1580 k = psv->
index( j );
1599 assert( nnonzeros >= 2 );
1620 int p_col, p_row, newrow;
1636 assert( p_row >= 0 );
1640 for ( j = 0; j < len; ++j )
1649 for ( k = n;
u.
col.
idx[k] != p_row; ++k )
1667 if ( rperm[newrow] >= 0 )
1677 for ( k = n;
u.
row.
idx[k] != p_col; --k )
1713 int p_row, p_col, len, rs, lk;
1722 for ( i = 0; i <
thedim; ++i )
1724 if ( rperm[i] < 0 &&
u.
row.
len[i] == 1 )
1740 setPivot( rs, p_col, p_row, pval );
1750 i = (
u.
col.
len[p_col] -= i );
1752 for ( ; i < len; ++i )
1763 for ( j = k;
u.
row.
idx[j] != p_col; --j )
1823 for ( i = 0; i <
thedim; ++i )
1908 for ( ; ( r = idx[i] ) != prow; ++i )
1915 for ( j = k;
u.
row.
idx[j] != pcol; --j )
1946 assert( i < len &&
"ERROR: pivot column does not contain pivot row" );
1948 for ( ++i; i < len; ++i )
1956 for ( j = k;
u.
row.
idx[j] != pcol; --j )
2018 for ( i = j; ( c =
u.
row.
idx[i] ) != pcol; --i )
2022 for ( k = m;
u.
col.
idx[k] != prow; ++k )
2048 for ( --i; i >= j; --i )
2053 for ( k = m;
u.
col.
idx[k] != prow; ++k )
2098 if ( candidates > 4 )
2113 len =
u.
row.
len[rw] + beg - 1;
2123 for ( i = len - 1; i >= beg; --i )
2130 l_maxabs *= threshold;
2136 for ( i = len; i >= beg; --i )
2142 if ( j < mkwtz &&
spxAbs( x ) > l_maxabs )
2158 len =
u.
col.
len[cl] + beg - 1;
2166 for ( i = len; i >= beg; --i )
2199 for ( kk = m +
u.
row.
len[k] - 1; kk >= m; --kk )
2212 for ( --kk; kk > m; --kk )
2221 l_maxabs *= threshold;
2223 if (
spxAbs( x ) > l_maxabs )
2229 if ( j <= count + 1 )
2258 if ( pr->
idx == rw || pr->
mkwtz >= mkwtz )
2264 if ( pr->
idx != rw )
2272 if ( num >= candidates )
2305 int c, i, j, k, ll, m, n;
2314 for ( j = m;
u.
row.
idx[j] != pcol; --j )
2335 for ( j = m - 1; j >= n; --j )
2364 for ( i = k;
u.
col.
idx[i] != r; --i )
2377 if ( ll + fill >
u.
row.
max[r] )
2434 int i, j, k, m = -1;
2439 int plen = --(
u.
row.
len[prow] );
2440 int pend = pbeg + plen;
2469 for ( i = pbeg; i < pend; ++i )
2477 for ( k = m;
u.
col.
idx[k] != prow; ++k )
2495 updateRow( m, lv++, prow, pcol, pval, eps );
2502 for ( ++i; i < m; ++i )
2514 for ( i =
u.
row.
start[prow], pend = i + plen; i < pend; ++i )
2529 const Real threshold )
2549 for ( i = 0; i <
thedim; ++i )
2568 "ERROR: no pivot element selected" );
2571 pivot = pivot->
next )
2591 "ERROR: one row must be left" );
2593 "ERROR: one col must be left" );
2615 for ( i = 0; i <
thedim; i++ )
2620 for ( i = 0; i <
thedim; i++ )
2631 assert(( *idx >= 0 ) && ( *idx < thedim ) );
2635 assert(( k >= 0 ) && ( k <
u.
col.
size ) );
2721 for ( i =
thedim; i--; *l_rbeg++ = 0 )
2723 *rorig++ = *rrorig++;
2724 *rperm++ = *rrperm++;
2729 l_rbeg =
l.
rbeg + 1;
2731 for ( i = mem; i--; )
2736 for ( m = 0, i =
thedim; i--; l_rbeg++ )
2745 l_rbeg =
l.
rbeg + 1;
2747 for ( i = j = 0; i < vecs; ++i )
2752 for ( ; j < beg[i + 1]; j++ )
2754 k = l_rbeg[*idx++]++;
2763 assert(
l.
rbeg[0] == 0 );
2836 for ( i = 0; i <
thedim; ++i )
2839 std::cout <<
"DCLUFA01 diag[" << i <<
"]: [" <<
col.
orig[
row.
perm[i]]
2840 <<
"] = " <<
diag[i] << std::endl;
2842 for ( j = 0; j <
u.
row.
len[i]; ++j )
2843 std::cout <<
"DCLUFA02 u[" << i <<
"]: [" 2850 for ( i = 0; i <
thedim; ++i )
2855 std::cout <<
"DCLUFA03 l[" << i <<
"]" << std::endl;
2858 std::cout <<
"DCLUFA04 l[" << k -
l.
start[j]
2859 <<
"]: [" <<
l.
idx[k]
2860 <<
"] = " <<
l.
val[k] << std::endl;
2912 if ( size >
l.
size )
2930 int* p_lrow =
l.
row;
2935 assert( p_len > 0 &&
"ERROR: no empty columns allowed in L vectors" );
2951 #ifdef ENABLE_CONSISTENCY_CHECKS 2968 assert( ring->
idx >= 0 );
2970 assert( ring->
prev->
next == ring );
2993 assert( ring->
idx >= 0 );
2995 assert( ring->
prev->
next == ring );
3010 for ( i = 0; i <
thedim; ++i )
3019 for ( i = 0; i <
thedim; ++i )
3046 for ( i = 0; i <
thedim; ++i )
3068 for ( i = 0; i < thedim -
temp.
stage; ++i )
3081 #endif // CONSISTENCY_CHECKS 3089 for (
int i =
thedim - 1; i >= 0; i-- )
3093 Real x = wrk[c] =
diag[r] * vec[r];
3110 int *cidx, *clen, *cbeg;
3127 for ( i =
thedim - 1; i >= 0; --i )
3130 x =
diag[r] * rhs[r];
3137 val = &cval[cbeg[c]];
3138 idx = &cidx[cbeg[c]];
3142 rhs[*idx++] -= x * ( *val++ );
3154 int *cidx, *clen, *cbeg;
3169 for ( i =
thedim - 1; i >= 0; --i )
3173 p_work1[c] = x1 =
diag[r] * vec1[r];
3174 p_work2[c] = x2 =
diag[r] * vec2[r];
3175 vec1[r] = vec2[r] = 0;
3177 if ( x1 != 0.0 && x2 != 0.0 )
3179 val = &cval[cbeg[c]];
3180 idx = &cidx[cbeg[c]];
3185 vec1[*idx] -= x1 * ( *val );
3186 vec2[*idx++] -= x2 * ( *val++ );
3192 val = &cval[cbeg[c]];
3193 idx = &cidx[cbeg[c]];
3197 vec1[*idx++] -= x1 * ( *val++ );
3202 val = &cval[cbeg[c]];
3203 idx = &cidx[cbeg[c]];
3207 vec2[*idx++] -= x2 * ( *val++ );
3214 int* nonz,
Real eps )
3218 int *cidx, *clen, *cbeg;
3219 bool notzero1, notzero2;
3236 for ( i =
thedim - 1; i >= 0; --i )
3240 p_work1[c] = x1 =
diag[r] * vec1[r];
3241 p_work2[c] = x2 =
diag[r] * vec2[r];
3242 vec1[r] = vec2[r] = 0;
3246 if ( notzero1 && notzero2 )
3250 val = &cval[cbeg[c]];
3251 idx = &cidx[cbeg[c]];
3256 vec1[*idx] -= x1 * ( *val );
3257 vec2[*idx++] -= x2 * ( *val++ );
3266 val = &cval[cbeg[c]];
3267 idx = &cidx[cbeg[c]];
3271 vec1[*idx++] -= x1 * ( *val++ );
3277 val = &cval[cbeg[c]];
3278 idx = &cidx[cbeg[c]];
3282 vec2[*idx++] -= x2 * ( *val++ );
3300 int *lrow, *lidx, *idx;
3310 for ( i = 0; i < end; ++i )
3312 if (( x = vec[lrow[i]] ) != 0.0 )
3314 MSG_DEBUG( std::cout <<
"y" << lrow[i] <<
"=" << vec[lrow[i]] << std::endl; )
3320 for ( j = lbeg[i + 1]; j > k; --j )
3322 MSG_DEBUG( std::cout <<
" -> y" << *idx <<
" -= " << x <<
" * " << *val <<
" = " << x * ( *val ) <<
" -> " << vec[*idx] - x * ( *val ) << std::endl; )
3323 vec[*idx++] -= x * ( *val++ );
3330 MSG_DEBUG( std::cout <<
"performing FT updates..." << std::endl; )
3334 for ( ; i < end; ++i )
3341 for ( j = lbeg[i + 1]; j > k; --j )
3342 x += vec[*idx++] * ( *val++ );
3346 MSG_DEBUG( std::cout <<
"y" << lrow[i] <<
"=" << vec[lrow[i]] << std::endl; )
3349 MSG_DEBUG( std::cout <<
"finished FT updates." << std::endl; )
3360 int *lrow, *lidx, *idx;
3370 for ( i = 0; i < end; ++i )
3375 if ( x1 != 0 && x2 != 0.0 )
3381 for ( j = lbeg[i + 1]; j > k; --j )
3383 vec1[*idx] -= x1 * ( *val );
3384 vec2[*idx++] -= x2 * ( *val++ );
3394 for ( j = lbeg[i + 1]; j > k; --j )
3395 vec1[*idx++] -= x1 * ( *val++ );
3404 for ( j = lbeg[i + 1]; j > k; --j )
3405 vec2[*idx++] -= x2 * ( *val++ );
3413 for ( ; i < end; ++i )
3421 for ( j = lbeg[i + 1]; j > k; --j )
3423 x1 += vec1[*idx] * ( *val );
3424 x2 += vec2[*idx++] * ( *val++ );
3427 vec1[lrow[i]] -= x1;
3429 vec2[lrow[i]] -= x2;
3440 int *lrow, *lidx, *idx;
3454 if (( x = vec[lrow[i]] ) != 0.0 )
3460 for ( j = lbeg[i + 1]; j > k; --j )
3461 vec[*idx++] -= x * ( *val++ );
3492 if ( x1 != 0.0 && x2 != 0.0 )
3498 for ( j = lbeg[i + 1]; j > k; --j )
3500 vec1[*idx] -= x1 * ( *val );
3501 vec2[*idx++] -= x2 * ( *val++ );
3511 for ( j = lbeg[i + 1]; j > k; --j )
3512 vec1[*idx++] -= x1 * ( *val++ );
3521 for ( j = lbeg[i + 1]; j > k; --j )
3522 vec2[*idx++] -= x2 * ( *val++ );
3528 Real* rhs,
Real* forest,
int* forestNum,
int* forestIdx )
3536 for (
int i = 0; i <
thedim; i++ )
3540 n += rhs[i] != 0.0 ? 1 : 0;
3581 for (
int i = 0; i <
thedim; i++ )
3584 forest[i] = rhs1[i];
3585 n += rhs1[i] != 0.0 ? 1 : 0;
3621 for (
int i = 0; i <
thedim; ++i )
3644 for (
int m =
u.
row.
start[r]; m < end; m++ )
3660 int *ridx, *rlen, *rbeg, *idx;
3671 for ( i = 0; i <
thedim; ++i )
3678 if (( x1 != 0.0 ) && ( x2 != 0.0 ) )
3688 for (
int m = rlen[r]; m != 0; --m )
3690 vec1[*idx] -= x1 * ( *val );
3691 vec2[*idx] -= x2 * ( *val++ );
3704 for (
int m = rlen[r]; m != 0; --m )
3705 vec1[*idx++] -= x1 * ( *val++ );
3716 for (
int m = rlen[r]; m != 0; --m )
3717 vec2[*idx++] -= x2 * ( *val++ );
3734 int *lidx, *idx, *lrow;
3758 for ( j = lbeg[i + 1]; j > k; --j )
3760 vec1[*idx] -= x1 * ( *val );
3761 vec2[*idx++] -= x2 * ( *val++ );
3770 for ( j = lbeg[i + 1]; j > k; --j )
3771 vec1[*idx++] -= x1 * ( *val++ );
3781 for ( j = lbeg[i + 1]; j > k; --j )
3782 vec2[*idx++] -= x2 * ( *val++ );
3817 for ( ; i >= 0; --i )
3825 for ( j = lbeg[i + 1]; j > k; --j )
3827 x1 += vec1[*idx] * ( *val );
3828 x2 += vec2[*idx++] * ( *val++ );
3831 vec1[lrow[i]] -= x1;
3833 vec2[lrow[i]] -= x2;
3842 x1not0 = ( x1 != 0 );
3843 x2not0 = ( x2 != 0 );
3845 if ( x1not0 && x2not0 )
3848 j = rbeg[r + 1] - k;
3855 vec1[*idx] -= x1 * *val;
3856 vec2[*idx++] -= x2 * *val++;
3863 j = rbeg[r + 1] - k;
3870 vec1[*idx++] -= x1 * *val++;
3877 j = rbeg[r + 1] - k;
3884 vec2[*idx++] -= x2 * *val++;
3897 int *idx, *lidx, *lrow, *lbeg;
3908 if (( x = vec[lrow[i]] ) != 0.0 )
3914 for ( j = lbeg[i + 1]; j > k; --j )
3915 vec[*idx++] -= x * ( *val++ );
3940 for (
int j = lbeg[i + 1]; j > k; --j )
3941 x += vec[*idx++] * ( *val++ );
3947 for (
int i =
thedim - 1; i >= 0; --i )
3954 for (
int k =
l.
rbeg[r]; k <
l.
rbeg[r + 1]; k++ )
3958 assert(
l.
rperm[j] < i );
3960 vec[j] -= x *
l.
rval[k];
3965 #endif // WITH_L_ROWS 3996 for ( j = lbeg[i + 1]; j > k; --j )
3997 x += vec[*idx++] * ( *val++ );
4013 j = rbeg[r + 1] - k;
4020 vec[*idx++] -= x * *val++;
4037 int *lrow, *lidx, *idx;
4056 for ( j = lbeg[i + 1]; j > k; --j )
4057 x += vec[*idx++] * ( *val++ );
4068 int *lrow, *lidx, *idx;
4088 for ( j = lbeg[i + 1]; j > k; --j )
4090 x1 += vec1[*idx] * ( *val );
4091 x2 += vec2[*idx++] * ( *val++ );
4094 vec1[lrow[i]] -= x1;
4096 vec2[lrow[i]] -= x2;
4105 int *lrow, *lidx, *idx;
4120 assert( k >= 0 && k <
l.
size );
4125 for ( j = lbeg[i + 1]; j > k; --j )
4127 assert( *idx >= 0 && *idx <
thedim );
4128 x += vec[*idx++] * ( *val++ );
4216 Real* vec,
int* vecidx,
4217 Real* rhs,
int* rhsidx,
int rhsn )
4220 int i, j, k, n, r, c;
4221 int *rorig, *corig, *cperm;
4222 int *ridx, *rlen, *rbeg, *idx;
4232 for ( i = 0; i < rhsn; )
4248 assert( i >= 0 && i <
thedim );
4250 assert( c >= 0 && c <
thedim );
4257 assert( r >= 0 && r <
thedim );
4262 assert( k >= 0 && k <
u.
row.
size );
4266 for (
int m = rlen[r]; m; --m )
4269 assert( j >= 0 && j <
thedim );
4274 y = -x * ( *val++ );
4284 y -= x * ( *val++ );
4296 Real* rhs,
int* rhsidx,
int rhsn )
4300 int *rorig, *corig, *cperm;
4301 int *ridx, *rlen, *rbeg, *idx;
4311 for ( i = 0; i < rhsn; )
4325 assert( i >= 0 && i <
thedim );
4327 assert( c >= 0 && c <
thedim );
4334 assert( r >= 0 && r <
thedim );
4338 assert( k >= 0 && k <
u.
row.
size );
4342 for (
int m = rlen[r]; m; --m )
4345 assert( j >= 0 && j <
thedim );
4350 y = -x * ( *val++ );
4360 y -= x * ( *val++ );
4374 int *idx, *lidx, *lrow, *lbeg;
4384 assert( i >= 0 && i <
l.
size );
4386 if (( x = vec[lrow[i]] ) != 0.0 )
4389 assert( k >= 0 && k <
l.
size );
4393 for ( j = lbeg[i + 1]; j > k; --j )
4396 assert( m >= 0 && m <
thedim );
4401 y = -x * ( *val++ );
4411 y -= x * ( *val++ );
4427 int *idx, *lidx, *lrow, *lbeg;
4437 if (( x = vec[lrow[i]] ) != 0.0 )
4439 assert( i >= 0 && i <
l.
size );
4441 assert( k >= 0 && k <
l.
size );
4445 for ( j = lbeg[i + 1]; j > k; --j )
4447 assert( *idx >= 0 && *idx <
thedim );
4448 vec[*idx++] -= x * ( *val++ );
4475 #pragma warn "Not yet implemented, define WITH_L_ROWS" 4481 for ( ; i >= 0; --i )
4488 for ( j = lbeg[i + 1]; j > k; --j )
4489 x += vec[*idx++] * ( *val++ );
4497 for ( i = 0; i < rn; )
4513 j = rbeg[r + 1] - k;
4519 assert(
l.
rperm[*idx] < i );
4544 for ( i = 0; i < n; ++i )
4577 for ( ; i >= 0; --i )
4580 assert( k >= 0 && k <
l.
size );
4585 for ( j = lbeg[i + 1]; j > k; --j )
4587 assert( *idx >= 0 && *idx <
thedim );
4588 x += vec[*idx++] * ( *val++ );
4603 j = rbeg[r + 1] - k;
4609 assert(
l.
rperm[*idx] < i );
4610 vec[*idx++] -= x * *val++;
4641 int *lrow, *lidx, *idx;
4652 for( i = 0; i < end; ++i )
4664 for( j = lbeg[i + 1]; j > k; --j )
4666 assert(*idx >= 0 && *idx <
thedim);
4678 for( ; i < end; ++i )
4685 for( j = lbeg[i + 1]; j > k; --j )
4687 assert(*idx >= 0 && *idx <
thedim);
4688 x += vec[*idx++] * ( *val++ );
4702 Real* vec,
int* ridx,
int& rn,
Real eps,
4703 Real* vec2,
int* ridx2,
int& rn2,
Real eps2 )
4709 int *lrow, *lidx, *idx;
4720 for ( i = 0; i < end; ++i )
4736 for( j = lbeg[i + 1]; j > k; --j )
4738 assert(*idx >= 0 && *idx <
thedim);
4748 for( j = lbeg[i + 1]; j > k; --j )
4750 assert(*idx >= 0 && *idx <
thedim);
4764 for( j = lbeg[i + 1]; j > k; --j )
4766 assert(*idx >= 0 && *idx <
thedim);
4778 for( ; i < end; ++i )
4785 for( j = lbeg[i + 1]; j > k; --j )
4787 assert( *idx >= 0 && *idx <
thedim );
4788 x += vec[*idx] * ( *val );
4789 x2 += vec2[*idx++] * ( *val++ );
4806 Real* vec,
int* ridx,
int& rn,
Real eps,
4807 Real* vec2,
int* ridx2,
int& rn2,
Real eps2,
4808 Real* vec3,
int* ridx3,
int& rn3,
Real eps3 )
4814 int *lrow, *lidx, *idx;
4824 for( i = 0; i < end; ++i )
4842 for( j = lbeg[i + 1]; j > k; --j )
4844 assert( *idx >= 0 && *idx <
thedim );
4855 for( j = lbeg[i + 1]; j > k; --j )
4857 assert( *idx >= 0 && *idx <
thedim );
4868 for ( j = lbeg[i + 1]; j > k; --j )
4870 assert( *idx >= 0 && *idx <
thedim );
4880 for ( j = lbeg[i + 1]; j > k; --j )
4882 assert( *idx >= 0 && *idx <
thedim );
4898 for( j = lbeg[i + 1]; j > k; --j )
4900 assert( *idx >= 0 && *idx <
thedim );
4910 for( j = lbeg[i + 1]; j > k; --j )
4912 assert( *idx >= 0 && *idx <
thedim );
4926 for ( j = lbeg[i + 1]; j > k; --j )
4928 assert( *idx >= 0 && *idx <
thedim );
4940 for ( ; i < end; ++i )
4947 for ( j = lbeg[i + 1]; j > k; --j )
4949 assert( *idx >= 0 && *idx <
thedim );
4950 x += vec[*idx] * ( *val );
4951 x2 += vec2[*idx] * ( *val );
4952 x3 += vec3[*idx++] * ( *val++ );
4970 Real* rhs,
int* ridx,
int rn,
Real eps )
4972 int i, j, k, r, c, n;
4975 int *cidx, *clen, *cbeg;
4998 assert( i >= 0 && i <
thedim );
5000 assert( r >= 0 && r <
thedim );
5002 x =
diag[r] * rhs[r];
5008 assert( c >= 0 && c <
thedim );
5011 val = &cval[cbeg[c]];
5012 idx = &cidx[cbeg[c]];
5017 assert( *idx >= 0 && *idx <
thedim );
5019 assert( k >= 0 && k <
thedim );
5024 y = -x * ( *val++ );
5034 y -= x * ( *val++ );
5040 if ( rn > i*verySparseFactor4right )
5042 for ( i = *ridx; i >= 0; --i )
5045 assert( r >= 0 && r <
thedim );
5046 x =
diag[r] * rhs[r];
5052 assert( c >= 0 && c <
thedim );
5055 val = &cval[cbeg[c]];
5056 idx = &cidx[cbeg[c]];
5061 assert( *idx >= 0 && *idx <
thedim );
5062 rhs[*idx++] -= x * ( *val++ );
5077 Real* rhs,
int* ridx,
int rn,
Real eps )
5082 int *cidx, *clen, *cbeg;
5100 if ( rn > *ridx * verySparseFactor4right )
5102 for ( i = *ridx; i >= 0; --i )
5104 assert( i >= 0 && i <
thedim );
5106 assert( r >= 0 && r <
thedim );
5107 x =
diag[r] * rhs[r];
5114 val = &cval[cbeg[c]];
5115 idx = &cidx[cbeg[c]];
5120 assert( *idx >= 0 && *idx <
thedim );
5121 rhs[*idx++] -= x * ( *val++ );
5133 assert( i >= 0 && i <
thedim );
5137 assert( r >= 0 && r <
thedim );
5139 x =
diag[r] * rhs[r];
5147 val = &cval[cbeg[c]];
5148 idx = &cidx[cbeg[c]];
5154 assert( k >= 0 && k <
thedim );
5159 y = -x * ( *val++ );
5169 y -= x * ( *val++ );
5180 Real* vec,
int* vidx,
Real* rhs,
int* ridx,
int rn,
Real eps,
5181 Real* vec2,
Real* rhs2,
int* ridx2,
int rn2,
Real eps2 )
5183 int i, j, k, r, c, n;
5186 int *cidx, *clen, *cbeg;
5205 while ( rn + rn2 > 0 )
5215 if ( *ridx2 > *ridx )
5218 if ( *ridx2 < *ridx )
5226 assert( i >= 0 && i <
thedim );
5229 assert( r >= 0 && r <
thedim );
5231 x =
diag[r] * rhs[r];
5232 x2 =
diag[r] * rhs2[r];
5242 val = &cval[cbeg[c]];
5243 idx = &cidx[cbeg[c]];
5251 assert( k >= 0 && k <
thedim );
5256 y2 = -x2 * ( *val );
5266 y2 -= x2 * ( *val );
5274 y = -x * ( *val++ );
5284 y -= x * ( *val++ );
5295 assert( k >= 0 && k <
thedim );
5300 y = -x * ( *val++ );
5310 y -= x * ( *val++ );
5321 assert( c >= 0 && c <
thedim );
5323 val = &cval[cbeg[c]];
5324 idx = &cidx[cbeg[c]];
5330 assert( k >= 0 && k <
thedim );
5335 y2 = -x2 * ( *val++ );
5345 y2 -= x2 * ( *val++ );
5351 if ( rn + rn2 > i*verySparseFactor4right )
5353 if ( *ridx > *ridx2 )
5358 for ( ; i >= 0; --i )
5362 assert( r >= 0 && r <
thedim );
5363 x =
diag[r] * rhs[r];
5364 x2 =
diag[r] * rhs2[r];
5371 assert( c >= 0 && c <
thedim );
5373 val = &cval[cbeg[c]];
5374 idx = &cidx[cbeg[c]];
5384 assert( *idx >= 0 && *idx <
thedim );
5385 rhs[*idx] -= x * ( *val );
5386 rhs2[*idx++] -= x2 * ( *val++ );
5393 assert( *idx >= 0 && *idx <
thedim );
5394 rhs2[*idx++] -= x2 * ( *val++ );
5402 assert( c >= 0 && c <
thedim );
5405 val = &cval[cbeg[c]];
5406 idx = &cidx[cbeg[c]];
5411 assert( *idx >= 0 && *idx <
thedim );
5412 rhs[*idx++] -= x * ( *val++ );
5430 int *lrow, *lidx, *idx;
5443 assert( i >= 0 && i <
thedim );
5449 assert( k >= 0 && k <
l.
size );
5453 for ( j = lbeg[i + 1]; j > k; --j )
5455 int m = ridx[n] = *idx++;
5456 assert( m >= 0 && m <
thedim );
5458 n += ( y == 0 ) ? 1 : 0;
5459 y = y - x * ( *val++ );
5474 int *lrow, *lidx, *idx;
5487 assert( i >= 0 && i <
thedim );
5489 if (( x = vec[lrow[i]] ) != 0.0 )
5492 assert( k >= 0 && k <
l.
size );
5496 for ( j = lbeg[i + 1]; j > k; --j )
5498 assert( *idx >= 0 && *idx <
thedim );
5499 vec[*idx++] -= x * ( *val++ );
5507 Real* vec,
int* idx,
5508 Real* rhs,
int* ridx,
int rn,
5509 Real* forest,
int* forestNum,
int* forestIdx )
5512 assert(rn >= 0 && rn <=
thedim);
5522 int* it = forestIdx;
5526 for ( i = j = 0; i < rn; ++i )
5529 assert( k >= 0 && k <
thedim );
5541 *forestNum = rn = j;
5551 for ( i = j = 0; i < rn; ++i )
5554 assert( k >= 0 && k <
thedim );
5575 Real* vec,
int* idx,
5576 Real* rhs,
int* ridx,
int rn,
5578 Real* rhs2,
int* ridx2,
int rn2,
5579 Real* forest,
int* forestNum,
int* forestIdx )
5582 assert(rn >= 0 && rn <=
thedim);
5583 assert(rn2 >= 0 && rn2 <=
thedim);
5593 int* it = forestIdx;
5597 for ( i = j = 0; i < rn; ++i )
5600 assert( k >= 0 && k <
thedim );
5612 *forestNum = rn = j;
5622 for ( i = j = 0; i < rn; ++i )
5625 assert( k >= 0 && k <
thedim );
5637 if ( rn2 >
thedim*verySparseFactor4right )
5652 for ( i = j = 0; i < rn2; ++i )
5655 assert( k >= 0 && k <
thedim );
5696 Real* rhs,
int* ridx,
int& rn,
5698 Real* rhs2,
int* ridx2,
int& rn2,
5699 Real* forest,
int* forestNum,
int* forestIdx )
5703 assert(rn >= 0 && rn <=
thedim);
5704 assert(rn2 >= 0 && rn2 <=
thedim);
5713 int* it = forestIdx;
5715 for ( i = j = 0; i < rn; ++i )
5718 assert( k >= 0 && k <
thedim );
5730 *forestNum = rn = j;
5734 for ( i = j = 0; i < rn; ++i )
5737 assert( k >= 0 && k <
thedim );
5749 for ( i = j = 0; i < rn2; ++i )
5752 assert( k >= 0 && k <
thedim );
5765 rn2 =
vSolveUright( vec2, idx2, rhs2, ridx2, rn2, eps2 );
5776 Real* vec,
int* idx,
5777 Real* rhs,
int* ridx,
int rn,
5779 Real* rhs2,
int* ridx2,
int rn2,
5781 Real* rhs3,
int* ridx3,
int rn3,
5782 Real* forest,
int* forestNum,
int* forestIdx )
5785 vSolveLright3(rhs, ridx, rn, eps, rhs2, ridx2, rn2, eps2, rhs3, ridx3, rn3, eps3);
5786 assert(rn >= 0 && rn <=
thedim);
5787 assert(rn2 >= 0 && rn2 <=
thedim);
5788 assert(rn3 >= 0 && rn3 <=
thedim);
5798 int* it = forestIdx;
5802 for ( i = j = 0; i < rn; ++i )
5805 assert( k >= 0 && k <
thedim );
5817 *forestNum = rn = j;
5827 for ( i = j = 0; i < rn; ++i )
5830 assert( k >= 0 && k <
thedim );
5842 if ( rn2 >
thedim*verySparseFactor4right )
5854 for ( i = j = 0; i < rn2; ++i )
5857 assert( k >= 0 && k <
thedim );
5876 if ( rn3 >
thedim*verySparseFactor4right )
5888 for ( i = j = 0; i < rn3; ++i )
5891 assert( k >= 0 && k <
thedim );
5926 Real* rhs,
int* ridx,
int& rn,
5928 Real* rhs2,
int* ridx2,
int& rn2,
5930 Real* rhs3,
int* ridx3,
int& rn3,
5931 Real* forest,
int* forestNum,
int* forestIdx )
5933 vSolveLright3( rhs, ridx, rn, eps, rhs2, ridx2, rn2, eps2, rhs3, ridx3, rn3, eps3 );
5934 assert( rn >= 0 && rn <=
thedim );
5935 assert( rn2 >= 0 && rn2 <=
thedim );
5936 assert( rn3 >= 0 && rn3 <=
thedim );
5945 int* it = forestIdx;
5947 for ( i = j = 0; i < rn; ++i )
5950 assert( k >= 0 && k <
thedim );
5962 *forestNum = rn = j;
5966 for ( i = j = 0; i < rn; ++i )
5969 assert( k >= 0 && k <
thedim );
5981 for ( i = j = 0; i < rn2; ++i )
5984 assert( k >= 0 && k <
thedim );
5995 for ( i = j = 0; i < rn3; ++i )
5998 assert( k >= 0 && k <
thedim );
6010 rn2 =
vSolveUright( vec2, idx2, rhs2, ridx2, rn2, eps2 );
6011 rn3 =
vSolveUright( vec3, idx3, rhs3, ridx3, rn3, eps3 );
6023 Real* rhs,
int* ridx,
int rn )
6026 assert( rn >= 0 && rn <=
thedim );
6028 if ( rn >
thedim*verySparseFactor4right )
6042 for ( i = j = 0; i < rn; ++i )
6045 assert( k >= 0 && k <
thedim );
6075 Real* vec,
int* idx,
6076 Real* rhs,
int* ridx,
int rn )
6082 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6086 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6103 Real* vec,
int* idx,
6104 Real* rhs,
int* ridx,
int rn,
6106 Real* rhs2,
int* ridx2,
int rn2 )
6112 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6118 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6132 Real* vec,
int* idx,
6133 Real* rhs,
int* ridx,
int& rn,
6134 Real* vec2,
int* idx2,
6135 Real* rhs2,
int* ridx2,
int& rn2 )
6140 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6142 rn2 =
solveUleft( eps, vec2, idx2, rhs2, ridx2, rn2 );
6146 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6148 rn2 =
solveUleft( eps, vec2, idx2, rhs2, ridx2, rn2 );
6159 Real* vec,
int* idx,
6160 Real* rhs,
int* ridx,
int rn,
6162 Real* rhs2,
int* ridx2,
int rn2,
6164 Real* rhs3,
int* ridx3,
int rn3 )
6170 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6178 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6195 Real* vec,
int* idx,
6196 Real* rhs,
int* ridx,
int& rn,
6197 Real* vec2,
int* idx2,
6198 Real* rhs2,
int* ridx2,
int& rn2,
6199 Real* vec3,
int* idx3,
6200 Real* rhs3,
int* ridx3,
int& rn3 )
6205 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6207 rn2 =
solveUleft( eps, vec2, idx2, rhs2, ridx2, rn2 );
6209 rn3 =
solveUleft( eps, vec3, idx3, rhs3, ridx3, rn3 );
6213 rn =
solveUleft( eps, vec, idx, rhs, ridx, rn );
6215 rn2 =
solveUleft( eps, vec2, idx2, rhs2, ridx2, rn2 );
6217 rn3 =
solveUleft( eps, vec3, idx3, rhs3, ridx3, rn3 );
6229 Real* rhs2,
int* ridx2,
int rn2 )
void solveUleft(Real *work, Real *vec)
Rational spxAbs(const Rational &r)
Absolute.
int * len
used nonzeros per row vectors
bool isNotZero(Real a, Real eps=Param::epsilon())
returns true iff |a| > eps
void solveLleft(Real *vec) const
int updateType
type of updates to be used.
void solveUpdateRight2(Real *vec1, Real *vec2)
void updateNoClear(int p_col, const Real *p_work, const int *p_idx, int num)
int solveUright2eps(Real *work1, Real *vec1, Real *work2, Real *vec2, int *nonz, Real eps)
void vSolveLright3(Real *vec, int *ridx, int &rn, Real eps, Real *vec2, int *ridx2, int &rn2, Real eps2, Real *vec3, int *ridx3, int &rn3, Real eps3)
int solveRight2update(Real *vec1, Real *vec2, Real *rhs1, Real *rhs2, int *nonz, Real eps, Real *forest, int *forestNum, int *forestIdx)
Dring list
Double linked ringlist of vector indices in the order they appear in the column file.
int * max
maximum available nonzeros per row: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
static const Real verySparseFactor4left
int vSolveRight4update(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *forest, int *forestNum, int *forestIdx)
void forestMinColMem(int size)
Memory allocation routines.
void vSolveRight4update3sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real eps2, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real eps3, Real *vec3, int *idx3, Real *rhs3, int *ridx3, int &rn3, Real *forest, int *forestNum, int *forestIdx)
sparse version of above method
Pring * pivot_rowNZ
lists for rows to number of nonzeros
int size() const
Number of used indices.
struct soplex::CLUFactor::U::Col col
int * start
starting positions in val and idx
int solveLleftForest(Real *vec, int *, Real)
Real * rval
values of rows of L
Exception classes for SoPlex.
#define init2DR(elem, ring)
void solveUleftNoNZ(Real eps, Real *vec, Real *rhs, int *rhsidx, int rhsn)
Real maxabs
maximum abs number in L and U
int vSolveRight4update3(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real eps2, Real *rhs2, int *ridx2, int rn2, Real *vec3, Real eps3, Real *rhs3, int *ridx3, int rn3, Real *forest, int *forestNum, int *forestIdx)
void vSolveLeft3sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real *vec3, int *idx3, Real *rhs3, int *ridx3, int &rn3)
sparse version of solving 3 systems of equations
Real * s_max
maximum absolute value per row (or -1)
static void enQueueMin(int *heap, int *size, int elem)
int size
size of array idx
R & value(int n)
Reference to value of n 'th nonzero.
int * rorig
original row permutation
void update(int p_col, Real *p_work, const int *p_idx, int num)
void solveUright(Real *wrk, Real *vec) const
Dring * elem
Array of ring elements.
void solveLeft(Real *vec, Real *rhs)
#define ASSERT_WARN(prefix, expr)
Macro to turn some assertions into warnings.
Real initMaxabs
maximum abs number in initail Matrix
int mkwtz
markowitz number of pivot
Pring * pivot_col
column index handlers for Real linked list
int vSolveLeft2(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real *rhs2, int *ridx2, int rn2)
Real * diag
Array of pivot elements.
Perm row
row permutation matrices
Dring * elem
Array of ring elements.
Perm col
column permutation matrices
void solveUpdateRight(Real *vec)
int * orig
orig[p] original index from p
int solveRight4update(Real *vec, int *nonz, Real eps, Real *rhs, Real *forest, int *forestNum, int *forestIdx)
void vSolveLright(Real *vec, int *ridx, int &rn, Real eps)
Real lMemMult
factor of minimum Memory * number of nonzeros
void eliminateRowSingletons()
virtual void start()=0
start timer, resume accounting user, system and real time.
Real * work
Working array: must always be left as 0!
void forestUpdate(int col, Real *work, int num, int *nonz)
Performs the Forrest-Tomlin update of the LU factorization.
virtual Real stop()=0
stop timer, return accounted user time.
void spx_alloc(T &p, int n=1)
Allocate memory.
void solveLleftForestNoNZ(Real *vec)
static const Real verySparseFactor4right
int * len
used nonzeros per column vector
#define SOPLEX_FACTOR_MARKER
void solveUpdateLeft2(Real *vec1, Real *vec2)
int & index(int n)
Reference to index of n 'th nonzero.
int solveLleftEps(Real *vec, int *nonz, Real eps)
int size
size of arrays val and idx
void solveUright2(Real *work1, Real *vec1, Real *work2, Real *vec2)
SLinSolver::Status stat
Status indicator.
Pring * pivot_row
row index handlers for Real linked list
#define MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
int used
used entries of arrays idx and val
void solveLright(Real *vec)
void vSolveUpdateRightNoNZ(Real *vec, Real)
int startSize
size of array start
void vSolveLright2(Real *vec, int *ridx, int &rn, Real eps, Real *vec2, int *ridx2, int &rn2, Real eps2)
Pring * pivot_colNZ
lists for columns to number of nonzeros
static Real epsilonUpdate()
int factorCount
Number of factorizations.
Real * val
hold nonzero values: this is only initialized in the end of the factorization with DEFAULT updates...
int stage
stage of the structure
int pos
position of pivot column in row
int firstUnused
number of first unused L vector
Temp temp
Temporary storage.
void setPivot(const int p_stage, const int p_col, const int p_row, const Real val)
void solveUpdateLeft(Real *vec)
void eliminateNucleus(const Real eps, const Real threshold)
void vSolveRight4update2sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real eps2, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real *forest, int *forestNum, int *forestIdx)
sparse version of above method
int thedim
dimension of factorized matrix
struct soplex::CLUFactor::U::Row row
int * start
starting positions in val and idx
Debugging, floating point type and parameter definitions.
int size
size of arrays val and idx
void spx_realloc(T &p, int n)
Change amount of allocated memory.
int * idx
indices of L vectors
void factor(const SVector **vec, Real threshold, Real eps)
epsilon for zero detection
int * perm
perm[i] permuted index from i
bool isConsistent() const
void eliminateColSingletons()
void solveUleft2(Real *work1, Real *vec1, Real *work2, Real *vec2)
Everything should be within this namespace.
void vSolveRightNoNZ(Real *vec, Real eps, Real *rhs, int *ridx, int rn)
void remaxRow(int p_row, int len)
int vSolveLeft(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn)
int solveLleft2forest(Real *vec1, int *, Real *vec2, Real)
void vSolveLeftNoNZ(Real eps, Real *vec, Real *rhs, int *ridx, int rn)
int firstUpdate
number of first update L vector
Pring pivots
ring of selected pivot rows
int vSolveLeft3(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real *rhs2, int *ridx2, int rn2, Real *vec3, Real *rhs3, int *ridx3, int rn3)
Real rowMemMult
factor of minimum Memory * number of nonzeros
void solveLright2(Real *vec1, Real *vec2)
Dring list
Double linked ringlist of vector indices in the order they appear in the row file.
int vSolveRight4update2(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real eps2, Real *rhs2, int *ridx2, int rn2, Real *forest, int *forestNum, int *forestIdx)
Timer * factorTime
Time spent in factorizations.
void clear()
clears the structure
int solveLeft2(Real *vec1, int *nonz, Real *vec2, Real eps, Real *rhs1, Real *rhs2)
void init(int p_dim)
initialization
static int deQueueMax(int *heap, int *size)
int solveLeftEps(Real *vec, Real *rhs, int *nonz, Real eps)
void vSolveUrightNoNZ(Real *vec, Real *rhs, int *ridx, int rn, Real eps)
void forestReMaxCol(int col, int len)
Implementation of sparse LU factorization.
int * idx
hold row indices of nonzeros
int idx
index of pivot row
void eliminatePivot(int prow, int pos, Real eps)
void remaxCol(int p_col, int len)
int * ridx
indices of rows of L
int vSolveUright2(Real *vec, int *vidx, Real *rhs, int *ridx, int rn, Real eps, Real *vec2, Real *rhs2, int *ridx2, int rn2, Real eps2)
Real colMemMult
factor of minimum Memory * number of nonzeros
int updateRow(int r, int lv, int prow, int pcol, Real pval, Real eps)
int vSolveUpdateRight(Real *vec, int *ridx, int n, Real eps)
int * max
maximum available nonzeros per colunn: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
static const Real verySparseFactor
int makeLvec(int p_len, int p_row)
void updateSolutionVectorLright(Real change, int j, Real &vec, int *idx, int &nnz)
int * row
column indices of L vectors
void vSolveLeft2sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2)
sparse version of solving 2 systems of equations
static Real epsilonPivot()
int * rbeg
start of rows in rval and ridx
int * s_cact
lengths of columns of active submatrix
void solveRight(Real *vec, Real *rhs)
void initFactorMatrix(const SVector **vec, const Real eps)
void solveLleft2(Real *vec1, int *, Real *vec2, Real)
static void enQueueMax(int *heap, int *size, int elem)
Exception class for status exceptions during the computationsThis class is derived from the SoPlex ex...
The loaded matrix is singular.
int nzCnt
number of nonzeros in U
void selectPivots(Real threshold)
Real * val
hold nonzero values
bool isZero(Real a, Real eps=Param::epsilon())
returns true iff |a| <= eps
int * rperm
original row permutation
int * start
starting positions in val and idx
int * idx
hold column indices of nonzeros
int used
used entries of array idx
void solveRight2(Real *vec1, Real *vec2, Real *rhs1, Real *rhs2)
int vSolveUright(Real *vec, int *vidx, Real *rhs, int *ridx, int rn, Real eps)
int solveUrightEps(Real *vec, int *nonz, Real eps, Real *rhs)
Real * val
values of L vectors
void spx_free(T &p)
Release memory.
void solveLleftNoNZ(Real *vec)
static int deQueueMin(int *heap, int *size)