Skip to content

Commit eccc4ee

Browse files
committed
MtxReader formatted
1 parent b886964 commit eccc4ee

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

src/GraphBLAS-sharp/IO/MtxReader.fs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ type MtxReader(pathToFile: string) =
7676
(fun line ->
7777
let i = int line.[0]
7878
let j = int line.[1]
79+
7980
let v =
8081
converter
8182
<| if line.Length > 2 then line.[2] else ""
83+
8284
struct (pack i j, v))
8385
|> Array.sortBy (fun struct (packedIndex, _) -> packedIndex)
8486
| Symmetric ->
@@ -89,14 +91,21 @@ type MtxReader(pathToFile: string) =
8991
(fun line ->
9092
let i = int line.[0]
9193
let j = int line.[1]
94+
9295
let v =
9396
converter
9497
<| if line.Length > 2 then line.[2] else ""
95-
if i = j then [| struct (pack i j, v) |]
96-
else [| struct (pack i j, v); struct (pack j i, v) |])
98+
99+
if i = j then
100+
[| struct (pack i j, v) |]
101+
else
102+
[| struct (pack i j, v)
103+
struct (pack j i, v) |])
97104
|> Array.concat
98105
|> Array.sortBy (fun struct (packedIndex, _) -> packedIndex)
99-
| _ -> failwith <| sprintf "This symmetry processing is not implemented: %A" this.Symmetry
106+
| _ ->
107+
failwith
108+
<| sprintf "This symmetry processing is not implemented: %A" this.Symmetry
100109

101110
let rows = Array.zeroCreate sortedData.Length
102111
let cols = Array.zeroCreate sortedData.Length

0 commit comments

Comments
 (0)