コード例 #1
0
ファイル: Getrs.cs プロジェクト: xuchuansheng/GenXSource
 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);
 }
コード例 #2
0
ファイル: Ormqr.cs プロジェクト: Altaxo/Altaxo
    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);
    }
コード例 #3
0
ファイル: Trsm.cs プロジェクト: xuchuansheng/GenXSource
 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);
 }
コード例 #4
0
 /// <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
0
ファイル: Unmbr.cs プロジェクト: xuchuansheng/GenXSource
 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
0
		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
0
ファイル: Gemv.cs プロジェクト: Altaxo/Altaxo
 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);
コード例 #8
0
ファイル: Unmqr.cs プロジェクト: carlhuth/GenXSource
 private static extern int dna_lapack_cunmqr(int block_size, Side side, Transpose trans, int m, int n, int k, [In, Out] ComplexFloat[] A, int lda, [In, Out] ComplexFloat[] tau, [In, Out] ComplexFloat[] C, int ldc);
コード例 #9
0
ファイル: Unmhr.cs プロジェクト: Altaxo/Altaxo
 private static extern int dna_lapack_zunmhr( int block_size, Side side, Transpose trans, int m, int n, int k, int ilo, int ihi, [In,Out]Complex[] A, int lda, [In,Out]Complex[] tau, [In,Out]Complex[] C, int ldc   );
コード例 #10
0
ファイル: Trsm.cs プロジェクト: xuchuansheng/GenXSource
 internal static void Compute( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, Complex alpha, Complex[] A, int lda, Complex[] B, int ldb ){
   ArgumentCheck(side, m, n, A, lda, B, ldb);
   
   dna_blas_ztrsm(order, side, uplo, transA, diag, m, n, ref alpha, A, lda, B, ldb);
 }
コード例 #11
0
ファイル: Trsm.cs プロジェクト: xuchuansheng/GenXSource
 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 );
コード例 #12
0
        /// <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);
            }
        }
コード例 #13
0
ファイル: Trsm.cs プロジェクト: carlhuth/GenXSource
        internal static void Compute(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, Complex alpha, Complex[] A, int lda, Complex[] B, int ldb)
        {
            ArgumentCheck(side, m, n, A, lda, B, ldb);

            dna_blas_ztrsm(order, side, uplo, transA, diag, m, n, ref alpha, A, lda, B, ldb);
        }
