forked from tsai/mathnet-numerics
6 changed files with 118 additions and 78 deletions
@ -0,0 +1,104 @@ |
|||
// <copyright file="Matrix.BCL.cs" company="Math.NET">
|
|||
// Math.NET Numerics, part of the Math.NET Project
|
|||
// http://numerics.mathdotnet.com
|
|||
// http://github.com/mathnet/mathnet-numerics
|
|||
// http://mathnetnumerics.codeplex.com
|
|||
//
|
|||
// Copyright (c) 2009-2013 Math.NET
|
|||
//
|
|||
// Permission is hereby granted, free of charge, to any person
|
|||
// obtaining a copy of this software and associated documentation
|
|||
// files (the "Software"), to deal in the Software without
|
|||
// restriction, including without limitation the rights to use,
|
|||
// copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|||
// copies of the Software, and to permit persons to whom the
|
|||
// Software is furnished to do so, subject to the following
|
|||
// conditions:
|
|||
//
|
|||
// The above copyright notice and this permission notice shall be
|
|||
// included in all copies or substantial portions of the Software.
|
|||
//
|
|||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|||
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|||
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|||
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|||
// OTHER DEALINGS IN THE SOFTWARE.
|
|||
// </copyright>
|
|||
|
|||
using System; |
|||
|
|||
namespace MathNet.Numerics.LinearAlgebra.Generic |
|||
{ |
|||
public abstract partial class Matrix<T> |
|||
{ |
|||
/// <summary>
|
|||
/// Indicates whether the current object is equal to another object of the same type.
|
|||
/// </summary>
|
|||
/// <param name="other">
|
|||
/// An object to compare with this object.
|
|||
/// </param>
|
|||
/// <returns>
|
|||
/// <c>true</c> if the current object is equal to the <paramref name="other"/> parameter; otherwise, <c>false</c>.
|
|||
/// </returns>
|
|||
public bool Equals(Matrix<T> other) |
|||
{ |
|||
return other != null && Storage.Equals(other.Storage); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
|
|||
/// </summary>
|
|||
/// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
|
|||
/// <returns>
|
|||
/// <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
|
|||
/// </returns>
|
|||
public override bool Equals(object obj) |
|||
{ |
|||
var other = obj as Matrix<T>; |
|||
return other != null && Storage.Equals(other.Storage); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns a hash code for this instance.
|
|||
/// </summary>
|
|||
/// <returns>
|
|||
/// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
|
|||
/// </returns>
|
|||
public override int GetHashCode() |
|||
{ |
|||
return Storage.GetHashCode(); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Returns a <see cref="System.String"/> that represents this instance.
|
|||
/// </summary>
|
|||
/// <returns>
|
|||
/// A <see cref="System.String"/> that represents this instance.
|
|||
/// </returns>
|
|||
public override string ToString() |
|||
{ |
|||
return ToString(null, null); |
|||
} |
|||
|
|||
#if !PORTABLE
|
|||
|
|||
/// <summary>
|
|||
/// Creates a new object that is a copy of the current instance.
|
|||
/// </summary>
|
|||
/// <returns>
|
|||
/// A new object that is a copy of this instance.
|
|||
/// </returns>
|
|||
object ICloneable.Clone() |
|||
{ |
|||
return Clone(); |
|||
} |
|||
|
|||
#endif
|
|||
|
|||
|
|||
|
|||
} |
|||
} |
|||
Loading…
Reference in new issue