本文整理汇总了C#中Norm类的典型用法代码示例。如果您正苦于以下问题:C# Norm类的具体用法?C# Norm怎么用?C# Norm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Norm类属于命名空间,在下文中一共展示了Norm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MatrixNorm
public override double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
if (matrix == null)
{
throw new ArgumentNullException("matrix");
}
if (rows <= 0)
{
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows");
}
if (columns <= 0)
{
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns");
}
if (matrix.Length < rows * columns)
{
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix");
}
var work = new double[rows];
return SafeNativeMethods.d_matrix_norm((byte)norm, rows, columns, matrix, work);
}
示例2: MatrixNorm
public override float MatrixNorm(Norm norm, int rows, int columns, float[] matrix)
{
if (matrix == null)
{
throw new ArgumentNullException("matrix");
}
if (rows <= 0)
{
throw new ArgumentException(Resources.ArgumentMustBePositive, "rows");
}
if (columns <= 0)
{
throw new ArgumentException(Resources.ArgumentMustBePositive, "columns");
}
if (matrix.Length < rows * columns)
{
throw new ArgumentException(string.Format(Resources.ArrayTooSmall, rows * columns), "matrix");
}
var work = new float[rows];
return MatrixNorm(norm, rows, columns, matrix, work);
}
示例3: Edit
//
// GET: /Games/Edit/5
public ActionResult Edit(Norm.ObjectId id)
{
Game game = context.Games.GetAll().Single(x => x.Id == id);
return View(game);
}
示例4: MatrixNorm
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex MatrixNorm(Norm norm, Complex[] matrix)
{
throw new NotImplementedException();
}
示例5: MatrixNorm
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <param name="work">The work array. Not used in the managed provider.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public virtual double MatrixNorm(Norm norm, int rows, int columns, double[] matrix, double[] work)
{
return MatrixNorm(norm, rows, columns, matrix);
}
示例6: MatrixNorm
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public Complex32 MatrixNorm(Norm norm, int rows, int columns, Complex32[] matrix)
{
throw new NotImplementedException();
}
示例7: Edit
//
// GET: /Users/Edit/5
public ActionResult Edit(Norm.ObjectId id)
{
User user = context.Users.GetAll().Single(x => x.Id == id);
return View(user);
}
示例8: Details
//
// GET: /Users/Details/5
public ViewResult Details(Norm.ObjectId id)
{
User user = context.Users.GetAll().Single(x => x.Id == id);
return View(user);
}
示例9: DeleteConfirmed
public ActionResult DeleteConfirmed(Norm.ObjectId id)
{
User user = context.Users.GetAll().Single(x => x.Id == id);
context.Users.Delete(user);
return RedirectToAction("Index");
}
示例10: CanComputeMatrixNorm
public void CanComputeMatrixNorm(Norm norm, double[] matrix, double[] work)
{
}
示例11: Edit
//
// GET: /HashTags/Edit/5
public ActionResult Edit(Norm.ObjectId id)
{
HashTag hashtag = _repository.Linq().Single(x => x.Id == id);
return View(hashtag);
}
示例12: Details
//
// GET: /HashTags/Details/5
public ViewResult Details(Norm.ObjectId id)
{
HashTag hashtag = _repository.Linq().Single(x => x.Id == id);
return View(hashtag);
}
示例13: DeleteConfirmed
public ActionResult DeleteConfirmed(Norm.ObjectId id)
{
_repository.Remove(id);
return RedirectToAction("Index");
}
示例14: Bytes
// Load & cache full bytes array. Returns bytes.
public byte[] Bytes()
{
lock (this)
{
System.Diagnostics.Debug.Assert(refCount > 0 &&(origNorm == null || origNorm.refCount > 0));
if (bytes == null)
{
// value not yet read
System.Diagnostics.Debug.Assert(bytesRef == null);
if (origNorm != null)
{
// Ask origNorm to load so that for a series of
// reopened readers we share a single read-only
// byte[]
bytes = origNorm.Bytes();
bytesRef = origNorm.bytesRef;
bytesRef.IncRef();
// Once we've loaded the bytes we no longer need
// origNorm:
origNorm.DecRef();
origNorm = null;
}
else
{
// We are the origNorm, so load the bytes for real
// ourself:
int count = Enclosing_Instance.MaxDoc();
bytes = new byte[count];
// Since we are orig, in must not be null
System.Diagnostics.Debug.Assert(in_Renamed != null);
// Read from disk.
lock (in_Renamed)
{
in_Renamed.Seek(normSeek);
in_Renamed.ReadBytes(bytes, 0, count, false);
}
bytesRef = new Ref();
CloseInput();
}
}
return bytes;
}
}
示例15: MatrixNorm
/// <summary>
/// Computes the requested <see cref="Norm"/> of the matrix.
/// </summary>
/// <param name="norm">The type of norm to compute.</param>
/// <param name="rows">The number of rows.</param>
/// <param name="columns">The number of columns.</param>
/// <param name="matrix">The matrix to compute the norm from.</param>
/// <returns>
/// The requested <see cref="Norm"/> of the matrix.
/// </returns>
public double MatrixNorm(Norm norm, int rows, int columns, double[] matrix)
{
var ret = 0.0;
switch (norm)
{
case Norm.OneNorm:
break;
case Norm.LargestAbsoluteValue:
break;
case Norm.InfinityNorm:
break;
case Norm.FrobeniusNorm:
break;
}
return ret;
}