Bug: `arena_matrix` traits aren't specialized properly for sparse matrices

Abierto
#3,135 3 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
cpp
Área
backend

Línea de trabajo

Comience en stan/math/rev/core/arena_matrix.hpp, alrededor de la definición de traits de arena_matrix en la línea 483, y después compare las definiciones de traits en lib/eigen_3.4.0/Eigen/src/SparseCore/SparseMap.h y Core/Map.h. Reproduzca el error de compilación reportado de arena_matrix<Eigen::SparseMatrix> y determine qué sparse traits faltan o son incompatibles. El trabajo estará terminado cuando el tipo sparse arena_matrix compile sin los errores de traits reportados.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Description

This is one of those things where I can't tell if it's a bug or a user error, but I'm trying to use an arena_matrix<Eigen::SparseMatrix<double>> type and I'm getting an error related to the setting of the internal Eigen traits. In particular, I'm getting

/home/dan-simpson/Documents/math/stan/math/rev/core/arena_matrix.hpp:490:38: error: ‘PlainObjectTypeInnerSize’ is not a member of ‘Eigen::internal::traits<stan::math::arena_matrix<Eigen::SparseMatrix<double> > >::base’ {aka ‘Eigen::internal::traits<Eigen::Map<Eigen::SparseMatrix<double>, 0, Eigen::Stride<0, 0> > >’}
  490 |     PlainObjectTypeInnerSize = base::PlainObjectTypeInnerSize,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/dan-simpson/Documents/math/stan/math/rev/core/arena_matrix.hpp:491:38: error: ‘InnerStrideAtCompileTime’ is not a member of ‘Eigen::internal::traits<stan::math::arena_matrix<Eigen::SparseMatrix<double> > >::base’ {aka ‘Eigen::internal::traits<Eigen::Map<Eigen::SparseMatrix<double>, 0, Eigen::Stride<0, 0> > >’}
  491 |     InnerStrideAtCompileTime = base::InnerStrideAtCompileTime,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/dan-simpson/Documents/math/stan/math/rev/core/arena_matrix.hpp:492:38: error: ‘OuterStrideAtCompileTime’ is not a member of ‘Eigen::internal::traits<stan::math::arena_matrix<Eigen::SparseMatrix<double> > >::base’ {aka ‘Eigen::internal::traits<Eigen::Map<Eigen::SparseMatrix<double>, 0, Eigen::Stride<0, 0> > >’}
  492 |     OuterStrideAtCompileTime = base::OuterStrideAtCompileTime,
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~
/home/dan-simpson/Documents/math/stan/math/rev/core/arena_matrix.hpp:493:23: error: ‘Alignment’ is not a member of ‘Eigen::internal::traits<stan::math::arena_matrix<Eigen::SparseMatrix<double> > >::base’ {aka ‘Eigen::internal::traits<Eigen::Map<Eigen::SparseMatrix<double>, 0, Eigen::Stride<0, 0> > >’}
  493 |     Alignment = base::Alignment,

I strongly suspect this is because the traits defined in SpraseCore/SparseMap.h don't line up with those in Core/Map.h, so the template defining them for arena_matrix needs to be specialized.

Lenguaje dominante
C++
Estrellas
845
Forks
225
Merge medio
3 d 9 h
PR fusionados (30 d)
12

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de stan-dev/math

Todos los issues de stan-dev/math

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.