本文整理汇总了C#中Transpose类的典型用法代码示例。如果您正苦于以下问题:C# Transpose类的具体用法?C# Transpose怎么用?C# Transpose使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Transpose类属于命名空间,在下文中一共展示了Transpose类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Compute
internal static void Compute( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, double alpha, double[] A, int lda, double[] B, int ldb ){
if ( transA == Transpose.ConjTrans ) {
transA = Transpose.Trans;
}
ArgumentCheck(side, m, n, A, lda, B, ldb);
dna_blas_dtrsm(order, side, uplo, transA, diag, m, n, alpha, A, lda, B, ldb);
}
示例2: Compute
internal static int Compute( Transpose trans, int n, int nrhs, double[] A, int lda, int[] ipiv, double[] B, int ldb ){
ArgumentCheck(n, nrhs, A, lda, B, ldb, ipiv);
if ( trans == Transpose.ConjTrans ) {
trans = Transpose.Trans;
}
return dna_lapack_dgetrs(trans,n,nrhs,A,lda,ipiv,B,ldb);
}
示例3: Compute
internal static int Compute( Side side, Transpose trans, int m, int n, int k, float[] A, int lda, float[] tau, float[] C, int ldc ){
ArgumentCheck(side, m, n, k, A, lda, tau, C, ldc);
if (tau.Length < System.Math.Max(1, k) ){
throw new ArgumentException("tau must be at least max(1,k).");
}
return dna_lapack_sormqr(Configuration.BlockSize, side, trans, m, n, k, A, lda, tau, C, ldc);
}
示例4: dcscmm
/// <summary>
/// Computes matrix-matrix product of a sparse matrix stored in the CSC format.
/// </summary>
void dcscmm(Transpose TransA, int m, int n, int k,
double alpha,
double[] val, int offsetval,
int[] indx, int offsetindx,
int[] pntrb, int offsetpntrb,
//int[] pntre, int offsetpntre,
double[] b, int offsetb, int ldb,
double beta,
double[] c, int offsetc, int ldc);
示例5: Compute
internal static int Compute( Vector vect, Side side, Transpose trans, int m, int n, int k, ComplexFloat[] A, int lda, ComplexFloat[] tau, ComplexFloat[] C, int ldc ){
ArgumentCheck(vect,side, m, n, k, A, lda, tau, C, ldc);
if( side == Side.Left){
if (tau.Length < System.Math.Max(1, System.Math.Min(m,k))){
throw new ArgumentException("tau must be at least max(1,k).");
}
}else{
if (tau.Length < System.Math.Max(1, System.Math.Min(n,k))){
throw new ArgumentException("tau must be at least max(1,k).");
}
}
return dna_lapack_cunmbr(Configuration.BlockSize, vect, side, trans, m, n, k, A, lda, tau, C, ldc);
}
示例6: Transpose
public CommandLineBuilder Transpose(Transpose mode, string input, string output) {
_owner.MarkFilterPosition();
if(input == null) {
input = PreviousOutput;
}
if(output == null) {
PreviousOutput = string.Format("[tmp{0}]", ++CurrentOperation);
output = PreviousOutput + ";";
} else if(output.Length > 0 && !output.EndsWith(";")) {
output += ";";
}
_ol.AppendFormat(" {0} transpose={1} {2}", input, (int)mode, output);
return _owner;
}
示例7: dna_blas_dtrsm
private static extern void dna_blas_dtrsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, double alpha, [In]double[] A, int lda, [In,Out]double[] B, int ldb );
示例8: dna_blas_strsm
private static extern void dna_blas_strsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, float alpha, [In]float[] A, int lda, [In,Out]float[] B, int ldb );
示例9: CacheObliviousMatrixMultiply
/// <summary>
/// Cache-Oblivious Matrix Multiplication
/// </summary>
/// <param name="transposeA">if set to <c>true</c> transpose matrix A.</param>
/// <param name="transposeB">if set to <c>true</c> transpose matrix B.</param>
/// <param name="alpha">The value to scale the matrix A with.</param>
/// <param name="matrixA">The matrix A.</param>
/// <param name="shiftArow">Row-shift of the left matrix</param>
/// <param name="shiftAcol">Column-shift of the left matrix</param>
/// <param name="matrixB">The matrix B.</param>
/// <param name="shiftBrow">Row-shift of the right matrix</param>
/// <param name="shiftBcol">Column-shift of the right matrix</param>
/// <param name="result">The matrix C.</param>
/// <param name="shiftCrow">Row-shift of the result matrix</param>
/// <param name="shiftCcol">Column-shift of the result matrix</param>
/// <param name="m">The number of rows of matrix op(A) and of the matrix C.</param>
/// <param name="n">The number of columns of matrix op(B) and of the matrix C.</param>
/// <param name="k">The number of columns of matrix op(A) and the rows of the matrix op(B).</param>
/// <param name="constM">The constant number of rows of matrix op(A) and of the matrix C.</param>
/// <param name="constN">The constant number of columns of matrix op(B) and of the matrix C.</param>
/// <param name="constK">The constant number of columns of matrix op(A) and the rows of the matrix op(B).</param>
/// <param name="first">Indicates if this is the first recursion.</param>
static void CacheObliviousMatrixMultiply(Transpose transposeA, Transpose transposeB, float alpha, float[] matrixA, int shiftArow, int shiftAcol, float[] matrixB, int shiftBrow, int shiftBcol, float[] result, int shiftCrow, int shiftCcol, int m, int n, int k, int constM, int constN, int constK, bool first)
{
if (m + n <= Control.ParallelizeOrder)
{
if ((int) transposeA > 111 && (int) transposeB > 111)
{
for (var m1 = 0; m1 < m; m1++)
{
var matArowPos = m1 + shiftArow;
var matCrowPos = m1 + shiftCrow;
for (var n1 = 0; n1 < n; ++n1)
{
var matBcolPos = n1 + shiftBcol;
float sum = 0;
for (var k1 = 0; k1 < k; ++k1)
{
sum += matrixA[(matArowPos*constK) + k1 + shiftAcol]*
matrixB[((k1 + shiftBrow)*constN) + matBcolPos];
}
result[((n1 + shiftCcol)*constM) + matCrowPos] += alpha*sum;
}
}
}
else if ((int) transposeA > 111)
{
for (var m1 = 0; m1 < m; m1++)
{
var matArowPos = m1 + shiftArow;
var matCrowPos = m1 + shiftCrow;
for (var n1 = 0; n1 < n; ++n1)
{
var matBcolPos = n1 + shiftBcol;
float sum = 0;
for (var k1 = 0; k1 < k; ++k1)
{
sum += matrixA[(matArowPos*constK) + k1 + shiftAcol]*
matrixB[(matBcolPos*constK) + k1 + shiftBrow];
}
result[((n1 + shiftCcol)*constM) + matCrowPos] += alpha*sum;
}
}
}
else if ((int) transposeB > 111)
{
for (var m1 = 0; m1 < m; m1++)
{
var matArowPos = m1 + shiftArow;
var matCrowPos = m1 + shiftCrow;
for (var n1 = 0; n1 < n; ++n1)
{
var matBcolPos = n1 + shiftBcol;
float sum = 0;
for (var k1 = 0; k1 < k; ++k1)
{
sum += matrixA[((k1 + shiftAcol)*constM) + matArowPos]*
matrixB[((k1 + shiftBrow)*constN) + matBcolPos];
}
result[((n1 + shiftCcol)*constM) + matCrowPos] += alpha*sum;
}
}
}
else
{
for (var m1 = 0; m1 < m; m1++)
{
var matArowPos = m1 + shiftArow;
var matCrowPos = m1 + shiftCrow;
for (var n1 = 0; n1 < n; ++n1)
{
var matBcolPos = n1 + shiftBcol;
float sum = 0;
for (var k1 = 0; k1 < k; ++k1)
{
sum += matrixA[((k1 + shiftAcol)*constM) + matArowPos]*
matrixB[(matBcolPos*constK) + k1 + shiftBrow];
//.........这里部分代码省略.........
示例10: MatrixMultiplyWithUpdate
/// <summary>
/// Multiplies two matrices and updates another with the result. <c>c = alpha*op(a)*op(b) + beta*c</c>
/// </summary>
/// <param name="transposeA">How to transpose the <paramref name="a"/> matrix.</param>
/// <param name="transposeB">How to transpose the <paramref name="b"/> matrix.</param>
/// <param name="alpha">The value to scale <paramref name="a"/> matrix.</param>
/// <param name="a">The a matrix.</param>
/// <param name="rowsA">The number of rows in the <paramref name="a"/> matrix.</param>
/// <param name="columnsA">The number of columns in the <paramref name="a"/> matrix.</param>
/// <param name="b">The b matrix</param>
/// <param name="rowsB">The number of rows in the <paramref name="b"/> matrix.</param>
/// <param name="columnsB">The number of columns in the <paramref name="b"/> matrix.</param>
/// <param name="beta">The value to scale the <paramref name="c"/> matrix.</param>
/// <param name="c">The c matrix.</param>
public virtual void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, float alpha, float[] a, int rowsA, int columnsA, float[] b, int rowsB, int columnsB, float beta, float[] c)
{
int m; // The number of rows of matrix op(A) and of the matrix C.
int n; // The number of columns of matrix op(B) and of the matrix C.
int k; // The number of columns of matrix op(A) and the rows of the matrix op(B).
// First check some basic requirement on the parameters of the matrix multiplication.
if (a == null)
{
throw new ArgumentNullException("a");
}
if (b == null)
{
throw new ArgumentNullException("b");
}
if ((int) transposeA > 111 && (int) transposeB > 111)
{
if (rowsA != columnsB)
{
throw new ArgumentOutOfRangeException();
}
if (columnsA*rowsB != c.Length)
{
throw new ArgumentOutOfRangeException();
}
m = columnsA;
n = rowsB;
k = rowsA;
}
else if ((int) transposeA > 111)
{
if (rowsA != rowsB)
{
throw new ArgumentOutOfRangeException();
}
if (columnsA*columnsB != c.Length)
{
throw new ArgumentOutOfRangeException();
}
m = columnsA;
n = columnsB;
k = rowsA;
}
else if ((int) transposeB > 111)
{
if (columnsA != columnsB)
{
throw new ArgumentOutOfRangeException();
}
if (rowsA*rowsB != c.Length)
{
throw new ArgumentOutOfRangeException();
}
m = rowsA;
n = rowsB;
k = columnsA;
}
else
{
if (columnsA != rowsB)
{
throw new ArgumentOutOfRangeException();
}
if (rowsA*columnsB != c.Length)
{
throw new ArgumentOutOfRangeException();
}
m = rowsA;
n = columnsB;
k = columnsA;
}
if (alpha == 0.0 && beta == 0.0)
{
Array.Clear(c, 0, c.Length);
return;
//.........这里部分代码省略.........
示例11: dna_blas_sgemv
private static extern void dna_blas_sgemv( Order order, Transpose TransA, int M, int N, float alpha, [In]float[] A, int lda, [In]float[] X, int incX, float beta, [In,Out]float[] Y, int incY);
示例12: LUSolve
/// <summary>
/// Solves A*X=B for X using LU factorization.
/// </summary>
/// <param name="transposeA">How to transpose the <paramref name="a"/> matrix.</param>
/// <param name="columnsOfB">The number of columns of B.</param>
/// <param name="a">The square matrix A.</param>
/// <param name="b">The B matrix.</param>
/// <remarks>This is equivalent to the GETRF and GETRS LAPACK routines.</remarks>
public void LUSolve(Transpose transposeA, int columnsOfB, Complex32[] a, Complex32[] b)
{
throw new NotImplementedException();
}
示例13: dna_blas_zgemv
private static extern void dna_blas_zgemv( Order order, Transpose TransA, int M, int N, ref Complex alpha, [In]Complex[] A, int lda, [In]Complex[] X, int incX, ref Complex beta, [In,Out]Complex[] Y, int incY);
示例14: ArgumentCheck
///<summary>Check arguments so that errors don't occur in native code</summary>
private static void ArgumentCheck(Order order, Transpose transA, int m, int n, object A, int lenA, int lda, object X, int lenX, ref int incx, object Y, int lenY, ref int incy)
{
if (A == null)
{
throw new ArgumentNullException("A", "A cannot be null.");
}
if (X == null)
{
throw new ArgumentNullException("X", "X cannot be null.");
}
if (Y == null)
{
throw new ArgumentNullException("Y", "Y cannot be null.");
}
if (m < 0)
{
throw new ArgumentException("m must be zero or greater", "m");
}
if (n < 0)
{
throw new ArgumentException("n must be zero or greater", "n");
}
if (order == Order.ColumnMajor)
{
if (lda < 1 || lda < m)
{
throw new ArgumentException("lda must be at least m.", "lda");
}
if (lenA < lda * n)
{
throw new ArgumentException("A must be at least lda * n.", "A");
}
}
else
{
if (lda < 1 || lda < n)
{
throw new ArgumentException("lda must be at least n.", "lda");
}
if (lenA < lda * m)
{
throw new ArgumentException("A must be at least lda * m.", "A");
}
}
if (incx == 0)
{
throw new ArgumentException("incx cannot be zero.", "incx");
}
if (incy == 0)
{
throw new ArgumentException("incy cannot be zero.", "incy");
}
incx = System.Math.Abs(incx);
incy = System.Math.Abs(incy);
if (transA == Transpose.NoTrans)
{
if (lenX < (1 + (n - 1) * incx))
{
throw new ArgumentException("The dimension of X must be at least 1 + (n-1) * abs(incx).");
}
if (lenY < (1 + (m - 1) * incy))
{
throw new ArgumentException("The dimension of Y must be at least 1 + (m-1) * abs(incy).");
}
}
else
{
if (lenX < (1 + (m - 1) * incx))
{
throw new ArgumentException("The dimension of X must be at least 1 + (m-1) * abs(incx).");
}
if (lenY < (1 + (n - 1) * incy))
{
throw new ArgumentException("The dimension of Y must be at least 1 + (n-1) * abs(incy).");
}
}
}
示例15: LUSolveFactored
/// <summary>
/// Solves A*X=B for X using a previously factored A matrix.
/// </summary>
/// <param name="transposeA">How to transpose the <paramref name="a"/> matrix.</param>
/// <param name="columnsOfB">The number of columns of B.</param>
/// <param name="a">The factored A matrix.</param>
/// <param name="order">The order of the square matrix <paramref name="a"/>.</param>
/// <param name="ipiv">The pivot indices of <paramref name="a"/>.</param>
/// <param name="b">The B matrix.</param>
/// <remarks>This is equivalent to the GETRS LAPACK routine.</remarks>
public void LUSolveFactored(Transpose transposeA, int columnsOfB, Complex32[] a, int order, int[] ipiv, Complex32[] b)
{
if (a == null)
{
throw new ArgumentNullException("a");
}
if (ipiv == null)
{
throw new ArgumentNullException("ipiv");
}
if (b == null)
{
throw new ArgumentNullException("b");
}
if (a.Length != order * order)
{
throw new ArgumentException(Resources.ArgumentArraysSameLength, "a");
}
if (ipiv.Length != order)
{
throw new ArgumentException(Resources.ArgumentArraysSameLength, "ipiv");
}
if (b.Length != order * columnsOfB)
{
throw new ArgumentException(Resources.ArgumentArraysSameLength, "b");
}
if (transposeA == Transpose.Transpose)
{
var aT = new Complex32[a.Length];
for (var i = 0; i < order; i++)
{
for (var j = 0; j < order; j++)
{
aT[(j * order) + i] = a[(i * order) + j];
}
}
LUSolveFactored(columnsOfB, aT, order, ipiv, b);
}
else if (transposeA == Transpose.ConjugateTranspose)
{
var acT = new Complex32[a.Length];
for (var i = 0; i < order; i++)
{
for (var j = 0; j < order; j++)
{
acT[(j * order) + i] = a[(i * order) + j].Conjugate();
}
}
LUSolveFactored(columnsOfB, acT, order, ipiv, b);
}
else
{
LUSolveFactored(columnsOfB, a, order, ipiv, b);
}
}