コード例 #14
0
ファイル: Gbmv.cs プロジェクト: carlhuth/GenXSource
 ///<summary>Check arguments so that errors don't occur in native code</summary>
 private static void ArgumentCheck(Order order, Transpose transA, int width, 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 (lda < width)
     {
         throw new ArgumentException("lda must be at least ku+kl+1", "lda");
     }
     if (lenA < lda * width)
     {
         throw new ArgumentException("A must be at least lda * (ku + k1 + 1).", "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 && order == Order.RowMajor)
     {
         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
0
ファイル: Gbmv.cs プロジェクト: carlhuth/GenXSource
 private static extern void dna_blas_zgbmv(Order order, Transpose TransA, int M, int N, int KL, int KU, ref Complex alpha, [In] Complex[] A, int lda, [In] Complex[] X, int incX, ref Complex beta, [In, Out] Complex[] Y, int incY);
コード例 #16
0
ファイル: Gbmv.cs プロジェクト: carlhuth/GenXSource
 private static extern void dna_blas_dgbmv(Order order, Transpose TransA, int M, int N, int KL, int KU, double alpha, [In] double[] A, int lda, [In] double[] X, int incX, double beta, [In, Out] double[] Y, int incY);
コード例 #17
0
ファイル: Gbmv.cs プロジェクト: carlhuth/GenXSource
 private static extern void dna_blas_sgbmv(Order order, Transpose TransA, int M, int N, int KL, int KU, float alpha, [In] float[] A, int lda, [In] float[] X, int incX, float beta, [In, Out] float[] Y, int incY);
コード例 #18
0
ファイル: CommonFormatter.cs プロジェクト: zhiyongpeng/xFunc
 /// <summary>
 /// Analyzes the specified expression.
 /// </summary>
 /// <param name="exp">The expression.</param>
 /// <returns>The result of analysis.</returns>
 public string Analyze(Transpose exp)
 {
     return(ToString(exp, "transpose({0})"));
 }
コード例 #19
0
ファイル: Unmhr.cs プロジェクト: olesar/Altaxo
 private static extern int dna_lapack_zunmhr(int block_size, Side side, Transpose trans, int m, int n, int k, int ilo, int ihi, [In, Out] Complex[] A, int lda, [In, Out] Complex[] tau, [In, Out] Complex[] C, int ldc);
コード例 #20
0
ファイル: Gemv.cs プロジェクト: Altaxo/Altaxo
 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);
コード例 #21
0
ファイル: Trsm.cs プロジェクト: carlhuth/GenXSource
 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);
コード例 #22
0
ファイル: Trsm.cs プロジェクト: carlhuth/GenXSource
 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);
コード例 #23
0
    public void Many_lines()
    {
        const string input =
            "Chor. Two households, both alike in dignity,\n" +
            "In fair Verona, where we lay our scene,\n" +
            "From ancient grudge break to new mutiny,\n" +
            "Where civil blood makes civil hands unclean.\n" +
            "From forth the fatal loins of these two foes\n" +
            "A pair of star-cross'd lovers take their life;\n" +
            "Whose misadventur'd piteous overthrows\n" +
            "Doth with their death bury their parents' strife.\n" +
            "The fearful passage of their death-mark'd love,\n" +
            "And the continuance of their parents' rage,\n" +
            "Which, but their children's end, naught could remove,\n" +
            "Is now the two hours' traffic of our stage;\n" +
            "The which if you with patient ears attend,\n" +
            "What here shall miss, our toil shall strive to mend.";

        const string expected =
            "CIFWFAWDTAWITW\n" +
            "hnrhr hohnhshh\n" +
            "o oeopotedi ea\n" +
            "rfmrmash  cn t\n" +
            ".a e ie fthow \n" +
            " ia fr weh,whh\n" +
            "Trnco miae  ie\n" +
            "w ciroitr btcr\n" +
            "oVivtfshfcuhhe\n" +
            " eeih a uote  \n" +
            "hrnl sdtln  is\n" +
            "oot ttvh tttfh\n" +
            "un bhaeepihw a\n" +
            "saglernianeoyl\n" +
            "e,ro -trsui ol\n" +
            "h uofcu sarhu \n" +
            "owddarrdan o m\n" +
            "lhg to'egccuwi\n" +
            "deemasdaeehris\n" +
            "sr als t  ists\n" +
            ",ebk 'phool'h,\n" +
            "  reldi ffd   \n" +
            "bweso tb  rtpo\n" +
            "oea ileutterau\n" +
            "t kcnoorhhnatr\n" +
            "hl isvuyee'fi \n" +
            " atv es iisfet\n" +
            "ayoior trr ino\n" +
            "l  lfsoh  ecti\n" +
            "ion   vedpn  l\n" +
            "kuehtteieadoe \n" +
            "erwaharrar,fas\n" +
            "   nekt te  rh\n" +
            "ismdsehphnnosa\n" +
            "ncuse ra-tau l\n" +
            " et  tormsural\n" +
            "dniuthwea'g t \n" +
            "iennwesnr hsts\n" +
            "g,ycoi tkrttet\n" +
            "n ,l r s'a anr\n" +
            "i  ef  'dgcgdi\n" +
            "t  aol   eoe,v\n" +
            "y  nei sl,u; e\n" +
            ",  .sf to l   \n" +
            "     e rv d  t\n" +
            "     ; ie    o\n" +
            "       f, r   \n" +
            "       e  e  m\n" +
            "       .  m  e\n" +
            "          o  n\n" +
            "          v  d\n" +
            "          e  .\n" +
            "          ,  ";


        Assert.That(Transpose.String(input), Is.EqualTo(expected));
    }
コード例 #24
0
ファイル: Trsm.cs プロジェクト: carlhuth/GenXSource
 private static extern void dna_blas_ztrsm(Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m, int n, ref Complex alpha, [In] Complex[] A, int lda, [In, Out] Complex[] B, int ldb);
コード例 #25
0
ファイル: Trsm.cs プロジェクト: xuchuansheng/GenXSource
 private static extern void dna_blas_ztrsm( Order order, Side side, UpLo uplo, Transpose transA, Diag diag, int m,int n, ref Complex alpha, [In]Complex[] A, int lda, [In,Out]Complex[] B, int ldb );
コード例 #26
0
        /// <inheritdoc />
        public bool Equals([AllowNull] HeatMapGl other)
        {
            if (other == null) return false;
            if (ReferenceEquals(this, other)) return true;

            return 
                (
                    Type == other.Type ||
                    Type != null &&
                    Type.Equals(other.Type)
                ) && 
                (
                    Visible == other.Visible ||
                    Visible != null &&
                    Visible.Equals(other.Visible)
                ) && 
                (
                    Opacity == other.Opacity ||
                    Opacity != null &&
                    Opacity.Equals(other.Opacity)
                ) && 
                (
                    Name == other.Name ||
                    Name != null &&
                    Name.Equals(other.Name)
                ) && 
                (
                    UId == other.UId ||
                    UId != null &&
                    UId.Equals(other.UId)
                ) && 
                (
                    Equals(Ids, other.Ids) ||
                    Ids != null && other.Ids != null &&
                    Ids.SequenceEqual(other.Ids)
                ) &&
                (
                    Equals(CustomData, other.CustomData) ||
                    CustomData != null && other.CustomData != null &&
                    CustomData.SequenceEqual(other.CustomData)
                ) &&
                (
                    Meta == other.Meta ||
                    Meta != null &&
                    Meta.Equals(other.Meta)
                ) && 
                (
                    Equals(MetaArray, other.MetaArray) ||
                    MetaArray != null && other.MetaArray != null &&
                    MetaArray.SequenceEqual(other.MetaArray)
                ) &&
                (
                    HoverInfo == other.HoverInfo ||
                    HoverInfo != null &&
                    HoverInfo.Equals(other.HoverInfo)
                ) && 
                (
                    Equals(HoverInfoArray, other.HoverInfoArray) ||
                    HoverInfoArray != null && other.HoverInfoArray != null &&
                    HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                ) &&
                (
                    HoverLabel == other.HoverLabel ||
                    HoverLabel != null &&
                    HoverLabel.Equals(other.HoverLabel)
                ) && 
                (
                    Stream == other.Stream ||
                    Stream != null &&
                    Stream.Equals(other.Stream)
                ) && 
                (
                    Equals(Transforms, other.Transforms) ||
                    Transforms != null && other.Transforms != null &&
                    Transforms.SequenceEqual(other.Transforms)
                ) &&
                (
                    UiRevision == other.UiRevision ||
                    UiRevision != null &&
                    UiRevision.Equals(other.UiRevision)
                ) && 
                (
                    Equals(Z, other.Z) ||
                    Z != null && other.Z != null &&
                    Z.SequenceEqual(other.Z)
                ) &&
                (
                    Equals(X, other.X) ||
                    X != null && other.X != null &&
                    X.SequenceEqual(other.X)
                ) &&
                (
                    X0 == other.X0 ||
                    X0 != null &&
                    X0.Equals(other.X0)
                ) && 
                (
                    DX == other.DX ||
                    DX != null &&
                    DX.Equals(other.DX)
                ) && 
                (
                    Equals(Y, other.Y) ||
                    Y != null && other.Y != null &&
                    Y.SequenceEqual(other.Y)
                ) &&
                (
                    Y0 == other.Y0 ||
                    Y0 != null &&
                    Y0.Equals(other.Y0)
                ) && 
                (
                    Dy == other.Dy ||
                    Dy != null &&
                    Dy.Equals(other.Dy)
                ) && 
                (
                    Equals(Text, other.Text) ||
                    Text != null && other.Text != null &&
                    Text.SequenceEqual(other.Text)
                ) &&
                (
                    Transpose == other.Transpose ||
                    Transpose != null &&
                    Transpose.Equals(other.Transpose)
                ) && 
                (
                    XType == other.XType ||
                    XType != null &&
                    XType.Equals(other.XType)
                ) && 
                (
                    YType == other.YType ||
                    YType != null &&
                    YType.Equals(other.YType)
                ) && 
                (
                    ZAuto == other.ZAuto ||
                    ZAuto != null &&
                    ZAuto.Equals(other.ZAuto)
                ) && 
                (
                    ZMin == other.ZMin ||
                    ZMin != null &&
                    ZMin.Equals(other.ZMin)
                ) && 
                (
                    ZMax == other.ZMax ||
                    ZMax != null &&
                    ZMax.Equals(other.ZMax)
                ) && 
                (
                    ZMid == other.ZMid ||
                    ZMid != null &&
                    ZMid.Equals(other.ZMid)
                ) && 
                (
                    ColorScale == other.ColorScale ||
                    ColorScale != null &&
                    ColorScale.Equals(other.ColorScale)
                ) && 
                (
                    AutoColorScale == other.AutoColorScale ||
                    AutoColorScale != null &&
                    AutoColorScale.Equals(other.AutoColorScale)
                ) && 
                (
                    ReverseScale == other.ReverseScale ||
                    ReverseScale != null &&
                    ReverseScale.Equals(other.ReverseScale)
                ) && 
                (
                    ShowScale == other.ShowScale ||
                    ShowScale != null &&
                    ShowScale.Equals(other.ShowScale)
                ) && 
                (
                    ColorBar == other.ColorBar ||
                    ColorBar != null &&
                    ColorBar.Equals(other.ColorBar)
                ) && 
                (
                    ColorAxis == other.ColorAxis ||
                    ColorAxis != null &&
                    ColorAxis.Equals(other.ColorAxis)
                ) && 
                (
                    XAxis == other.XAxis ||
                    XAxis != null &&
                    XAxis.Equals(other.XAxis)
                ) && 
                (
                    YAxis == other.YAxis ||
                    YAxis != null &&
                    YAxis.Equals(other.YAxis)
                ) && 
                (
                    IdsSrc == other.IdsSrc ||
                    IdsSrc != null &&
                    IdsSrc.Equals(other.IdsSrc)
                ) && 
                (
                    CustomDataSrc == other.CustomDataSrc ||
                    CustomDataSrc != null &&
                    CustomDataSrc.Equals(other.CustomDataSrc)
                ) && 
                (
                    MetaSrc == other.MetaSrc ||
                    MetaSrc != null &&
                    MetaSrc.Equals(other.MetaSrc)
                ) && 
                (
                    HoverInfoSrc == other.HoverInfoSrc ||
                    HoverInfoSrc != null &&
                    HoverInfoSrc.Equals(other.HoverInfoSrc)
                ) && 
                (
                    ZSrc == other.ZSrc ||
                    ZSrc != null &&
                    ZSrc.Equals(other.ZSrc)
                ) && 
                (
                    XSrc == other.XSrc ||
                    XSrc != null &&
                    XSrc.Equals(other.XSrc)
                ) && 
                (
                    YSrc == other.YSrc ||
                    YSrc != null &&
                    YSrc.Equals(other.YSrc)
                ) && 
                (
                    TextSrc == other.TextSrc ||
                    TextSrc != null &&
                    TextSrc.Equals(other.TextSrc)
                );
        }
コード例 #27
0
 internal static extern void s_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, float alpha, float[] x, float[] y, float beta, [In, Out] float[] c);
コード例 #28
0
        public void ProcessCurrentEvents()
        {
            if (CurrentEvents == null || CurrentEvents.Count == 0)
            {
                return;
            }

            // a plugin must implement IVstPluginMidiSource or this call will throw an exception.
            IVstMidiProcessor midiHost = _plugin.Host.GetInstance <IVstMidiProcessor>();

            // always expect some hosts not to support this.
            if (midiHost != null)
            {
                VstEventCollection outEvents = new VstEventCollection();

                // NOTE: other types of events could be in the collection!
                foreach (VstEvent evnt in CurrentEvents)
                {
                    switch (evnt.EventType)
                    {
                    case VstEventTypes.MidiEvent:
                        VstMidiEvent midiEvent = (VstMidiEvent)evnt;

                        //General midi effects for all inputs
                        midiEvent = Gain.ProcessEvent(midiEvent);
                        midiEvent = Transpose.ProcessEvent(midiEvent);

                        //Process Midi Note in SampleManager
                        if ((midiEvent.Data[0] & 0xF0) == 0x80)
                        {
                            _plugin.SampleManager.ProcessNoteOffEvent(midiEvent.Data[1]);
                        }

                        if ((midiEvent.Data[0] & 0xF0) == 0x90)
                        {
                            // note on with velocity = 0 is a note off
                            if (MidiHelper.IsNoteOff(midiEvent.Data))
                            {
                                _plugin.SampleManager.ProcessNoteOffEvent(midiEvent.Data[1]);
                            }
                            else
                            {
                                _plugin.SampleManager.ProcessNoteOnEvent(midiEvent.Data[1]);
                            }
                        }

                        outEvents.Add(midiEvent);
                        break;

                    default:
                        // non VstMidiEvent
                        outEvents.Add(evnt);
                        break;
                    }
                }

                midiHost.Process(outEvents);
            }

            // Clear the cache, we've processed the events.
            CurrentEvents = null;
        }
