nuget server logo nuget api documents
↑

API Docs / Microsoft.VisualBasic.Math.Core / Vector

Vector

Full name Microsoft.VisualBasic.Math.LinearAlgebra.Vector Assembly Microsoft.VisualBasic.Math.Core Members 94

A numeric vector

00 Remarks

this numeric vector is based on the Vector

01 Syntax

Microsoft.VisualBasic.Math.LinearAlgebra.Vector

02 Methods

NameOverloadsSummary
Call 1 Try to call target method in vector mode.
Sqrt 1 abs(x) computes the absolute value of x, sqrt(x) computes the (principal) square root of x, √{x}.
Exp 2 log computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms.
Quantile 1
Log 2
Trunc 1 Rounding of Numbers
BesselI 2 Bessel Functions of integer and fractional order, of first and second kind, J(nu) and Y(nu), and Modified Bessel functions (of first and third kind), I(nu) and K(nu).
Order 2 order()的返回值是对应排名的元素所在向量中的位置。 R x <- c(97, 93, 85, 74, 32, 100, 99, 67); sort(x) # [1] 32 67 74 85 93 97 99 100 order(x) # [1] 5 8 4 3 2 1 7 6 rank(x) # [1] 6 5 4 3…
.ctor 9 创建一个空的向量,包含有零个元素
AsDiagonal 1 Convert the vector as the diagonal matrix
CopyTo 3 Copies the vector instance to a specified destination array starting at a specified index position.
CopyFrom 1 Make data copy from the given source to current vector object
op_Addition 3 两个向量加法算符重载,分量分别相加
op_Subtraction 3 向量减法算符重载,分量分别相减
op_Multiply 4 向量乘法算符重载,分量分别相乘,相当于MATLAB中的.*算符
op_Division 2 向量除法算符重载,分量分别相除,相当于MATLAB中的./算符
op_BitwiseOr 1 向量内积
op_ExclusiveOr 1 向量外积(相当于列向量,乘以横向量)
op_UnaryNegation 1 负向量
op_Equality 2 x向量之中的每一个元素是否都等于n?
op_Exponent 1 Power: Math.Pow())
op_GreaterThanOrEqual 1 返回一个逻辑向量,用来指示向量对象的每一个分量与目标比较的逻辑值结果
op_LessThanOrEqual 1 x <= n
op_Implicit 1 [1,2,3,4,5,6,...]
slice 1 进行序列切片操作
DotProduct 1 dot + http://mathworld.wolfram.com/DotProduct.html + http://www.mathsisfun.com/algebra/vectors-dot-product.html
dot 2 helper function for vector dot product
Product 1 返回这个向量之中的所有的元素的乘积
ScaleToRange 1 scale elements in current vector to another value range.
ToString 2 Display member's data as json array
SumMagnitudes 1 http://math.stackexchange.com/questions/440320/what-is-magnitude-of-sum-of-two-vector
Ones 1 Returns a numeric vector with all elements is value 1
rand 2
norm 1 create a vector that contains the random number from the gaussian distribution
Call 3
Log10 2
Max 2
Min 2
Abs 2
floor 1
round 1
Sinh 1
Sign 1
pchisq 1
seq 1
AsSparse 1
op_Inequality 1
op_GreaterThan 1
op_LessThan 1
op_Explicit 1
CumSum 1
Scalar 1

03 Properties

NameOverloadsSummary
NaN 1 Double.NaN
Inf 1 Double.PositiveInfinity
Zero 1 Only one number in the vector and its value is ZERO
IsNumeric 1 check of current vector is scalar?
IsNaN 1 get NaN elements
Item 1
Mod 1 norm2() 向量模的平方,||x||是向量x=(x1,x2,…,xp)的欧几里得范数
SumMagnitude 1 norm() http://math.stackexchange.com/questions/440320/what-is-magnitude-of-sum-of-two-vector
Unit 1 normalize
Range 1 [min, max]

04 Members

method Call #
Call``1(Delegate, Argument())

Try to call target method in vector mode.

Type Parameters
NameDescription
TOut
Parameters
NameTypeDescription
methodDelegate

只可以是静态的共享方法

argsArgument()

-

method Sqrt #
Sqrt(Vector)

abs(x) computes the absolute value of x, sqrt(x) computes the (principal) square root of x, √{x}.

Parameters
NameTypeDescription
xVector

a numeric or complex vector or array.

method Exp overload 2 #
Exp(Vector)

log computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base. log1p(x) computes log(1+x) accurately also for |x| << 1. exp computes the exponential function. expm1(x) computes exp(x) - 1 accurately also for |x| << 1.

Parameters
NameTypeDescription
xVector

a numeric or complex vector.

method Exp #
Exp

log computes logarithms, by default natural logarithms, log10 computes common (i.e., base 10) logarithms, and log2 computes binary (i.e., base 2) logarithms. The general form log(x, base) computes logarithms with base base. log1p(x) computes log(1+x) accurately also for |x| << 1. exp computes the exponential function. expm1(x) computes exp(x) - 1 accurately also for |x| << 1.

method Quantile #
Quantile(Double())
Parameters
NameTypeDescription
percentageDouble()

[0, 1]之间

method Log #
Log(Vector, Double)
Parameters
NameTypeDescription
xVector

a numeric or complex vector.

baseDouble

a positive or complex number: the base with respect to which logarithms are computed. Defaults to e=exp(1).

method Trunc #
Trunc(Vector)

Rounding of Numbers

Parameters
NameTypeDescription
xVector

-

method BesselI #
BesselI(Vector, Vector, Boolean)

Bessel Functions of integer and fractional order, of first and second kind, J(nu) and Y(nu), and Modified Bessel functions (of first and third kind), I(nu) and K(nu).

Returns

Numeric vector with the (scaled, if expon.scaled = TRUE) values of the corresponding Bessel function. The length of the result is the maximum of the lengths of the parameters. All parameters are recycled to that length.

method BesselI overload 2 #
BesselI(Vector, Double, Boolean)

Bessel Functions of integer and fractional order, of first and second kind, J(nu) and Y(nu), and Modified Bessel functions (of first and third kind), I(nu) and K(nu).

Parameters
NameTypeDescription
xVector

a numeric vector, the argument of the Bessel function.

nuDouble

a numeric vector, the order of the Bessel function.

ExponScaledBoolean

if TRUE, the results are exponentially scaled in order to avoid overflow.

Returns

Numeric vector with the (scaled) values of the modified Bessel function I(nu).

method Order overload 2 #
Order(Vector, Boolean, Boolean)

order returns a permutation which rearranges its first argument into ascending or descending order, breaking ties by further arguments. sort.list is the same, using only one argument.

method Order #
Order

order()的返回值是对应排名的元素所在向量中的位置。

 x <- c(97, 93, 85, 74, 32, 100, 99, 67);
 
 sort(x)
 # [1] 32  67  74  85  93  97  99 100
 order(x)
 # [1] 5 8 4 3 2 1 7 6
 rank(x)
 # [1] 6 5 4 3 1 8 7 2
method .ctor overload 8 #
#ctor(Int32)

Creates vector with m element and init value set to zero It creates a double-precision vector of the specified length with each element equal to 0.

Remarks

equality to R expression

 numeric(m)
Parameters
NameTypeDescription
mInt32

-

method .ctor #
#ctor

创建一个空的向量,包含有零个元素

method .ctor overload 3 #
#ctor(IEnumerable(Of Double))

Creates vector with a specific value sequence.

Parameters
NameTypeDescription
dataIEnumerable(Of Double)

a sequence of numeric value that will fill the vector's data Vector.buffer.

method .ctor overload 5 #
#ctor(IEnumerable(Of Single))

Creates vector with a specific value sequence

Parameters
NameTypeDescription
shortsIEnumerable(Of Single)

-

method .ctor overload 2 #
#ctor(IEnumerable(Of Double), Func(Of Double, Double))

Init with transform

Parameters
NameTypeDescription
xIEnumerable(Of Double)

-

applyFunc(Of Double, Double)

-

method .ctor overload 4 #
#ctor(IEnumerable(Of Int32))

Creates vector with a specific value sequence

Parameters
NameTypeDescription
integersIEnumerable(Of Int32)

-

method .ctor overload 6 #
#ctor(Double, Int32)

Creates vector with m element and init value specific by init parameter.

Parameters
NameTypeDescription
initDouble

-

mInt32

-

method .ctor overload 9 #
#ctor(Single(), Int32)

Creates a vector from a specified array starting at a specified index position.

Parameters
NameTypeDescription
valuesSingle()

The values to add to the vector, as an array of objects of type T. The array must contain at least Count elements from the specified index and only the first Count elements are used.

indexInt32

The starting index position from which to create the vector.

method .ctor overload 7 #
#ctor(Double(), Int32, Int32)

Creates a vector from a specified array starting at a specified index position.

Parameters
NameTypeDescription
valuesDouble()

