Browse Source

Data: StyleCop

provider
Christoph Ruegg 12 years ago
parent
commit
184e41c863
  1. 8
      src/Data/Matlab/Adler32.cs
  2. 26
      src/Data/Matlab/ArrayClass.cs
  3. 2
      src/Data/Matlab/ArrayFlags.cs
  4. 22
      src/Data/Matlab/DataType.cs
  5. 6
      src/Data/Matlab/MatlabFile.cs
  6. 101
      src/Data/Matlab/MatlabParser.cs
  7. 2
      src/Data/Matlab/MatlabReader.cs
  8. 95
      src/Data/Matlab/MatlabWriter.cs
  9. 395
      src/Data/Matlab/Settings.StyleCop
  10. 21
      src/Data/Text/DelimitedReader.cs
  11. 47
      src/Data/Text/MatrixMarketReader.cs
  12. 17
      src/Data/Text/MatrixMarketWriter.cs
  13. 395
      src/Data/Text/Settings.StyleCop

8
src/Data/Matlab/Adler32.cs

@ -28,7 +28,7 @@
// OTHER DEALINGS IN THE SOFTWARE.
// </copyright>
/* This code is a port and simplification of
/* This code is a port and simplification of
adler32.c -- compute the Adler-32 checksum of a data stream
Copyright (C) 1995-2011 Mark Adler
zlib license:
@ -60,7 +60,7 @@ namespace MathNet.Numerics.Data.Matlab
internal static class Adler32
{
/* largest prime smaller than 65536 */
const int Base = 65521;
const int Base = 65521;
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */
const int Nmax = 5552;
@ -84,11 +84,13 @@ namespace MathNet.Numerics.Data.Matlab
{
adler += data[offset++];
sum2 += adler;
} while (--tlen > 0);
}
while (--tlen > 0);
adler %= Base;
sum2 %= Base;
}
return adler | (sum2 << 16);
}
}

26
src/Data/Matlab/ArrayClass.cs

@ -38,13 +38,13 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// mxUNKNOWN CLASS
/// </summary>
Unknown = 0,
Unknown = 0,
/// <summary>
/// mxCELL CLASS
/// </summary>
Cell = 1,
Cell = 1,
/// <summary>
/// mxSTRUCT CLASS
/// </summary>
@ -53,7 +53,7 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// mxOBJECT CLASS
/// </summary>
Object = 3,
Object = 3,
/// <summary>
/// mxCHAR CLASS
@ -73,37 +73,37 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// mxSINGLE CLASS
/// </summary>
Single = 7,
Single = 7,
/// <summary>
/// mxINT8 CLASS
/// </summary>
Int8 = 8,
Int8 = 8,
/// <summary>
/// mxUINT8 CLASS
/// </summary>
UInt8 = 9,
UInt8 = 9,
/// <summary>
/// mxINT16 CLASS
/// </summary>
Int16 = 10,
Int16 = 10,
/// <summary>
/// mxUINT16 CLASS
/// </summary>
UInt16 = 11,
UInt16 = 11,
/// <summary>
/// mxINT32 CLASS
/// </summary>
Int32 = 12,
Int32 = 12,
/// <summary>
/// mxUINT32 CLASS
/// </summary>
UInt32 = 13,
UInt32 = 13,
/// <summary>
/// mxINT64 CLASS
@ -113,11 +113,11 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// mxUINT64 CLASS
/// </summary>
UInt64 = 15,
UInt64 = 15,
/// <summary>
/// mxFUNCTION CLASS
/// </summary>
Function = 16
Function = 16
}
}

2
src/Data/Matlab/ArrayFlags.cs

@ -46,7 +46,7 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// Global flag
/// </summary>
Global = 4,
Global = 4,
/// <summary>
/// Logical flag

22
src/Data/Matlab/DataType.cs

@ -63,7 +63,7 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// miINT32 type
/// </summary>
Int32 = 5,
Int32 = 5,
/// <summary>
/// miUINT32 type
@ -73,13 +73,13 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// miSINGLE type
/// </summary>
Single = 7,
Single = 7,
/// <summary>
/// miDOUBLE type
/// </summary>
Double = 9,
Double = 9,
/// <summary>
/// miINT64 type
/// </summary>
@ -88,8 +88,8 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// miUINT6 4type
/// </summary>
UInt64 = 13,
UInt64 = 13,
/// <summary>
/// miMATRIX type
/// </summary>
@ -98,21 +98,21 @@ namespace MathNet.Numerics.Data.Matlab
/// <summary>
/// miCOMPRESSED type
/// </summary>
Compressed = 15,
Compressed = 15,
/// <summary>
/// miUTF8 type
/// </summary>
Utf8 = 16,
Utf8 = 16,
/// <summary>
/// miUTF16 type
/// </summary>
Utf16 = 17,
Utf16 = 17,
/// <summary>
/// miUTF32 type
/// </summary>
Utf32 = 18
Utf32 = 18
}
}

6
src/Data/Matlab/MatlabFile.cs