コード例 #29
0
 /// <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();
 }
コード例 #30
0
        /// <inheritdoc />
        public bool Equals([AllowNull] HeatMap other)
        {
            if (other == null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type != null &&
                     Type.Equals(other.Type)
                     ) &&
                 (
                     Visible == other.Visible ||
                     Visible != null &&
                     Visible.Equals(other.Visible)
                 ) &&
                 (
                     LegendGroup == other.LegendGroup ||
                     LegendGroup != null &&
                     LegendGroup.Equals(other.LegendGroup)
                 ) &&
                 (
                     Opacity == other.Opacity ||
                     Opacity != null &&
                     Opacity.Equals(other.Opacity)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UId == other.UId ||
                     UId != null &&
                     UId.Equals(other.UId)
                 ) &&
                 (
                     Equals(Ids, other.Ids) ||
                     Ids != null && other.Ids != null &&
                     Ids.SequenceEqual(other.Ids)
                 ) &&
                 (
                     Equals(CustomData, other.CustomData) ||
                     CustomData != null && other.CustomData != null &&
                     CustomData.SequenceEqual(other.CustomData)
                 ) &&
                 (
                     Meta == other.Meta ||
                     Meta != null &&
                     Meta.Equals(other.Meta)
                 ) &&
                 (
                     Equals(MetaArray, other.MetaArray) ||
                     MetaArray != null && other.MetaArray != null &&
                     MetaArray.SequenceEqual(other.MetaArray)
                 ) &&
                 (
                     HoverInfo == other.HoverInfo ||
                     HoverInfo != null &&
                     HoverInfo.Equals(other.HoverInfo)
                 ) &&
                 (
                     Equals(HoverInfoArray, other.HoverInfoArray) ||
                     HoverInfoArray != null && other.HoverInfoArray != null &&
                     HoverInfoArray.SequenceEqual(other.HoverInfoArray)
                 ) &&
                 (
                     HoverLabel == other.HoverLabel ||
                     HoverLabel != null &&
                     HoverLabel.Equals(other.HoverLabel)
                 ) &&
                 (
                     Stream == other.Stream ||
                     Stream != null &&
                     Stream.Equals(other.Stream)
                 ) &&
                 (
                     Equals(Transforms, other.Transforms) ||
                     Transforms != null && other.Transforms != null &&
                     Transforms.SequenceEqual(other.Transforms)
                 ) &&
                 (
                     UiRevision == other.UiRevision ||
                     UiRevision != null &&
                     UiRevision.Equals(other.UiRevision)
                 ) &&
                 (
                     Equals(Z, other.Z) ||
                     Z != null && other.Z != null &&
                     Z.SequenceEqual(other.Z)
                 ) &&
                 (
                     Equals(X, other.X) ||
                     X != null && other.X != null &&
                     X.SequenceEqual(other.X)
                 ) &&
                 (
                     X0 == other.X0 ||
                     X0 != null &&
                     X0.Equals(other.X0)
                 ) &&
                 (
                     DX == other.DX ||
                     DX != null &&
                     DX.Equals(other.DX)
                 ) &&
                 (
                     Equals(Y, other.Y) ||
                     Y != null && other.Y != null &&
                     Y.SequenceEqual(other.Y)
                 ) &&
                 (
                     Y0 == other.Y0 ||
                     Y0 != null &&
                     Y0.Equals(other.Y0)
                 ) &&
                 (
                     Dy == other.Dy ||
                     Dy != null &&
                     Dy.Equals(other.Dy)
                 ) &&
                 (
                     Equals(Text, other.Text) ||
                     Text != null && other.Text != null &&
                     Text.SequenceEqual(other.Text)
                 ) &&
                 (
                     Equals(HoverText, other.HoverText) ||
                     HoverText != null && other.HoverText != null &&
                     HoverText.SequenceEqual(other.HoverText)
                 ) &&
                 (
                     Transpose == other.Transpose ||
                     Transpose != null &&
                     Transpose.Equals(other.Transpose)
                 ) &&
                 (
                     XType == other.XType ||
                     XType != null &&
                     XType.Equals(other.XType)
                 ) &&
                 (
                     YType == other.YType ||
                     YType != null &&
                     YType.Equals(other.YType)
                 ) &&
                 (
                     ZSmooth == other.ZSmooth ||
                     ZSmooth != null &&
                     ZSmooth.Equals(other.ZSmooth)
                 ) &&
                 (
                     HoverOnGaps == other.HoverOnGaps ||
                     HoverOnGaps != null &&
                     HoverOnGaps.Equals(other.HoverOnGaps)
                 ) &&
                 (
                     ConnectGaps == other.ConnectGaps ||
                     ConnectGaps != null &&
                     ConnectGaps.Equals(other.ConnectGaps)
                 ) &&
                 (
                     XGap == other.XGap ||
                     XGap != null &&
                     XGap.Equals(other.XGap)
                 ) &&
                 (
                     YGap == other.YGap ||
                     YGap != null &&
                     YGap.Equals(other.YGap)
                 ) &&
                 (
                     ZHoverFormat == other.ZHoverFormat ||
                     ZHoverFormat != null &&
                     ZHoverFormat.Equals(other.ZHoverFormat)
                 ) &&
                 (
                     HoverTemplate == other.HoverTemplate ||
                     HoverTemplate != null &&
                     HoverTemplate.Equals(other.HoverTemplate)
                 ) &&
                 (
                     Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                     HoverTemplateArray != null && other.HoverTemplateArray != null &&
                     HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)
                 ) &&
                 (
                     ShowLegend == other.ShowLegend ||
                     ShowLegend != null &&
                     ShowLegend.Equals(other.ShowLegend)
                 ) &&
                 (
                     ZAuto == other.ZAuto ||
                     ZAuto != null &&
                     ZAuto.Equals(other.ZAuto)
                 ) &&
                 (
                     ZMin == other.ZMin ||
                     ZMin != null &&
                     ZMin.Equals(other.ZMin)
                 ) &&
                 (
                     ZMax == other.ZMax ||
                     ZMax != null &&
                     ZMax.Equals(other.ZMax)
                 ) &&
                 (
                     ZMid == other.ZMid ||
                     ZMid != null &&
                     ZMid.Equals(other.ZMid)
                 ) &&
                 (
                     ColorScale == other.ColorScale ||
                     ColorScale != null &&
                     ColorScale.Equals(other.ColorScale)
                 ) &&
                 (
                     AutoColorScale == other.AutoColorScale ||
                     AutoColorScale != null &&
                     AutoColorScale.Equals(other.AutoColorScale)
                 ) &&
                 (
                     ReverseScale == other.ReverseScale ||
                     ReverseScale != null &&
                     ReverseScale.Equals(other.ReverseScale)
                 ) &&
                 (
                     ShowScale == other.ShowScale ||
                     ShowScale != null &&
                     ShowScale.Equals(other.ShowScale)
                 ) &&
                 (
                     ColorBar == other.ColorBar ||
                     ColorBar != null &&
                     ColorBar.Equals(other.ColorBar)
                 ) &&
                 (
                     ColorAxis == other.ColorAxis ||
                     ColorAxis != null &&
                     ColorAxis.Equals(other.ColorAxis)
                 ) &&
                 (
                     XCalendar == other.XCalendar ||
                     XCalendar != null &&
                     XCalendar.Equals(other.XCalendar)
                 ) &&
                 (
                     YCalendar == other.YCalendar ||
                     YCalendar != null &&
                     YCalendar.Equals(other.YCalendar)
                 ) &&
                 (
                     XAxis == other.XAxis ||
                     XAxis != null &&
                     XAxis.Equals(other.XAxis)
                 ) &&
                 (
                     YAxis == other.YAxis ||
                     YAxis != null &&
                     YAxis.Equals(other.YAxis)
                 ) &&
                 (
                     IdsSrc == other.IdsSrc ||
                     IdsSrc != null &&
                     IdsSrc.Equals(other.IdsSrc)
                 ) &&
                 (
                     CustomDataSrc == other.CustomDataSrc ||
                     CustomDataSrc != null &&
                     CustomDataSrc.Equals(other.CustomDataSrc)
                 ) &&
                 (
                     MetaSrc == other.MetaSrc ||
                     MetaSrc != null &&
                     MetaSrc.Equals(other.MetaSrc)
                 ) &&
                 (
                     HoverInfoSrc == other.HoverInfoSrc ||
                     HoverInfoSrc != null &&
                     HoverInfoSrc.Equals(other.HoverInfoSrc)
                 ) &&
                 (
                     ZSrc == other.ZSrc ||
                     ZSrc != null &&
                     ZSrc.Equals(other.ZSrc)
                 ) &&
                 (
                     XSrc == other.XSrc ||
                     XSrc != null &&
                     XSrc.Equals(other.XSrc)
                 ) &&
                 (
                     YSrc == other.YSrc ||
                     YSrc != null &&
                     YSrc.Equals(other.YSrc)
                 ) &&
                 (
                     TextSrc == other.TextSrc ||
                     TextSrc != null &&
                     TextSrc.Equals(other.TextSrc)
                 ) &&
                 (
                     HoverTextSrc == other.HoverTextSrc ||
                     HoverTextSrc != null &&
                     HoverTextSrc.Equals(other.HoverTextSrc)
                 ) &&
                 (
                     HoverTemplateSrc == other.HoverTemplateSrc ||
                     HoverTemplateSrc != null &&
                     HoverTemplateSrc.Equals(other.HoverTemplateSrc)
                 ));
        }
