Skip to content

Code gen LangC identity matrix lincomb  #17

@jarlebring

Description

@jarlebring

When using lincomb with an identity matrix it seems LangC causes problems.

Considering that ONE is declared as

    const double ZERO = 0.0;

I believe, this use of ONE should be something different:

https://github.com/jarlebring/GraphMatFun.jl/blob/2558b55495b7bafeaa0b6082105546407b83352f/src/gen_code.jl#L584-L589

which generates code like

    memcpy(memslots+(1-1)*n*n, A, n*n*sizeof(*memslots));
    cblas_dscal(n*n, coeff2, memslots+(1-1)*n*n, 1);
    cblas_daxpby(n*n, coeff1, &ONE, 0,
             ONE, memslots+(1-1)*n*n, n+1);

It segfaults.

The third parameter in axbpy should be a matrix/vector.

I wouldn't mind looking it myself with a hint of what was the plan

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions