Skip to content

Commit 2d54edf

Browse files
committed
Revert code formatting to something close to the default VC# settings of Visual Studio rdotnet#3
1 parent 496d759 commit 2d54edf

File tree

143 files changed

+17419
-17467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+17419
-17467
lines changed

4tabs.vssettings

Lines changed: 0 additions & 23 deletions
This file was deleted.

R.NET/BuiltinFunction.cs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
using System.Collections.Generic;
2-
using System;
1+
using System;
2+
using System.Collections.Generic;
33

44
namespace RDotNet
55
{
6-
/// <summary>
7-
/// A built-in function.
8-
/// </summary>
9-
public class BuiltinFunction : Function
10-
{
11-
/// <summary>
12-
/// Creates a built-in function proxy.
13-
/// </summary>
14-
/// <param name="engine">The engine.</param>
15-
/// <param name="pointer">The pointer.</param>
16-
protected internal BuiltinFunction(REngine engine, IntPtr pointer)
17-
: base(engine, pointer)
18-
{ }
6+
/// <summary>
7+
/// A built-in function.
8+
/// </summary>
9+
public class BuiltinFunction : Function
10+
{
11+
/// <summary>
12+
/// Creates a built-in function proxy.
13+
/// </summary>
14+
/// <param name="engine">The engine.</param>
15+
/// <param name="pointer">The pointer.</param>
16+
protected internal BuiltinFunction(REngine engine, IntPtr pointer)
17+
: base(engine, pointer)
18+
{ }
1919

20-
/// <summary>
21-
/// Invoke this builtin function, using an ordered list of unnamed arguments.
22-
/// </summary>
23-
/// <param name="args">The arguments of the function</param>
24-
/// <returns>The result of the evaluation</returns>
25-
public override SymbolicExpression Invoke(params SymbolicExpression[] args)
26-
{
27-
return InvokeOrderedArguments(args);
28-
}
20+
/// <summary>
21+
/// Invoke this builtin function, using an ordered list of unnamed arguments.
22+
/// </summary>
23+
/// <param name="args">The arguments of the function</param>
24+
/// <returns>The result of the evaluation</returns>
25+
public override SymbolicExpression Invoke(params SymbolicExpression[] args)
26+
{
27+
return InvokeOrderedArguments(args);
28+
}
2929

30-
/// <summary>
31-
/// NotSupportedException
32-
/// </summary>
33-
/// <param name="args">key-value pairs</param>
34-
/// <returns>Always throws an exception</returns>
35-
public override SymbolicExpression Invoke(IDictionary<string, SymbolicExpression> args)
36-
{
37-
throw new NotSupportedException();
38-
}
39-
}
30+
/// <summary>
31+
/// NotSupportedException
32+
/// </summary>
33+
/// <param name="args">key-value pairs</param>
34+
/// <returns>Always throws an exception</returns>
35+
public override SymbolicExpression Invoke(IDictionary<string, SymbolicExpression> args)
36+
{
37+
throw new NotSupportedException();
38+
}
39+
}
4040
}

R.NET/CharacterMatrix.cs

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -5,126 +5,126 @@
55