コード例 #31
0
ファイル: Unmqr.cs プロジェクト: carlhuth/GenXSource
 internal static int Compute(Side side, Transpose trans, int m, int n, int k, ComplexFloat[] A, int lda, ComplexFloat[] tau, ComplexFloat[] C, int ldc)
 {
     ArgumentCheck(side, m, n, k, A, lda, tau, C, ldc);
     return(dna_lapack_cunmqr(Configuration.BlockSize, side, trans, m, n, k, A, lda, tau, C, ldc));
 }
コード例 #32
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null)
         {
             hashCode = hashCode * 59 + Type.GetHashCode();
         }
         if (Visible != null)
         {
             hashCode = hashCode * 59 + Visible.GetHashCode();
         }
         if (LegendGroup != null)
         {
             hashCode = hashCode * 59 + LegendGroup.GetHashCode();
         }
         if (Opacity != null)
         {
             hashCode = hashCode * 59 + Opacity.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UId != null)
         {
             hashCode = hashCode * 59 + UId.GetHashCode();
         }
         if (Ids != null)
         {
             hashCode = hashCode * 59 + Ids.GetHashCode();
         }
         if (CustomData != null)
         {
             hashCode = hashCode * 59 + CustomData.GetHashCode();
         }
         if (Meta != null)
         {
             hashCode = hashCode * 59 + Meta.GetHashCode();
         }
         if (MetaArray != null)
         {
             hashCode = hashCode * 59 + MetaArray.GetHashCode();
         }
         if (HoverInfo != null)
         {
             hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         }
         if (HoverInfoArray != null)
         {
             hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         }
         if (HoverLabel != null)
         {
             hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         }
         if (Stream != null)
         {
             hashCode = hashCode * 59 + Stream.GetHashCode();
         }
         if (Transforms != null)
         {
             hashCode = hashCode * 59 + Transforms.GetHashCode();
         }
         if (UiRevision != null)
         {
             hashCode = hashCode * 59 + UiRevision.GetHashCode();
         }
         if (Z != null)
         {
             hashCode = hashCode * 59 + Z.GetHashCode();
         }
         if (X != null)
         {
             hashCode = hashCode * 59 + X.GetHashCode();
         }
         if (X0 != null)
         {
             hashCode = hashCode * 59 + X0.GetHashCode();
         }
         if (DX != null)
         {
             hashCode = hashCode * 59 + DX.GetHashCode();
         }
         if (Y != null)
         {
             hashCode = hashCode * 59 + Y.GetHashCode();
         }
         if (Y0 != null)
         {
             hashCode = hashCode * 59 + Y0.GetHashCode();
         }
         if (Dy != null)
         {
             hashCode = hashCode * 59 + Dy.GetHashCode();
         }
         if (Text != null)
         {
             hashCode = hashCode * 59 + Text.GetHashCode();
         }
         if (HoverText != null)
         {
             hashCode = hashCode * 59 + HoverText.GetHashCode();
         }
         if (Transpose != null)
         {
             hashCode = hashCode * 59 + Transpose.GetHashCode();
         }
         if (XType != null)
         {
             hashCode = hashCode * 59 + XType.GetHashCode();
         }
         if (YType != null)
         {
             hashCode = hashCode * 59 + YType.GetHashCode();
         }
         if (ZSmooth != null)
         {
             hashCode = hashCode * 59 + ZSmooth.GetHashCode();
         }
         if (HoverOnGaps != null)
         {
             hashCode = hashCode * 59 + HoverOnGaps.GetHashCode();
         }
         if (ConnectGaps != null)
         {
             hashCode = hashCode * 59 + ConnectGaps.GetHashCode();
         }
         if (XGap != null)
         {
             hashCode = hashCode * 59 + XGap.GetHashCode();
         }
         if (YGap != null)
         {
             hashCode = hashCode * 59 + YGap.GetHashCode();
         }
         if (ZHoverFormat != null)
         {
             hashCode = hashCode * 59 + ZHoverFormat.GetHashCode();
         }
         if (HoverTemplate != null)
         {
             hashCode = hashCode * 59 + HoverTemplate.GetHashCode();
         }
         if (HoverTemplateArray != null)
         {
             hashCode = hashCode * 59 + HoverTemplateArray.GetHashCode();
         }
         if (ShowLegend != null)
         {
             hashCode = hashCode * 59 + ShowLegend.GetHashCode();
         }
         if (ZAuto != null)
         {
             hashCode = hashCode * 59 + ZAuto.GetHashCode();
         }
         if (ZMin != null)
         {
             hashCode = hashCode * 59 + ZMin.GetHashCode();
         }
         if (ZMax != null)
         {
             hashCode = hashCode * 59 + ZMax.GetHashCode();
         }
         if (ZMid != null)
         {
             hashCode = hashCode * 59 + ZMid.GetHashCode();
         }
         if (ColorScale != null)
         {
             hashCode = hashCode * 59 + ColorScale.GetHashCode();
         }
         if (AutoColorScale != null)
         {
             hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         }
         if (ReverseScale != null)
         {
             hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         }
         if (ShowScale != null)
         {
             hashCode = hashCode * 59 + ShowScale.GetHashCode();
         }
         if (ColorBar != null)
         {
             hashCode = hashCode * 59 + ColorBar.GetHashCode();
         }
         if (ColorAxis != null)
         {
             hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         }
         if (XCalendar != null)
         {
             hashCode = hashCode * 59 + XCalendar.GetHashCode();
         }
         if (YCalendar != null)
         {
             hashCode = hashCode * 59 + YCalendar.GetHashCode();
         }
         if (XAxis != null)
         {
             hashCode = hashCode * 59 + XAxis.GetHashCode();
         }
         if (YAxis != null)
         {
             hashCode = hashCode * 59 + YAxis.GetHashCode();
         }
         if (IdsSrc != null)
         {
             hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         }
         if (CustomDataSrc != null)
         {
             hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         }
         if (MetaSrc != null)
         {
             hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         }
         if (HoverInfoSrc != null)
         {
             hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         }
         if (ZSrc != null)
         {
             hashCode = hashCode * 59 + ZSrc.GetHashCode();
         }
         if (XSrc != null)
         {
             hashCode = hashCode * 59 + XSrc.GetHashCode();
         }
         if (YSrc != null)
         {
             hashCode = hashCode * 59 + YSrc.GetHashCode();
         }
         if (TextSrc != null)
         {
             hashCode = hashCode * 59 + TextSrc.GetHashCode();
         }
         if (HoverTextSrc != null)
         {
             hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
         }
         if (HoverTemplateSrc != null)
         {
             hashCode = hashCode * 59 + HoverTemplateSrc.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #33
0
ファイル: Gemv.cs プロジェクト: Altaxo/Altaxo
		///<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).");
				}
			}
		}
