Changeset 98e52e6 in tol
- Timestamp:
- Jan 22, 2009, 9:35:23 AM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 59bbd54
- Parents:
- 7a01db8
- File:
-
- 1 edited
-
tol/btol/vmatrix_type/vmat_convert.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/vmatrix_type/vmat_convert.cpp
r7a01db8 r98e52e6 741 741 } 742 742 bool lower = diag<=0; 743 int k, n = isCol?v.Rows():v.Columns();743 int i, k, n = isCol?v.Rows():v.Columns(); 744 744 if(lower) 745 745 { … … 757 757 int* c_ = (int*) triplet->j; 758 758 double* x_ = (double*)triplet->x; 759 for(k=0; k<n; k++) 760 { 761 r_[k] = lower?k-diag:k; 762 c_[k] = lower?k:k+diag; 763 x_[k] = isCol?v.GetCell(k,0):v.GetCell(0,k); 764 if(x_[k]!=0.0) { triplet->nnz++; } 759 760 for(i=k=0; k<n; k++) 761 { 762 r_[i] = lower?k-diag:k; 763 c_[i] = lower?k:k+diag; 764 x_[i] = isCol?v.GetCell(k,0):v.GetCell(0,k); 765 if(x_[i]!=0.0) { triplet->nnz++; i++; } 765 766 } 766 767 code_ = ESC_chlmRsparse; … … 794 795 cholmod_triplet* triplet = cholmod_allocate_triplet 795 796 (nrow,ncol,n,0,CHOLMOD_REAL,common_); 796 int* r_ = (int*) triplet->i; 797 int* c_ = (int*) triplet->j; 798 double* x_ = (double*)triplet->x; 799 for(k=0; k<n; k++) 800 { 801 r_[k] = lower?k-diag:k; 802 c_[k] = lower?k:k+diag; 803 x_[k] = x; 804 triplet->nnz += (x!=0.0); 797 if(x!=0.0) 798 { 799 int* r_ = (int*) triplet->i; 800 int* c_ = (int*) triplet->j; 801 double* x_ = (double*)triplet->x; 802 for(k=0; k<n; k++) 803 { 804 r_[k] = lower?k-diag:k; 805 c_[k] = lower?k:k+diag; 806 x_[k] = x; 807 } 808 triplet->nnz = n; 805 809 } 806 810 code_ = ESC_chlmRsparse;
Note: See TracChangeset
for help on using the changeset viewer.
