Beispiel #1
0
 /// <summary>
 /// ベクトルの各要素に対してactionを適用する.
 /// </summary>
 /// <param name="action">
 /// <see cref="ElementActionByValWithIndex"/>により規定されたデリゲート
 /// </param>
 /// <returns>メソッド適用後の自身への参照</returns>
 public IVector ForEach(ElementActionByValWithIndex action)
 {
     return(VectorImpl.ForEach(this, action));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #4
0
 public IEnumerator <double> GetEnumerator()
 {
     return(VectorImpl.Enumerator(this));
 }
Beispiel #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));
 }
Beispiel #6
0
 IVector IVector.Sub(IVector v)
 {
     return(VectorImpl.SubEq(this, v));
 }
Beispiel #7
0
 IVector IVector.Div(double value)
 {
     return(VectorImpl.DivEq(this, value));
 }
Beispiel #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));
 }
Beispiel #9
0
 public override string ToString()
 {
     return(VectorImpl.ToString(this));
 }
Beispiel #10
0
 /// <summary>
 /// このベクトルオブジェクトに<paramref name="v"/>を加算する.
 /// </summary>
 /// <param name="v">ベクトルオブジェクト</param>
 /// <returns>自身への参照</returns>
 public IVector Add(IVector v)
 {
     return(VectorImpl.AddEq(this, v));
 }
Beispiel #11
0
 /// <summary>
 /// このベクトルオブジェクトから<paramref name="v"/>を減算する.
 /// </summary>
 /// <param name="v">ベクトルオブジェクト</param>
 /// <returns>自身への参照</returns>
 public IVector Sub(IVector v)
 {
     return(VectorImpl.SubEq(this, v));
 }
Beispiel #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));
 }
Beispiel #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));
 }
Beispiel #14
0
 /// <summary>
 /// CSV形式の文字列で出力する.
 /// </summary>
 /// <returns>CSV形式の文字列</returns>
 public string ToCsv()
 {
     return(VectorImpl.ToCsv(this));
 }
Beispiel #15
0
 IVector IVector.Add(double value)
 {
     return(VectorImpl.AddEq(this, value));
 }
Beispiel #16
0
 IVector IVector.Flip()
 {
     return(VectorImpl.Flip(this));
 }
Beispiel #17
0
 IVector IVector.Add(IVector v)
 {
     return(VectorImpl.AddEq(this, v));
 }
Beispiel #18
0
 IVector IVector.Zero()
 {
     return(VectorImpl.Zero(this));
 }
Beispiel #19
0
 IVector IVector.Mul(double value)
 {
     return(VectorImpl.MulEq(this, value));
 }
Beispiel #20
0
 double[] IVector.ToArray()
 {
     return(VectorImpl.ToArray(this));
 }
Beispiel #21
0
 IEnumerator IEnumerable.GetEnumerator()
 {
     return(VectorImpl.Enumerator(this));
 }
Beispiel #22
0
 IVector IVector.ForEach(ElementActionByVal action)
 {
     return(VectorImpl.ForEach(this, action));
 }
Beispiel #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));
 }
Beispiel #24
0
 IVector IVector.ForEach(ElementActionByRefWithIndex action)
 {
     return(VectorImpl.ForEach(this, action));
 }
Beispiel #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));
 }
Beispiel #26
0
 IVector IVector.Subvector(int startIndex)
 {
     return(VectorImpl.Subvector(this, startIndex));
 }
Beispiel #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));
 }
Beispiel #28
0
 IVector IVector.Subvector(int startIndex, int length)
 {
     return(VectorImpl.Subvector(this, startIndex, length));
 }
Beispiel #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));
 }
Beispiel #30
0
 /// <summary>
 /// ベクトルの各要素に対してactionを適用する.
 /// </summary>
 /// <param name="action">
 /// <see cref="ElementActionByRef"/>により規定されたデリゲート
 /// </param>
 /// <returns>メソッド適用後の自身への参照</returns>
 public IVector ForEach(ElementActionByRef action)
 {
     return(VectorImpl.ForEach(this, action));
 }