nuget server logo nuget api documents
↑

API Docs / REnv / RVectorExtensions

RVectorExtensions

Full name SMRUCC.Rsharp.Runtime.RVectorExtensions Assembly REnv Members 16

01 Syntax

SMRUCC.Rsharp.Runtime.RVectorExtensions

02 Methods

NameOverloadsSummary
AllNothing 1 check all elements inside the given array is all nothing?
isVector 1 Object x is an array of T?
getFirst 1 Get first element in the input value sequence
single 1 Try get a single element
asVector 2 Ensure that the input value object is a sequence.
UnsafeTryCastGenericArray 2 Cast a possible object array to a generic type constrained array
isScalarVector 1 target value is nothing orelse is array with less than or equals to one element?
MeltArray 1 vector length = 0: means nothing vector length = 1: means scalar
TryCastGenericArray 1 This function make sure the return array is not a generic type array
asVector 1 这个函数会确保返回的输出值都是一个数组
castSingle 1 handling some special type cast situation
isVector 1
CTypeOfList 1
DirectCastGenericArray 1

03 Members

method AllNothing #
AllNothing(Array)

check all elements inside the given array is all nothing?

Parameters
NameTypeDescription
vArray

-

method isVector #
isVector``1(Object)

Object x is an array of T?

Type Parameters
NameDescription
T
Parameters
NameTypeDescription
xObject

-

Returns

returns a logical value of this type test operation

method getFirst #
getFirst(Object, Boolean)

Get first element in the input value sequence

Parameters
NameTypeDescription
valueObject

-

method single #
single(Object, Boolean)

Try get a single element

Remarks

这个函数只会在确认只有一个向量元素的情况下才会返回单个元素

Parameters
NameTypeDescription
xObject

If the input object x is an array with just one element, then the single value will be populate, otherwise will populate the input x

forceSingleBoolean

this function returns the first element in array/vector always if this parameter is set to true

method asVector #
asVector(Object, Type, Environment)

Ensure that the input value object is a sequence. (This method will decouple the object instance value from vbObject container unless the required type is vbObject.)

Parameters
NameTypeDescription
valueObject

-

typeType

should be the element type of the target vector array

Returns

如果执行出错,这个函数会返回一个错误消息

method UnsafeTryCastGenericArray overload 2 #
UnsafeTryCastGenericArray(Array)

Cast a possible object array to a generic type constrained array

Parameters
NameTypeDescription
vecArray

-

Returns

propably returns an array with all element value is nothing

method UnsafeTryCastGenericArray #
UnsafeTryCastGenericArray(Array, Type)

Cast a possible object array to a generic type constrained array

Parameters
NameTypeDescription
vecArray

-

Returns

propably returns an array with all element value is nothing

method isScalarVector #
isScalarVector(Object)

target value is nothing orelse is array with less than or equals to one element?

Parameters
NameTypeDescription
xiObject

-

Returns

Does the input test object xi not contains multiple value?

method MeltArray #
MeltArray(Array)

vector length = 0: means nothing vector length = 1: means scalar

Parameters
NameTypeDescription
vecArray

-

method TryCastGenericArray #
TryCastGenericArray(Array, Environment)

This function make sure the return array is not a generic type array

Remarks

返回错误消息或者结果向量

Parameters
NameTypeDescription
vecArray

-

envEnvironment

-

Returns

A class variant type: error message or a generic array.

Andalso this function will returns nothing if the input vec is nothing orelse is empty array.

method asVector #
asVector``1(Object)

这个函数会确保返回的输出值都是一个数组

Remarks
20210526 因为这个函数会涉及到转换类型的操作,所以性能损耗会非常严重

所以假若仅仅只需要转换数据对象为数组的话,请避免使用这个函数 应该手动编写代码以提升性能

在进行.NET语言编写相应的包的时候,尽量使用CLRVector模块之中 的类型转换函数以减少性能损失

Type Parameters
NameDescription
T
Parameters
NameTypeDescription
valueObject

-

Returns

this function returns an empty collection if the given value is nothing.

method castSingle #
castSingle``1(Type, Object)

handling some special type cast situation

Type Parameters
NameDescription
T
Parameters
NameTypeDescription
typeofTType

-

oObject

-

method isVector #
isVector(Object)
method CTypeOfList #
CTypeOfList(IDictionary, Environment)
method DirectCastGenericArray #
DirectCastGenericArray(Array, Type, Environment)
method asVector overload 2 #
asVector(Object)