Browse Source

sparse: added Andriy's sparse matrix

la-knuth
Marcus Cuda 17 years ago
parent
commit
a3b39c5622
  1. 736
      src/MathNet.Numerics.5.0.ReSharper
  2. 20
      src/Numerics/LinearAlgebra/Double/DenseVector.cs
  3. 81
      src/Numerics/LinearAlgebra/Double/SparseVector.cs
  4. 1
      src/Numerics/Numerics.csproj
  5. 3
      src/Silverlight/Silverlight.csproj
  6. 1
      src/UnitTests/UnitTests.csproj

736
src/MathNet.Numerics.5.0.ReSharper

@ -3,6 +3,742 @@
<ExternalPath IsNull="False">
</ExternalPath>
<Sharing>SOLUTION</Sharing>
<AgentSmithCSharpStyleSettings version="1">
<CodeStyleSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<CustomDictionaries>
<Dictionaries>
<CustomDictionary>
<Name>en-US</Name>
<CaseSensitive>false</CaseSensitive>
<UserWords>pointwise</UserWords>
</CustomDictionary>
</Dictionaries>
</CustomDictionaries>
<StringsDictionary>en-US</StringsDictionary>
<IdentifierDictionary>en-US</IdentifierDictionary>
<LastSelectedCustomDictionary>en-US</LastSelectedCustomDictionary>
<CommentsSettings>
<DictionaryName>en-US</DictionaryName>
<CommentMatch>
<Match>
<AccessLevel>Public Protected ProtectedInternal</AccessLevel>
<Declaration>Any</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</CommentMatch>
<SuppressIfBaseHasComment>false</SuppressIfBaseHasComment>
<MaxLineLength>80</MaxLineLength>
</CommentsSettings>
<NamingConventionSettings>
<Rules>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Enum</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>EnumerationMember</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches />
<Description>Classes, Enumerations, Enumeration values should be named in Pascal</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Pascal</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Public Internal Protected ProtectedInternal</AccessLevel>
<Declaration>Property</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Public Internal Protected ProtectedInternal</AccessLevel>
<Declaration>Method</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Public Internal Protected ProtectedInternal</AccessLevel>
<Declaration>Event</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches />
<Description>Non private properties, methods, events should be in pascal.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Pascal</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>true</IsDisabled>
<Matches>
<Match>
<AccessLevel>Private</AccessLevel>
<Declaration>Property</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Private</AccessLevel>
<Declaration>Method</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Private</AccessLevel>
<Declaration>Event</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches />
<Description>Private properties, methods, events should be in camel.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Camel</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Field</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches />
<Description>Fields should be underscore camel.</Description>
<MustHavePrefixes>
<string>_</string>
</MustHavePrefixes>
<MustNotHavePrefixes>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Camel</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Variable</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Variable should be declared in camel.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Camel</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Parameter</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Function parameters should be in camel.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Camel</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Namespace</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Namespaces should be in Pascal.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>_</string>
<string>m_</string>
</MustNotHavePrefixes>
<Rule>Pascal</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Constant</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Constants should be in capital.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>UpperCase</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Any</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Constant</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</NotMatches>
<Description>Acronyms should not have more than 2 characters.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>MatchesRegex</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
<Regex>^(?&gt;(XML|SQL|[A-Z]{0,2})[A-Z]?([^A-Z]|$)|[^A-Z]+)*$</Regex>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Any</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Constant</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Field</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Private</AccessLevel>
<Declaration>Method</Declaration>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>None</AccessLevel>
<Declaration>Namespace</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</NotMatches>
<Description>Names should not have underscore character</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>NotMatchesRegex</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
<Regex>(?&lt;remove&gt;_)</Regex>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<MarkedWithAttribute>NUnit.Framework.TestFixtureAttribute</MarkedWithAttribute>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>TestFixtures should end with Test.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>Test</string>
</MustNotHavePrefixes>
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Test</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Method</Declaration>
<MarkedWithAttribute>NUnit.Framework.TestAttribute</MarkedWithAttribute>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Test methods should start with Test.</Description>
<MustHavePrefixes>
<string>Test</string>
</MustHavePrefixes>
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes>
<string>Test</string>
</MustNotHaveSuffixes>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Enum</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Enumerations should not end with Enum.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes>
<string>Enum</string>
</MustNotHaveSuffixes>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>EnumerationMember</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Do not name enumerations reserved.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>NotMatchesRegex</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
<Regex>(?&lt;remove&gt;(reserved|Reserved))</Regex>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Event</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Event should not have Before or After prefix.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes>
<string>Before</string>
<string>After</string>
</MustNotHavePrefixes>
<Rule>None</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Enum</Declaration>
<MarkedWithAttribute>System.FlagsAttribute</MarkedWithAttribute>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Flags enums should have plural names</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>s</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>true</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Enum</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Enum</Declaration>
<MarkedWithAttribute>System.FlagsAttribute</MarkedWithAttribute>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</NotMatches>
<Description>Enums that are not flags should not have plural names</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes>
<string>s</string>
</MustNotHaveSuffixes>
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Attribute</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Attribute should end with Attribute.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Attribute</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.EventArgs</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>EventArgs should end with EventArgs.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>EventArgs</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Exception</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Exceptions should end with Exception.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Exception</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Stack</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Generic.Stack</InheritedFrom>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches />
<Description>Stack should end with Collection or Stack.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Collection</string>
<string>Stack</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.ICollection</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.IEnumerable</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Generic.ICollection</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<NotMatches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Stack</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Queue</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Generic.Stack</InheritedFrom>
<MarkedWithAttribute />
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</NotMatches>
<Description>Collections should end with Collection.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Collection</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.IDictionary</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Generic.IDictionary</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Dictionary should end with Dictionary.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Dictionary</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Class</Declaration>
<InheritedFrom>System.Collections.Queue</InheritedFrom>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Queue should end with Collection or Queue.</Description>
<MustHavePrefixes />
<MustNotHavePrefixes />
<Rule>None</Rule>
<MustHaveSuffixes>
<string>Collection</string>
<string>Queue</string>
</MustHaveSuffixes>
<MustNotHaveSuffixes />
</NamingConventionRule>
<NamingConventionRule>
<IsDisabled>false</IsDisabled>
<Matches>
<Match>
<AccessLevel>Any</AccessLevel>
<Declaration>Interface</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</Matches>
<Description>Interfaces should be in Pascal and start with I.</Description>
<MustHavePrefixes>
<string>I</string>
</MustHavePrefixes>
<MustNotHavePrefixes />
<Rule>Pascal</Rule>
<MustHaveSuffixes />
<MustNotHaveSuffixes />
</NamingConventionRule>
</Rules>
<Exclusions />
</NamingConventionSettings>
<IdentifiersToSpellCheck>
<Match>
<AccessLevel>Public Protected ProtectedInternal</AccessLevel>
<Declaration>Any</Declaration>
<IsReadOnly>Maybe</IsReadOnly>
<IsStatic>Maybe</IsStatic>
<ParamDirection>Any</ParamDirection>
</Match>
</IdentifiersToSpellCheck>
<PatternsToIgnore>
<string>(?#email)\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*</string>
<string>(?#url)http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?</string>
</PatternsToIgnore>
</CodeStyleSettings>
</AgentSmithCSharpStyleSettings>
<CSharp>
<FormatSettings>
<ANONYMOUS_METHOD_DECLARATION_BRACES>NEXT_LINE</ANONYMOUS_METHOD_DECLARATION_BRACES>

20
src/Numerics/LinearAlgebra/Double/DenseVector.cs

@ -138,7 +138,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Returns a reference to the internal data structure.
/// </summary>
/// <param name="vector">The DenseVector whose internal data we are
/// <param name="vector">The <c>DenseVector</c> whose internal data we are
/// returning.</param>
/// <returns>
/// A reference to the internal date of the given vector.
@ -156,7 +156,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Returns a vector bound directly to a reference of the provided array.
/// </summary>
/// <param name="array">The array to bind to the DenseVector object.</param>
/// <param name="array">The array to bind to the <c>DenseVector</c> object.</param>
/// <returns>
/// A DenseVector whose values are bound to the given array.
/// </returns>
@ -404,7 +404,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
}
/// <summary>
/// Returns a <strong>Vector</strong> containing the same values of rightSide.
/// Returns a <strong>Vector</strong> containing the same values of <paramref name="rightSide"/>.
/// </summary>
/// <remarks>This method is included for completeness.</remarks>
/// <param name="rightSide">The vector to get the values from.</param>
@ -560,7 +560,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
}
/// <summary>
/// Returns a <strong>Vector</strong> containing the negated values of rightSide.
/// Returns a <strong>Vector</strong> containing the negated values of <paramref name="rightSide"/>.
/// </summary>
/// <param name="rightSide">The vector to get the values from.</param>
/// <returns>A vector containing the negated values as <paramref name="rightSide"/>.</returns>
@ -1137,7 +1137,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// A vector with n-random elements distributed according
/// to the specified random distribution.
/// </returns>
/// <exception cref="ArgumentNullException">If the n vector is non poisitive<see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">If the n vector is non positive<see langword="null" />.</exception>
public override Vector Random(int length, IContinuousDistribution randomDistribution)
{
if (length < 1)
@ -1163,7 +1163,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// A vector with n-random elements distributed according
/// to the specified random distribution.
/// </returns>
/// <exception cref="ArgumentNullException">If the n vector is non poisitive<see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">If the n vector is non positive<see langword="null" />.</exception>
public override Vector Random(int length, IDiscreteDistribution randomDistribution)
{
if (length < 1)
@ -1198,7 +1198,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Euclidean Norm also known as 2-Norm.
/// </summary>
/// <returns>Scalar ret = sqrt(sum(this[i]^2))</returns>
/// <returns>Scalar <c>ret = sqrt(sum(this[i]^2))</c></returns>
public override double Norm()
{
var sum = 0.0;
@ -1214,7 +1214,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// 1-Norm also known as Manhattan Norm or Taxicab Norm.
/// </summary>
/// <returns>Scalar ret = sum(abs(this[i]))</returns>
/// <returns>Scalar <c>ret = sum(abs(this[i]))</c></returns>
public override double Norm1()
{
return CommonParallel.Aggregate(
@ -1227,7 +1227,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// Computes the p-Norm.
/// </summary>
/// <param name="p">The p value.</param>
/// <returns>Scalar ret = (sum(abs(this[i])^p))^(1/p)</returns>
/// <returns>Scalar <c>ret = (sum(abs(this[i])^p))^(1/p)</c></returns>
public override double NormP(int p)
{
if (1 > p)
@ -1256,7 +1256,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Infinity Norm.
/// </summary>
/// <returns>Scalar ret = max(abs(this[i]))</returns>
/// <returns>Scalar <c>ret = max(abs(this[i]))</c></returns>
public override double NormInfinity()
{
return CommonParallel.Select(

81
src/Numerics/LinearAlgebra/Double/SparseVector.cs

@ -183,14 +183,13 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <returns>This vector as a column matrix.</returns>
public override Matrix ToColumnMatrix()
{
throw new NotImplementedException();
// var matrix = new SparseMatrix(this.Count, 1);
// CommonParallel.For(
// 0,
// this.Count,
// index => matrix[i, 0] = vector[index]);
// return matrix;
var matrix = new SparseMatrix(this.Count, 1);
for (var i = 0; i < this.NonZerosCount; i++)
{
matrix[this._nonZeroIndices[i], 0] = this._nonZeroValues[i];
}
return matrix;
}
/// <summary>
@ -199,14 +198,13 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <returns>This vector as a row matrix.</returns>
public override Matrix ToRowMatrix()
{
throw new NotImplementedException();
// var matrix = new SparseMatrix(1, this.Count);
// CommonParallel.For(
// 0,
// this.Count,
// index => matrix[0, i] = vector[index]);
// return matrix;
var matrix = new SparseMatrix(1, this.Count);
for (var i = 0; i < this.NonZerosCount; i++)
{
matrix[0, this._nonZeroIndices[i]] = this._nonZeroValues[i];
}
return matrix;
}
/// <summary>Gets or sets the value at the given <paramref name="index"/>.</summary>
@ -267,9 +265,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// </returns>
public override Matrix CreateMatrix(int rows, int columns)
{
throw new NotImplementedException();
// return new SparseMatrix(rows, columns);
return new SparseMatrix(rows, columns);
}
/// <summary>
@ -427,7 +423,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
}
/// <summary>
/// Adds the scaled sparce vector.
/// Adds the scaled sparse vector.
/// </summary>
/// <param name="alpha">The alpha.</param>
/// <param name="other">The other.</param>
@ -535,7 +531,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
}
/// <summary>
/// Returns a <strong>Vector</strong> containing the same values of rightSide.
/// Returns a <strong>Vector</strong> containing the same values of <paramref name="rightSide"/>.
/// </summary>
/// <remarks>This method is included for completeness.</remarks>
/// <param name="rightSide">The vector to get the values from.</param>
@ -691,7 +687,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
}
/// <summary>
/// Returns a <strong>Vector</strong> containing the negated values of rightSide.
/// Returns a <strong>Vector</strong> containing the negated values of <paramref name="rightSide"/>.
/// </summary>
/// <param name="rightSide">The vector to get the values from.</param>
/// <returns>A vector containing the negated values as <paramref name="rightSide"/>.</returns>
@ -1221,20 +1217,19 @@ namespace MathNet.Numerics.LinearAlgebra.Double
throw new ArgumentNullException("v");
}
throw new NotImplementedException();
// var matrix = new DenseMatrix(u.Count, v.Count);
// CommonParallel.For(
// 0,
// u.Count,
// i =>
// {
// for (int j = 0; j < v.Count; j++)
// {
// matrix.At(i, j, u.Data[i] * v.Data[j]);
// }
// });
// return matrix;
var matrix = new SparseMatrix(u.Count, v.Count);
for (var i = 0; i < u.NonZerosCount; i++)
{
for (var j = 0; j < v.NonZerosCount; j++)
{
if (u._nonZeroIndices[i] == v._nonZeroIndices[j])
{
matrix.At(i, j, u._nonZeroValues[i] * v._nonZeroValues[j]);
}
}
}
return matrix;
}
/// <summary>
@ -1246,7 +1241,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// A vector with n-random elements distributed according
/// to the specified random distribution.
/// </returns>
/// <exception cref="ArgumentNullException">If the length vector is non poisitive<see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">If the length vector is non positive<see langword="null" />.</exception>
public override Vector Random(int length, IContinuousDistribution randomDistribution)
{
if (length < 0)
@ -1272,7 +1267,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// A vector with n-random elements distributed according
/// to the specified random distribution.
/// </returns>
/// <exception cref="ArgumentNullException">If the n vector is non poisitive<see langword="null" />.</exception>
/// <exception cref="ArgumentNullException">If the n vector is non positive<see langword="null" />.</exception>
public override Vector Random(int length, IDiscreteDistribution randomDistribution)
{
if (length < 0)
@ -1310,7 +1305,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// Computes the p-Norm.
/// </summary>
/// <param name="p">The p value.</param>
/// <returns>Scalar ret = (sum(abs(this[i])^p))^(1/p)</returns>
/// <returns>Scalar <c>ret = (sum(abs(this[i])^p))^(1/p)</c></returns>
public override double NormP(int p)
{
if (1 > p)
@ -1329,7 +1324,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// <summary>
/// Infinity Norm.
/// </summary>
/// <returns>Scalar ret = max(abs(this[i]))</returns>
/// <returns>Scalar <c>ret = max(abs(this[i]))</c></returns>
public override double NormInfinity()
{
return CommonParallel.Select(0, this.NonZerosCount, (index, localData) => localData = Math.Max(localData, Math.Abs(this._nonZeroValues[index])), Math.Max);
@ -1344,7 +1339,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
/// </summary>
/// <returns>
/// A double sparce vector containing the values specified by the given string.
/// A double sparse vector containing the values specified by the given string.
/// </returns>
/// <param name="value">
/// The string to parse.
@ -1359,7 +1354,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
/// quotes): 'n', 'n,n,..', '(n,n,..)', '[n,n,...]', where n is a double.
/// </summary>
/// <returns>
/// A double sparce vector containing the values specified by the given string.
/// A double sparse vector containing the values specified by the given string.
/// </returns>
/// <param name="value">
/// the string to parse.
@ -1596,7 +1591,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double
#region System.Object override
/// <summary>
/// Check equality. If this is regular vector, then chek by base implementation. If Sparse - use own equition
/// Check equality. If this is regular vector, then check by base implementation. If Sparse - use own method.
/// </summary>
/// <param name="obj">Object to compare</param>
/// <returns>

1
src/Numerics/Numerics.csproj

@ -101,6 +101,7 @@
<Compile Include="Constants.cs" />
<Compile Include="Control.cs" />
<Compile Include="Complex32.cs" />
<Compile Include="LinearAlgebra\Double\SparseMatrix.cs" />
<Compile Include="Permutation.cs" />
<Compile Include="Distributions\Continuous\Beta.cs" />
<Compile Include="Distributions\Continuous\ContinuousUniform.cs" />

3
src/Silverlight/Silverlight.csproj

@ -242,6 +242,9 @@
<Compile Include="..\Numerics\LinearAlgebra\Double\Matrix.cs">
<Link>LinearAlgebra\Double\Matrix.cs</Link>
</Compile>
<Compile Include="..\Numerics\LinearAlgebra\Double\SparseMatrix.cs">
<Link>LinearAlgebra\Double\SparseMatrix.cs</Link>
</Compile>
<Compile Include="..\Numerics\LinearAlgebra\Double\SparseVector.cs">
<Link>LinearAlgebra\Double\SparseVector.cs</Link>
</Compile>

1
src/UnitTests/UnitTests.csproj

@ -90,6 +90,7 @@
<Compile Include="ComplexTests\ComplexTest.cs" />
<Compile Include="ComplexTests\Complex32Test.TextHandling.cs" />
<Compile Include="ComplexTests\Complex32Test.cs" />
<Compile Include="LinearAlgebraTests\Double\SparseMatrixTests.cs" />
<Compile Include="PermutationTest.cs" />
<Compile Include="DistributionTests\CommonDistributionTests.cs" />
<Compile Include="DistributionTests\Continuous\BetaTests.cs" />

Loading…
Cancel
Save