コード例 #34
0
        public bool Equals([AllowNull] ContourCarpet other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Carpet == other.Carpet && Carpet != null && other.Carpet != null && Carpet.Equals(other.Carpet)) &&
                   (Equals(Z, other.Z) || Z != null && other.Z != null && Z.SequenceEqual(other.Z)) &&
                   (Equals(A, other.A) || A != null && other.A != null && A.SequenceEqual(other.A)) &&
                   (A0 == other.A0 && A0 != null && other.A0 != null && A0.Equals(other.A0)) &&
                   (DA == other.DA && DA != null && other.DA != null && DA.Equals(other.DA)) &&
                   (Equals(B, other.B) || B != null && other.B != null && B.SequenceEqual(other.B)) &&
                   (B0 == other.B0 && B0 != null && other.B0 != null && B0.Equals(other.B0)) &&
                   (Db == other.Db && Db != null && other.Db != null && Db.Equals(other.Db)) &&
                   (Equals(Text, other.Text) || Text != null && other.Text != null && Text.SequenceEqual(other.Text)) &&
                   (Equals(HoverText, other.HoverText) || HoverText != null && other.HoverText != null && HoverText.SequenceEqual(other.HoverText)) &&
                   (Transpose == other.Transpose && Transpose != null && other.Transpose != null && Transpose.Equals(other.Transpose)) &&
                   (AType == other.AType && AType != null && other.AType != null && AType.Equals(other.AType)) &&
                   (BType == other.BType && BType != null && other.BType != null && BType.Equals(other.BType)) &&
                   (FillColor == other.FillColor && FillColor != null && other.FillColor != null && FillColor.Equals(other.FillColor)) &&
                   (AutoContour == other.AutoContour && AutoContour != null && other.AutoContour != null && AutoContour.Equals(other.AutoContour)) &&
                   (NContours == other.NContours && NContours != null && other.NContours != null && NContours.Equals(other.NContours)) &&
                   (Contours == other.Contours && Contours != null && other.Contours != null && Contours.Equals(other.Contours)) &&
                   (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) &&
                   (ZAuto == other.ZAuto && ZAuto != null && other.ZAuto != null && ZAuto.Equals(other.ZAuto)) &&
                   (ZMin == other.ZMin && ZMin != null && other.ZMin != null && ZMin.Equals(other.ZMin)) &&
                   (ZMax == other.ZMax && ZMax != null && other.ZMax != null && ZMax.Equals(other.ZMax)) &&
                   (ZMid == other.ZMid && ZMid != null && other.ZMid != null && ZMid.Equals(other.ZMid)) &&
                   (ColorScale == other.ColorScale && ColorScale != null && other.ColorScale != null && ColorScale.Equals(other.ColorScale)) &&
                   (AutoColorScale == other.AutoColorScale && AutoColorScale != null && other.AutoColorScale != null && AutoColorScale.Equals(other.AutoColorScale)) &&
                   (ReverseScale == other.ReverseScale && ReverseScale != null && other.ReverseScale != null && ReverseScale.Equals(other.ReverseScale)) &&
                   (ShowScale == other.ShowScale && ShowScale != null && other.ShowScale != null && ShowScale.Equals(other.ShowScale)) &&
                   (ColorBar == other.ColorBar && ColorBar != null && other.ColorBar != null && ColorBar.Equals(other.ColorBar)) &&
                   (ColorAxis == other.ColorAxis && ColorAxis != null && other.ColorAxis != null && ColorAxis.Equals(other.ColorAxis)) &&
                   (XAxis == other.XAxis && XAxis != null && other.XAxis != null && XAxis.Equals(other.XAxis)) &&
                   (YAxis == other.YAxis && YAxis != null && other.YAxis != null && YAxis.Equals(other.YAxis)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (ZSrc == other.ZSrc && ZSrc != null && other.ZSrc != null && ZSrc.Equals(other.ZSrc)) &&
                   (ASrc == other.ASrc && ASrc != null && other.ASrc != null && ASrc.Equals(other.ASrc)) &&
                   (BSrc == other.BSrc && BSrc != null && other.BSrc != null && BSrc.Equals(other.BSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)));
        }
コード例 #35
0
ファイル: Gemv.cs プロジェクト: Altaxo/Altaxo
 private static extern void dna_blas_dgemv( Order order, Transpose TransA, int M, int N, double alpha, [In]double[] A, int lda, [In]double[] X, int incX, double beta, [In,Out]double[] Y, int incY);
コード例 #36
0
 /// <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)
 {
     throw new NotImplementedException();
 }
コード例 #37
0
		public CommandLineBuilder Transpose(Transpose mode) {
			return Transpose(mode, null, null);
		}
        public override void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, Complex32 alpha, Complex32[] a, int rowsA, int columnsA, Complex32[] b, int rowsB, int columnsB, Complex32 beta, Complex32[] c)
        {
            if (a == null)
            {
                throw new ArgumentNullException("a");
            }

            if (b == null)
            {
                throw new ArgumentNullException("b");
            }

            if (c == null)
            {
                throw new ArgumentNullException("c");
            }

            var m = transposeA == Transpose.DontTranspose ? rowsA : columnsA;
            var n = transposeB == Transpose.DontTranspose ? columnsB : rowsB;
            var k = transposeA == Transpose.DontTranspose ? columnsA : rowsA;
            var l = transposeB == Transpose.DontTranspose ? rowsB : columnsB;

            if (c.Length != m * n)
            {
                throw new ArgumentException(Resources.ArgumentMatrixDimensions);   
            }

            if (k != l)
            {
                throw new ArgumentException(Resources.ArgumentMatrixDimensions);
            }

            SafeNativeMethods.c_matrix_multiply(transposeA, transposeB, m, n, k, alpha, a, b, beta, c);
        }
コード例 #39
0
        /// <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="order">The order of the square matrix <paramref name="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, int order, Complex32[] b)
        {
            if (a == null)
            {
                throw new ArgumentNullException("a");
            }

            if (b == null)
            {
                throw new ArgumentNullException("b");
            }

            if (a.Length != order * order)
            {
                throw new ArgumentException(Resources.ArgumentArraysSameLength, "a");
            }

            if (b.Length != order * columnsOfB)
            {
                throw new ArgumentException(Resources.ArgumentArraysSameLength, "b");
            }

            var ipiv = new int[order];
            LUFactor(a, order, ipiv);
            LUSolveFactored(transposeA, columnsOfB, a, order, ipiv, b);
        }
コード例 #40
0
        /// <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;
            }

            // Check whether we will be overwriting any of our inputs and make copies if necessary.
            // TODO - we can don't have to allocate a completely new matrix when x or y point to the same memory
            // as result, we can do it on a row wise basis. We should investigate this.
            float[] adata;
            if (ReferenceEquals(a, c))
            {
                adata = (float[]) a.Clone();
            }
            else
            {
                adata = a;
            }

            float[] bdata;
            if (ReferenceEquals(b, c))
            {
                bdata = (float[]) b.Clone();
            }
            else
            {
                bdata = b;
            }

            if (beta == 0.0f)
            {
                Array.Clear(c, 0, c.Length);
            }
            else if (beta != 1.0f)
            {
                ScaleArray(beta, c, c);
            }

            if (alpha == 0.0f)
            {
                return;
            }

            CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, adata, 0, 0, bdata, 0, 0, c, 0, 0, m, n, k, m, n, k, true);
        }
