-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PageRank #88
PageRank #88
Changes from 1 commit
faf242c
b278b7a
ebdb250
6f3819b
1ed601c
858cd82
0826562
b82fe68
c8f3042
0ab7361
97b6db4
f671a2e
6de410f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -173,3 +173,36 @@ type ClMatrix<'a when 'a: struct> = | |
| ClMatrix.COO matrix -> matrix.NNZ | ||
| ClMatrix.CSC matrix -> matrix.NNZ | ||
| ClMatrix.LIL matrix -> matrix.NNZ | ||
|
||
/// <summary> | ||
/// Represents an abstraction over matrix, which is converted to correct format for PageRank algorithm | ||
/// </summary> | ||
type PageRankMatrix<'a when 'a: struct> = | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great. But it needs to be even stronger. Abstract types are needed here. Like here in the first example. https://okmij.org/ftp/Computation/lightweight-static-guarantees.html I was told that this can be done using signatures. The idea is that we should not allow anyone to use this type unless they have passed some kind of verification. It seems to me that this also applies to disjoint matrices, @artemiipatov . Of course, this can be disabled during benchmarking. In the same way, we will add another functional and at the same time zero abstraction. This is exactly what is needed on FHPNC There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Signatures are not working? |
||
| PageRankMatrix of ClMatrix<'a> | ||
/// <summary> | ||
/// Gets the number of rows in matrix. | ||
/// </summary> | ||
member this.RowCount = | ||
match this with | ||
| PageRankMatrix matrix -> matrix.RowCount | ||
|
||
/// <summary> | ||
/// Gets the number of columns in matrix. | ||
/// </summary> | ||
member this.ColumnCount = | ||
match this with | ||
| PageRankMatrix matrix -> matrix.ColumnCount | ||
|
||
/// <summary> | ||
/// Release device resources allocated for the matrix. | ||
/// </summary> | ||
member this.Dispose q = | ||
match this with | ||
| PageRankMatrix matrix -> matrix.Dispose q | ||
|
||
/// <summary> | ||
/// Gets the number of non-zero elements in matrix. | ||
/// </summary> | ||
member this.NNZ = | ||
match this with | ||
| PageRankMatrix matrix -> matrix.NNZ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are predefined constants in Expecto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, why is it necessary separately? Perhaps we need to create a module with constants and actions on them in order to avoid mistakes in the future?
Abstract types could also be used here, so that they could be used only with the help of this most magical module.