feat:node-modules
This commit is contained in:
117
node_modules/mathjs/lib/cjs/function/matrix/apply.js
generated
vendored
Normal file
117
node_modules/mathjs/lib/cjs/function/matrix/apply.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
65
node_modules/mathjs/lib/cjs/function/matrix/column.js
generated
vendored
Normal file
65
node_modules/mathjs/lib/cjs/function/matrix/column.js
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createColumn = void 0;
|
||||
var _factory = require("../../utils/factory.js");
|
||||
var _is = require("../../utils/is.js");
|
||||
var _object = require("../../utils/object.js");
|
||||
var _array = require("../../utils/array.js");
|
||||
const name = 'column';
|
||||
const dependencies = ['typed', 'Index', 'matrix', 'range'];
|
||||
const createColumn = exports.createColumn = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
|
||||
let {
|
||||
typed,
|
||||
Index,
|
||||
matrix,
|
||||
range
|
||||
} = _ref;
|
||||
/**
|
||||
* Return a column from a Matrix.
|
||||
*
|
||||
* Syntax:
|
||||
*
|
||||
* math.column(value, index)
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* // get a column
|
||||
* const d = [[1, 2], [3, 4]]
|
||||
* math.column(d, 1) // returns [[2], [4]]
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* row
|
||||
*
|
||||
* @param {Array | Matrix } value An array or matrix
|
||||
* @param {number} column The index of the column
|
||||
* @return {Array | Matrix} The retrieved column
|
||||
*/
|
||||
return typed(name, {
|
||||
'Matrix, number': _column,
|
||||
'Array, number': function (value, column) {
|
||||
return _column(matrix((0, _object.clone)(value)), column).valueOf();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Retrieve a column of a matrix
|
||||
* @param {Matrix } value A matrix
|
||||
* @param {number} column The index of the column
|
||||
* @return {Matrix} The retrieved column
|
||||
*/
|
||||
function _column(value, column) {
|
||||
// check dimensions
|
||||
if (value.size().length !== 2) {
|
||||
throw new Error('Only two dimensional matrix is supported');
|
||||
}
|
||||
(0, _array.validateIndex)(column, value.size()[1]);
|
||||
const rowRange = range(0, value.size()[0]);
|
||||
const index = new Index(rowRange, column);
|
||||
const result = value.subset(index);
|
||||
return (0, _is.isMatrix)(result) ? result : matrix([[result]]);
|
||||
}
|
||||
});
|
||||
110
node_modules/mathjs/lib/cjs/function/matrix/concat.js
generated
vendored
Normal file
110
node_modules/mathjs/lib/cjs/function/matrix/concat.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
45
node_modules/mathjs/lib/cjs/function/matrix/count.js
generated
vendored
Normal file
45
node_modules/mathjs/lib/cjs/function/matrix/count.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createCount = void 0;
|
||||
var _factory = require("../../utils/factory.js");
|
||||
const name = 'count';
|
||||
const dependencies = ['typed', 'size', 'prod'];
|
||||
const createCount = exports.createCount = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
|
||||
let {
|
||||
typed,
|
||||
size,
|
||||
prod
|
||||
} = _ref;
|
||||
/**
|
||||
* Count the number of elements of a matrix, array or string.
|
||||
*
|
||||
* Syntax:
|
||||
*
|
||||
* math.count(x)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* math.count('hello world') // returns 11
|
||||
* const A = [[1, 2, 3], [4, 5, 6]]
|
||||
* math.count(A) // returns 6
|
||||
* math.count(math.range(1,6)) // returns 5
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* size
|
||||
*
|
||||
* @param {string | Array | Matrix} x A matrix or string
|
||||
* @return {number} An integer with the elements in `x`.
|
||||
*/
|
||||
return typed(name, {
|
||||
string: function (x) {
|
||||
return x.length;
|
||||
},
|
||||
'Matrix | Array': function (x) {
|
||||
return prod(size(x));
|
||||
}
|
||||
});
|
||||
});
|
||||
87
node_modules/mathjs/lib/cjs/function/matrix/cross.js
generated
vendored
Normal file
87
node_modules/mathjs/lib/cjs/function/matrix/cross.js
generated
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createCross = void 0;
|
||||
var _array = require("../../utils/array.js");
|
||||
var _factory = require("../../utils/factory.js");
|
||||
const name = 'cross';
|
||||
const dependencies = ['typed', 'matrix', 'subtract', 'multiply'];
|
||||
const createCross = exports.createCross = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
|
||||
let {
|
||||
typed,
|
||||
matrix,
|
||||
subtract,
|
||||
multiply
|
||||
} = _ref;
|
||||
/**
|
||||
* Calculate the cross product for two vectors in three dimensional space.
|
||||
* The cross product of `A = [a1, a2, a3]` and `B = [b1, b2, b3]` is defined
|
||||
* as:
|
||||
*
|
||||
* cross(A, B) = [
|
||||
* a2 * b3 - a3 * b2,
|
||||
* a3 * b1 - a1 * b3,
|
||||
* a1 * b2 - a2 * b1
|
||||
* ]
|
||||
*
|
||||
* If one of the input vectors has a dimension greater than 1, the output
|
||||
* vector will be a 1x3 (2-dimensional) matrix.
|
||||
*
|
||||
* Syntax:
|
||||
*
|
||||
* math.cross(x, y)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* math.cross([1, 1, 0], [0, 1, 1]) // Returns [1, -1, 1]
|
||||
* math.cross([3, -3, 1], [4, 9, 2]) // Returns [-15, -2, 39]
|
||||
* math.cross([2, 3, 4], [5, 6, 7]) // Returns [-3, 6, -3]
|
||||
* math.cross([[1, 2, 3]], [[4], [5], [6]]) // Returns [[-3, 6, -3]]
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* dot, multiply
|
||||
*
|
||||
* @param {Array | Matrix} x First vector
|
||||
* @param {Array | Matrix} y Second vector
|
||||
* @return {Array | Matrix} Returns the cross product of `x` and `y`
|
||||
*/
|
||||
return typed(name, {
|
||||
'Matrix, Matrix': function (x, y) {
|
||||
return matrix(_cross(x.toArray(), y.toArray()));
|
||||
},
|
||||
'Matrix, Array': function (x, y) {
|
||||
return matrix(_cross(x.toArray(), y));
|
||||
},
|
||||
'Array, Matrix': function (x, y) {
|
||||
return matrix(_cross(x, y.toArray()));
|
||||
},
|
||||
'Array, Array': _cross
|
||||
});
|
||||
|
||||
/**
|
||||
* Calculate the cross product for two arrays
|
||||
* @param {Array} x First vector
|
||||
* @param {Array} y Second vector
|
||||
* @returns {Array} Returns the cross product of x and y
|
||||
* @private
|
||||
*/
|
||||
function _cross(x, y) {
|
||||
const highestDimension = Math.max((0, _array.arraySize)(x).length, (0, _array.arraySize)(y).length);
|
||||
x = (0, _array.squeeze)(x);
|
||||
y = (0, _array.squeeze)(y);
|
||||
const xSize = (0, _array.arraySize)(x);
|
||||
const ySize = (0, _array.arraySize)(y);
|
||||
if (xSize.length !== 1 || ySize.length !== 1 || xSize[0] !== 3 || ySize[0] !== 3) {
|
||||
throw new RangeError('Vectors with length 3 expected ' + '(Size A = [' + xSize.join(', ') + '], B = [' + ySize.join(', ') + '])');
|
||||
}
|
||||
const product = [subtract(multiply(x[1], y[2]), multiply(x[2], y[1])), subtract(multiply(x[2], y[0]), multiply(x[0], y[2])), subtract(multiply(x[0], y[1]), multiply(x[1], y[0]))];
|
||||
if (highestDimension > 1) {
|
||||
return [product];
|
||||
} else {
|
||||
return product;
|
||||
}
|
||||
}
|
||||
});
|
||||
43
node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js
generated
vendored
Normal file
43
node_modules/mathjs/lib/cjs/function/matrix/ctranspose.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.createCtranspose = void 0;
|
||||
var _factory = require("../../utils/factory.js");
|
||||
const name = 'ctranspose';
|
||||
const dependencies = ['typed', 'transpose', 'conj'];
|
||||
const createCtranspose = exports.createCtranspose = /* #__PURE__ */(0, _factory.factory)(name, dependencies, _ref => {
|
||||
let {
|
||||
typed,
|
||||
transpose,
|
||||
conj
|
||||
} = _ref;
|
||||
/**
|
||||
* Transpose and complex conjugate a matrix. All values of the matrix are
|
||||
* reflected over its main diagonal and then the complex conjugate is
|
||||
* taken. This is equivalent to complex conjugation for scalars and
|
||||
* vectors.
|
||||
*
|
||||
* Syntax:
|
||||
*
|
||||
* math.ctranspose(x)
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]
|
||||
* math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]
|
||||
*
|
||||
* See also:
|
||||
*
|
||||
* transpose, diag, inv, subset, squeeze
|
||||
*
|
||||
* @param {Array | Matrix} x Matrix to be ctransposed
|
||||
* @return {Array | Matrix} The ctransposed matrix
|
||||
*/
|
||||
return typed(name, {
|
||||
any: function (x) {
|
||||
return conj(transpose(x));
|
||||
}
|
||||
});
|
||||
});
|
||||
148
node_modules/mathjs/lib/cjs/function/matrix/det.js
generated
vendored
Normal file
148
node_modules/mathjs/lib/cjs/function/matrix/det.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
161
node_modules/mathjs/lib/cjs/function/matrix/diag.js
generated
vendored
Normal file
161
node_modules/mathjs/lib/cjs/function/matrix/diag.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
169
node_modules/mathjs/lib/cjs/function/matrix/diff.js
generated
vendored
Normal file
169
node_modules/mathjs/lib/cjs/function/matrix/diff.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
162
node_modules/mathjs/lib/cjs/function/matrix/dot.js
generated
vendored
Normal file
162
node_modules/mathjs/lib/cjs/function/matrix/dot.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user