/* MOD_V2.0 * Copyright (c) 2012 OpenDA Association * All rights reserved. * * This file is part of OpenDA. * * OpenDA is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation, either version 3 of * the License, or (at your option) any later version. * * OpenDA is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with OpenDA. If not, see . */ using System; namespace OpenDA.DotNet.Interfaces { /// /// Vector /// public interface IVector { /// /// Set whole vector equal to a constant value. ///

/// Note: This method can only be used if all elements of the vector /// have the same data type. /// /// value to set ///

void SetConstant(double value); /// /// Scale vector. /// /// @param alpha scalar /// void Scale(double alpha); /// /// Set / Get all values of the vector. ///

///

double[] Values { get; set; } /// /// Set single value of the vector. /// /// @param index index of value in vector /// @param value value to be set /// void SetValue(int index, double value); /// /// Get single value of the vector. /// /// @param index index in value in vector /// @return todo describe /// double GetValue(int index); /// /// Get size of vector. /// /// @return todo describe /// int Size { get; } /// /// Axpy operation between two Vectors. ///

/// Note: Axpy: this=alpha*x+this. Add alpha times Vector x to /// this Vector. /// /// @param alpha scalar /// @param x handle of Vector x ///

void Axpy(double alpha, IVector x); /// /// Compute DotProduct product of two Vectors. ///

/// Note: dotprod = sum[all i] (this.hVector_i * hVector2_i) /// /// @param otherVector the other Vector /// @return todo describe ///

double DotProduct(IVector otherVector); /// /// Compute the 2-norm of a Vector. /// /// @return todo describe /// double Norm2(); /// /// Devide each value in the vector by the related value in an other vector. /// /// @param otherVector The values to devide the vector by. /// void PointwiseDivide(IVector otherVector); /// /// Multiply each value in the vector with the related value in an other vector. /// /// @param otherVector The values to devide the vector by. /// void PointwiseMultiply(IVector otherVector); /// /// Compute square root of all elements in the vector. /// /// void Sqrt(); /// /// Clone (i.e. duplicate) a vector. ///

/// Note: Duplication means that a new vector is created that is identical to /// the current vector. All data in the current vector is also copied. /// /// @return A copy of the present vector. ///

IVector Clone(); /// /// Free a Vector Instance. /// void Finish(); /// /// Print the contents in a nice way /// String PrintString(String indent); } }