コード例 #41
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine, just wrap
            {
                int hashCode = 41;

                if (Type != null)
                {
                    hashCode = hashCode * 59 + Type.GetHashCode();
                }

                if (Visible != null)
                {
                    hashCode = hashCode * 59 + Visible.GetHashCode();
                }

                if (ShowLegend != null)
                {
                    hashCode = hashCode * 59 + ShowLegend.GetHashCode();
                }

                if (LegendGroup != null)
                {
                    hashCode = hashCode * 59 + LegendGroup.GetHashCode();
                }

                if (Opacity != null)
                {
                    hashCode = hashCode * 59 + Opacity.GetHashCode();
                }

                if (Name != null)
                {
                    hashCode = hashCode * 59 + Name.GetHashCode();
                }

                if (UId != null)
                {
                    hashCode = hashCode * 59 + UId.GetHashCode();
                }

                if (Ids != null)
                {
                    hashCode = hashCode * 59 + Ids.GetHashCode();
                }

                if (CustomData != null)
                {
                    hashCode = hashCode * 59 + CustomData.GetHashCode();
                }

                if (Meta != null)
                {
                    hashCode = hashCode * 59 + Meta.GetHashCode();
                }

                if (MetaArray != null)
                {
                    hashCode = hashCode * 59 + MetaArray.GetHashCode();
                }

                if (Stream != null)
                {
                    hashCode = hashCode * 59 + Stream.GetHashCode();
                }

                if (UiRevision != null)
                {
                    hashCode = hashCode * 59 + UiRevision.GetHashCode();
                }

                if (Carpet != null)
                {
                    hashCode = hashCode * 59 + Carpet.GetHashCode();
                }

                if (Z != null)
                {
                    hashCode = hashCode * 59 + Z.GetHashCode();
                }

                if (A != null)
                {
                    hashCode = hashCode * 59 + A.GetHashCode();
                }

                if (A0 != null)
                {
                    hashCode = hashCode * 59 + A0.GetHashCode();
                }

                if (DA != null)
                {
                    hashCode = hashCode * 59 + DA.GetHashCode();
                }

                if (B != null)
                {
                    hashCode = hashCode * 59 + B.GetHashCode();
                }

                if (B0 != null)
                {
                    hashCode = hashCode * 59 + B0.GetHashCode();
                }

                if (Db != null)
                {
                    hashCode = hashCode * 59 + Db.GetHashCode();
                }

                if (Text != null)
                {
                    hashCode = hashCode * 59 + Text.GetHashCode();
                }

                if (HoverText != null)
                {
                    hashCode = hashCode * 59 + HoverText.GetHashCode();
                }

                if (Transpose != null)
                {
                    hashCode = hashCode * 59 + Transpose.GetHashCode();
                }

                if (AType != null)
                {
                    hashCode = hashCode * 59 + AType.GetHashCode();
                }

                if (BType != null)
                {
                    hashCode = hashCode * 59 + BType.GetHashCode();
                }

                if (FillColor != null)
                {
                    hashCode = hashCode * 59 + FillColor.GetHashCode();
                }

                if (AutoContour != null)
                {
                    hashCode = hashCode * 59 + AutoContour.GetHashCode();
                }

                if (NContours != null)
                {
                    hashCode = hashCode * 59 + NContours.GetHashCode();
                }

                if (Contours != null)
                {
                    hashCode = hashCode * 59 + Contours.GetHashCode();
                }

                if (Line != null)
                {
                    hashCode = hashCode * 59 + Line.GetHashCode();
                }

                if (ZAuto != null)
                {
                    hashCode = hashCode * 59 + ZAuto.GetHashCode();
                }

                if (ZMin != null)
                {
                    hashCode = hashCode * 59 + ZMin.GetHashCode();
                }

                if (ZMax != null)
                {
                    hashCode = hashCode * 59 + ZMax.GetHashCode();
                }

                if (ZMid != null)
                {
                    hashCode = hashCode * 59 + ZMid.GetHashCode();
                }

                if (ColorScale != null)
                {
                    hashCode = hashCode * 59 + ColorScale.GetHashCode();
                }

                if (AutoColorScale != null)
                {
                    hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
                }

                if (ReverseScale != null)
                {
                    hashCode = hashCode * 59 + ReverseScale.GetHashCode();
                }

                if (ShowScale != null)
                {
                    hashCode = hashCode * 59 + ShowScale.GetHashCode();
                }

                if (ColorBar != null)
                {
                    hashCode = hashCode * 59 + ColorBar.GetHashCode();
                }

                if (ColorAxis != null)
                {
                    hashCode = hashCode * 59 + ColorAxis.GetHashCode();
                }

                if (XAxis != null)
                {
                    hashCode = hashCode * 59 + XAxis.GetHashCode();
                }

                if (YAxis != null)
                {
                    hashCode = hashCode * 59 + YAxis.GetHashCode();
                }

                if (IdsSrc != null)
                {
                    hashCode = hashCode * 59 + IdsSrc.GetHashCode();
                }

                if (CustomDataSrc != null)
                {
                    hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
                }

                if (MetaSrc != null)
                {
                    hashCode = hashCode * 59 + MetaSrc.GetHashCode();
                }

                if (ZSrc != null)
                {
                    hashCode = hashCode * 59 + ZSrc.GetHashCode();
                }

                if (ASrc != null)
                {
                    hashCode = hashCode * 59 + ASrc.GetHashCode();
                }

                if (BSrc != null)
                {
                    hashCode = hashCode * 59 + BSrc.GetHashCode();
                }

                if (TextSrc != null)
                {
                    hashCode = hashCode * 59 + TextSrc.GetHashCode();
                }

                if (HoverTextSrc != null)
                {
                    hashCode = hashCode * 59 + HoverTextSrc.GetHashCode();
                }

                return(hashCode);
            }
        }
コード例 #42
0
 internal static extern void cblas_sgemm(Order order, Transpose transa, Transpose transb, int m, int n, int k, float alpha, float[] a, int lda, float[] b, int ldb, float beta, float[] c, int ldc);
コード例 #43
0
 /// <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="order">The order of the square matrix <paramref name="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, float[] a, int order, float[] b)
 {
     throw new NotImplementedException();
 }
コード例 #44
0
 public CommandLineBuilder Transpose(Transpose mode)
 {
     return(Transpose(mode, null, null));
 }
