Changeset f4016fe in tol
- Timestamp:
- Feb 4, 2009, 7:56:20 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- f4a032f
- Parents:
- 3993889
- File:
-
- 1 edited
-
tol/btol/vmatrix_type/vmat_stats.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/vmatrix_type/vmat_stats.cpp
r3993889 rf4016fe 378 378 ( nrow, ncol, nrow, CHOLMOD_REAL, common_); 379 379 int k; 380 double* x = (double*)dense->x; 381 for(k=0; k<dense->nzmax; k++) 382 { 383 x[k] = xu.Random().Value(); 380 if(dense) 381 { 382 double* x = (double*)dense->x; 383 for(k=0; k<dense->nzmax; k++) 384 { 385 x[k] = xu.Random().Value(); 386 } 384 387 } 385 388 return(dense); … … 398 401 cholmod_triplet* triplet = cholmod_allocate_triplet 399 402 ( nrow, ncol, nzmax, 0, CHOLMOD_REAL, common_); 400 int k; 401 int* i = (int*)triplet->i; 402 int* j = (int*)triplet->j; 403 double* x = (double*)triplet->x; 404 for(k=0; k<nzmax; k++) 405 { 406 p.r_ = (int)::Round(iu.Random()).Value(); 407 p.c_ = (int)::Round(ju.Random()).Value(); 408 //BHashPairs::const_iterator fc = hashPairs.find(p); 409 //if(fc==hashPairs.end()) 410 { 411 i[k] = p.r_; 412 j[k] = p.c_; 413 x[k] = dist.Random().Value(); 414 if(x[k]!=0.0) 415 { 416 triplet->nnz++; 417 //hashPairs[p] = x[k]; 403 if(triplet) 404 { 405 int k; 406 int* i = (int*)triplet->i; 407 int* j = (int*)triplet->j; 408 double* x = (double*)triplet->x; 409 for(k=0; k<nzmax; k++) 410 { 411 p.r_ = (int)::Round(iu.Random()).Value(); 412 p.c_ = (int)::Round(ju.Random()).Value(); 413 //BHashPairs::const_iterator fc = hashPairs.find(p); 414 //if(fc==hashPairs.end()) 415 { 416 i[k] = p.r_; 417 j[k] = p.c_; 418 x[k] = dist.Random().Value(); 419 if(x[k]!=0.0) 420 { 421 triplet->nnz++; 422 //hashPairs[p] = x[k]; 423 } 418 424 } 419 425 }
Note: See TracChangeset
for help on using the changeset viewer.
