[ 
https://issues.apache.org/jira/browse/MATH-1094?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bogdan Bezpartochnyy updated MATH-1094:
---------------------------------------

    Description: 
Firstly I would like to point out that I'm not very proficient in linear 
algebra, but in my opinion the following behavior should not occur. When I 
solve the following linear system by hand it has no solution, but in commons 
math it outputs  x1= 7.5 x2 = 5.5

double[][] vals = {{-4.0,3.0},{5.0,6.0},{4.0,-3.0},{5.0,6.0}};
        double[] vals1 = {6, 51, 33, 90};
        try {
            RealMatrix coefficients = new Array2DRowRealMatrix(vals, false);
            DecompositionSolver solver = new 
QRDecomposition(coefficients).getSolver();
            RealVector constants = new ArrayRealVector(vals1, false);
            RealVector slution = solver.solve(constants);
            System.out.println(slution.getEntry(0) + " " + slution.getEntry(1));
        }
        catch (SingularMatrixException smx) {
        } 

  was:Firstly I would like to point out that I'm not very proficient in linear 
algebra, but in my opinion the following behavior should not occur.


> Incorrect linear system solution
> --------------------------------
>
>                 Key: MATH-1094
>                 URL: https://issues.apache.org/jira/browse/MATH-1094
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.2
>         Environment: Oracle JDK7
> Linux x86-64
>            Reporter: Bogdan Bezpartochnyy
>              Labels: patch
>         Attachments: Main.java
>
>
> Firstly I would like to point out that I'm not very proficient in linear 
> algebra, but in my opinion the following behavior should not occur. When I 
> solve the following linear system by hand it has no solution, but in commons 
> math it outputs  x1= 7.5 x2 = 5.5
> double[][] vals = {{-4.0,3.0},{5.0,6.0},{4.0,-3.0},{5.0,6.0}};
>         double[] vals1 = {6, 51, 33, 90};
>         try {
>             RealMatrix coefficients = new Array2DRowRealMatrix(vals, false);
>             DecompositionSolver solver = new 
> QRDecomposition(coefficients).getSolver();
>             RealVector constants = new ArrayRealVector(vals1, false);
>             RealVector slution = solver.solve(constants);
>             System.out.println(slution.getEntry(0) + " " + 
> slution.getEntry(1));
>         }
>         catch (SingularMatrixException smx) {
>         } 



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to