Ejemplo n.º 1
0
 /// <summary>
 /// Overloads plus operator for ILArrays of numeric type
 /// </summary>
 /// <param name="in1">First summand</param>
 /// <param name="in2">Second summand</param>
 /// <returns>New solid ILArray of same type as input array with sum of elements of
 /// <code>in1 + in2 </code>
 /// </returns>
 /// <remarks>This operator is overloaded for all numeric datatypes: <![CDATA[ILArray<double>,ILArray<float>,ILArray<complex>,ILArray<fcomplex>,ILArray<byte>,ILArray<char>,ILArray<Int16>,ILArray<Int32>,ILArray<Int64>,ILArray<UInt16>,ILArray<UInt32>,ILArray<UInt64>]]></remarks>
 public static /*!HC:outArr1*/ ILArray <double> operator +(/*!HC:inCls1*/ ILArray <double> in1, ILArray <BaseT> in2)
 {
     if (false)
     {
     }
     else if (in2 is /*!HC:inCls2*/ ILArray <double> )
     {
         return(ILMath.add(in1 as /*!HC:inCls1*/ ILArray <double>, in2 as /*!HC:inCls2*/ ILArray <double>));
     }
     throw new Exception("Operator + not defined for "
                         + in1.GetType().Name + " and " + in2.GetType().Name);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Overloads plus operator for ILArrays of numeric type
 /// </summary>
 /// <param name="in1">First summand</param>
 /// <param name="in2">Second summand</param>
 /// <returns>New solid ILArray of same type as input array with sum of elements of
 /// <code>in1 + in2 </code>
 /// </returns>
 /// <remarks>This operator is overloaded for all numeric datatypes: <![CDATA[ILArray<double>,ILArray<float>,ILArray<complex>,ILArray<fcomplex>,ILArray<byte>,ILArray<char>,ILArray<Int16>,ILArray<Int32>,ILArray<Int64>,ILArray<UInt16>,ILArray<UInt32>,ILArray<UInt64>]]></remarks>
 public static ILArray <byte> operator +(ILArray <byte> in1, ILArray <BaseT> in2)
 {
     if (false)
     {
     }
     else if (in2 is  ILArray <byte> )
     {
         return(ILMath.add(in1 as  ILArray <byte>, in2 as  ILArray <byte>));
     }
     throw new Exception("Operator + not defined for "
                         + in1.GetType().Name + " and " + in2.GetType().Name);
 }
Ejemplo n.º 3
0
 public void CountMDFMean()
 {
     if (this.items.Count == 1)
     {
         this.meanMDF = this.items[0].ValuesMDF.ToArray();
     }
     else
     {
         // initialize array with nulls
         ILArray <double> sum = ILMath.zeros(this.items[0].ValuesMDF.Length);
         for (int i = 0; i < this.items.Count; i++)
         {
             sum = ILMath.add(sum, items[i].ValuesMDF);
         }
         this.meanMDF = sum / items.Count;
     }
 }