1 | import { createAlgorithm02 } from '../../type/matrix/utils/algorithm02.js';
|
2 | import { createAlgorithm11 } from '../../type/matrix/utils/algorithm11.js';
|
3 | import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js';
|
4 | import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js';
|
5 | import { createAlgorithm01 } from '../../type/matrix/utils/algorithm01.js';
|
6 | import { createAlgorithm10 } from '../../type/matrix/utils/algorithm10.js';
|
7 | import { createAlgorithm08 } from '../../type/matrix/utils/algorithm08.js';
|
8 | import { factory } from '../../utils/factory.js';
|
9 | import { rightLogShiftNumber } from '../../plain/number/index.js';
|
10 | var name = 'rightLogShift';
|
11 | var dependencies = ['typed', 'matrix', 'equalScalar', 'zeros', 'DenseMatrix'];
|
12 | export var createRightLogShift = factory(name, dependencies, (_ref) => {
|
13 | var {
|
14 | typed,
|
15 | matrix,
|
16 | equalScalar,
|
17 | zeros,
|
18 | DenseMatrix
|
19 | } = _ref;
|
20 | var algorithm01 = createAlgorithm01({
|
21 | typed
|
22 | });
|
23 | var algorithm02 = createAlgorithm02({
|
24 | typed,
|
25 | equalScalar
|
26 | });
|
27 | var algorithm08 = createAlgorithm08({
|
28 | typed,
|
29 | equalScalar
|
30 | });
|
31 | var algorithm10 = createAlgorithm10({
|
32 | typed,
|
33 | DenseMatrix
|
34 | });
|
35 | var algorithm11 = createAlgorithm11({
|
36 | typed,
|
37 | equalScalar
|
38 | });
|
39 | var algorithm13 = createAlgorithm13({
|
40 | typed
|
41 | });
|
42 | var algorithm14 = createAlgorithm14({
|
43 | typed
|
44 | });
|
45 | |
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | return typed(name, {
|
70 | 'number, number': rightLogShiftNumber,
|
71 |
|
72 | 'SparseMatrix, SparseMatrix': function SparseMatrixSparseMatrix(x, y) {
|
73 | return algorithm08(x, y, this, false);
|
74 | },
|
75 | 'SparseMatrix, DenseMatrix': function SparseMatrixDenseMatrix(x, y) {
|
76 | return algorithm02(y, x, this, true);
|
77 | },
|
78 | 'DenseMatrix, SparseMatrix': function DenseMatrixSparseMatrix(x, y) {
|
79 | return algorithm01(x, y, this, false);
|
80 | },
|
81 | 'DenseMatrix, DenseMatrix': function DenseMatrixDenseMatrix(x, y) {
|
82 | return algorithm13(x, y, this);
|
83 | },
|
84 | 'Array, Array': function ArrayArray(x, y) {
|
85 |
|
86 | return this(matrix(x), matrix(y)).valueOf();
|
87 | },
|
88 | 'Array, Matrix': function ArrayMatrix(x, y) {
|
89 |
|
90 | return this(matrix(x), y);
|
91 | },
|
92 | 'Matrix, Array': function MatrixArray(x, y) {
|
93 |
|
94 | return this(x, matrix(y));
|
95 | },
|
96 | 'SparseMatrix, number | BigNumber': function SparseMatrixNumberBigNumber(x, y) {
|
97 |
|
98 | if (equalScalar(y, 0)) {
|
99 | return x.clone();
|
100 | }
|
101 |
|
102 | return algorithm11(x, y, this, false);
|
103 | },
|
104 | 'DenseMatrix, number | BigNumber': function DenseMatrixNumberBigNumber(x, y) {
|
105 |
|
106 | if (equalScalar(y, 0)) {
|
107 | return x.clone();
|
108 | }
|
109 |
|
110 | return algorithm14(x, y, this, false);
|
111 | },
|
112 | 'number | BigNumber, SparseMatrix': function numberBigNumberSparseMatrix(x, y) {
|
113 |
|
114 | if (equalScalar(x, 0)) {
|
115 | return zeros(y.size(), y.storage());
|
116 | }
|
117 |
|
118 | return algorithm10(y, x, this, true);
|
119 | },
|
120 | 'number | BigNumber, DenseMatrix': function numberBigNumberDenseMatrix(x, y) {
|
121 |
|
122 | if (equalScalar(x, 0)) {
|
123 | return zeros(y.size(), y.storage());
|
124 | }
|
125 |
|
126 | return algorithm14(y, x, this, true);
|
127 | },
|
128 | 'Array, number | BigNumber': function ArrayNumberBigNumber(x, y) {
|
129 |
|
130 | return this(matrix(x), y).valueOf();
|
131 | },
|
132 | 'number | BigNumber, Array': function numberBigNumberArray(x, y) {
|
133 |
|
134 | return this(x, matrix(y)).valueOf();
|
135 | }
|
136 | });
|
137 | }); |
\ | No newline at end of file |