예제 #1
0
 /// <summary>
 /// ベクトルの各要素に対してactionを適用する.
 /// </summary>
 /// <param name="action">
 /// <see cref="ElementActionByValWithIndex"/>により規定されたデリゲート
 /// </param>
 /// <returns>メソッド適用後の自身への参照</returns>
 public IVector ForEach(ElementActionByValWithIndex action)
 {
     return(VectorImpl.ForEach(this, action));
 }
예제 #2
0
 /// <summary>
 /// スカラ値を乗算する.
 /// </summary>
 /// <param name="v"></param>
 /// <param name="d"></param>
 /// <returns>乗算結果の<see cref="RowVector"/></returns>
 public static new RowVector Mul(IVector v, double d)
 {
     VectorChecker.ZeroSize(v);
     return(VectorImpl.Mul(new RowVector(v.Size), d, v));
 }
예제 #3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v1"></param>
 /// <param name="v2"></param>
 /// <returns></returns>
 public static RowVector operator +(Vector v1, RowVector v2)
 {
     VectorChecker.MismatchSize(v1, v2);
     return(VectorImpl.Add(new RowVector(v1.Size), v1, v2));
 }
예제 #4
0
 public IEnumerator <double> GetEnumerator()
 {
     return(VectorImpl.Enumerator(this));
 }
예제 #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="d"></param>
 /// <param name="v"></param>
 /// <returns></returns>
 public static RowVector operator *(double d, RowVector v)
 {
     VectorChecker.ZeroSize(v);
     return(VectorImpl.Mul(new RowVector(v.Size), d, v));
 }
예제 #6
0
 IVector IVector.Sub(IVector v)
 {
     return(VectorImpl.SubEq(this, v));
 }
예제 #7
0
 IVector IVector.Div(double value)
 {
     return(VectorImpl.DivEq(this, value));
 }
예제 #8
0
 /// <summary>
 /// 2つの<see cref="IVector"/>インタフェースを実装したオブジェクトを加算して
 /// <see cref="Vector"/>オブジェクトを作成する.
 /// </summary>
 /// <param name="v1"><see cref="IVector"/>インタフェースを実装したオブジェクト(左項)</param>
 /// <param name="v2"><see cref="IVector"/>インタフェースを実装したオブジェクト(右項)</param>
 /// <returns>加算結果を格納した<see cref="Vector"/>オブジェクト</returns>
 public static Vector Add(IVector v1, IVector v2)
 {
     VectorChecker.MismatchSize(v1, v2);
     return(VectorImpl.Add(new Vector(v1.Size), v1, v2));
 }
예제 #9
0
 public override string ToString()
 {
     return(VectorImpl.ToString(this));
 }
예제 #10
0
 /// <summary>
 /// このベクトルオブジェクトに<paramref name="v"/>を加算する.
 /// </summary>
 /// <param name="v">ベクトルオブジェクト</param>
 /// <returns>自身への参照</returns>
 public IVector Add(IVector v)
 {
     return(VectorImpl.AddEq(this, v));
 }
예제 #11
0
 /// <summary>
 /// このベクトルオブジェクトから<paramref name="v"/>を減算する.
 /// </summary>
 /// <param name="v">ベクトルオブジェクト</param>
 /// <returns>自身への参照</returns>
 public IVector Sub(IVector v)
 {
     return(VectorImpl.SubEq(this, v));
 }
예제 #12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v"></param>
 /// <param name="d"></param>
 /// <returns></returns>
 public static Vector operator /(Vector v, double d)
 {
     VectorChecker.ZeroSize(v);
     return(VectorImpl.Div(new Vector(v.Size), v, d));
 }
예제 #13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v"></param>
 /// <param name="d"></param>
 /// <returns></returns>
 public static Vector operator *(Vector v, double d)
 {
     VectorChecker.ZeroSize(v);
     return(VectorImpl.Mul(new Vector(v.Size), d, v));
 }
예제 #14
0
 /// <summary>
 /// CSV形式の文字列で出力する.
 /// </summary>
 /// <returns>CSV形式の文字列</returns>
 public string ToCsv()
 {
     return(VectorImpl.ToCsv(this));
 }
예제 #15
0
 IVector IVector.Add(double value)
 {
     return(VectorImpl.AddEq(this, value));
 }
예제 #16
0
 IVector IVector.Flip()
 {
     return(VectorImpl.Flip(this));
 }
예제 #17
0
 IVector IVector.Add(IVector v)
 {
     return(VectorImpl.AddEq(this, v));
 }
예제 #18
0
 IVector IVector.Zero()
 {
     return(VectorImpl.Zero(this));
 }
예제 #19
0
 IVector IVector.Mul(double value)
 {
     return(VectorImpl.MulEq(this, value));
 }
예제 #20
0
 double[] IVector.ToArray()
 {
     return(VectorImpl.ToArray(this));
 }
예제 #21
0
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(VectorImpl.Enumerator(this));
 }
예제 #22
0
 IVector IVector.ForEach(ElementActionByVal action)
 {
     return(VectorImpl.ForEach(this, action));
 }
예제 #23
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v1"></param>
 /// <param name="v2"></param>
 /// <returns></returns>
 public static double operator *(IVector v1, RowVector v2)
 {
     VectorChecker.MismatchSize(v1, v2);
     return(VectorImpl.Dot(v1, v2));
 }
예제 #24
0
 IVector IVector.ForEach(ElementActionByRefWithIndex action)
 {
     return(VectorImpl.ForEach(this, action));
 }
예제 #25
0
 /// <summary>
 /// 減算する.
 /// </summary>
 /// <param name="v1"></param>
 /// <param name="v2"></param>
 /// <returns>減算結果の<see cref="RowVector"/></returns>
 public static new RowVector Sub(IVector v1, IVector v2)
 {
     VectorChecker.MismatchSize(v1, v2);
     return(VectorImpl.Sub(new RowVector(v1.Size), v1, v2));
 }
예제 #26
0
 IVector IVector.Subvector(int startIndex)
 {
     return(VectorImpl.Subvector(this, startIndex));
 }
예제 #27
0
 /// <summary>
 /// スカラ値で除算する.
 /// </summary>
 /// <param name="v"></param>
 /// <param name="d"></param>
 /// <returns>除算結果の<see cref="RowVector"/></returns>
 public static new RowVector Div(IVector v, double d)
 {
     VectorChecker.ZeroSize(v);
     return(VectorImpl.Div(new RowVector(v.Size), v, d));
 }
예제 #28
0
 IVector IVector.Subvector(int startIndex, int length)
 {
     return(VectorImpl.Subvector(this, startIndex, length));
 }
예제 #29
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="v1"></param>
 /// <param name="v2"></param>
 /// <returns></returns>
 public static ColumnVector operator -(ColumnVector v1, Vector v2)
 {
     VectorChecker.MismatchSize(v1, v2);
     return(VectorImpl.Sub(new ColumnVector(v1.Size), v1, v2));
 }
예제 #30
0
 /// <summary>
 /// ベクトルの各要素に対してactionを適用する.
 /// </summary>
 /// <param name="action">
 /// <see cref="ElementActionByRef"/>により規定されたデリゲート
 /// </param>
 /// <returns>メソッド適用後の自身への参照</returns>
 public IVector ForEach(ElementActionByRef action)
 {
     return(VectorImpl.ForEach(this, action));
 }