Changeset bf5e53b in tol
- Timestamp:
- Dec 11, 2009, 9:41:52 AM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- a1affcf
- Parents:
- e571dbe
- File:
-
- 1 edited
-
tol_pkg/MatQuery/MatQuery.tol (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol_pkg/MatQuery/MatQuery.tol
re571dbe rbf5e53b 213 213 }); 214 214 class 215 })} 216 217 215 })}; 216 217 ////////////////////////////////////////////////////////////////////////////// 218 Text _.autodoc.member.SortAndCount = "Sorts the rows of a column matrix and " 219 "returns a matrix with two columns. The first one contains sorted unique " 220 "values found in given matrixand second one conatins the number of times " 221 "that this value is presented."; 222 VMatrix SortAndCount(VMatrix A) 223 ////////////////////////////////////////////////////////////////////////////// 224 { 225 Matrix B = VMat2Mat(A); 226 VMatrix C = Mat2VMat(PivotByRows(B,Sort(B,[[1]]))); 227 Real m = VRows(C); 228 Set change = Col2Set(Sort(VMat2Mat(C),[[1]],True)); 229 Set next = ExtractByIndex(change,Range(2,Card(change),1))<<[[Real m+1]]; 230 VMatrix aux.1 = DifEq(1/(1-B),Rand(m+1,1,1,1)); 231 VMatrix aux.2 = SubRow(aux.1,change); 232 VMatrix aux.3 = SubRow(aux.1,next); 233 SubRow(C,change) | (aux.3-aux.2) 234 } 218 235 219 236 ]];
Note: See TracChangeset
for help on using the changeset viewer.
