Replies: 2 comments
-
Have written these methods and will have these methods available in a branch in less than 2 weeks. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is now available on my latest branch RowAndColAddOns: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
SORTING AND SHUFFLING:
SortByColumn -- similar to excel sort
SortByRow
ShuffleRows --puts rowvectors in a matrix in a random order
ShuffleColumns --puts columnvectos in a matrix in a random order.
FINDING AND SETTING SPECIFIC ELEMENTS:
FindMask(Predicate matchCondition) find a mask matrix of 0's and 1's where matchCondition is true.
OnMaskSet(Matrix mask, T value)
OnMaskApply(Matrix mask, Func<T, T> func) can apply a functin to all elements of a Mask Matrix.
e.g. in other languages:
A= Find(myMatrix<0)
myMatrix(A)=0;
//find elemets less than 0
var lessthanZero= myMatrix.FindMask(elem => (elem < 0.0))
// set them all to 0
myMatrix.OnMaskSet(lessthanZero, 0.0)
// a similar method:
FindIndices(Predicate matchCondition)
REMOVING AND SETTING SPECIFIC ROW AND COLUM RANGES:
RemoveColumn
RemoveRow
RemoveRowandColumn
SelectColumns ..selects all rows from a specified range of columns e.g. Matrix(:,10:12) would be selectColumns(10,3)
SelectRows ..selects all rows from a specified range of Rows e.g. Matrix(10:12,:) would be selectRows(10,3)
SetColumns
SetRows
Beta Was this translation helpful? Give feedback.
All reactions