コード例 #45
0
        /// <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, double alpha, double[] a, int rowsA, int columnsA, double[] b, int rowsB, int columnsB, double beta, double[] c)
        {
            // Choose nonsensical values for the number of rows in c; fill them in depending
            // on the operations on a and b.
            int rowsC;

            // 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();
                }

                rowsC = columnsA;
            }
            else if ((int)transposeA > 111)
            {
                if (rowsA != rowsB)
                {
                    throw new ArgumentOutOfRangeException();
                }

                if (columnsA * columnsB != c.Length)
                {
                    throw new ArgumentOutOfRangeException();
                }

                rowsC = columnsA;
            }
            else if ((int)transposeB > 111)
            {
                if (columnsA != columnsB)
                {
                    throw new ArgumentOutOfRangeException();
                }

                if (rowsA * rowsB != c.Length)
                {
                    throw new ArgumentOutOfRangeException();
                }

                rowsC = rowsA;
            }
            else
            {
                if (columnsA != rowsB)
                {
                    throw new ArgumentOutOfRangeException();
                }

                if (rowsA * columnsB != c.Length)
                {
                    throw new ArgumentOutOfRangeException();
                }

                rowsC = rowsA;
            }

            if (alpha == 0.0 && beta == 0.0)
            {
                Array.Clear(c, 0, c.Length);
                return;
            }

            // Check whether we will be overwriting any of our inputs and make copies if necessary.
            // TODO - we can don't have to allocate a completely new matrix when x or y point to the same memory
            // as result, we can do it on a row wise basis. We should investigate this.
            double[] adata;
            if (ReferenceEquals(a, c))
            {
                adata = (double[])a.Clone();
            }
            else
            {
                adata = a;
            }

            double[] bdata;
            if (ReferenceEquals(b, c))
            {
                bdata = (double[])b.Clone();
            }
            else
            {
                bdata = b;
            }

            if (alpha == 1.0)
            {
                if (beta == 0.0)
                {
                    if ((int)transposeA > 111 && (int)transposeB > 111)
                    {
                        CommonParallel.For(
                            0,
                            columnsA,
                            j =>
                            {
                                var jIndex = j * rowsC;
                                for (var i = 0; i != rowsB; i++)
                                {
                                    var iIndex = i * rowsA;
                                    double s = 0;
                                    for (var l = 0; l != columnsB; l++)
                                    {
                                        s += adata[iIndex + l] * bdata[(l * rowsB) + j];
                                    }

                                    c[jIndex + i] = s;
                                }
                            });
                    }
                    else if ((int)transposeA > 111)
                    {
                        CommonParallel.For(
                            0,
                                           columnsB,
                                           j =>
                                           {
                                               var jcIndex = j * rowsC;
                                               var jbIndex = j * rowsB;
                                               for (var i = 0; i != columnsA; i++)
                                               {
                                                   var iIndex = i * rowsA;
                                                   double s = 0;
                                                   for (var l = 0; l != rowsA; l++)
                                                   {
                                                       s += adata[iIndex + l] * bdata[jbIndex + l];
                                                   }

                                                   c[jcIndex + i] = s;
                                               }
                                           });
                    }
                    else if ((int)transposeB > 111)
                    {
                        CommonParallel.For(
                            0,
                            rowsB,
                            j =>
                            {
                                var jIndex = j * rowsC;
                                for (var i = 0; i != rowsA; i++)
                                {
                                    double s = 0;
                                    for (var l = 0; l != columnsA; l++)
                                    {
                                        s += adata[(l * rowsA) + i] * bdata[(l * rowsB) + j];
                                    }

                                    c[jIndex + i] = s;
                                }
                            });
                    }
                    else
                    {
                        CommonParallel.For(
                            0,
                            columnsB,
                            j =>
                            {
                                var jcIndex = j * rowsC;
                                var jbIndex = j * rowsB;
                                for (var i = 0; i != rowsA; i++)
                                {
                                    double s = 0;
                                    for (var l = 0; l != columnsA; l++)
                                    {
                                        s += adata[(l * rowsA) + i] * bdata[jbIndex + l];
                                    }

                                    c[jcIndex + i] = s;
                                }
                            });
                    }
                }
                else
                {
                    if ((int)transposeA > 111 && (int)transposeB > 111)
                    {
                        CommonParallel.For(
                            0,
                            columnsA,
                            j =>
                            {
                                var jIndex = j * rowsC;
                                for (var i = 0; i != rowsB; i++)
                                {
                                    var iIndex = i * rowsA;
                                    double s = 0;
                                    for (var l = 0; l != columnsB; l++)
                                    {
                                        s += adata[iIndex + l] * bdata[(l * rowsB) + j];
                                    }

                                    c[jIndex + i] = (c[jIndex + i] * beta) + s;
                                }
                            });
                    }
                    else if ((int)transposeA > 111)
                    {
                        CommonParallel.For(
                            0,
                            columnsB,
                            j =>
                            {
                                var jcIndex = j * rowsC;
                                var jbIndex = j * rowsB;
                                for (var i = 0; i != columnsA; i++)
                                {
                                    var iIndex = i * rowsA;
                                    double s = 0;
                                    for (var l = 0; l != rowsA; l++)
                                    {
                                        s += adata[iIndex + l] * bdata[jbIndex + l];
                                    }

                                    c[jcIndex + i] = s + (c[jcIndex + i] * beta);
                                }
                            });
                    }
                    else if ((int)transposeB > 111)
                    {
                        CommonParallel.For(
                            0,
                            rowsB,
                            j =>
                            {
                                var jIndex = j * rowsC;
                                for (var i = 0; i != rowsA; i++)
                                {
                                    double s = 0;
                                    for (var l = 0; l != columnsA; l++)
                                    {
                                        s += adata[(l * rowsA) + i] * bdata[(l * rowsB) + j];
                                    }

                                    c[jIndex + i] = s + (c[jIndex + i] * beta);
                                }
                            });
                    }
                    else
                    {
                        CommonParallel.For(
                            0,
                            columnsB,
                            j =>
                            {
                                var jcIndex = j * rowsC;
                                var jbIndex = j * rowsB;
                                for (var i = 0; i != rowsA; i++)
                                {
                                    double s = 0;
                                    for (var l = 0; l != columnsA; l++)
                                    {
                                        s += adata[(l * rowsA) + i] * bdata[jbIndex + l];
                                    }

                                    c[jcIndex + i] = s + (c[jcIndex + i] * beta);
                                }
                            });
                    }
                }
            }
            else
            {
                if ((int)transposeA > 111 && (int)transposeB > 111)
                {
                    CommonParallel.For(
                        0,
                        columnsA,
                        j =>
                        {
                            var jIndex = j * rowsC;
                            for (var i = 0; i != rowsB; i++)
                            {
                                var iIndex = i * rowsA;
                                double s = 0;
                                for (var l = 0; l != columnsB; l++)
                                {
                                    s += adata[iIndex + l] * bdata[(l * rowsB) + j];
                                }

                                c[jIndex + i] = (c[jIndex + i] * beta) + (alpha * s);
                            }
                        });
                }
                else if ((int)transposeA > 111)
                {
                    CommonParallel.For(
                        0,
                        columnsB,
                        j =>
                        {
                            var jcIndex = j * rowsC;
                            var jbIndex = j * rowsB;
                            for (var i = 0; i != columnsA; i++)
                            {
                                var iIndex = i * rowsA;
                                double s = 0;
                                for (var l = 0; l != rowsA; l++)
                                {
                                    s += adata[iIndex + l] * bdata[jbIndex + l];
                                }

                                c[jcIndex + i] = (alpha * s) + (c[jcIndex + i] * beta);
                            }
                        });
                }
                else if ((int)transposeB > 111)
                {
                    CommonParallel.For(
                        0,
                        rowsB,
                        j =>
                        {
                            var jIndex = j * rowsC;
                            for (var i = 0; i != rowsA; i++)
                            {
                                double s = 0;
                                for (var l = 0; l != columnsA; l++)
                                {
                                    s += adata[(l * rowsA) + i] * bdata[(l * rowsB) + j];
                                }

                                c[jIndex + i] = (alpha * s) + (c[jIndex + i] * beta);
                            }
                        });
                }
                else
                {
                    CommonParallel.For(
                        0,
                        columnsB,
                        j =>
                        {
                            var jcIndex = j * rowsC;
                            var jbIndex = j * rowsB;
                            for (var i = 0; i != rowsA; i++)
                            {
                                double s = 0;
                                for (var l = 0; l != columnsA; l++)
                                {
                                    s += adata[(l * rowsA) + i] * bdata[jbIndex + l];
                                }

                                c[jcIndex + i] = (alpha * s) + (c[jcIndex + i] * beta);
                            }
                        });
                }
            }
        }
コード例 #46
0
 /// <summary>
 /// Analyzes the specified expression.
 /// </summary>
 /// <param name="exp">The expression.</param>
 /// <returns>
 /// The result of analysis.
 /// </returns>
 /// <exception cref="System.NotSupportedException">Always.</exception>
 public virtual TResult Analyze(Transpose exp)
 {
     throw new NotSupportedException();
 }
コード例 #47
0
        /// <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];
                            }

                            result[((n1 + shiftCcol)*constM) + matCrowPos] += alpha*sum;
                        }
                    }
                }
            }
            else
            {
                // divide and conquer
                int m2 = m/2, n2 = n/2, k2 = k/2;

                if (first)
                {
                    CommonParallel.Invoke(
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol, matrixB, shiftBrow, shiftBcol, result, shiftCrow, shiftCcol, m2, n2, k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol, matrixB, shiftBrow, shiftBcol + n2, result, shiftCrow, shiftCcol + n2, m2, n - n2, k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol, matrixB, shiftBrow, shiftBcol, result, shiftCrow + m2, shiftCcol, m - m2, n2, k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol, matrixB, shiftBrow, shiftBcol + n2, result, shiftCrow + m2, shiftCcol + n2, m - m2, n - n2, k2, constM, constN, constK, false));

                    CommonParallel.Invoke(
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol, result, shiftCrow, shiftCcol, m2, n2, k - k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol + n2, result, shiftCrow, shiftCcol + n2, m2, n - n2, k - k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol, result, shiftCrow + m2, shiftCcol, m - m2, n2, k - k2, constM, constN, constK, false),
                        () => CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol + n2, result, shiftCrow + m2, shiftCcol + n2, m - m2, n - n2, k - k2, constM, constN, constK, false));
                }
                else
                {
                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol, matrixB, shiftBrow, shiftBcol, result, shiftCrow, shiftCcol, m2, n2, k2, constM, constN, constK, false);
                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol, matrixB, shiftBrow, shiftBcol + n2, result, shiftCrow, shiftCcol + n2, m2, n - n2, k2, constM, constN, constK, false);

                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol, result, shiftCrow, shiftCcol, m2, n2, k - k2, constM, constN, constK, false);
                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol + n2, result, shiftCrow, shiftCcol + n2, m2, n - n2, k - k2, constM, constN, constK, false);

                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol, matrixB, shiftBrow, shiftBcol, result, shiftCrow + m2, shiftCcol, m - m2, n2, k2, constM, constN, constK, false);
                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol, matrixB, shiftBrow, shiftBcol + n2, result, shiftCrow + m2, shiftCcol + n2, m - m2, n - n2, k2, constM, constN, constK, false);

                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol, result, shiftCrow + m2, shiftCcol, m - m2, n2, k - k2, constM, constN, constK, false);
                    CacheObliviousMatrixMultiply(transposeA, transposeB, alpha, matrixA, shiftArow + m2, shiftAcol + k2, matrixB, shiftBrow + k2, shiftBcol + n2, result, shiftCrow + m2, shiftCcol + n2, m - m2, n - n2, k - k2, constM, constN, constK, false);
                }
            }
        }
