Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display of RealBlockVector with large values is off (printing only) #110

Open
maersdal opened this issue Jan 12, 2021 · 1 comment
Open

Comments

@maersdal
Copy link

I don't know if this is just my setup, or an actual bug in the printing of these vectors.
It is a visual/printing issue only I think.

Experienced issue:

(ns sauce
  (:require [uncomplicate.neanderthal 
             [core :refer [scal]] 
             [native :refer [dv]]]))
(println  (scal 2000 (dv -1 2 5.2 0)))

outputs

#RealBlockVector[double, n:4, offset: 0, stride:1]
[-2.00E+34.00E+3 1.04E+4 .00     ]

nil

Whats wrong:

  • The spaces are at the end (?) so 2000 followed by 4000 it looks like -2x10^34 ...
  • The leading zero of the last element is gone, expected 0.00, or 0, not .00

expected output

#RealBlockVector[double, n:4, offset: 0, stride:1]
[-2.00E+3 4.00E+3 1.04E+4 0.00]

nil

My system:

  • OS: WSL2 with ubuntu 20.04,
  • clj with deps.edn

editor:

  • VS code with Calva using nrepl and cider middleware (standard jack-in)

Now It could probably be solved with a print-method, but I'm a beginner and don't know how to do that yet.

@kxygk
Copy link

kxygk commented Apr 13, 2022

To change how things print you should take a look in here:
https://github.com/uncomplicate/neanderthal/blob/5c76fb83eb43b7aa3307e6e90d5025e41750a00f/src/clojure/uncomplicate/neanderthal/internal/printing.clj

I've definitely done this before.. if I find my code I'll update this comment later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants