Skip to content

Commit

Permalink
Rename NumberOfElements to Count
Browse files Browse the repository at this point in the history
  • Loading branch information
mahalex committed Nov 17, 2017
1 parent 6cd9ffa commit 404096b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions MatFileHandler.Tests/MatFileWriterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ private void CompareStructureArrays(IStructureArray expected, IStructureArray ac
Assert.That(expected.FieldNames, Is.EquivalentTo(actual.FieldNames));
foreach (var name in expected.FieldNames)
{
for (var i = 0; i < expected.NumberOfElements; i++)
for (var i = 0; i < expected.Count; i++)
{
CompareMatArrays(expected[name, i], actual[name, i]);
}
Expand All @@ -252,7 +252,7 @@ private void CompareCellArrays(ICellArray expected, ICellArray actual)
{
Assert.That(actual, Is.Not.Null);
Assert.That(expected.Dimensions, Is.EqualTo(actual.Dimensions));
for (var i = 0; i < expected.NumberOfElements; i++)
for (var i = 0; i < expected.Count; i++)
{
CompareMatArrays(expected[i], actual[i]);
}
Expand Down
4 changes: 2 additions & 2 deletions MatFileHandler/IArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public interface IArray
int[] Dimensions { get; }

/// <summary>
/// Gets the number of elements in the array.
/// Gets the total number of elements in the array.
/// </summary>
int NumberOfElements { get; }
int Count { get; }

/// <summary>
/// Tries to convert the array to an array of Double values.
Expand Down
2 changes: 1 addition & 1 deletion MatFileHandler/MatArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected MatArray(
public string Name { get; }

/// <inheritdoc />
public int NumberOfElements => Dimensions.NumberOfElements();
public int Count => Dimensions.NumberOfElements();

/// <inheritdoc />
public bool IsEmpty => Dimensions.Length == 0;
Expand Down
4 changes: 2 additions & 2 deletions MatFileHandler/MatFileWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ private void WriteFieldNames(BinaryWriter writer, IEnumerable<string> fieldNames

private void WriteStructureArrayValues(BinaryWriter writer, IStructureArray array)
{
for (var i = 0; i < array.NumberOfElements; i++)
for (var i = 0; i < array.Count; i++)
{
foreach (var name in array.FieldNames)
{
Expand Down Expand Up @@ -556,7 +556,7 @@ private void WriteStructureArray(

private void WriteCellArrayValues(BinaryWriter writer, ICellArray array)
{
for (var i = 0; i < array.NumberOfElements; i++)
for (var i = 0; i < array.Count; i++)
{
WriteArray(writer, array[i]);
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public interface IArray
{
bool IsEmpty { get; }
int[] Dimensions { get; }
int NumberOfElements { get; }
int Count { get; }
double[] ConvertToDoubleArray();
System.Numerics.Complex[] ConvertToDoubleArray();
}
Expand Down

0 comments on commit 404096b

Please sign in to comment.