Skip to content

Commit e5c9ed5

Browse files
authored
Merge pull request #8 from dpanfilyonok/simple-bfs-benchmark
Update interface with OpenCLEvaluation
2 parents 0f7f9e1 + 53a9104 commit e5c9ed5

15 files changed

Lines changed: 231 additions & 243 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@
99
<Authors>YaccConstructor</Authors>
1010
<RepositoryUrl>https://github.com/YaccConstructor/GraphBLAS-sharp</RepositoryUrl>
1111
<!-- owners is not supported in MSBuild -->
12+
<DisableFody>true</DisableFody>
1213
</PropertyGroup>
1314
</Project>

paket.dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ nuget System.CodeDom 4.7.0
1818
nuget FSharp.Quotations.Evaluator 2.1.0
1919
nuget FSharpx.Collections 2.1.3
2020
nuget FSharpx.Text.StructuredFormat 2.3.0
21-
nuget Brahma.FSharp.OpenCL.WorkflowBuilder
21+
nuget Brahma.FSharp.OpenCL.WorkflowBuilder 2.0.0-alpha4
2222
nuget BenchmarkDotNet
2323
nuget MathNet.Numerics.FSharp
2424

paket.lock

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,34 @@ NUGET
2222
System.Threading.Tasks.Extensions (>= 4.5.2) - restriction: >= netstandard2.0
2323
System.ValueTuple (>= 4.5) - restriction: >= netstandard2.0
2424
BenchmarkDotNet.Annotations (0.12.1) - restriction: >= netstandard2.0
25-
Brahma.FSharp (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
26-
Brahma.FSharp.OpenCL.Printer (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
27-
Brahma.FSharp.OpenCL.Translator (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
25+
Brahma.FSharp (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
26+
Brahma.FSharp.OpenCL.Printer (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
27+
Brahma.FSharp.OpenCL.Translator (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
2828
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
2929
FSharp.Quotations.Evaluator (>= 2.1) - restriction: || (>= net461) (>= netstandard2.1)
30-
YC.Brahma (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
31-
YC.Brahma.OpenCL (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
32-
YC.OpenCL.NET (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
33-
Brahma.FSharp.OpenCL.AST (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
30+
YC.Brahma (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
31+
YC.Brahma.OpenCL (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
32+
YC.OpenCL.NET (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
33+
Brahma.FSharp.OpenCL.AST (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
3434
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
35-
Brahma.FSharp.OpenCL.Extensions (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
35+
Brahma.FSharp.OpenCL.Extensions (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
3636
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
37-
YC.Brahma.OpenCL (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
38-
YC.OpenCL.NET (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
39-
Brahma.FSharp.OpenCL.Printer (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
40-
Brahma.FSharp.OpenCL.AST (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
41-
Brahma.FSharp.OpenCL.Translator (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
37+
YC.Brahma.OpenCL (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
38+
YC.OpenCL.NET (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
39+
Brahma.FSharp.OpenCL.Printer (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
40+
Brahma.FSharp.OpenCL.AST (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
41+
Brahma.FSharp.OpenCL.Translator (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
4242
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
4343
FSharpx.Collections (>= 2.1.3) - restriction: || (>= net461) (>= netstandard2.1)
4444
FSharpx.Text.StructuredFormat (>= 2.3) - restriction: || (>= net461) (>= netstandard2.1)
45-
Brahma.FSharp.OpenCL.Translator (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
46-
Brahma.FSharp.OpenCL.AST (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
47-
Brahma.FSharp.OpenCL.Extensions (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
45+
Brahma.FSharp.OpenCL.Translator (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
46+
Brahma.FSharp.OpenCL.AST (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
47+
Brahma.FSharp.OpenCL.Extensions (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
4848
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
4949
FSharpx.Collections (>= 2.1.3) - restriction: || (>= net461) (>= netstandard2.1)
50-
Brahma.FSharp.OpenCL.WorkflowBuilder (2.0.0-alpha3)
51-
Brahma.FSharp (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
52-
Brahma.FSharp.OpenCL.Extensions (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
50+
Brahma.FSharp.OpenCL.WorkflowBuilder (2.0.0-alpha4)
51+
Brahma.FSharp (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
52+
Brahma.FSharp.OpenCL.Extensions (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
5353
FSharp.Core (>= 4.3.4) - restriction: || (>= net461) (>= netstandard2.1)
5454
Chessie (0.6) - restriction: >= netcoreapp1.0
5555
FSharp.Core (>= 4.0.1.7-alpha) - restriction: >= netstandard1.6
@@ -521,7 +521,6 @@ NUGET
521521
System.Runtime.InteropServices (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net45) (>= netstandard1.1) (< netstandard2.0) (< win8) (< wpa81) (< xamarintvos) (< xamarinwatchos)
522522
System.Net.Http (4.3.4) - restriction: || (&& (< net45) (>= net46) (< netstandard1.4) (>= netstandard1.6)) (&& (< net45) (< netstandard1.2) (>= netstandard1.6) (< win8)) (&& (< net45) (< netstandard1.3) (>= netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.4) (>= netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (< netstandard1.5) (>= netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.6) (< netstandard2.0) (< win8) (< wpa81)) (&& (>= netcoreapp5.0) (< netstandard2.0)) (&& (< netstandard1.5) (>= netstandard1.6) (>= uap10.0))
523523
Microsoft.NETCore.Platforms (>= 1.1.1) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)) (>= netcoreapp5.0)
524-
Microsoft.Win32.Primitives (>= 4.3) - restriction: && (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)
525524
runtime.native.System (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net45) (< netcoreapp5.0) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
526525
runtime.native.System.Net.Http (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net45) (< netcoreapp5.0) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
527526
runtime.native.System.Security.Cryptography.OpenSsl (>= 4.3.2) - restriction: && (< monoandroid) (< monotouch) (< net45) (< netcoreapp5.0) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
@@ -532,7 +531,6 @@ NUGET
532531
System.Globalization (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)) (>= netcoreapp5.0)
533532
System.Globalization.Extensions (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net45) (< netcoreapp5.0) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
534533
System.IO (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.1) (< netstandard1.3) (< win8) (< wpa81)) (&& (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)) (>= netcoreapp5.0)
535-
System.IO.Compression (>= 4.3) - restriction: && (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)
536534
System.IO.FileSystem (>= 4.3) - restriction: && (< monoandroid) (< monotouch) (< net45) (< netcoreapp5.0) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)
537535
System.Net.Primitives (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.1) (< netstandard1.3) (< win8) (< wpa81)) (&& (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)) (>= netcoreapp5.0)
538536
System.Resources.ResourceManager (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.6) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.3) (< netstandard1.6) (< win8) (< wpa81)) (>= netcoreapp5.0)
@@ -921,11 +919,11 @@ NUGET
921919
System.Threading (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.3) (< win8) (< wpa81) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (>= netcoreapp5.0)
922920
System.Xml.ReaderWriter (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.3) (< win8) (< wpa81) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< net45) (>= netstandard1.0) (< netstandard1.3) (< win8) (< wp8) (< wpa81)) (>= netcoreapp5.0)
923921
System.Xml.XmlDocument (>= 4.3) - restriction: || (&& (< monoandroid) (< monotouch) (< net45) (>= netstandard1.3) (< win8) (< wpa81) (< xamarinios) (< xamarinmac) (< xamarintvos) (< xamarinwatchos)) (>= netcoreapp5.0)
924-
YC.Brahma (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
925-
YC.Brahma.OpenCL (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
926-
YC.Brahma (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
927-
YC.OpenCL.NET (>= 2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
928-
YC.OpenCL.NET (2.0.0-alpha3) - restriction: || (>= net461) (>= netstandard2.1)
922+
YC.Brahma (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
923+
YC.Brahma.OpenCL (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
924+
YC.Brahma (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
925+
YC.OpenCL.NET (>= 2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
926+
YC.OpenCL.NET (2.0.0-alpha4) - restriction: || (>= net461) (>= netstandard2.1)
929927
ExtraConstraints.Fody (>= 1.14) - restriction: >= netstandard2.0
930928
Microsoft.Build.Framework (>= 16.6) - restriction: >= netstandard2.0
931929
System.CodeDom (>= 4.7) - restriction: >= netstandard2.0

src/GraphBLAS-sharp/Abstracts.fs

Lines changed: 58 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,89 @@
11
namespace GraphBLAS.FSharp
22

3+
open Brahma.FSharp.OpenCL.WorkflowBuilder.Evaluation
4+
35
[<AbstractClass>]
46
type Matrix<'a when 'a : struct and 'a : equality>(nrow: int, ncol: int) =
57
abstract RowCount: int
68
abstract ColumnCount: int
79
default this.RowCount = nrow
810
default this.ColumnCount = ncol
911

10-
abstract Mask: Mask2D option
11-
abstract Complemented: Mask2D option
12-
13-
abstract Item: Mask2D option -> Matrix<'a> with get, set
14-
abstract Item: Mask1D option * int -> Vector<'a> with get, set
15-
abstract Item: int * Mask1D option -> Vector<'a> with get, set
16-
abstract Item: int * int -> Scalar<'a> with get, set
17-
abstract Fill: Mask2D option -> Scalar<'a> with set
18-
abstract Fill: Mask1D option * int -> Scalar<'a> with set
19-
abstract Fill: int * Mask1D option -> Scalar<'a> with set
20-
21-
abstract Mxm: Matrix<'a> -> Mask2D option -> Semiring<'a> -> Matrix<'a>
22-
abstract Mxv: Vector<'a> -> Mask1D option -> Semiring<'a> -> Vector<'a>
23-
abstract EWiseAdd: Matrix<'a> -> Mask2D option -> Monoid<'a> -> Matrix<'a>
24-
abstract EWiseMult: Matrix<'a> -> Mask2D option -> Monoid<'a> -> Matrix<'a>
25-
abstract Apply: Mask1D option -> UnaryOp<'a, 'b> -> Matrix<'b>
26-
abstract ReduceIn: Mask1D option -> Monoid<'a> -> Vector<'a>
27-
abstract ReduceOut: Mask1D option -> Monoid<'a> -> Vector<'a>
28-
abstract Reduce: Monoid<'a> -> Scalar<'a>
29-
abstract T: Matrix<'a>
12+
abstract Clear: unit -> OpenCLEvaluation<unit>
13+
abstract Copy: unit -> OpenCLEvaluation<Matrix<'a>>
14+
abstract Resize: int -> int -> OpenCLEvaluation<Matrix<'a>>
15+
abstract GetNNZ: unit -> OpenCLEvaluation<int>
16+
abstract GetTuples: unit -> OpenCLEvaluation<{| Rows: int[]; Columns: int[]; Values: 'a[] |}>
17+
abstract GetMask: ?isComplemented: bool -> OpenCLEvaluation<Mask2D option>
18+
19+
abstract Extract: Mask2D option -> OpenCLEvaluation<Matrix<'a>>
20+
abstract Extract: (Mask1D option * int) -> OpenCLEvaluation<Vector<'a>>
21+
abstract Extract: (int * Mask1D option) -> OpenCLEvaluation<Vector<'a>>
22+
abstract Extract: (int * int) -> OpenCLEvaluation<Scalar<'a>>
23+
abstract Assign: Mask2D option * Matrix<'a> -> OpenCLEvaluation<unit>
24+
abstract Assign: (Mask1D option * int) * Vector<'a> -> OpenCLEvaluation<unit>
25+
abstract Assign: (int * Mask1D option) * Vector<'a> -> OpenCLEvaluation<unit>
26+
abstract Assign: (int * int) * Scalar<'a> -> OpenCLEvaluation<unit>
27+
abstract Assign: Mask2D option * Scalar<'a> -> OpenCLEvaluation<unit>
28+
abstract Assign: (Mask1D option * int) * Scalar<'a> -> OpenCLEvaluation<unit>
29+
abstract Assign: (int * Mask1D option) * Scalar<'a> -> OpenCLEvaluation<unit>
30+
31+
abstract Mxm: Matrix<'a> -> Mask2D option -> Semiring<'a> -> OpenCLEvaluation<Matrix<'a>>
32+
abstract Mxv: Vector<'a> -> Mask1D option -> Semiring<'a> -> OpenCLEvaluation<Vector<'a>>
33+
abstract EWiseAdd: Matrix<'a> -> Mask2D option -> Semiring<'a> -> OpenCLEvaluation<Matrix<'a>>
34+
abstract EWiseMult: Matrix<'a> -> Mask2D option -> Semiring<'a> -> OpenCLEvaluation<Matrix<'a>>
35+
abstract Apply: Mask2D option -> UnaryOp<'a, 'b> -> OpenCLEvaluation<Matrix<'b>>
36+
abstract Prune: Mask2D option -> UnaryOp<'a, bool> -> OpenCLEvaluation<Matrix<'a>>
37+
abstract ReduceIn: Mask1D option -> Monoid<'a> -> OpenCLEvaluation<Vector<'a>>
38+
abstract ReduceOut: Mask1D option -> Monoid<'a> -> OpenCLEvaluation<Vector<'a>>
39+
abstract Reduce: Monoid<'a> -> OpenCLEvaluation<Scalar<'a>>
40+
abstract Transpose: unit -> OpenCLEvaluation<Matrix<'a>>
41+
abstract Kronecker: Matrix<'a> -> Mask2D option -> Semiring<'a> -> OpenCLEvaluation<Matrix<'a>>
3042

3143
static member inline (+) (x: Matrix<'a>, y: Matrix<'a>) = x.EWiseAdd y
3244
static member inline (*) (x: Matrix<'a>, y: Matrix<'a>) = x.EWiseMult y
3345
static member inline (@.) (x: Matrix<'a>, y: Matrix<'a>) = x.Mxm y
3446
static member inline (@.) (x: Matrix<'a>, y: Vector<'a>) = x.Mxv y
3547

36-
and [<AbstractClass>] Vector<'a when 'a : struct and 'a : equality>(length: int) =
37-
abstract Length: int
38-
default this.Length = length
3948

40-
abstract AsArray: 'a[]
41-
abstract Clear: unit -> unit
49+
and [<AbstractClass>] Vector<'a when 'a : struct and 'a : equality>(size: int) =
50+
abstract Size: int
51+
default this.Size = size
4252

43-
abstract Mask: Mask1D option
44-
abstract Complemented: Mask1D option
53+
abstract Clear: unit -> OpenCLEvaluation<unit>
54+
abstract Copy: unit -> OpenCLEvaluation<Vector<'a>>
55+
abstract Resize: int -> OpenCLEvaluation<Vector<'a>>
56+
abstract GetNNZ: unit -> OpenCLEvaluation<int>
57+
abstract GetTuples: unit -> OpenCLEvaluation<{| Indices: int[]; Values: 'a[] |}>
58+
abstract GetMask: ?isComplemented: bool -> OpenCLEvaluation<Mask1D option>
4559

46-
abstract Item: Mask1D option -> Vector<'a> with get, set
47-
abstract Item: int -> Scalar<'a> with get, set
48-
abstract Fill: Mask1D option -> Scalar<'a> with set
60+
abstract Extract: Mask1D option -> OpenCLEvaluation<Vector<'a>>
61+
abstract Extract: int -> OpenCLEvaluation<Scalar<'a>>
62+
abstract Assign: Mask1D option * Vector<'a> -> OpenCLEvaluation<unit>
63+
abstract Assign: int * Scalar<'a> -> OpenCLEvaluation<unit>
64+
abstract Assign: Mask1D option * Scalar<'a> -> OpenCLEvaluation<unit>
4965

50-
abstract Vxm: Matrix<'a> -> Mask1D option -> Semiring<'a> -> Vector<'a>
51-
abstract EWiseAdd: Vector<'a> -> Mask1D option -> Monoid<'a> -> Vector<'a>
52-
abstract EWiseMult: Vector<'a> -> Mask1D option -> Monoid<'a> -> Vector<'a>
53-
abstract Apply: Mask1D option -> UnaryOp<'a, 'b> -> Vector<'b>
54-
abstract Reduce: Monoid<'a> -> Scalar<'a>
66+
abstract Vxm: Matrix<'a> -> Mask1D option -> Semiring<'a> -> OpenCLEvaluation<Vector<'a>>
67+
abstract EWiseAdd: Vector<'a> -> Mask1D option -> Semiring<'a> -> OpenCLEvaluation<Vector<'a>>
68+
abstract EWiseMult: Vector<'a> -> Mask1D option -> Semiring<'a> -> OpenCLEvaluation<Vector<'a>>
69+
abstract Apply: Mask1D option -> UnaryOp<'a, 'b> -> OpenCLEvaluation<Vector<'b>>
70+
abstract Prune: Mask1D option -> UnaryOp<'a, bool> -> OpenCLEvaluation<Vector<'a>>
71+
abstract Reduce: Monoid<'a> -> OpenCLEvaluation<Scalar<'a>>
5572

5673
static member inline (+) (x: Vector<'a>, y: Vector<'a>) = x.EWiseAdd y
5774
static member inline (*) (x: Vector<'a>, y: Vector<'a>) = x.EWiseMult y
5875
static member inline (@.) (x: Vector<'a>, y: Matrix<'a>) = x.Vxm y
5976

60-
and Mask1D(indices: int[], length: int, isComplemented: bool) =
77+
78+
and Mask1D(indices: int[], size: int, isComplemented: bool) =
6179
member this.Indices = indices
62-
member this.Length = length
80+
member this.Size = size
6381
member this.IsComplemented = isComplemented
6482

65-
member this.Item
66-
with get (idx: int) : bool =
67-
this.Indices
68-
|> Array.exists ((=) idx)
69-
|> (<>) this.IsComplemented
7083

71-
and Mask2D(indices: (int * int)[], rowCount: int, columnCount: int, isComplemented: bool) =
72-
member this.Rows = indices |> Array.unzip |> fst
73-
member this.Columns = indices |> Array.unzip |> snd
84+
and Mask2D(rowIndices: int[], columnIndices: int[], rowCount: int, columnCount: int, isComplemented: bool) =
85+
member this.RowIndices = rowIndices
86+
member this.ColumnIndices = columnIndices
7487
member this.RowCount = rowCount
7588
member this.ColumnCount = columnCount
7689
member this.IsComplemented = isComplemented
77-
78-
member this.Item
79-
with get (rowIdx: int, colIdx: int) : bool =
80-
(this.Rows, this.Columns)
81-
||> Array.zip
82-
|> Array.exists ((=) (rowIdx, colIdx))
83-
|> (<>) this.IsComplemented

0 commit comments

Comments
 (0)