The values to add to the vector, as an array of objects of type T. The array must contain at least Count elements from the specified index and only the first Count elements are used.

indexInt32

The starting index position from which to create the vector.

method AsDiagonal #
AsDiagonal

Convert the vector as the diagonal matrix

Returns

returns a NxN matrix object, N size is equals to the vector dimension size

method CopyTo #
CopyTo(Double(), Int32)

Copies the vector instance to a specified destination array starting at a specified index position.

Parameters
NameTypeDescription
destinationDouble()

The array to receive a copy of the vector values.

startIndexInt32

The starting index in destination at which to begin the copy operation.

method CopyTo overload 2 #
CopyTo(Int32(), Int32)

Copies the vector instance to a specified destination array starting at a specified index position.

Parameters
NameTypeDescription
destinationInt32()

The array to receive a copy of the vector values.

startIndexInt32

The starting index in destination at which to begin the copy operation.

method CopyTo overload 3 #
CopyTo(Single(), Int32)

Copies the vector instance to a specified destination array starting at a specified index position.

Parameters
NameTypeDescription
destinationSingle()

The array to receive a copy of the vector values.

startIndexInt32

The starting index in destination at which to begin the copy operation.

method CopyFrom #
CopyFrom(Double(), Int32, Int32)

Make data copy from the given source to current vector object

Parameters
NameTypeDescription
sourceDouble()

the source vector data for copy data to current vector

startIndexInt32

the start index of the data in current vector

countInt32

the number of the data elements copy from the source data

method op_Addition #
op_Addition(Vector, Vector)

两个向量加法算符重载,分量分别相加

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

Returns

this operator is a safe function: if any one vector is nothing, then returns the copy of another vector directly.

method op_Addition overload 2 #
op_Addition(Vector, Double)

向量减加实数,各分量分别加实数

Parameters
NameTypeDescription
v1Vector

-

aDouble

-

method op_Addition overload 3 #
op_Addition(Double, Vector)

实数加向量

Parameters
NameTypeDescription
aDouble

-

v1Vector

-

method op_Subtraction #
op_Subtraction(Vector, Vector)

向量减法算符重载,分量分别相减

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

method op_Subtraction overload 2 #
op_Subtraction(Vector, Double)

向量减实数,各分量分别减实数

Parameters
NameTypeDescription
v1Vector

-

aDouble

-

method op_Subtraction overload 3 #
op_Subtraction(Double, Vector)

实数减向量

Parameters
NameTypeDescription
aDouble

-

v1Vector

-

method op_Multiply overload 3 #
op_Multiply(Vector, Double())

向量乘法算符重载,分量分别相乘,相当于MATLAB中的.*算符

Parameters
NameTypeDescription
v1Vector

-

v2Double()

-

method op_Multiply #
op_Multiply(Vector, Vector)

向量乘法算符重载,分量分别相乘,相当于MATLAB中的.*算符

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

method op_Multiply overload 2 #
op_Multiply(Vector, Double)

向量 数乘,各分量分别乘以实数

Parameters
NameTypeDescription
v1Vector

-

aDouble

-

method op_Multiply overload 4 #
op_Multiply(Double, Vector)

向量 数乘

Parameters
NameTypeDescription
aDouble

-

v1Vector

-

method op_Division #
op_Division(Vector, Vector)

向量除法算符重载,分量分别相除,相当于MATLAB中的./算符

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

method op_Division overload 2 #
op_Division(Vector, Double)

向量 数除,各分量分别除以实数

Parameters
NameTypeDescription
v1Vector

-

aDouble

-

method op_BitwiseOr #
op_BitwiseOr(Vector, Vector)

向量内积

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

method op_ExclusiveOr #
op_ExclusiveOr(Vector, Vector)

向量外积(相当于列向量,乘以横向量)

Parameters
NameTypeDescription
v1Vector

-

v2Vector

-

method op_UnaryNegation #
op_UnaryNegation(Vector)

负向量

Parameters
NameTypeDescription
v1Vector

-

method op_Equality overload 2 #
op_Equality(Vector, Int32)

x向量之中的每一个元素是否都等于n?

Parameters
NameTypeDescription
xVector

-

nInt32

-

method op_Equality #
op_Equality(Vector, Double)

x向量之中的每一个元素是否都等于n?

Parameters
NameTypeDescription
xVector

-

nDouble

-

method op_Exponent #
op_Exponent(Vector, Double)

Power: Math.Pow()

Parameters
NameTypeDescription
vVector

-

