text: ["^ ","~:resource-id",["~:shadow.build.npm/resource","node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js"],"~:js","shadow$provide.module$node_modules$mathjs$lib$cjs$type$matrix$utils$algorithm12=function(global,require,module,exports){Object.defineProperty(exports,\"__esModule\",{value:!0});exports.createAlgorithm12=void 0;global=require(\"module$node_modules$mathjs$lib$cjs$utils$factory\");global=(0,global.factory)(\"algorithm12\",[\"typed\",\"DenseMatrix\"],function(_ref){var typed=_ref.typed,DenseMatrix=_ref.DenseMatrix;return function(s,b,callback,inverse){var avalues=s._values,aindex=s._index,aptr=s._ptr,asize=s._size,\nadt=s._datatype;if(!avalues)throw Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");s=asize[0];asize=asize[1];var cf=callback;if(\"string\"===typeof adt){var dt=adt;b=typed.convert(b,dt);cf=typed.find(callback,[dt,dt])}callback=[];adt=[];for(var w=[],j=0;j<asize;j++){for(var mark=j+1,k1=aptr[j+1],k=aptr[j];k<k1;k++){var r=aindex[k];adt[r]=avalues[k];w[r]=mark}for(k1=0;k1<s;k1++)0===j&&(callback[k1]=[]),callback[k1][j]=w[k1]===mark?inverse?cf(b,adt[k1]):cf(adt[k1],b):inverse?\ncf(b,0):cf(0,b)}return new DenseMatrix({data:callback,size:[s,asize],datatype:dt})}});exports.createAlgorithm12=global}","~:source","shadow$provide[\"module$node_modules$mathjs$lib$cjs$type$matrix$utils$algorithm12\"] = function(global,require,module,exports) {\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\nexports.createAlgorithm12 = void 0;\n\nvar _factory = require(\"../../../utils/factory.js\");\n\nvar name = 'algorithm12';\nvar dependencies = ['typed', 'DenseMatrix'];\nvar createAlgorithm12 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {\n  var typed = _ref.typed,\n      DenseMatrix = _ref.DenseMatrix;\n\n  /**\n   * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\n   * Callback function invoked MxN times.\n   *\n   *\n   *          ┌  f(Sij, b)  ; S(i,j) !== 0\n   * C(i,j) = ┤\n   *          └  f(0, b)    ; otherwise\n   *\n   *\n   * @param {Matrix}   s                 The SparseMatrix instance (S)\n   * @param {Scalar}   b                 The Scalar value\n   * @param {Function} callback          The f(Aij,b) operation to invoke\n   * @param {boolean}  inverse           A true value indicates callback should be invoked f(b,Sij)\n   *\n   * @return {Matrix}                    DenseMatrix (C)\n   *\n   * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\n   */\n  return function algorithm12(s, b, callback, inverse) {\n    // sparse matrix arrays\n    var avalues = s._values;\n    var aindex = s._index;\n    var aptr = s._ptr;\n    var asize = s._size;\n    var adt = s._datatype; // sparse matrix cannot be a Pattern matrix\n\n    if (!avalues) {\n      throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\n    } // rows & columns\n\n\n    var rows = asize[0];\n    var columns = asize[1]; // datatype\n\n    var dt; // callback signature to use\n\n    var cf = callback; // process data types\n\n    if (typeof adt === 'string') {\n      // datatype\n      dt = adt; // convert b to the same datatype\n\n      b = typed.convert(b, dt); // callback\n\n      cf = typed.find(callback, [dt, dt]);\n    } // result arrays\n\n\n    var cdata = []; // workspaces\n\n    var x = []; // marks indicating we have a value in x for a given column\n\n    var w = []; // loop columns\n\n    for (var j = 0; j < columns; j++) {\n      // columns mark\n      var mark = j + 1; // values in j\n\n      for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\n        // row\n        var r = aindex[k]; // update workspace\n\n        x[r] = avalues[k];\n        w[r] = mark;\n      } // loop rows\n\n\n      for (var i = 0; i < rows; i++) {\n        // initialize C on first column\n        if (j === 0) {\n          // create row array\n          cdata[i] = [];\n        } // check sparse matrix has a value @ i,j\n\n\n        if (w[i] === mark) {\n          // invoke callback, update C\n          cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\n        } else {\n          // dense matrix value @ i, j\n          cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\n        }\n      }\n    } // return dense matrix\n\n\n    return new DenseMatrix({\n      data: cdata,\n      size: [rows, columns],\n      datatype: dt\n    });\n  };\n});\nexports.createAlgorithm12 = createAlgorithm12;\n};","~:removed-requires",["~#set",[]],"~:actual-requires",["^5",["~$shadow.js","~$module$node_modules$mathjs$lib$cjs$utils$factory"]],"~:properties",["^5",["__esModule","value","createAlgorithm12","datatype","size","data"]],"~:compiled-at",1619135262185,"~:source-map-json","{\n\"version\":3,\n\"file\":\"module$node_modules$mathjs$lib$cjs$type$matrix$utils$algorithm12.js\",\n\"lineCount\":3,\n\"mappings\":\"AAAAA,cAAA,CAAA,gEAAA,CAAqF,QAAQ,CAACC,MAAD,CAAQC,OAAR,CAAgBC,MAAhB,CAAuBC,OAAvB,CAAgC,CAG7HC,MAAOC,CAAAA,cAAP,CAAsBF,OAAtB,CAA+B,YAA/B,CAA6C,CAC3CG,MAAO,CAAA,CADoC,CAA7C,CAGAH,QAAQI,CAAAA,iBAAR,CAA4B,IAAK,EAE7BC,OAAAA,CAAWP,OAAA,CAAQ,kDAAR,CAIXM,OAAAA,CAAmC,CAAC,CAAA,CAAGC,MAASC,CAAAA,OAAb,EAF5BC,aAE4B,CADpBC,CAAC,OAADA,CAAU,aAAVA,CACoB,CAA0C,QAAS,CAACC,IAAD,CAAO,CAAA,IAC3FC,MAAQD,IAAKC,CAAAA,KAD8E,CAE3FC,YAAcF,IAAKE,CAAAA,WAqBvB,OAAOC,SAAoB,CAACC,CAAD,CAAIC,CAAJ,CAAOC,QAAP,CAAiBC,OAAjB,CAA0B,CAEnD,IAAIC,QAAUJ,CAAEK,CAAAA,OAAhB,CACIC,OAASN,CAAEO,CAAAA,MADf,CAEIC,KAAOR,CAAES,CAAAA,IAFb,CAGIC,MAAQV,CAAEW,CAAAA,KAHd;AAIIC,IAAMZ,CAAEa,CAAAA,SAEZ,IAAI,CAACT,OAAL,CACE,KAAUU,MAAJ,CAAU,oEAAV,CAAN,CAIEC,CAAAA,CAAOL,K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KgBE,OAAA;AAAUc,EAAA,CAAGhB,CAAH,CAAM,CAAN,CAAV,CAAqBgB,EAAA,CAAG,CAAH,CAAMhB,CAAN,CA1BP,CAgClC,MAAO,KAAIH,WAAJ,CAAgB,CACrBiC,KAAMV,QADe,CAErBW,KAAM,CAACjB,CAAD,CAAOC,KAAP,CAFe,CAGrBiB,SAAUf,EAHW,CAAhB,CApE4C,CAvB0C,CAA1D,CAkGvC/B,QAAQI,CAAAA,iBAAR,CAA4BA,MA9GiG;\",\n\"sources\":[\"node_modules/mathjs/lib/cjs/type/matrix/utils/algorithm12.js\"],\n\"sourcesContent\":[\"shadow$provide[\\\"module$node_modules$mathjs$lib$cjs$type$matrix$utils$algorithm12\\\"] = function(global,require,module,exports) {\\n\\\"use strict\\\";\\n\\nObject.defineProperty(exports, \\\"__esModule\\\", {\\n  value: true\\n});\\nexports.createAlgorithm12 = void 0;\\n\\nvar _factory = require(\\\"../../../utils/factory.js\\\");\\n\\nvar name = 'algorithm12';\\nvar dependencies = ['typed', 'DenseMatrix'];\\nvar createAlgorithm12 = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {\\n  var typed = _ref.typed,\\n      DenseMatrix = _ref.DenseMatrix;\\n\\n  /**\\n   * Iterates over SparseMatrix S nonzero items and invokes the callback function f(Sij, b).\\n   * Callback function invoked MxN times.\\n   *\\n   *\\n   *          \\u250c  f(Sij, b)  ; S(i,j) !== 0\\n   * C(i,j) = \\u2524\\n   *          \\u2514  f(0, b)    ; otherwise\\n   *\\n   *\\n   * @param {Matrix}   s                 The SparseMatrix instance (S)\\n   * @param {Scalar}   b                 The Scalar value\\n   * @param {Function} callback          The f(Aij,b) operation to invoke\\n   * @param {boolean}  inverse           A true value indicates callback should be invoked f(b,Sij)\\n   *\\n   * @return {Matrix}                    DenseMatrix (C)\\n   *\\n   * https://github.com/josdejong/mathjs/pull/346#issuecomment-97626813\\n   */\\n  return function algorithm12(s, b, callback, inverse) {\\n    // sparse matrix arrays\\n    var avalues = s._values;\\n    var aindex = s._index;\\n    var aptr = s._ptr;\\n    var asize = s._size;\\n    var adt = s._datatype; // sparse matrix cannot be a Pattern matrix\\n\\n    if (!avalues) {\\n      throw new Error('Cannot perform operation on Pattern Sparse Matrix and Scalar value');\\n    } // rows & columns\\n\\n\\n    var rows = asize[0];\\n    var columns = asize[1]; // datatype\\n\\n    var dt; // callback signature to use\\n\\n    var cf = callback; // process data types\\n\\n    if (typeof adt === 'string') {\\n      // datatype\\n      dt = adt; // convert b to the same datatype\\n\\n      b = typed.convert(b, dt); // callback\\n\\n      cf = typed.find(callback, [dt, dt]);\\n    } // result arrays\\n\\n\\n    var cdata = []; // workspaces\\n\\n    var x = []; // marks indicating we have a value in x for a given column\\n\\n    var w = []; // loop columns\\n\\n    for (var j = 0; j < columns; j++) {\\n      // columns mark\\n      var mark = j + 1; // values in j\\n\\n      for (var k0 = aptr[j], k1 = aptr[j + 1], k = k0; k < k1; k++) {\\n        // row\\n        var r = aindex[k]; // update workspace\\n\\n        x[r] = avalues[k];\\n        w[r] = mark;\\n      } // loop rows\\n\\n\\n      for (var i = 0; i < rows; i++) {\\n        // initialize C on first column\\n        if (j === 0) {\\n          // create row array\\n          cdata[i] = [];\\n        } // check sparse matrix has a value @ i,j\\n\\n\\n        if (w[i] === mark) {\\n          // invoke callback, update C\\n          cdata[i][j] = inverse ? cf(b, x[i]) : cf(x[i], b);\\n        } else {\\n          // dense matrix value @ i, j\\n          cdata[i][j] = inverse ? cf(b, 0) : cf(0, b);\\n        }\\n      }\\n    } // return dense matrix\\n\\n\\n    return new DenseMatrix({\\n      data: cdata,\\n      size: [rows, columns],\\n      datatype: dt\\n    });\\n  };\\n});\\nexports.createAlgorithm12 = createAlgorithm12;\\n};\"],\n\"names\":[\"shadow$provide\",\"global\",\"require\",\"module\",\"exports\",\"Object\",\"defineProperty\",\"value\",\"createAlgorithm12\",\"_factory\",\"factory\",\"name\",\"dependencies\",\"_ref\",\"typed\",\"DenseMatrix\",\"algorithm12\",\"s\",\"b\",\"callback\",\"inverse\",\"avalues\",\"_values\",\"aindex\",\"_index\",\"aptr\",\"_ptr\",\"asize\",\"_size\",\"adt\",\"_datatype\",\"Error\",\"rows\",\"columns\",\"cf\",\"dt\",\"convert\",\"find\",\"cdata\",\"x\",\"w\",\"j\",\"mark\",\"k1\",\"k\",\"k0\",\"r\",\"i\",\"data\",\"size\",\"datatype\"]\n}\n"]