@ -38,13 +38,13 @@ namespace MathNet.Numerics.Data.Matlab
/// Represents a Matlab file
/// </summary>
/// <typeparam name="TDataType">The data type of the matrix to return.</typeparam>
internal class MatlabFile<TDataType> where TDataType : struct, IEquatable<TDataType>, IFormattable
internal class MatlabFile<TDataType> where TDataType : struct, IEquatable<TDataType>, IFormattable
{
/// <summary>
/// Matrices in a matlab file stored as 1-D arrays
/// </summary>
private readonly IDictionary<string, Matrix<TDataType>> _matrices = new SortedList<string, Matrix<TDataType>>();
readonly IDictionary<string, Matrix<TDataType>> _matrices = new SortedList<string, Matrix<TDataType>>();
/// <summary>
/// Gets or sets the header text.
/// </summary>

101
src/Data/Matlab/MatlabParser.cs

@ -160,7 +160,7 @@ namespace MathNet.Numerics.Data.Matlab
// for each data block add a Matlab object to the file.
while (reader.BaseStream.Position < length)
{
var type = (DataType) reader.ReadInt16();
var type = (DataType)reader.ReadInt16();
int size = reader.ReadInt16();
var smallBlock = true;
if (size == 0)
@ -232,7 +232,7 @@ namespace MathNet.Numerics.Data.Matlab
decompressed.Position = 0;
var buf = new byte[4];
decompressed.Read(buf, 0, 4);
type = (DataType) BitConverter.ToInt32(buf, 0);
type = (DataType)BitConverter.ToInt32(buf, 0);
decompressed.Read(buf, 0, 4);
var size = BitConverter.ToInt32(buf, 0);
data = new byte[size];
@ -257,9 +257,9 @@ namespace MathNet.Numerics.Data.Matlab
// skip tag - doesn't tell us anything we don't already know
reader.BaseStream.Seek(8, SeekOrigin.Current);
var arrayClass = (ArrayClass) reader.ReadByte();
var arrayClass = (ArrayClass)reader.ReadByte();
var flags = reader.ReadByte();
var isComplex = (flags & (byte) ArrayFlags.Complex) == (byte) ArrayFlags.Complex;
var isComplex = (flags & (byte)ArrayFlags.Complex) == (byte)ArrayFlags.Complex;
// skip unneeded bytes
reader.BaseStream.Seek(10, SeekOrigin.Current);
@ -292,7 +292,7 @@ namespace MathNet.Numerics.Data.Matlab
return;
}
var type = (DataType) reader.ReadInt16();
var type = (DataType)reader.ReadInt16();
size = reader.ReadInt16();
if (size == 0)
{
@ -359,7 +359,7 @@ namespace MathNet.Numerics.Data.Matlab
AlignData(reader.BaseStream, jcsize, false);
var type = (DataType) reader.ReadInt32();
var type = (DataType)reader.ReadInt32();
var dataSize = reader.ReadInt32();
var matrix = Matrix<TDataType>.Build.Sparse(rows, columns);
@ -372,7 +372,7 @@ namespace MathNet.Numerics.Data.Matlab
throw new ArgumentException("Invalid TDataType. Matrix is stored as a complex matrix, but a real data type was given.");
}
PopulateDoubleSparseMatrix((Matrix<double>) (object) matrix, type, ir, jc, reader);
PopulateDoubleSparseMatrix((Matrix<double>)(object)matrix, type, ir, jc, reader);
}
else if (dataType == typeof (float))
{
@ -381,15 +381,15 @@ namespace MathNet.Numerics.Data.Matlab
throw new ArgumentException("Invalid TDataType. Matrix is stored as a complex matrix, but a real data type was given.");
}
PopulateSingleSparseMatrix((Matrix<float>) (object) matrix, type, ir, jc, reader);
PopulateSingleSparseMatrix((Matrix<float>)(object)matrix, type, ir, jc, reader);
}
else if (dataType == typeof (Complex))
{
PopulateComplexSparseMatrix((Matrix<Complex>) (object) matrix, type, isComplex, ir, jc, reader, dataSize);
PopulateComplexSparseMatrix((Matrix<Complex>)(object)matrix, type, isComplex, ir, jc, reader, dataSize);
}
else if (dataType == typeof (Complex32))
{
PopulateComplex32SparseMatrix((Matrix<Complex32>) (object) matrix, type, isComplex, ir, jc, reader, dataSize);
PopulateComplex32SparseMatrix((Matrix<Complex32>)(object)matrix, type, isComplex, ir, jc, reader, dataSize);
}
else
{
@ -579,7 +579,7 @@ namespace MathNet.Numerics.Data.Matlab
reader.ReadBytes(skip);
// skip header
type = (DataType) reader.ReadInt32();
type = (DataType)reader.ReadInt32();
reader.ReadInt32();
col = 0;
for (var i = 0; i < ir.Count; i++)
@ -696,7 +696,7 @@ namespace MathNet.Numerics.Data.Matlab
reader.ReadBytes(skip);
// skip header
type = (DataType) reader.ReadInt32();
type = (DataType)reader.ReadInt32();
reader.ReadInt32();
col = 0;
@ -767,14 +767,14 @@ namespace MathNet.Numerics.Data.Matlab
var count = rows*columns;
var data = new double[count];
Buffer.BlockCopy(reader.ReadBytes(count*Constants.SizeOfDouble), 0, data, 0, count*Constants.SizeOfDouble);
matrix = (Matrix<TDataType>) (object) new LinearAlgebra.Double.DenseMatrix(rows, columns, data);
matrix = (Matrix<TDataType>)(object)new LinearAlgebra.Double.DenseMatrix(rows, columns, data);
}
else if (type == DataType.Single && dataType == typeof (float))
{
var count = rows*columns;
var data = new float[count];
Buffer.BlockCopy(reader.ReadBytes(count*Constants.SizeOfFloat), 0, data, 0, count*Constants.SizeOfFloat);
matrix = (Matrix<TDataType>) (object) new LinearAlgebra.Single.DenseMatrix(rows, columns, data);
matrix = (Matrix<TDataType>)(object)new LinearAlgebra.Single.DenseMatrix(rows, columns, data);
}
else
{
@ -787,7 +787,7 @@ namespace MathNet.Numerics.Data.Matlab
throw new ArgumentException("Invalid TDataType. Matrix is stored as a complex matrix, but a real data type was given.");
}
PopulateDoubleDenseMatrix((Matrix<double>) (object) matrix, type, reader, rows, columns);
PopulateDoubleDenseMatrix((Matrix<double>)(object)matrix, type, reader, rows, columns);
}
else if (dataType == typeof (float))
{
@ -796,21 +796,22 @@ namespace MathNet.Numerics.Data.Matlab
throw new ArgumentException("Invalid TDataType. Matrix is stored as a complex matrix, but a real data type was given.");
}
PopulateSingleDenseMatrix((Matrix<float>) (object) matrix, type, reader, rows, columns);
PopulateSingleDenseMatrix((Matrix<float>)(object)matrix, type, reader, rows, columns);
}
else if (dataType == typeof (Complex))
{
PopulateComplexDenseMatrix((Matrix<Complex>) (object) matrix, type, isComplex, reader, rows, columns, size);
PopulateComplexDenseMatrix((Matrix<Complex>)(object)matrix, type, isComplex, reader, rows, columns, size);
}
else if (dataType == typeof (Complex32))
{
PopulateComplex32DenseMatrix((Matrix<Complex32>) (object) matrix, type, isComplex, reader, rows, columns, size);
PopulateComplex32DenseMatrix((Matrix<Complex32>)(object)matrix, type, isComplex, reader, rows, columns, size);
}
else
{
throw new NotSupportedException();
}
}
return matrix;
}
@ -836,6 +837,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -846,6 +848,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -856,6 +859,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -866,6 +870,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -876,6 +881,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -886,6 +892,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -896,6 +903,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -906,6 +914,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -916,6 +925,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -926,6 +936,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}
@ -955,6 +966,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -965,6 +977,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -975,6 +988,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -985,6 +999,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -995,6 +1010,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -1005,6 +1021,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -1015,6 +1032,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -1025,6 +1043,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -1035,6 +1054,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -1045,6 +1065,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}
@ -1057,7 +1078,7 @@ namespace MathNet.Numerics.Data.Matlab
reader.ReadBytes(skip);
// skip header
type = (DataType) reader.ReadInt32();
type = (DataType)reader.ReadInt32();
reader.ReadInt32();
switch (type)
@ -1072,6 +1093,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -1082,6 +1104,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -1092,6 +1115,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -1102,6 +1126,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -1112,6 +1137,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -1122,6 +1148,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -1132,6 +1159,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -1142,6 +1170,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -1152,6 +1181,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -1162,6 +1192,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}
@ -1192,6 +1223,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -1202,6 +1234,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -1212,6 +1245,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -1222,6 +1256,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -1232,6 +1267,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -1242,6 +1278,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -1252,6 +1289,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -1262,6 +1300,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -1272,6 +1311,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -1282,6 +1322,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}
@ -1294,7 +1335,7 @@ namespace MathNet.Numerics.Data.Matlab
reader.ReadBytes(skip);
// skip header
type = (DataType) reader.ReadInt32();
type = (DataType)reader.ReadInt32();
reader.ReadInt32();
switch (type)
@ -1309,6 +1350,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -1319,6 +1361,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -1329,6 +1372,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -1339,6 +1383,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -1349,6 +1394,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -1359,6 +1405,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -1369,6 +1416,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -1379,6 +1427,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -1389,6 +1438,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -1399,6 +1449,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}
@ -1427,6 +1478,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt8:
for (var j = 0; j < columns; j++)
{
@ -1437,6 +1489,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int16:
for (var j = 0; j < columns; j++)
{
@ -1447,6 +1500,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt16:
for (var j = 0; j < columns; j++)
{
@ -1457,6 +1511,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int32:
for (var j = 0; j < columns; j++)
{
@ -1467,6 +1522,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt32:
for (var j = 0; j < columns; j++)
{
@ -1477,6 +1533,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Single:
for (var j = 0; j < columns; j++)
{
@ -1487,6 +1544,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Int64:
for (var j = 0; j < columns; j++)
{
@ -1497,6 +1555,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.UInt64:
for (var j = 0; j < columns; j++)
{
@ -1507,6 +1566,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
case DataType.Double:
for (var j = 0; j < columns; j++)
{
@ -1517,6 +1577,7 @@ namespace MathNet.Numerics.Data.Matlab
}
break;
default:
throw new NotSupportedException();
}

2
src/Data/Matlab/MatlabReader.cs

@ -53,10 +53,12 @@ namespace MathNet.Numerics.Data.Matlab
{
return file.FirstMatrix;
}
if (!file.Matrices.ContainsKey(matrixName))
{
throw new KeyNotFoundException("Matrix with the provided name was not found.");
}
return file.Matrices[matrixName];
}

95
src/Data/Matlab/MatlabWriter.cs

@ -126,7 +126,7 @@ namespace MathNet.Numerics.Data.Matlab
}
// write datatype
_writer.Write((int) DataType.Compressed);
_writer.Write((int)DataType.Compressed);
byte[] data;
@ -134,29 +134,29 @@ namespace MathNet.Numerics.Data.Matlab
{
var o = matrix as LinearAlgebra.Double.SparseMatrix;
data = o != null
? GetSparseDataArray((LinearAlgebra.Double.SparseMatrix) (object) matrix, name)
: GetDenseDataArray((LinearAlgebra.Double.Matrix) (object) matrix, name);
? GetSparseDataArray((LinearAlgebra.Double.SparseMatrix)(object)matrix, name)
: GetDenseDataArray((LinearAlgebra.Double.Matrix)(object)matrix, name);
}
else if (typeof (TDataType) == typeof (float))
{
var o = matrix as LinearAlgebra.Single.SparseMatrix;
data = o != null
? GetSparseDataArray((LinearAlgebra.Single.SparseMatrix) (object) matrix, name)
: GetDenseDataArray((LinearAlgebra.Single.Matrix) (object) matrix, name);
? GetSparseDataArray((LinearAlgebra.Single.SparseMatrix)(object)matrix, name)
: GetDenseDataArray((LinearAlgebra.Single.Matrix)(object)matrix, name);
}
else if (typeof (TDataType) == typeof (Complex))
{
var o = matrix as LinearAlgebra.Complex.SparseMatrix;
data = o != null
? GetSparseDataArray((LinearAlgebra.Complex.SparseMatrix) (object) matrix, name)
: GetDenseDataArray((LinearAlgebra.Complex.Matrix) (object) matrix, name);
? GetSparseDataArray((LinearAlgebra.Complex.SparseMatrix)(object)matrix, name)
: GetDenseDataArray((LinearAlgebra.Complex.Matrix)(object)matrix, name);
}
else if (typeof (TDataType) == typeof (Complex32))
{
var o = matrix as LinearAlgebra.Complex32.SparseMatrix;
data = o != null
? GetSparseDataArray((LinearAlgebra.Complex32.SparseMatrix) (object) matrix, name)
: GetDenseDataArray((LinearAlgebra.Complex32.Matrix) (object) matrix, name);
? GetSparseDataArray((LinearAlgebra.Complex32.SparseMatrix)(object)matrix, name)
: GetDenseDataArray((LinearAlgebra.Complex32.Matrix)(object)matrix, name);
}
else
{
@ -219,31 +219,31 @@ namespace MathNet.Numerics.Data.Matlab
static void WriteMatrixTagAndName(BinaryWriter writer, ArrayClass arrayClass, bool isComplex,
string name, int rows, int columns, int nzmax)
{
writer.Write((int) DataType.Matrix);
writer.Write((int)DataType.Matrix);
// add place holder for data size
writer.Write(0);
// write flag, data type and size
writer.Write((int) DataType.UInt32);
writer.Write((int)DataType.UInt32);
writer.Write(8);
// write array class and flags
writer.Write((byte) arrayClass);
writer.Write((byte)arrayClass);
if (isComplex)
{
writer.Write((byte) ArrayFlags.Complex);
writer.Write((byte)ArrayFlags.Complex);
}
else
{
writer.Write((byte) 0);
writer.Write((byte)0);
}
writer.Write((short) 0);
writer.Write((short)0);
writer.Write(nzmax);
// write dimensions
writer.Write((int) DataType.Int32);
writer.Write((int)DataType.Int32);
writer.Write(8);
writer.Write(rows);
writer.Write(columns);
@ -253,7 +253,7 @@ namespace MathNet.Numerics.Data.Matlab
// write name
if (nameBytes.Length > 4)
{
writer.Write((int) DataType.Int8);
writer.Write((int)DataType.Int8);
writer.Write(nameBytes.Length);
writer.Write(nameBytes);
var pad = 8 - (nameBytes.Length%8);
@ -261,8 +261,8 @@ namespace MathNet.Numerics.Data.Matlab
}
else
{
writer.Write((short) DataType.Int8);
writer.Write((short) nameBytes.Length);
writer.Write((short)DataType.Int8);
writer.Write((short)nameBytes.Length);
writer.Write(nameBytes);
PadData(writer, 4 - nameBytes.Length);
}
@ -284,6 +284,7 @@ namespace MathNet.Numerics.Data.Matlab
{
outputStream.Write(data, 0, data.Length);
}
compressedStream.WriteByte(adler[3]);
compressedStream.WriteByte(adler[2]);
compressedStream.WriteByte(adler[1]);
@ -307,7 +308,7 @@ namespace MathNet.Numerics.Data.Matlab
WriteMatrixTagAndName(dataWriter, ArrayClass.Double, false, name, matrix.RowCount, matrix.ColumnCount, 0);
// write data
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*8);
for (var j = 0; j < matrix.ColumnCount; j++)
@ -340,7 +341,7 @@ namespace MathNet.Numerics.Data.Matlab
WriteMatrixTagAndName(dataWriter, ArrayClass.Single, false, name, matrix.RowCount, matrix.ColumnCount, 0);
// write data
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*4);
@ -377,7 +378,7 @@ namespace MathNet.Numerics.Data.Matlab
WriteMatrixTagAndName(dataWriter, ArrayClass.Double, true, name, matrix.RowCount, matrix.ColumnCount, 0);
// write data
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*8);
for (var j = 0; j < matrix.ColumnCount; j++)
@ -389,7 +390,7 @@ namespace MathNet.Numerics.Data.Matlab
}
}
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*8);
for (var j = 0; j < matrix.ColumnCount; j++)
@ -422,7 +423,7 @@ namespace MathNet.Numerics.Data.Matlab
WriteMatrixTagAndName(dataWriter, ArrayClass.Single, true, name, matrix.RowCount, matrix.ColumnCount, 0);
// write data
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*4);
for (var j = 0; j < matrix.ColumnCount; j++)
@ -437,7 +438,7 @@ namespace MathNet.Numerics.Data.Matlab
var pad = (matrix.RowCount*matrix.ColumnCount*4)%8;
PadData(dataWriter, pad);
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(matrix.RowCount*matrix.ColumnCount*4);
for (var j = 0; j < matrix.ColumnCount; j++)
@ -474,7 +475,7 @@ namespace MathNet.Numerics.Data.Matlab
nzmax);
// write ir
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -492,13 +493,13 @@ namespace MathNet.Numerics.Data.Matlab
}
// write jc
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write((matrix.ColumnCount + 1)*4);
dataWriter.Write(0);
var count = 0;
foreach (var column in matrix.EnumerateColumns())
{
count += ((SparseVectorStorage<double>) column.Storage).ValueCount;
count += ((SparseVectorStorage<double>)column.Storage).ValueCount;
dataWriter.Write(count);
}
@ -509,7 +510,7 @@ namespace MathNet.Numerics.Data.Matlab
}
// write data
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(nzmax*8);
foreach (var column in matrix.EnumerateColumns())
@ -543,7 +544,7 @@ namespace MathNet.Numerics.Data.Matlab
nzmax);
// write ir
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -561,13 +562,13 @@ namespace MathNet.Numerics.Data.Matlab
}
// write jc
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write((matrix.ColumnCount + 1)*4);
dataWriter.Write(0);
var count = 0;
foreach (var column in matrix.EnumerateColumns())
{
count += ((SparseVectorStorage<float>) column.Storage).ValueCount;
count += ((SparseVectorStorage<float>)column.Storage).ValueCount;
dataWriter.Write(count);
}
@ -578,7 +579,7 @@ namespace MathNet.Numerics.Data.Matlab
}
// write data
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -615,7 +616,7 @@ namespace MathNet.Numerics.Data.Matlab
nzmax);
// write ir
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -633,13 +634,13 @@ namespace MathNet.Numerics.Data.Matlab
}
// write jc
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write((matrix.ColumnCount + 1)*4);
dataWriter.Write(0);
var count = 0;
foreach (var column in matrix.EnumerateColumns())
{
count += ((SparseVectorStorage<Complex>) column.Storage).ValueCount;
count += ((SparseVectorStorage<Complex>)column.Storage).ValueCount;
dataWriter.Write(count);
}
@ -650,7 +651,7 @@ namespace MathNet.Numerics.Data.Matlab
}
// write data
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(nzmax*8);
foreach (var column in matrix.EnumerateColumns())
@ -661,7 +662,7 @@ namespace MathNet.Numerics.Data.Matlab
}
}
dataWriter.Write((int) DataType.Double);
dataWriter.Write((int)DataType.Double);
dataWriter.Write(nzmax*8);
foreach (var column in matrix.EnumerateColumns())
@ -695,7 +696,7 @@ namespace MathNet.Numerics.Data.Matlab
nzmax);
// write ir
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -713,13 +714,13 @@ namespace MathNet.Numerics.Data.Matlab
}
// write jc
dataWriter.Write((int) DataType.Int32);
dataWriter.Write((int)DataType.Int32);
dataWriter.Write((matrix.ColumnCount + 1)*4);
dataWriter.Write(0);
var count = 0;
foreach (var column in matrix.EnumerateColumns())
{
count += ((SparseVectorStorage<Complex32>) column.Storage).ValueCount;
count += ((SparseVectorStorage<Complex32>)column.Storage).ValueCount;
dataWriter.Write(count);
}
@ -730,7 +731,7 @@ namespace MathNet.Numerics.Data.Matlab
}
// write data
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -744,7 +745,7 @@ namespace MathNet.Numerics.Data.Matlab
var pad = (nzmax*4)%8;
PadData(dataWriter, pad);
dataWriter.Write((int) DataType.Single);
dataWriter.Write((int)DataType.Single);
dataWriter.Write(nzmax*4);
foreach (var column in matrix.EnumerateColumns())
@ -794,11 +795,11 @@ namespace MathNet.Numerics.Data.Matlab
PadData(_writer, HeaderTextLength - header.Length + 8, 32);
// write version
_writer.Write((short) 0x100);
_writer.Write((short)0x100);
// write little endian indicator
_writer.Write((byte) 0x49);
_writer.Write((byte) 0x4D);
_writer.Write((byte)0x49);
_writer.Write((byte)0x4D);
}
/// <summary>
@ -807,7 +808,7 @@ namespace MathNet.Numerics.Data.Matlab
/// <param name="writer">Where to write the pad values.</param>
/// <param name="bytes">The number of bytes to pad.</param>
/// <param name="pad">What value to pad with.</param>
static void PadData(BinaryWriter writer, int bytes, byte pad = (byte) 0)
static void PadData(BinaryWriter writer, int bytes, byte pad = (byte)0)
{
for (var i = 0; i < bytes; i++)
{

395
src/Data/Matlab/Settings.StyleCop

@ -0,0 +1,395 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="PartialElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="EnumerationItemsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="VoidReturnValueMustNotBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustNotBeEmpty">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustContainWhitespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustMeetCharacterPercentage">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludedDocumentationXPathDoesNotExist">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveCopyrightText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustContainValidXml">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings>
<BooleanProperty Name="IncludeFields">False</BooleanProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
<Rule Name="FieldNamesMustNotBeginWithUnderscore">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstFieldNamesMustBeginWithUpperCaseLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
<Value>x</Value>
<Value>y</Value>
<Value>z</Value>
</CollectionProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="AccessModifierMustBeDeclared">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldsMustBePrivate">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="DoNotUseRegions">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixCallsCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterMustFollowComma">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstantsMustAppearBeforeFields">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="SymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="KeywordsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingSquareBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncrementDecrementSymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>

21
src/Data/Text/DelimitedReader.cs

@ -49,7 +49,7 @@ namespace MathNet.Numerics.Data.Text
/// <summary>
/// The base regular expression.
/// </summary>
private const string RegexTemplate = "\\([^\\)]*\\)|'[^']*'|\"[^\"]*\"|[^{0}]*";
const string RegexTemplate = "\\([^\\)]*\\)|'[^']*'|\"[^\"]*\"|[^{0}]*";
/// <summary>
/// Cached compiled regular expressions for various delimiters, as needed.
@ -134,10 +134,11 @@ namespace MathNet.Numerics.Data.Text
public static Matrix<TDataType> Read<TDataType>(TextReader reader, bool sparse = false, string delimiter = @"\s", bool hasHeaders = false, IFormatProvider formatProvider = null)
where TDataType : struct, IEquatable<TDataType>, IFormattable
{
if (String.IsNullOrEmpty(delimiter))
if (string.IsNullOrEmpty(delimiter))
{
delimiter = @"\s";
}
var regex = RegexCache.GetOrAdd(delimiter, d => new Regex(string.Format(RegexTemplate, d), RegexOptions.Compiled));
var data = new List<string[]>();
@ -147,7 +148,7 @@ namespace MathNet.Numerics.Data.Text
// 3,4,5,6
// 7
// this creates a 3x4 matrix:
// 1, 2, 0 ,0
// 1, 2, 0 ,0
// 3, 4, 5, 6
// 7, 0, 0, 0
var max = -1;
@ -235,21 +236,25 @@ namespace MathNet.Numerics.Data.Text
{
if (typeof (T) == typeof (double))
{
return number => (T) (object) double.Parse(number, NumberStyles.Any, formatProvider);
return number => (T)(object)double.Parse(number, NumberStyles.Any, formatProvider);
}
if (typeof (T) == typeof (float))
{
return number => (T) (object) float.Parse(number, NumberStyles.Any, formatProvider);
return number => (T)(object)float.Parse(number, NumberStyles.Any, formatProvider);
}
if (typeof (T) == typeof (Complex))
{
return number => (T) (object) number.ToComplex(formatProvider);
return number => (T)(object)number.ToComplex(formatProvider);
}
if (typeof (T) == typeof (Complex32))
{
return number => (T) (object) number.ToComplex32(formatProvider);
return number => (T)(object)number.ToComplex32(formatProvider);
}
throw new NotSupportedException();
}
}
}
}

47
src/Data/Text/MatrixMarketReader.cs

@ -66,12 +66,14 @@ namespace MathNet.Numerics.Data.Text
{
return ReadMatrix<T>(reader);
}
case Compression.GZip:
using (var decompressed = new GZipStream(stream, CompressionMode.Decompress))
using (var reader = new StreamReader(decompressed))
{
return ReadMatrix<T>(reader);
}
default:
throw new NotSupportedException("Compression not supported: " + compression);
}
@ -89,12 +91,14 @@ namespace MathNet.Numerics.Data.Text
{
return ReadVector<T>(reader);
}
case Compression.GZip:
using (var decompressed = new GZipStream(stream, CompressionMode.Decompress))
using (var reader = new StreamReader(decompressed))
{
return ReadVector<T>(reader);
}
default:
throw new NotSupportedException("Compression not supported: " + compression);
}
@ -142,6 +146,7 @@ namespace MathNet.Numerics.Data.Text
{
return Matrix<T>.Build.DenseOfColumnMajor(rows, cols, columnMajor);
}
case MatrixMarketSymmetry.Symmetric:
{
var m = Matrix<T>.Build.Dense(rows, cols);
@ -153,8 +158,10 @@ namespace MathNet.Numerics.Data.Text
m.SetRow(k, k, cols - k, vector);
k++;
}
return m;
}
case MatrixMarketSymmetry.Hermitian:
{
var m = Matrix<T>.Build.Dense(rows, cols);
@ -166,8 +173,10 @@ namespace MathNet.Numerics.Data.Text
m.SetRow(k, k, cols - k, vector.Conjugate());
k++;
}
return m;
}
case MatrixMarketSymmetry.SkewSymmetric:
{
var m = Matrix<T>.Build.Dense(rows, cols);
@ -179,8 +188,10 @@ namespace MathNet.Numerics.Data.Text
m.SetRow(k, k + 1, cols - 1 - k, vector);
k++;
}
return m;
}
default:
throw new NotSupportedException("Symmetry type not supported.");
}
@ -220,10 +231,12 @@ namespace MathNet.Numerics.Data.Text
{
throw new FormatException(@"Expected MatrixMarket Header with 2-4 attributes: object format [field] [symmetry]; see http://math.nist.gov/MatrixMarket/ for details.");
}
if (tokens[0] != (matrix ? "matrix" : "vector"))
{
throw new FormatException("Expected matrix content.");
}
switch (tokens[1])
{
case "array":
@ -235,6 +248,7 @@ namespace MathNet.Numerics.Data.Text
default:
throw new NotSupportedException("Format type not supported.");
}
if (tokens.Length < 3)
{
complex = false;
@ -255,6 +269,7 @@ namespace MathNet.Numerics.Data.Text
throw new NotSupportedException("Field type not supported.");
}
}
if (tokens.Length < 4)
{
symmetry = MatrixMarketSymmetry.General;
@ -279,9 +294,11 @@ namespace MathNet.Numerics.Data.Text
throw new NotSupportedException("Symmetry type not supported");
}
}
return;
}
}
throw new FormatException(@"Expected MatrixMarket Header, see http://math.nist.gov/MatrixMarket/ for details.");
}
@ -338,8 +355,10 @@ namespace MathNet.Numerics.Data.Text
slice = new T[--initialLength];
nextIndex = 0;
}
slice[nextIndex++] = value;
}
yield return slice;
}
@ -350,32 +369,52 @@ namespace MathNet.Numerics.Data.Text
// ignore imaginary part if source is complex
return (offset, tokens) => (T)(object)double.Parse(tokens[offset], NumberStyles.Any, Format);
}
if (typeof (T) == typeof (float))
{
// ignore imaginary part if source is complex
return (offset, tokens) => (T)(object)float.Parse(tokens[offset], NumberStyles.Any, Format);
}
if (typeof (T) == typeof (Complex))
{
return sourceIsComplex
? ((offset, tokens) => (T)(object)new Complex(double.Parse(tokens[offset], NumberStyles.Any, Format), double.Parse(tokens[offset + 1], NumberStyles.Any, Format)))
: (Func<int, string[], T>)((offset, tokens) => (T)(object)new Complex(double.Parse(tokens[offset], NumberStyles.Any, Format), 0d));
}
if (typeof (T) == typeof (Complex32))
{
return sourceIsComplex
? ((offset, tokens) => (T)(object)new Complex32(float.Parse(tokens[offset], NumberStyles.Any, Format), float.Parse(tokens[offset + 1], NumberStyles.Any, Format)))
: (Func<int, string[], T>)((offset, tokens) => (T)(object)new Complex32(float.Parse(tokens[offset], NumberStyles.Any, Format), 0f));
}
throw new NotSupportedException();
}
static Func<T, T> CreateSymmetryMap<T>(MatrixMarketSymmetry symmetry)
{
if (symmetry != MatrixMarketSymmetry.Hermitian) return x => x;
if (typeof (T) == typeof (double) || typeof (T) == typeof (float)) return x => x;
if (typeof (T) == typeof (Complex)) return x => (T)(object)((Complex)(object)x).Conjugate();
if (typeof (T) == typeof (Complex32)) return x => (T)(object)((Complex32)(object)x).Conjugate();
if (symmetry != MatrixMarketSymmetry.Hermitian)
{
return x => x;
}
if (typeof (T) == typeof (double) || typeof (T) == typeof (float))
{
return x => x;
}
if (typeof (T) == typeof (Complex))
{
return x => (T)(object)((Complex)(object)x).Conjugate();
}
if (typeof (T) == typeof (Complex32))
{
return x => (T)(object)((Complex32)(object)x).Conjugate();
}
throw new NotSupportedException();
}
}

