Clarify undefined behavior when target == source in PMatrix::mult docs
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 85/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- java
- Ambito
- documentation
Direzione di ricerca
Leggi il Javadoc di PMatrix.mult in core/src/processing/core/PMatrix.java, intorno alle righe 165–171. Chiarisci cosa succede quando target e source sono lo stesso oggetto e correggi la formulazione che definisce matrice il valore restituito. Il lavoro è completato quando la documentazione descrive accuratamente il comportamento e identifica il valore restituito come un PVector.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi folks!
I know this won't be top priority, but this issue caused me to spin my wheels for a couple days straight since it was one of those times where all my logic "looked right" after many passes so I figured it might throw some other beginners for a loop.
I'd like to request additional clarity be added to the javadoc here:
Specifically, I think that it should be stated explicitly that behavior is undefined when target == source. Since no warning was offered I did not expect for the contents of source to still be in the process of being read by the time that target is actually being populated within this method but it appears something like that is happening (my expectation was that the contents of source would have probably been extracted into local variables once at the beginning since there are so few elements in a PVector and then loaded into target once at the end after performing intermediate computations). Ideally, if there is no utility in allowing target == source whatsoever, this case should throw an exception but, alternatively, additional doc clarity would have been a noninvasive way of preventing prolonged confusion in my case. Also I think "target will then be the matrix returned" is a typo since this method is returning a PVector.
Here is an example sketch you can use to observe the undocumented undefined behavior. Move the mouse around without pressing anything to observe normal behavior when simply passing target = null. Similarly, pressing Right-click will set target equal to a PVector reference which is fixed across draw() frames--the outcome of which is normal behavior. Pressing Left-click will pass target = source triggering the undefined behavior.
Thanks!
- Lingua principale
- Java
- Stelle
- 527
- Fork
- 190
- Merge medio
- 1g 4h
- PR unite (30g)
- 3
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di processing/processing4
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
processing/processing4#1592 ·
-
`Processing lsp` never exits and leaves orphaned processesForse già presa @overcast302 l’ha presa 24 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
processing/processing4#1578 · 2 commenti · 1 reazione · 1 assegnatario ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
processing/processing4#1554 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
processing/processing4#1515 · 1 reazione ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
processing/processing4#1590 · 1 commento ·
Tutte le issue di processing/processing4
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Dans-Plugins/Medieval-Roleplay-Engine#396 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 6 giorni
-
type: dependency-upgrade
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
spring-projects/spring-session#4156 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
quarkiverse/quarkus-langchain4j#3127 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
HotswapProjects/HotswapAgent#688 ·