Changeset 2b448e9 in tol
- Timestamp:
- Mar 9, 2009, 8:57:02 AM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 516e91c
- Parents:
- d11b5b0
- File:
-
- 1 edited
-
tol/btol/vmatrix_type/vmat_arith.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/btol/vmatrix_type/vmat_arith.cpp
rd11b5b0 r2b448e9 67 67 DefineMonary (ACosH, fRR_acosh, false, "ACosH"); 68 68 DefineMonary (ATanH, fRR_atanh, true, "ATanH"); 69 DefineBinaryR(Drop, fR2R_drop, true, "Drop");70 69 DefineBinaryR(Sum, fR2R_sum, true, "+ Real"); 71 70 DefineBinaryR(Rest, fR2R_rest, true, "- Real"); … … 137 136 }; 138 137 138 139 //////////////////////////////////////////////////////////////////////////////// 140 int BVMat::Drop(double drop) 141 //Importing method 142 //////////////////////////////////////////////////////////////////////////////// 143 { 144 int r, c, k, result=0; 145 double* x; 146 switch(code_) { 147 case(ESC_blasRdense ) : 148 { 149 r = s_.blasRdense_->nrow; 150 c = s_.blasRdense_->ncol; 151 x = (double*)(s_.blasRdense_->x); 152 for (k=0; k<r*c; k++) 153 { 154 if(fabs(*x)<=drop) { *x = 0.0; } 155 } 156 break; 157 } 158 case(ESC_chlmRsparse ) : 159 { 160 cholmod_drop(drop,s_.chlmRsparse_, common_); 161 cholmod_sort(s_.chlmRsparse_, common_); 162 break; 163 } 164 case(ESC_chlmRtriplet) : 165 { 166 BVMat sprs; 167 cRt2cRs(*this,sprs); 168 cholmod_drop(drop,sprs.s_.chlmRsparse_, common_); 169 cholmod_sort(sprs.s_.chlmRsparse_, common_); 170 cRs2cRt(sprs,*this); 171 break; 172 } 173 default: 174 err_invalid_subtype("Drop",*this); 175 result = -1; } 176 return(result); 177 }; 178 179 //////////////////////////////////////////////////////////////////////////////// 180 BVMat BVMat::Drop(const BVMat& A, double drop) 181 //////////////////////////////////////////////////////////////////////////////// 182 { 183 BVMat v; 184 v.Copy(A); 185 v.Drop(drop); 186 return(v); 187 } 139 188 140 189 ////////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.
