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