コード例 #48
0
ファイル: Ormqr.cs プロジェクト: carlhuth/GenXSource
 private static extern int dna_lapack_dormqr(int block_size, Side side, Transpose trans, int m, int n, int k, [In, Out] double[] A, int lda, [In, Out] double[] tau, [In, Out] double[] C, int ldc);
コード例 #49
0
ファイル: Trsm.cs プロジェクト: xuchuansheng/GenXSource
 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 );
コード例 #50
0
 internal static extern void s_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, float alpha, float[] x, float[] y, float beta, [In, Out] float[] c);
コード例 #51
0
 internal static extern void d_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, double alpha, double[] x, double[] y, double beta, [In, Out] double[] c);
コード例 #52
0
 internal static extern void z_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex alpha, Complex[] x, Complex[] y, Complex beta, [In, Out] Complex[] c);
コード例 #53
0
 internal static extern void d_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, double alpha, double[] x, double[] y, double beta, [In, Out] double[] c);
コード例 #54
0
 private static unsafe extern void Gemv(Layout layout, Transpose trans, int m, int n, float alpha,
                                        float *a, int lda, float *x, int incx, float beta, float *y, int incy);
コード例 #55
0
 internal static extern void c_matrix_multiply(Transpose transA, Transpose transB, int m, int n, int k, Complex32 alpha, Complex32[] x, Complex32[] y, Complex32 beta, [In, Out] Complex32[] c);
コード例 #56
0
 public static extern void Gemm(Layout layout, Transpose transA, Transpose transB, int m, int n, int k, float alpha,
                                float[] a, int lda, float[] b, int ldb, float beta, float[] c, int ldc);
コード例 #57
0
        /// <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="aRows">The number of rows in the <paramref name="a"/> matrix.</param>
        /// <param name="aColumns">The number of columns in the <paramref name="a"/> matrix.</param>
        /// <param name="b">The b matrix</param>
        /// <param name="bRows">The number of rows in the <paramref name="b"/> matrix.</param>
        /// <param name="bColumns">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 void MatrixMultiplyWithUpdate(Transpose transposeA, Transpose transposeB, Complex32 alpha, Complex32[] a,
            int aRows, int aColumns, Complex32[] b, int bRows, int bColumns, Complex32 beta, Complex32[] c)
        {
            if (a == null)
            {
                throw new ArgumentNullException("a");
            }

            if (b == null)
            {
                throw new ArgumentNullException("b");
            }

            if (c == null)
            {
                throw new ArgumentNullException("c");
            }

            var m = transposeA == Transpose.DontTranspose ? aRows : aColumns;
            var n = transposeB == Transpose.DontTranspose ? bColumns : bRows;
            var k = transposeA == Transpose.DontTranspose ? aColumns : aRows;

            if (c.Length != aRows * bColumns)
            {
                throw new ArgumentException(Resources.ArgumentMatrixDimensions);
            }

            if (aColumns != bRows)
            {
                throw new ArgumentException(Resources.ArgumentMatrixDimensions);
            }

            SafeNativeMethods.c_matrix_multiply(transposeA, transposeB, m, n, k, ref alpha, a, b, ref beta, c);
        }
コード例 #58
0
 public static extern void Gemv(Layout layout, Transpose trans, int m, int n, Float alpha,
                                Float[] a, int lda, Float[] x, int incx, Float beta, Float[] y, int incy);
コード例 #59
0
 /// <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="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, double[] a, int ipiv, double[] b)
 {
     throw new NotImplementedException();
 }
コード例 #60
0
        /// <summary>
        /// Creates an expression object from <see cref="FunctionToken"/>.
        /// </summary>
        /// <param name="token">The function token.</param>
        /// <returns>An expression.</returns>
        protected virtual IExpression CreateFunction(FunctionToken token)
        {
            IExpression exp;

            switch (token.Function)
            {
            case Functions.Add:
                exp = new Add(); break;

            case Functions.Sub:
                exp = new Sub(); break;

            case Functions.Mul:
                exp = new Mul(); break;

            case Functions.Div:
                exp = new Div(); break;

            case Functions.Pow:
                exp = new Pow(); break;

            case Functions.Absolute:
                exp = new Abs(); break;

            case Functions.Sine:
                exp = new Sin(); break;

            case Functions.Cosine:
                exp = new Cos(); break;

            case Functions.Tangent:
                exp = new Tan(); break;

            case Functions.Cotangent:
                exp = new Cot(); break;

            case Functions.Secant:
                exp = new Sec(); break;

            case Functions.Cosecant:
                exp = new Csc(); break;

            case Functions.Arcsine:
                exp = new Arcsin(); break;

            case Functions.Arccosine:
                exp = new Arccos(); break;

            case Functions.Arctangent:
                exp = new Arctan(); break;

            case Functions.Arccotangent:
                exp = new Arccot(); break;

            case Functions.Arcsecant:
                exp = new Arcsec(); break;

            case Functions.Arccosecant:
                exp = new Arccsc(); break;

            case Functions.Sqrt:
                exp = new Sqrt(); break;

            case Functions.Root:
                exp = new Root(); break;

            case Functions.Ln:
                exp = new Ln(); break;

            case Functions.Lg:
                exp = new Lg(); break;

            case Functions.Lb:
                exp = new Lb(); break;

            case Functions.Log:
                exp = new Log(); break;

            case Functions.Sineh:
                exp = new Sinh(); break;

            case Functions.Cosineh:
                exp = new Cosh(); break;

            case Functions.Tangenth:
                exp = new Tanh(); break;

            case Functions.Cotangenth:
                exp = new Coth(); break;

            case Functions.Secanth:
                exp = new Sech(); break;

            case Functions.Cosecanth:
                exp = new Csch(); break;

            case Functions.Arsineh:
                exp = new Arsinh(); break;

            case Functions.Arcosineh:
                exp = new Arcosh(); break;

            case Functions.Artangenth:
                exp = new Artanh(); break;

            case Functions.Arcotangenth:
                exp = new Arcoth(); break;

            case Functions.Arsecanth:
                exp = new Arsech(); break;

            case Functions.Arcosecanth:
                exp = new Arcsch(); break;

            case Functions.Exp:
                exp = new Exp(); break;

            case Functions.GCD:
                exp = new GCD(); break;

            case Functions.LCM:
                exp = new LCM(); break;

            case Functions.Factorial:
                exp = new Fact(); break;

            case Functions.Sum:
                exp = new Sum(); break;

            case Functions.Product:
                exp = new Product(); break;

            case Functions.Round:
                exp = new Round(); break;

            case Functions.Floor:
                exp = new Floor(); break;

            case Functions.Ceil:
                exp = new Ceil(); break;

            case Functions.Derivative:
                exp = new Derivative(); break;

            case Functions.Simplify:
                exp = new Simplify(); break;

            case Functions.Del:
                exp = new Del(); break;

            case Functions.Define:
                exp = new Define(); break;

            case Functions.Vector:
                exp = new Vector(); break;

            case Functions.Matrix:
                exp = new Matrix(); break;

            case Functions.Transpose:
                exp = new Transpose(); break;

            case Functions.Determinant:
                exp = new Determinant(); break;

            case Functions.Inverse:
                exp = new Inverse(); break;

            case Functions.If:
                exp = new If(); break;

            case Functions.For:
                exp = new For(); break;

            case Functions.While:
                exp = new While(); break;

            case Functions.Undefine:
                exp = new Undefine(); break;

            case Functions.Im:
                exp = new Im(); break;

            case Functions.Re:
                exp = new Re(); break;

            case Functions.Phase:
                exp = new Phase(); break;

            case Functions.Conjugate:
                exp = new Conjugate(); break;

            case Functions.Reciprocal:
                exp = new Reciprocal(); break;

            case Functions.Min:
                exp = new Min(); break;

            case Functions.Max:
                exp = new Max(); break;

            case Functions.Avg:
                exp = new Avg(); break;

            case Functions.Count:
                exp = new Count(); break;

            case Functions.Var:
                exp = new Var(); break;

            case Functions.Varp:
                exp = new Varp(); break;

            case Functions.Stdev:
                exp = new Stdev(); break;

            case Functions.Stdevp:
                exp = new Stdevp(); break;

            default:
                exp = null; break;
            }

            var diff = exp as DifferentParametersExpression;

            if (diff != null)
            {
                diff.ParametersCount = token.CountOfParams;
            }

            return(exp);
        }