Skip to content

Commit 402204b

Browse files
committed
final narrowing fix
1 parent 780eeaa commit 402204b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

BinaryRelations/Binary/UnaryOperations.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,15 @@ public static partial class BinaryRelations
8080
if (x == null) throw new ArgumentNullException(nameof(x));
8181
ThrowIfNull_NotQuad(matrix1);
8282
var length = matrix1.GetLength(0);
83-
var result = new bool[length, length];
83+
var result = (bool[,])matrix1.Clone(); //new bool[length, length];
8484
x = x.Select(p => --p).ToArray();
85+
8586
for (int i = 0; i < length; i++)
8687
{
8788
for (int j = 0; j < length; j++)
8889
{
89-
if (x.Contains(i) || x.Contains(j))
90-
result[i, j] = matrix1[i, j];
90+
if (!x.Contains(i) || !x.Contains(j))
91+
result[i, j] = false;
9192
}
9293
}
9394

BinaryRelations/BinaryRelations.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<RootNamespace>MaxRev.Extensions</RootNamespace>
6-
<Version>1.2.0</Version>
6+
<Version>1.2.2</Version>
77
<Authors>MaxRev</Authors>
88
<Copyright>MaxRev © 2019</Copyright>
99
<Description>Binary relations and matrix extensions library targeting netstandard2.0</Description>
1010
<PackageProjectUrl>https://github.com/MaxRev-Dev/binary-relations</PackageProjectUrl>
1111
<RepositoryUrl>https://github.com/MaxRev-Dev/binary-relations</RepositoryUrl>
1212
<RepositoryType>git</RepositoryType>
1313
<PackageTags>binary-relations, maxrev, matrix, matrix-functions, extension-methods, graphs-theory, graphs, matrix-extensions</PackageTags>
14-
<PackageReleaseNotes>added derived properties</PackageReleaseNotes>
14+
<PackageReleaseNotes>fixed narrowing operation</PackageReleaseNotes>
1515
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1616
<PackageId>MaxRev.BinaryRelations</PackageId>
1717
<Product>MaxRev.BinaryRelations</Product>

0 commit comments

Comments
 (0)