Difference between revisions of "ForceColumnVector"
Jump to navigation
Jump to search
imported>DragoonWraith |
imported>DragoonWraith |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| origin = OBSE | | origin = OBSE | ||
| summary = Takes a one-dimensional array, and returns an equivalent two-dimensional array, where the outer array's elements are each arrays with only one element - each element in the 1d array. I.e., <tt>A<nowiki>[i][0]</nowiki> == '''v'''<nowiki>[i]<nowiki></tt>. This forces various linear algebra functions to treat the vector as a column vector, and can be necessary when using [[MatrixMultiply]]. | | summary = Takes a one-dimensional array, and returns an equivalent two-dimensional array, where the outer array's elements are each arrays with only one element - each element in the 1d array. I.e., <tt>A<nowiki>[i][0]</nowiki> == '''v'''<nowiki>[i]</nowiki></tt>. This forces various linear algebra functions to treat the vector as a column vector, and can be necessary when using [[MatrixMultiply]]. | ||
Note that row vectors require only 2 array variables, as opposed to the ''n''+1 (where ''n'' is the number of elements) array variables needed for column vectors; for this reason, row vectors are generally preferred. | Note that row vectors require only 2 array variables, as opposed to the ''n''+1 (where ''n'' is the number of elements) array variables needed for column vectors; for this reason, row vectors are generally preferred. |
Latest revision as of 00:30, 10 August 2010
< [[::Category:Functions|Category:Functions]]
A function added by the Oblivion Script Extender.
Syntax:
(colVector:array) ForceColumnVector vector1d:array (colVector:array) ColVec vector1d:array
Takes a one-dimensional array, and returns an equivalent two-dimensional array, where the outer array's elements are each arrays with only one element - each element in the 1d array. I.e., A[i][0] == v[i]. This forces various linear algebra functions to treat the vector as a column vector, and can be necessary when using MatrixMultiply.
Note that row vectors require only 2 array variables, as opposed to the n+1 (where n is the number of elements) array variables needed for column vectors; for this reason, row vectors are generally preferred.