Changeset aad4ca4 in git for Singular/svd/bidiagonal.h
- Timestamp:
- Dec 6, 2017, 7:05:25 PM (6 years ago)
- Branches:
- (u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
- Children:
- 06b3e84d21e073249ada6d3b863bb3b8ce91d3be
- Parents:
- 3803c6a39fad57f9a8e12942b2928c215504e027
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/svd/bidiagonal.h
r3803c6 raad4ca4 207 207 208 208 209 209 210 210 // 211 211 // Prepare … … 231 231 if( m>=n ) 232 232 { 233 233 234 234 // 235 235 // Reduce to upper bidiagonal form … … 237 237 for(i=0; i<=n-1; i++) 238 238 { 239 239 240 240 // 241 241 // Generate elementary reflector H(i) to annihilate A(i+1:m-1,i) … … 246 246 ap::vmove(a.getcolumn(i, i, m-1), t.getvector(1, m-i)); 247 247 t(1) = 1; 248 248 249 249 // 250 250 // Apply H(i) to A(i:m-1,i+1:n-1) from the left … … 253 253 if( i<n-1 ) 254 254 { 255 255 256 256 // 257 257 // Generate elementary reflector G(i) to annihilate … … 263 263 ap::vmove(a.getrow(i, i+1, n-1), t.getvector(1, n-1-i)); 264 264 t(1) = 1; 265 265 266 266 // 267 267 // Apply G(i) to A(i+1:m-1,i+1:n-1) from the right … … 277 277 else 278 278 { 279 279 280 280 // 281 281 // Reduce to lower bidiagonal form … … 283 283 for(i=0; i<=m-1; i++) 284 284 { 285 285 286 286 // 287 287 // Generate elementary reflector G(i) to annihilate A(i,i+1:n-1) … … 292 292 ap::vmove(a.getrow(i, i, n-1), t.getvector(1, n-i)); 293 293 t(1) = 1; 294 294 295 295 // 296 296 // Apply G(i) to A(i+1:m-1,i:n-1) from the right … … 299 299 if( i<m-1 ) 300 300 { 301 301 302 302 // 303 303 // Generate elementary reflector H(i) to annihilate … … 309 309 ap::vmove(a.getcolumn(i, i+1, m-1), t.getvector(1, m-1-i)); 310 310 t(1) = 1; 311 311 312 312 // 313 313 // Apply H(i) to A(i+1:m-1,i+1:n-1) from the left … … 363 363 return; 364 364 } 365 365 366 366 // 367 367 // prepare Q … … 382 382 } 383 383 } 384 384 385 385 // 386 386 // Calculate … … 444 444 } 445 445 ap::ap_error::make_assertion(fromtheright && zcolumns==m || !fromtheright && zrows==m); 446 446 447 447 // 448 448 // init … … 455 455 if( m>=n ) 456 456 { 457 457 458 458 // 459 459 // setup … … 478 478 istep = -istep; 479 479 } 480 480 481 481 // 482 482 // Process … … 501 501 else 502 502 { 503 503 504 504 // 505 505 // setup … … 524 524 istep = -istep; 525 525 } 526 526 527 527 // 528 528 // Process … … 590 590 return; 591 591 } 592 592 593 593 // 594 594 // prepare PT … … 609 609 } 610 610 } 611 611 612 612 // 613 613 // Calculate … … 671 671 } 672 672 ap::ap_error::make_assertion(fromtheright && zcolumns==n || !fromtheright && zrows==n); 673 673 674 674 // 675 675 // init … … 684 684 if( m>=n ) 685 685 { 686 686 687 687 // 688 688 // setup … … 707 707 istep = -istep; 708 708 } 709 709 710 710 // 711 711 // Process … … 733 733 else 734 734 { 735 735 736 736 // 737 737 // setup … … 756 756 istep = -istep; 757 757 } 758 758 759 759 // 760 760 // Process … … 875 875 if( m>=n ) 876 876 { 877 877 878 878 // 879 879 // Reduce to upper bidiagonal form … … 881 881 for(i=1; i<=n; i++) 882 882 { 883 883 884 884 // 885 885 // Generate elementary reflector H(i) to annihilate A(i+1:m,i) … … 891 891 ap::vmove(a.getcolumn(i, i, m), t.getvector(1, mmip1)); 892 892 t(1) = 1; 893 893 894 894 // 895 895 // Apply H(i) to A(i:m,i+1:n) from the left … … 898 898 if( i<n ) 899 899 { 900 900 901 901 // 902 902 // Generate elementary reflector G(i) to annihilate … … 910 910 ap::vmove(a.getrow(i, ip1, n), t.getvector(1, nmi)); 911 911 t(1) = 1; 912 912 913 913 // 914 914 // Apply G(i) to A(i+1:m,i+1:n) from the right … … 924 924 else 925 925 { 926 926 927 927 // 928 928 // Reduce to lower bidiagonal form … … 930 930 for(i=1; i<=m; i++) 931 931 { 932 932 933 933 // 934 934 // Generate elementary reflector G(i) to annihilate A(i,i+1:n) … … 940 940 ap::vmove(a.getrow(i, i, n), t.getvector(1, nmip1)); 941 941 t(1) = 1; 942 942 943 943 // 944 944 // Apply G(i) to A(i+1:m,i:n) from the right … … 947 947 if( i<m ) 948 948 { 949 949 950 950 // 951 951 // Generate elementary reflector H(i) to annihilate … … 959 959 ap::vmove(a.getcolumn(i, ip1, m), t.getvector(1, mmi)); 960 960 t(1) = 1; 961 961 962 962 // 963 963 // Apply H(i) to A(i+1:m,i+1:n) from the left … … 999 999 return; 1000 1000 } 1001 1001 1002 1002 // 1003 1003 // init … … 1006 1006 v.setbounds(1, m); 1007 1007 work.setbounds(1, qcolumns); 1008 1008 1009 1009 // 1010 1010 // prepare Q … … 1079 1079 } 1080 1080 ap::ap_error::make_assertion(fromtheright && zcolumns==m || !fromtheright && zrows==m); 1081 1081 1082 1082 // 1083 1083 // init … … 1090 1090 if( m>=n ) 1091 1091 { 1092 1092 1093 1093 // 1094 1094 // setup … … 1113 1113 istep = -istep; 1114 1114 } 1115 1115 1116 1116 // 1117 1117 // Process … … 1137 1137 else 1138 1138 { 1139 1139 1140 1140 // 1141 1141 // setup … … 1160 1160 istep = -istep; 1161 1161 } 1162 1162 1163 1163 // 1164 1164 // Process … … 1214 1214 return; 1215 1215 } 1216 1216 1217 1217 // 1218 1218 // init … … 1221 1221 v.setbounds(1, n); 1222 1222 work.setbounds(1, ptrows); 1223 1223 1224 1224 // 1225 1225 // prepare PT … … 1294 1294 } 1295 1295 ap::ap_error::make_assertion(fromtheright && zcolumns==n || !fromtheright && zrows==n); 1296 1296 1297 1297 // 1298 1298 // init … … 1307 1307 if( m>=n ) 1308 1308 { 1309 1309 1310 1310 // 1311 1311 // setup … … 1330 1330 istep = -istep; 1331 1331 } 1332 1332 1333 1333 // 1334 1334 // Process … … 1358 1358 else 1359 1359 { 1360 1360 1361 1361 // 1362 1362 // setup … … 1381 1381 istep = -istep; 1382 1382 } 1383 1383 1384 1384 // 1385 1385 // Process
Note: See TracChangeset
for help on using the changeset viewer.