17
src/Data/Text/MatrixMarketWriter.cs

@ -56,7 +56,9 @@ namespace MathNet.Numerics.Data.Text
{
WriteMatrix(writer, matrix);
}
break;
case Compression.GZip:
using (var compressed = new GZipStream(stream, CompressionMode.Compress))
using (var buffered = new BufferedStream(compressed, 4096))
@ -64,7 +66,9 @@ namespace MathNet.Numerics.Data.Text
{
WriteMatrix(writer, matrix);
}
break;
default:
throw new NotSupportedException("Compression not supported: " + compression);
}
@ -82,7 +86,9 @@ namespace MathNet.Numerics.Data.Text
{
WriteVector(writer, vector);
}
break;
case Compression.GZip:
using (var compressed = new GZipStream(stream, CompressionMode.Compress))
using (var buffered = new BufferedStream(compressed, 4096))
@ -90,7 +96,9 @@ namespace MathNet.Numerics.Data.Text
{
WriteVector(writer, vector);
}
break;
default:
throw new NotSupportedException("Compression not supported: " + compression);
}
@ -132,6 +140,7 @@ namespace MathNet.Numerics.Data.Text
writer.WriteLine("{0} {1} {2}", row + 1, sparse.ColumnIndices[j] + 1, format(sparse.Values[j]));
}
}
return;
}
@ -144,6 +153,7 @@ namespace MathNet.Numerics.Data.Text
{
writer.WriteLine("{0} {1} {2}", k + 1, k + 1, format(diagonal.Data[k]));
}
return;
}
@ -156,6 +166,7 @@ namespace MathNet.Numerics.Data.Text
{
writer.WriteLine(format(value));
}
return;
}
@ -182,6 +193,7 @@ namespace MathNet.Numerics.Data.Text
{
writer.WriteLine("{0} {1}", k + 1, format(sparse.Values[k]));
}
return;
}
@ -194,6 +206,7 @@ namespace MathNet.Numerics.Data.Text
{
writer.WriteLine(format(value));
}
return;
}
@ -211,10 +224,12 @@ namespace MathNet.Numerics.Data.Text
{
return value => string.Format(Format, "{0:G14}", value);
}
if (typeof (T) == typeof (float))
{
return value => string.Format(Format, "{0:G7}", value);
}
if (typeof (T) == typeof (Complex))
{
return value =>
@ -223,6 +238,7 @@ namespace MathNet.Numerics.Data.Text
return string.Format(Format, "{0:G14} {1:G14}", c.Real, c.Imaginary);
};
}
if (typeof (T) == typeof (Complex32))
{
return value =>
@ -231,6 +247,7 @@ namespace MathNet.Numerics.Data.Text
return string.Format(Format, "{0:G7} {1:G7}", c.Real, c.Imaginary);
};
}
throw new NotSupportedException();
}
}

