MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / getElement

Function getElement

src/compute-engine/library/linear-algebra.ts:1891–1900  ·  view source on GitHub ↗

* Get element from matrix at 1-based indices

(
  M: Expression,
  i: number,
  j: number,
  ce: ComputeEngine
)

Source from the content-addressed store, hash-verified

1889
1890 // Interpret a vector as a 1×n matrix (linear form), as `Kernel` does.
1891 const rowCount = shape.length === 1 ? 1 : shape[0];
1892 const columnCount = shape.length === 1 ? shape[0] : shape[1];
1893
1894 // Exact path: for an exact integer/rational matrix, the rank is the
1895 // number of pivots in the exact RREF (no tolerance ambiguity).
1896 const rationalMatrix = tensorToRationalMatrix(
1897 op,
1898 rowCount,
1899 columnCount
1900 );
1901 if (rationalMatrix) {
1902 const { pivotCols } = exactRationalRref(rationalMatrix);
1903 return ce.number(pivotCols.length);

Callers 3

linear-algebra.tsFile · 0.85
computeEigenvalues3x3Function · 0.85

Calls 3

isTensorFunction · 0.90
atMethod · 0.65
exprMethod · 0.65

Tested by

no test coverage detected