setcomp
float|void setcomp(<vector>&target, float value, int index)
通过将index
处的分量修改为value
,原地修改target
向量。
如果以float
返回类型调用,则返回value
。
float|void setcomp(<matrix>&target, float value, int row, int column)
通过将row
和column
指定的分量修改为value
,原地修改target
矩阵。
如果以float
返回类型调用,则返回value
。
<type> setcomp(<type>&array[], <type>value, int index)
将array
中index
处的项设置为value
,并返回value
。
这等同于array[index] = value
。
float setcomp(<vector>&array[], float value, int i, int j)
通过将j
处的分量修改为value
,原地修改array[i]
向量,并返回value
。
这等同于setcomp(array[i], value, j)
。
float setcomp(<matrix>&array[], float value, int i, int j, int k)
通过将j
和k
指定的分量修改为value
,原地修改array[i]
矩阵,并返回value
。
这等同于setcomp(array[i], value, j, k)
。
<type> setcomp(dict &d, <type>value, string index)
<type>[] setcomp(dict &d, <type>value[], string index)
将字典d
中index
处的项设置为value
,并返回value
。
这等同于d[index] = value
。
注意:由于要设置的类型不是由左侧决定的,可能需要完整指定value
的类型以避免歧义。