66
namespace RDotNet
77
{
8-
/// <summary>
9-
/// A matrix of strings.
10-
/// </summary>
11-
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
12-
public class CharacterMatrix : Matrix<string>
13-
{
14-
/// <summary>
15-
/// Creates a new empty CharacterMatrix with the specified size.
16-
/// </summary>
17-
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
18-
/// <param name="rowCount">The row size.</param>
19-
/// <param name="columnCount">The column size.</param>
20-
/// <seealso cref="REngineExtension.CreateCharacterMatrix(REngine, int, int)"/>
21-
public CharacterMatrix(REngine engine, int rowCount, int columnCount)
22-
: base(engine, SymbolicExpressionType.CharacterVector, rowCount, columnCount)
23-
{ }
8+
/// <summary>
9+
/// A matrix of strings.
10+
/// </summary>
11+
[SecurityPermission(SecurityAction.Demand, Flags = SecurityPermissionFlag.UnmanagedCode)]
12+
public class CharacterMatrix : Matrix<string>
13+
{
14+
/// <summary>
15+
/// Creates a new empty CharacterMatrix with the specified size.
16+
/// </summary>
17+
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
18+
/// <param name="rowCount">The row size.</param>
19+
/// <param name="columnCount">The column size.</param>
20+
/// <seealso cref="REngineExtension.CreateCharacterMatrix(REngine, int, int)"/>
21+
public CharacterMatrix(REngine engine, int rowCount, int columnCount)
22+
: base(engine, SymbolicExpressionType.CharacterVector, rowCount, columnCount)
23+
{ }
2424

25-
/// <summary>
26-
/// Creates a new CharacterMatrix with the specified values.
27-
/// </summary>
28-
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
29-
/// <param name="matrix">The values.</param>
30-
/// <seealso cref="REngineExtension.CreateCharacterMatrix(REngine, string[,])"/>
31-
public CharacterMatrix(REngine engine, string[,] matrix)
32-
: base(engine, SymbolicExpressionType.CharacterVector, matrix)
33-
{ }
25+
/// <summary>
26+
/// Creates a new CharacterMatrix with the specified values.
27+
/// </summary>
28+
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
29+
/// <param name="matrix">The values.</param>
30+
/// <seealso cref="REngineExtension.CreateCharacterMatrix(REngine, string[,])"/>
31+
public CharacterMatrix(REngine engine, string[,] matrix)
32+
: base(engine, SymbolicExpressionType.CharacterVector, matrix)
33+
{ }
3434

35-
/// <summary>
36-
/// Creates a new instance for a string matrix.
37-
/// </summary>
38-
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
39-
/// <param name="coerced">The pointer to a string matrix.</param>
40-
protected internal CharacterMatrix(REngine engine, IntPtr coerced)
41-
: base(engine, coerced)
42-
{ }
35+
/// <summary>
36+
/// Creates a new instance for a string matrix.
37+
/// </summary>
38+
/// <param name="engine">The <see cref="REngine"/> handling this instance.</param>
39+
/// <param name="coerced">The pointer to a string matrix.</param>
40+
protected internal CharacterMatrix(REngine engine, IntPtr coerced)
41+
: base(engine, coerced)
42+
{ }
4343

44-
/// <summary>
45-
/// Gets or sets the element at the specified index.
46-
/// </summary>
47-
/// <param name="rowIndex">The zero-based rowIndex index of the element to get or set.</param>
48-
/// <param name="columnIndex">The zero-based columnIndex index of the element to get or set.</param>
49-
/// <returns>The element at the specified index.</returns>
50-
public override string this[int rowIndex, int columnIndex]
51-
{
52-
get
53-
{
54-
if (rowIndex < 0 || RowCount <= rowIndex)
44+
/// <summary>
45+
/// Gets or sets the element at the specified index.
46+
/// </summary>
47+
/// <param name="rowIndex">The zero-based rowIndex index of the element to get or set.</param>
48+
/// <param name="columnIndex">The zero-based columnIndex index of the element to get or set.</param>
49+
/// <returns>The element at the specified index.</returns>
50+
public override string this[int rowIndex, int columnIndex]
51+
{
52+
get
5553
{
56-
throw new ArgumentOutOfRangeException("rowIndex");
54+
if (rowIndex < 0 || RowCount <= rowIndex)
55+
{
56+
throw new ArgumentOutOfRangeException("rowIndex");
57+
}
58+
if (columnIndex < 0 || ColumnCount <= columnIndex)
59+
{
60+
throw new ArgumentOutOfRangeException("columnIndex");
61+
}
62+
using (new ProtectedPointer(this))
63+
{
64+
int offset = GetOffset(rowIndex, columnIndex);
65+
IntPtr pointer = Marshal.ReadIntPtr(DataPointer, offset);
66+
return new InternalString(Engine, pointer);
67+
}
5768
}
58-
if (columnIndex < 0 || ColumnCount <= columnIndex)
69+
set
5970
{
60-
throw new ArgumentOutOfRangeException("columnIndex");
71+
if (rowIndex < 0 || RowCount <= rowIndex)
72+
{
73+
throw new ArgumentOutOfRangeException("rowIndex");
74+
}
75+
if (columnIndex < 0 || ColumnCount <= columnIndex)
76+
{
77+
throw new ArgumentOutOfRangeException("columnIndex");
78+
}
79+
using (new ProtectedPointer(this))
80+
{
81+
SetValue(rowIndex, columnIndex, value);
82+
}
6183
}
62-
using (new ProtectedPointer(this))
63-
{
64-
int offset = GetOffset(rowIndex, columnIndex);
65-
IntPtr pointer = Marshal.ReadIntPtr(DataPointer, offset);
66-
return new InternalString(Engine, pointer);
67-
}
68-
}
69-
set
70-
{
71-
if (rowIndex < 0 || RowCount <= rowIndex)
72-
{
73-
throw new ArgumentOutOfRangeException("rowIndex");
74-
}
75-
if (columnIndex < 0 || ColumnCount <= columnIndex)
76-
{
77-
throw new ArgumentOutOfRangeException("columnIndex");
78-
}
79-
using (new ProtectedPointer(this))
84+
}
85+
86+
private void SetValue(int rowIndex, int columnIndex, string value)
87+
{
88+
int offset = GetOffset(rowIndex, columnIndex);
89+
SymbolicExpression s = value == null ? Engine.NilValue : new InternalString(Engine, value);
90+
using (new ProtectedPointer(s))
8091
{
81-
SetValue(rowIndex, columnIndex, value);
92+
Marshal.WriteIntPtr(DataPointer, offset, s.DangerousGetHandle());
8293
}
83-
}
84-
}
85-
86-
private void SetValue(int rowIndex, int columnIndex, string value)
87-
{
88-
int offset = GetOffset(rowIndex, columnIndex);
89-
SymbolicExpression s = value == null ? Engine.NilValue : new InternalString(Engine, value);
90-
using (new ProtectedPointer(s))
91-
{
92-
Marshal.WriteIntPtr(DataPointer, offset, s.DangerousGetHandle());
93-
}
94-
}
94+
}
9595

96-
/// <summary>
97-
/// Initializes this R matrix, using the values in a rectangular array.
98-
/// </summary>
99-
/// <param name="matrix"></param>
100-
protected override void InitMatrixFastDirect(string[,] matrix)
101-
{
102-
int rows = matrix.GetLength(0);
103-
int cols = matrix.GetLength(1);
104-
for (int i = 0; i < rows; i++)
105-
{
106-
for (int j = 0; j < cols; j++)
96+
/// <summary>
97+
/// Initializes this R matrix, using the values in a rectangular array.
98+
/// </summary>
99+
/// <param name="matrix"></param>
100+
protected override void InitMatrixFastDirect(string[,] matrix)
101+
{
102+
int rows = matrix.GetLength(0);
103+
int cols = matrix.GetLength(1);
104+
for (int i = 0; i < rows; i++)
107105
{
108-
SetValue(i, j, matrix[i, j]);
106+
for (int j = 0; j < cols; j++)
107+
{
108+
SetValue(i, j, matrix[i, j]);
109+
}
109110
}
110-
}
111-
}
111+
}
112112

113-
/// <summary>
114-
/// NotSupportedException();
115-
/// </summary>
116-
/// <returns></returns>
117-
protected override string[,] GetArrayFast()
118-
{
119-
throw new NotSupportedException();
120-
}
113+
/// <summary>
114+
/// NotSupportedException();
115+
/// </summary>
116+
/// <returns></returns>
117+
protected override string[,] GetArrayFast()
118+
{
119+
throw new NotSupportedException();
120+
}
121121

122-
/// <summary>
123-
/// Gets the size of a pointer in byte.
124-
/// </summary>
125-
protected override int DataSize
126-
{
127-
get { return Marshal.SizeOf(typeof(IntPtr)); }
128-
}
129-
}
122+
/// <summary>
123+
/// Gets the size of a pointer in byte.
124+
/// </summary>
125+
protected override int DataSize
126+
{
127+
get { return Marshal.SizeOf(typeof(IntPtr)); }
128+
}
129+
}
130130
}

0 commit comments

Comments
 (0)