Skip to content

Commit de94981

Browse files
committed
add docs to weight function
1 parent 0846492 commit de94981

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/NetMSA.jl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ end
5454

5555

5656
"""
57-
getposition(value::T, rowindex::Int64, matrix::Matrix{T}) where (T)
57+
getposition(value, rowindex, matrix)
5858
5959
Return the Position (rowindex, [colindex1, colindex2, ...]) of the Particle
6060
represented by `value`, at the `rowindex` in the `matrix`.
@@ -76,7 +76,7 @@ julia> M = createPeerMatrix(["abcbcdem", "acbcfg", "abchimn", "abcbcjkm"])
7676
NetMSA.Position(2, [1, 3, 4])
7777
```
7878
"""
79-
function getposition(value::T, rowindex::Int64, matrix::Matrix{T}) where (T)
79+
function getposition(value, rowindex, matrix)
8080
indexes = findall(i -> i == value, skipmissing(matrix[rowindex, :]))
8181
return Position(rowindex, indexes);
8282
end
@@ -181,6 +181,10 @@ end
181181
182182
Return the weight of the row, calculated as:
183183
184+
```math
185+
\frac{n!}{k!(n - k)!} = \binom{n}{k}
186+
```
187+
184188
```math
185189
w(r) = \\begin{gather*}
186190
\\begin{cases}
@@ -219,7 +223,7 @@ function weight(row; w1=0.25, w2=0.5, w3=1.0)
219223
if full(row)
220224
return w3;
221225
end
222-
226+
223227
c = length(row);
224228
max = mostfrequent(row)[1];
225229

0 commit comments

Comments
 (0)