nDouble

-

method op_GreaterThanOrEqual #
op_GreaterThanOrEqual(Vector, Double)

返回一个逻辑向量,用来指示向量对象的每一个分量与目标比较的逻辑值结果

Parameters
NameTypeDescription
xVector

-

nDouble

-

method op_LessThanOrEqual #
op_LessThanOrEqual(Vector, Double)

x <= n

Parameters
NameTypeDescription
xVector

-

nDouble

-

method op_Implicit #
op_Implicit(String)

[1,2,3,4,5,6,...]

Parameters
NameTypeDescription
vector$String

-

method slice #
slice(Int32, Int32, Int32)

进行序列切片操作

Parameters
NameTypeDescription
start%Int32

-

stop%Int32

-

steps%Int32

-

method DotProduct #
DotProduct(Vector)
Parameters
NameTypeDescription
v2Vector

-

method dot #
dot(Double(), Double())

helper function for vector dot product

Parameters
NameTypeDescription
lhsDouble()

-

rhsDouble()

-

method dot overload 2 #
dot(Single(), Single())

helper function for vector dot product

Parameters
NameTypeDescription
lhsSingle()

-

rhsSingle()

-

method Product #
Product

返回这个向量之中的所有的元素的乘积

method ScaleToRange #
ScaleToRange(DoubleRange)

scale elements in current vector to another value range.

Parameters
NameTypeDescription
rangeDoubleRange

-

Returns

a new data Vector which its element value is in range of a given range.

method ToString #
ToString

Display member's data as json array

method SumMagnitudes #
SumMagnitudes(Vector, Vector)
Parameters
NameTypeDescription
x1Vector

-

x2Vector

-

method Ones #
Ones(Int32)

Returns a numeric vector with all elements is value 1

Parameters
NameTypeDescription
nInt32

-

method rand overload 2 #
rand(Int32)
Remarks

this method can be affected by the RandomExtensions.SetSeed() method.

Parameters
NameTypeDescription
size%Int32

-

method norm #
norm(Int32, Double, Double)

create a vector that contains the random number from the gaussian distribution

Remarks

gaussian number generated via the RandomExtensions.NextGaussian() method.

Parameters
NameTypeDescription
sizeInt32

-

muDouble

-

sigmaDouble

-

property NaN #
NaN

Double.NaN

property Inf #
Inf

Double.PositiveInfinity

property Zero #
Zero(Int32)

Only one number in the vector and its value is ZERO

property IsNumeric #
IsNumeric

check of current vector is scalar?

Remarks

GenericVector.Dim为1?即当前的向量对象是否是只包含有一个数字?

property IsNaN #
IsNaN

get NaN elements

property Item #
Item(String)
Remarks

syntax helper

Parameters
NameTypeDescription
rangeExpressionString

-

property Mod #
Mod

norm2()

向量模的平方,||x||是向量x=(x1,x2,…,xp)的欧几里得范数

Remarks

SquaredNorm 平方绝对值的总和

property SumMagnitude #
SumMagnitude
property Unit #
Unit

normalize

property Range #
Range

[min, max]

method Call overload 3 #
Call(Func(Of Double, Double), Vector+Argument)
method Call overload 2 #
Call(Func(Of Double, Double, Double), Vector+Argument, Vector+Argument)
method Call #
Call(Func(Of Double, Double, Double, Double), Vector+Argument, Vector+Argument, Vector+Argument)
method Log overload 2 #
Log(Double)
method Log10 overload 2 #
Log10(Vector)
method Log10 #
Log10()
method Max overload 2 #
Max(Vector)
method Max #
Max(Vector, Double)
method Min overload 2 #
Min(Vector)
method Min #
Min(Vector, Double)
method Abs overload 2 #
Abs(Vector)
method floor #
floor(Vector)
method round #
round(Vector, Int32)
method Sinh #
Sinh(Vector)
method Sign #
Sign(Vector)
method pchisq #
pchisq(Vector, Vector, Double, Boolean, Boolean)
method seq #
seq(Int32, Int32, Double)
method AsSparse #
AsSparse()
method op_Inequality #
op_Inequality(Vector, Int32)
method op_GreaterThan #
op_GreaterThan(Vector, Double)
method op_LessThan #
op_LessThan(Vector, Double)
method op_Explicit #
op_Explicit(Vector)
method CumSum #
CumSum()
method Abs #
Abs()
method ToString overload 2 #
ToString(String)
method Scalar #
Scalar(Double)
method rand #
rand(Double, Double, Int32)