11import { factory } from '../../../utils/factory.js'
22import { extend } from '../../../utils/object.js'
3- // import { createMatAlgo13xDD } from './matAlgo13xDD.js'
3+ import { createMatAlgo13xDD } from './matAlgo13xDD.js'
44import { createMatAlgo14xDs } from './matAlgo14xDs.js'
5- import { createMatAlgo13xCC } from './matAlgo13xCC.js'
6- import { broadcast } from './broadcast.js'
5+ import { broadcastMatrices } from './broadcast.js'
76
87const name = 'matrixAlgorithmSuite'
98const dependencies = [ 'typed' , 'matrix' ]
109
1110export const createMatrixAlgorithmSuite = /* #__PURE__ */ factory (
1211 name , dependencies , ( { typed, matrix } ) => {
13- // const matAlgo13xDD = createMatAlgo13xDD({ typed })
12+ const matAlgo13xDD = createMatAlgo13xDD ( { typed } )
1413 const matAlgo14xDs = createMatAlgo14xDs ( { typed } )
15- const matAlgo13xCC = createMatAlgo13xCC ( { typed } )
1614
1715 /**
1816 * Return a signatures object with the usual boilerplate of
@@ -38,71 +36,71 @@ export const createMatrixAlgorithmSuite = /* #__PURE__ */ factory(
3836 if ( elop ) {
3937 // First the dense ones
4038 matrixSignatures = {
41- 'DenseMatrix, DenseMatrix' : ( x , y ) => matAlgo13xCC ( x , y , elop ) ,
39+ 'DenseMatrix, DenseMatrix' : ( x , y ) => matAlgo13xDD ( x , y , elop ) ,
4240 'Array, Array' : ( x , y ) =>
43- matAlgo13xCC ( matrix ( x ) , matrix ( y ) , elop ) . valueOf ( ) ,
44- 'Array, DenseMatrix' : ( x , y ) => matAlgo13xCC ( matrix ( x ) , y , elop ) ,
45- 'DenseMatrix, Array' : ( x , y ) => matAlgo13xCC ( x , matrix ( y ) , elop )
41+ matAlgo13xDD ( matrix ( x ) , matrix ( y ) , elop ) . valueOf ( ) ,
42+ 'Array, DenseMatrix' : ( x , y ) => matAlgo13xDD ( matrix ( x ) , y , elop ) ,
43+ 'DenseMatrix, Array' : ( x , y ) => matAlgo13xDD ( x , matrix ( y ) , elop )
4644 }
4745 // Now incorporate sparse matrices
4846 if ( options . SS ) {
4947 matrixSignatures [ 'SparseMatrix, SparseMatrix' ] =
50- ( x , y ) => options . SS ( ...broadcast ( x , y ) , elop , false )
48+ ( x , y ) => options . SS ( ...broadcastMatrices ( x , y ) , elop , false )
5149 }
5250 if ( options . DS ) {
5351 matrixSignatures [ 'DenseMatrix, SparseMatrix' ] =
54- ( x , y ) => options . DS ( ...broadcast ( x , y ) , elop , false )
52+ ( x , y ) => options . DS ( ...broadcastMatrices ( x , y ) , elop , false )
5553 matrixSignatures [ 'Array, SparseMatrix' ] =
56- ( x , y ) => options . DS ( ...broadcast ( matrix ( x ) , y ) , elop , false )
54+ ( x , y ) => options . DS ( ...broadcastMatrices ( matrix ( x ) , y ) , elop , false )
5755 }
5856 if ( SD ) {
5957 matrixSignatures [ 'SparseMatrix, DenseMatrix' ] =
60- ( x , y ) => SD ( ...broadcast ( y , x ) , elop , true )
58+ ( x , y ) => SD ( ...broadcastMatrices ( y , x ) , elop , true )
6159 matrixSignatures [ 'SparseMatrix, Array' ] =
62- ( x , y ) => SD ( ...broadcast ( matrix ( y ) , x ) , elop , true )
60+ ( x , y ) => SD ( ...broadcastMatrices ( matrix ( y ) , x ) , elop , true )
6361 }
6462 } else {
6563 // No elop, use this
6664 // First the dense ones
6765 matrixSignatures = {
6866 'DenseMatrix, DenseMatrix' : typed . referToSelf ( self => ( x , y ) => {
69- return matAlgo13xCC ( x , y , self )
67+ return matAlgo13xDD ( x , y , self )
7068 } ) ,
7169 'Array, Array' : typed . referToSelf ( self => ( x , y ) => {
72- return matAlgo13xCC ( matrix ( x ) , matrix ( y ) , self ) . valueOf ( )
70+ return matAlgo13xDD ( matrix ( x ) , matrix ( y ) , self ) . valueOf ( )
7371 } ) ,
7472 'Array, DenseMatrix' : typed . referToSelf ( self => ( x , y ) => {
75- return matAlgo13xCC ( matrix ( x ) , y , self )
73+ return matAlgo13xDD ( matrix ( x ) , y , self )
7674 } ) ,
7775 'DenseMatrix, Array' : typed . referToSelf ( self => ( x , y ) => {
78- return matAlgo13xCC ( x , matrix ( y ) , self )
76+ return matAlgo13xDD ( x , matrix ( y ) , self )
7977 } )
8078 }
8179 // Now incorporate sparse matrices
8280 if ( options . SS ) {
8381 matrixSignatures [ 'SparseMatrix, SparseMatrix' ] =
8482 typed . referToSelf ( self => ( x , y ) => {
85- return options . SS ( ...broadcast ( x , y ) , self , false )
83+ return options . SS ( ...broadcastMatrices ( x , y ) , self , false )
8684 } )
8785 }
8886 if ( options . DS ) {
8987 matrixSignatures [ 'DenseMatrix, SparseMatrix' ] =
9088 typed . referToSelf ( self => ( x , y ) => {
91- return options . DS ( ...broadcast ( x , y ) , self , false )
89+ return options . DS ( ...broadcastMatrices ( x , y ) , self , false )
9290 } )
9391 matrixSignatures [ 'Array, SparseMatrix' ] =
9492 typed . referToSelf ( self => ( x , y ) => {
95- return options . DS ( ...broadcast ( matrix ( x ) , y ) , self , false )
93+ return options . DS ( ...broadcastMatrices ( matrix ( x ) , y ) , self , false )
9694 } )
9795 }
9896 if ( SD ) {
9997 matrixSignatures [ 'SparseMatrix, DenseMatrix' ] =
10098 typed . referToSelf ( self => ( x , y ) => {
101- return SD ( ...broadcast ( y , x ) , self , true )
99+ return SD ( ...broadcastMatrices ( y , x ) , self , true )
102100 } )
103101 matrixSignatures [ 'SparseMatrix, Array' ] =
104102 typed . referToSelf ( self => ( x , y ) => {
105- return SD ( ...broadcast ( matrix ( y ) , x ) , self , true )
103+ return SD ( ...broadcastMatrices ( matrix ( y ) , x ) , self , true )
106104 } )
107105 }
108106 }
0 commit comments