Giter Site home page Giter Site logo

Comments (6)

dpo avatar dpo commented on June 25, 2024

The Fortran source code says that VECTOR, the vector with which you compute the product, should be of size n. That's probably an error.

from cutest.jl.

dpo avatar dpo commented on June 25, 2024

This results in no errors at all:

diff --git a/issue126.jl b/issue126.jl
index ed23ffa..24b3de3 100644
--- a/issue126.jl
+++ b/issue126.jl
@@ -22,12 +22,14 @@ function foo()
     err_sum1 = 0.0
     err_sum2 = 0.0
 
+    vect = ones(Cdouble, n)
+
     nnzr, Ir, r = Cint[0], Array{Cint}(n), zeros(n)
-    ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], Cdouble[1.0], nnzr, Ir, r)
+    ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], vect, nnzr, Ir, r)
     CUTEst.@cutest_error
     for i = 1:N
       nnzr2, Ir2, r2 = Cint[0], Array{Cint}(n), zeros(n)
-      ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], Cdouble[1.0], nnzr2, Ir2, r2)
+      ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], vect, nnzr2, Ir2, r2)
       CUTEst.@cutest_error
       if norm(r - r2) > 1e-6
         err_count1 += 1
@@ -41,7 +43,7 @@ function foo()
 
     for i = (N+1):2N
       nnzr2, Ir2, r2 = Cint[0], Array{Cint}(n), zeros(n)
-      ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], Cdouble[1.0], nnzr2, Ir2, r2)
+      ushprod(io_err, Cint[n], goth, x0, Cint[1], Cint[1], vect, nnzr2, Ir2, r2)
       CUTEst.@cutest_error
       if norm(r - r2) > 1e-6
         err_count2 += 1
@@ -64,4 +66,4 @@ function foo()
   end
 end
 
-foo()
\ No newline at end of file
+foo()

The size of VECTOR is consistent in the library but I wonder if it's intentional.

from cutest.jl.

abelsiqueira avatar abelsiqueira commented on June 25, 2024

Ah, thanks. I though it would use the value of nnz_vector. Not a bug, so closing.

from cutest.jl.

dpo avatar dpo commented on June 25, 2024

We should be sure our doc is clear about that.

from cutest.jl.

abelsiqueira avatar abelsiqueira commented on June 25, 2024

For the core interface I just copied the DESCRIPTION in the man. The only further description is the function call and the types of each parameter. Should I add the disclaimer above as additional information?

from cutest.jl.

dpo avatar dpo commented on June 25, 2024

It should say somewhere that the input and output vectors are of size n, otherwise, it's tempting to think that they should only contain the nonzero elements.

from cutest.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.