395
src/Data/Text/Settings.StyleCop

@ -0,0 +1,395 @@
<StyleCopSettings Version="105">
<GlobalSettings>
<StringProperty Name="MergeSettingsFiles">NoMerge</StringProperty>
</GlobalSettings>
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.DocumentationRules">
<Rules>
<Rule Name="PartialElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="EnumerationItemsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotHaveDefaultSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustMatchElementParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementReturnValueDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="VoidReturnValueMustNotBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParametersMustBeDocumentedPartialClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustMatchTypeParameters">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="GenericTypeParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustNotBeCopiedAndPasted">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SingleLineCommentsMustNotUseDocumentationStyleSlashes">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustNotBeEmpty">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationTextMustContainWhitespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustMeetCharacterPercentage">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DestructorSummaryDocumentationMustBeginWithStandardText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationHeadersMustNotContainBlankLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludedDocumentationXPathDoesNotExist">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncludeNodeDoesNotContainValidFileAndPath">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InheritDocMustBeUsedWithInheritingClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustBeSpelledCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMustHaveHeader">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustShowCopyright">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveCopyrightText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustContainFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchFileName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderMustHaveValidCompanyText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileHeaderFileNameDocumentationMustMatchTypeName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeDocumented">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="DocumentationMustContainValidXml">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummary">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PartialElementDocumentationMustHaveSummaryText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustDeclareParameterName">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementParameterDocumentationMustHaveText">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustMatchAccessors">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PropertySummaryDocumentationMustOmitSetAccessorWithRestrictedAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings>
<BooleanProperty Name="IncludeFields">False</BooleanProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.NamingRules">
<Rules>
<Rule Name="FieldNamesMustNotBeginWithUnderscore">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstFieldNamesMustBeginWithUpperCaseLetter">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings>
<CollectionProperty Name="Hungarian">
<Value>x</Value>
<Value>y</Value>
<Value>z</Value>
</CollectionProperty>
</AnalyzerSettings>
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.MaintainabilityRules">
<Rules>
<Rule Name="AccessModifierMustBeDeclared">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FieldsMustBePrivate">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleClass">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="FileMayOnlyContainASingleNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ArithmeticExpressionsMustDeclarePrecedence">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.ReadabilityRules">
<Rules>
<Rule Name="DoNotUseRegions">
<RuleSettings>
<BooleanProperty Name="Enabled">True</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixLocalCallsWithThis">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="PrefixCallsCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParametersMustBeOnSameLineOrSeparateLines">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ParameterMustFollowComma">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SplitParametersMustStartOnLineAfterDeclaration">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.OrderingRules">
<Rules>
<Rule Name="UsingDirectivesMustBePlacedWithinNamespace">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ConstantsMustAppearBeforeFields">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticElementsMustAppearBeforeInstanceElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="StaticReadonlyElementsMustAppearBeforeStaticNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="SystemUsingDirectivesMustBePlacedBeforeOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="UsingAliasDirectivesMustBePlacedAfterOtherUsingDirectives">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustAppearInTheCorrectOrder">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ElementsMustBeOrderedByAccess">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
<Analyzer AnalyzerId="StyleCop.CSharp.SpacingRules">
<Rules>
<Rule Name="SymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="KeywordsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="OpeningParenthesisMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="ClosingSquareBracketsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
<Rule Name="IncrementDecrementSymbolsMustBeSpacedCorrectly">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
<AnalyzerSettings />
</Analyzer>
</Analyzers>
</StyleCopSettings>
Loading…
Cancel
Save