Skip to content

QRDecomposition reverts with panic: division or modulo by zero (0x12) #1

@aviggiano

Description

@aviggiano

I am trying to use SolMATe on a project.

The following example reverts with panic: division or modulo by zero (0x12), it looks like it is an issue with QRDecomposition

diff --git a/scripts/multiple_linear_regression.js b/scripts/multiple_linear_regression.js
index ec3788a..479270d 100644
--- a/scripts/multiple_linear_regression.js
+++ b/scripts/multiple_linear_regression.js
@@ -17,12 +17,11 @@ async function main() {
   const solmate_demo = await SolMATe_demo.deploy();
 
   await solmate_demo.deployed();
-  const inputMat = [[43,1],[21,1],[25,1],[42,1],[57,1],[59,1]]
-  const b = [99,65,79,75,87,81]
+  const inputMat = [["2592000", "-2592000"], ["10000000000000000", "0"]];
+  const b = ["-2592000", "10000000000000000"];
   const result = await solmate_demo.multipleLinearRegression(inputMat, b);
-  console.log(result);
+  console.log(result.map(arr => arr.map(e => e.toString())));
 }
-
 // We recommend this pattern to be able to use async/await everywhere
 // and properly handle errors.
 main()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions