Add `check_foreach(...)` function that does multiple checks at once on an array or matrix
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Start by reading the existing check_not_nan, check_positive, and check_finite implementations, including their vectorized overloads and index-reporting behavior. Define the lambda interfaces and confirm how check_foreach should handle arrays and Eigen matrices; it is done when one traversal performs all requested checks while preserving the failing index in errors.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Often we have code that does a series of checks on an std::vector or Eigen matrix like the following
check_not_nan(function, "log odds parameter", beta);
check_positive(function, "log odds parameter", beta);
check_finite(function, "log odds parameter", beta);
The issue is that this causes three separate passes over beta. If beta is a large vector this can be kind of expensive.
We could make this nicer via one of two schems
- Just use a loop for these types of checks
for (auto&& beta_i : beta)
check_not_nan(function, "log odds parameter", beta_i);
check_positive(function, "log odds parameter", beta_i);
check_finite(function, "log odds parameter", beta_i);
}
But then we lose the nice information that the vectorized checks do where it also tells us what index caused the errors.
- A
check_foreachfunction that checks multiple things at every line.
For this we would also need lambdas for each of the check functions. The user would call something like this
check_foreach(function, "log odds parameter", beta, check_not_nan_p, check_positive_p, check_finite_p);
Under the hood this would expand into a loop that handles all of the indexing so that the end error still has the correct index information.
for (Eigen::Index = 0; i < x.size(); i++) {
check_not_nan_p(function, name, x[i], i);
check_positive_p(function, name, x[i], i);
check_finite_p(function, name, x[i], i);
}
So then we only do one pass over the memory and still get the pretty checks
- Lenguaje dominante
- C++
- Estrellas
- 845
- Forks
- 225
- Merge medio
- 3 d 9 h
- PR fusionados (30 d)
- 12
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de stan-dev/math
-
Dificultad 3/5 1-2 días Aptitud para principiantes 54/100
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 54/100
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Los mantenedores suelen responder en 1 día
-
numerics performance
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
stan-dev/math#3481 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
`eigendecompose_sym`, `eigenvalues_sym` and `eigenvectors_sym` do not compile for complex matrices of `fvar<var>` or `fvar<fvar<double>>`Quizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abiertobug
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
stan-dev/math#3477 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de stan-dev/math
Issues similares
-
Upstream changes to reviewAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
rhalbersma/xstd-ints#395 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Root filesystem scope (/) incorrectly rejects all descendant pathsPosiblemente ocupada @mugenkyou la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
neutralinojs/neutralino.js#304 · 1 comentario ·
-
CLI: enforce absolute ADB device paths in file and directory commandsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
FuSa
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
tenstorrent/tt-umd#3851 ·
Los mantenedores suelen responder en 3 días
-
zq prints a raw SQL 'no such table: index_default' error when the index has no default indexAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
mattgodbolt/zindex#67 ·
Los mantenedores suelen responder en 1 día