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