Comments (7)
It might have to do with a compiler optimization. I ran across an odd typecast from double to int, but not this one. It was the case where the double was outside the range of a valid int, which gives an undefined result in ANSI C11.
Is your two-line printing of a vector displaying the indices in the first line, and values in the 2nd?
It looks like a bug, in any case. A standalone C example would be very helpful.
How are you printing the values? I assume you force completion first? Do you use extractTuples to get the values out, to print them?
from graphblas.
Yes, the first line displays the indices and the values are in the second line.
Yes, the values are gotten from extractTuples. Also, Vector_build was used to populate the arrays.
I'm working on a C example and should probably try to verify I see this behavior with my local build.
from graphblas.
Bah, I just realized I compiled the wrong version. I'll continue tomorrow. I did verify the C call from Python though:
import grblas as gb
w = gb.Vector.from_values([0, 1], [0, -20], dtype='INT64')
u = gb.Vector.from_values([0, 1], [1, 2], dtype='FP64')
gb.lib.GrB_Vector_apply(
w.gb_obj[0],
gb.base.NULL,
gb.lib.GrB_PLUS_INT64,
gb.lib.GrB_IDENTITY_FP64,
u.gb_obj[0],
gb.base.NULL
)
which gives the wonky results. Here, gb.base.NULL
is the null pointer.
If any observers are curious, one can install grblas
via conda install -c conda-forge grblas
on OS X and Linux (and conda from here: https://docs.conda.io/en/latest/miniconda.html). It will be pip-installable soon (the normal way to install Python packages).
from graphblas.
I replicated the error. That's a bug in 3.2.2 that I fixed in the 3.3.0 draft. It was a typecasting mistake in Source/GB_dense_subassign_23.c for the generic case. In 3.2.2, I picked the wrong typecasting function. It's fixed in the draft of 3.3.0.
from graphblas.
In v3.2.2, this code below replicates the bug. In v3.3.0, it gives the right result.
#include "GraphBLAS.h"
#define OK(method) \
{ \
info = method ; \
if (info != GrB_SUCCESS) printf ("Error: %s\n", GrB_error ()) ; \
}
int main (void)
{
GrB_Vector w, u ;
GrB_Info info ;
OK (GrB_init (GrB_NONBLOCKING)) ;
OK (GrB_Vector_new (&w, GrB_INT64, 2)) ;
OK (GrB_Vector_setElement_INT64 (w, 0, 0)) ;
OK (GrB_Vector_setElement_INT64 (w, -20, 1)) ;
OK (GrB_Vector_new (&u, GrB_FP64, 2)) ;
OK (GrB_Vector_setElement_FP64 (u, 1, 0)) ;
OK (GrB_Vector_setElement_FP64 (u, 2, 1)) ;
OK (GxB_print (w, 3)) ;
OK (GxB_print (u, 3)) ;
OK (GrB_apply (w, NULL, GrB_PLUS_INT64, GrB_IDENTITY_FP64, u, NULL)) ;
OK (GxB_print (w, 3)) ;
OK (GrB_finalize ( )) ;
}
from graphblas.
I fixed the bug on June 1st, but I didn't log the bug fix in the Doc/ChangeLog. I've added that (bug #18) to the ChangeLog, in v3.3.0-draft10, just posted now.
from graphblas.
Great, thanks!
from graphblas.
Related Issues (20)
- GxB sort with smaller (or larger) output objects
- cpu_features: Build error for MinGW HOT 13
- Size of Static Library HOT 16
- Link error with Intel igx and Ninja generator on Windows HOT 9
- Optimisation report causing build failure when using Intel oneAPI HOT 2
- nvals weirdness with 8.0.0 for max-sized Vector HOT 6
- Where is `GxB_Context_error`? HOT 3
- Why was `nthreads` and `chunks` remove from the descriptor? HOT 5
- dynamic connectivity in the language of graphblas HOT 1
- Fastest Way to Exfiltrate a Matrix HOT 3
- no JIT kernels produced? HOT 3
- Modify CMake options to build without bundled libraries HOT 1
- Sublinear Performance with n Threads HOT 6
- [BUG]: Incorrect result(!) in vector-matrix multiply with accumulation in versions 8.0.2 and 8.2.0 HOT 13
- Allow enabling and disabling JIT for operators and types with get/set HOT 1
- Monoid Creation with Scalar HOT 1
- Excess allocation in dense apply HOT 2
- Proposal: GxB_CASTOP HOT 3
- `GrB_get` instead of fprint HOT 1
- make static not working as expected in 9.0.1 release HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphblas.