You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles Sadowski (Jira)" <ji...@apache.org> on 2022/05/23 08:33:00 UTC

[jira] [Reopened] (MATH-1646) PreconditionedIterativeLinearSolver.solve() not throwing proper NullArgumentException

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

Gilles Sadowski reopened MATH-1646:
-----------------------------------

> PreconditionedIterativeLinearSolver.solve() not throwing proper NullArgumentException
> -------------------------------------------------------------------------------------
>
>                 Key: MATH-1646
>                 URL: https://issues.apache.org/jira/browse/MATH-1646
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 3.6.1
>            Reporter: Elia Bertolina
>            Priority: Major
>             Fix For: 4.0
>
>
> PreconditionedIterativeLinearSolver.solve(RealLinearOperator a, RealLinearOperator m,RealVector b, RealVector x0) does not throw a NullArgumentException when one of the parameters is null.In the documentation it is stated that an NullArgumentException will be thrown if any of the parameters is null.
> However, in this test case:
>  
> {code:java}
> public class PreconditionedIterativeLinearSolver_failure_Test {
>     public void test() throws Throwable {
>         Array2DRowRealMatrix array2DRowRealMatrix =
>                              new Array2DRowRealMatrix();
>         ConjugateGradient conjugateGradient = 
>                              new ConjugateGradient(49, 49, true);
>         ArrayRealVector arrayRealVector = new ArrayRealVector();
>         try {
>             RealVector realVector = conjugateGradient.solve(
>             (RealLinearOperator) array2DRowRealMatrix,
>             (RealLinearOperator) null,
>             (RealVector) arrayRealVector,
>             (RealVector) arrayRealVector);
>             org.junit.Assert.fail();
>         } 
>         catch 
>         (org.apache.commons.math3.exception.NullArgumentException e){
>           //Exception caught and test successful        
>         }
>     }
> }{code}
>  
> The second RealLinearOperator parameter is null and a NullArgumentException should be thrown, however the method executes normally, and test case fails.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)