Skip to content

Creating an identity matrix crashing program #682

Open
@general-rishkin

Description

@general-rishkin

I just tried to create an identity matrix and the program keeps crashing:

import arraymancer
var b = eye[float](3, 3)
echo b

or

import arraymancer
var b = identity[float](3)
echo b

The output:

/home/~/tester.nim(12, 24) template/generic instantiation of `identity` from here
/home/~/Arraymancer/src/arraymancer/linear_algebra/special_matrices.nim(238, 16) template/generic instantiation of `diag` from here
/home/~/Arraymancer/src/arraymancer/linear_algebra/special_matrices.nim(226, 9) template/generic instantiation of `set_diagonal` from here
/home/~/Arraymancer/src/arraymancer/linear_algebra/special_matrices.nim(172, 26) Error: type mismatch
Expression: &"Diagonal index ({k=}) exceeds input matrix height ({a.shape[0]})"
  [1] "Diagonal index ({k=}) exceeds input matrix height ({a.shape[0]})": string

Expected one of (first mismatch at [position]):
[1] func `&`(a, b: DynamicStackArray): DynamicStackArray
[1] func `&`[T](a: DynamicStackArray[T]; value: T): DynamicStackArray[T]
[1] proc `&`(x, y: char): string
[1] proc `&`(x: char; y: string): string
[1] proc `&`[T](x, y: sink seq[T]): seq[T]
[1] proc `&`[T](x: sink seq[T]; y: sink T): seq[T]
[2] proc `&`(x, y: string): string
  missing parameter: y
[2] proc `&`(x: string; y: char): string
  missing parameter: y
[2] proc `&`[T](x: sink T; y: sink seq[T]): seq[T]
  missing parameter: y

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions