Mercurial > octave
changeset 22595:acfb81e6992a
maint: merge stable to default
author | Carlo de Falco <carlo.defalco@polimi.it> |
---|---|
date | Thu, 06 Oct 2016 07:36:59 +0200 |
parents | 354b7a6e642c (current diff) b8d525710075 (diff) |
children | f812283c4367 |
files | scripts/ode/private/integrate_const.m scripts/ode/private/integrate_n_steps.m scripts/ode/private/ode_struct_value_check.m |
diffstat | 17 files changed, 619 insertions(+), 1808 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/languages/de_DE.ts Mon Oct 03 19:24:23 2016 +0100 +++ b/libgui/languages/de_DE.ts Thu Oct 06 07:36:59 2016 +0200 @@ -121,7 +121,7 @@ <context> <name>QWinTerminalImpl</name> <message> - <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1779"/> + <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1780"/> <source>copied selection to clipboard</source> <translation>Auswahl in die Zwischenablage kopiert</translation> </message> @@ -129,7 +129,7 @@ <context> <name>QtHandles::Figure</name> <message> - <location filename="../graphics/Figure.cc" line="+298"/> + <location filename="../graphics/Figure.cc" line="+297"/> <source>Figure ToolBar</source> <translation>Werkzeugleiste</translation> </message> @@ -180,17 +180,17 @@ </message> <message> <location line="+7"/> - <location line="+463"/> + <location line="+465"/> <source>About Octave</source> <translation>Über Octave</translation> </message> <message> - <location line="-465"/> + <location line="-467"/> <source>&Help</source> <translation>&Hilfe</translation> </message> <message> - <location line="+504"/> + <location line="+506"/> <location line="+69"/> <source>Save Figure As</source> <translation>Abbildung speichern unter</translation> @@ -409,12 +409,12 @@ <location line="+25"/> <location line="+62"/> <location line="+28"/> - <location line="+79"/> + <location line="+81"/> <source>Octave Editor</source> <translation>Octave Editor</translation> </message> <message> - <location line="-462"/> + <location line="-464"/> <source>Octave Files (*.m);;All Files (*)</source> <translation>Octave Dateien (*.m);;Alle Dateien (*)</translation> </message> @@ -440,12 +440,12 @@ ist im Editor bereits geöffnet</translation> </message> <message> - <location line="+492"/> + <location line="+494"/> <source>&%1 %2</source> <translation>&%1 %2</translation> </message> <message> - <location line="+480"/> + <location line="+481"/> <source>&Save File</source> <translation>Datei &speichern</translation> </message> @@ -547,7 +547,7 @@ <translation>&Gehe zu Zeile...</translation> </message> <message> - <location line="-1341"/> + <location line="-1344"/> <source>Could not start custom file editor %1</source> <translation>Externer Editor kann nicht gestartet werden: @@ -564,7 +564,7 @@ <translation>Abbrechen</translation> </message> <message> - <location line="+1041"/> + <location line="+1044"/> <source>&Recent Editor Files</source> <translation>&Zuletzt bearbeitete Dateien</translation> </message> @@ -746,23 +746,23 @@ <translation>Z&eilenenden anzeigen</translation> </message> <message> - <location line="-1467"/> + <location line="-1470"/> <source>File Encoding:</source> <translation>Zeichenkodierung:</translation> </message> <message> - <location line="+403"/> + <location line="+404"/> <source>%1 is a built-in function</source> <translation>%1 ist eine eingebaute Funktion</translation> </message> <message> - <location line="+36"/> + <location line="+37"/> <source>Can not find function %1</source> <translatorcomment>Schreibfehler im Englischen: "Can not" -> "Cannot"</translatorcomment> <translation>Kann Funktion %1 nicht finden</translation> </message> <message> - <location line="+911"/> + <location line="+912"/> <source>Find &Next...</source> <translation>&Nächsten suchen...</translation> </message> @@ -817,7 +817,7 @@ <translation>&Dokumentation zum Schlüsselwort</translation> </message> <message> - <location line="-1305"/> + <location line="-1308"/> <source>Could not open file %1 for read: %2.</source> @@ -851,7 +851,7 @@ <translation>Der zugehörige Editor-Reiter ist nicht mehr vorhanden.</translation> </message> <message> - <location line="+928"/> + <location line="+931"/> <source>&File</source> <translation>&Datei</translation> </message> @@ -894,7 +894,14 @@ <translation>Spalte:</translation> </message> <message> - <location line="+1146"/> + <location line="+339"/> + <source>Cannot add breakpoint to modified file. +Save and add breakpoint, or cancel?</source> + <translation>Haltepunkt kann nicht in einer geänderten Datei gesetzt werden. +Speichern und Haltepunkt setzen oder abbrechen?</translation> + </message> + <message> + <location line="+812"/> <source>Goto line</source> <translation>Gehe zu Zeile</translation> </message> @@ -961,18 +968,18 @@ <translation>Änderungen speichern, verwerfen oder Schließen abbrechen?</translation> </message> <message> - <location line="-1342"/> + <location line="-1347"/> <source>encoding:</source> <translation>Kodierung:</translation> </message> <message> - <location line="+239"/> + <location line="+243"/> <source>Breakpoint condition</source> <translation>Bedingung für Haltepunkt</translation> </message> <message> <location line="+88"/> - <location line="+1024"/> + <location line="+1025"/> <location line="+372"/> <location line="+215"/> <location line="+21"/> @@ -982,14 +989,7 @@ <translation>Octave Editor</translation> </message> <message> - <location line="-1737"/> - <source>Cannot add breakpoint to modified file. -Save and add breakpoint, or canel?</source> - <translation>Haltepunkt kann nicht in einer geänderten Datei gesetzt werden. -Speichern und Haltepunkt setzen oder abbrechen?</translation> - </message> - <message> - <location line="+1611"/> + <location line="-126"/> <source>"%1" is not a valid identifier. @@ -1078,7 +1078,7 @@ </message> <message> <location line="+4"/> - <location line="+373"/> + <location line="+377"/> <source>Find Files...</source> <translation>Dateien suchen...</translation> </message> @@ -1093,12 +1093,12 @@ <translation>Im Texteditor öffnen</translation> </message> <message> - <location line="+389"/> + <location line="+391"/> <source>New Directory</source> <translation>Neues Verzeichnis</translation> </message> <message> - <location line="-773"/> + <location line="-779"/> <source>Show Octave directory</source> <translation>Aktuelles Octave Verzeichnis anzeigen</translation> </message> @@ -1113,32 +1113,7 @@ <translation>Alternierende Farben für die Zeilen verwenden</translation> </message> <message> - <location line="+3"/> - <source>filesdockwidget/showFileSize</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showFileType</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showLastModified</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showHiddenFiles</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/useAlternatingRowColors</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+29"/> + <location line="+36"/> <source>One directory up</source> <translation>Ein Verzeichnis höher</translation> </message> @@ -1159,23 +1134,23 @@ </message> <message> <location line="+20"/> - <location line="+382"/> + <location line="+386"/> <source>New File...</source> <translation>Neue Datei...</translation> </message> <message> - <location line="-379"/> - <location line="+382"/> + <location line="-383"/> + <location line="+386"/> <source>New Directory...</source> <translation>Neues Verzeichnis...</translation> </message> <message> - <location line="-329"/> + <location line="-332"/> <source>Activate to open in editor, right click for alternatives</source> <translation>Doppelklick zum Öffnen im Editor, Rechtsklick für mehr Optionen</translation> </message> <message> - <location line="-136"/> + <location line="-137"/> <source>File size</source> <translation>Dateigröße</translation> </message> @@ -1195,7 +1170,7 @@ <translation>Verborgene Dateien anzeigen</translation> </message> <message> - <location line="+415"/> + <location line="+419"/> <source>Open</source> <translation>Öffnen</translation> </message> @@ -1266,12 +1241,12 @@ <translation>Verzeichnis ist nicht leer und kann daher nicht gelöscht werden</translation> </message> <message> - <location line="+145"/> + <location line="+146"/> <source>Set directory of file browser</source> <translation>Setze aktuelles Browser Verzeichnis</translation> </message> <message> - <location line="+29"/> + <location line="+30"/> <source>Create File</source> <translation>Neue Datei</translation> </message> @@ -1664,7 +1639,7 @@ <translation>Befehlsverlauf</translation> </message> <message> - <location line="+107"/> + <location line="+109"/> <source>Copy</source> <translation>Kopieren</translation> </message> @@ -1729,12 +1704,12 @@ </message> <message> <location line="+758"/> - <location line="+975"/> + <location line="+980"/> <source>About Octave</source> <translation>Über Octave</translation> </message> <message> - <location line="-301"/> + <location line="-298"/> <source>&File</source> <translation>&Datei</translation> </message> @@ -1779,7 +1754,7 @@ <translation>Einfügen</translation> </message> <message> - <location line="-1537"/> + <location line="-1545"/> <source>Save Workspace As</source> <translation>Arbeitsumgebung speichern unter</translation> </message> @@ -1804,12 +1779,12 @@ <translation>Neuigkeiten aus der Octave Community</translation> </message> <message> - <location line="+206"/> + <location line="+201"/> <source>Are you sure you want to exit Octave?</source> <translation>Octave wirklich beenden?</translation> </message> <message> - <location line="+916"/> + <location line="+929"/> <source>Open an existing file in editor</source> <translation>Öffne eine vorhandene Datei im Editor</translation> </message> @@ -1879,7 +1854,7 @@ <translation>Dateibrowser</translation> </message> <message> - <location line="+36"/> + <location line="+33"/> <source>Contribute</source> <translation>Zum Projekt beitragen</translation> </message> @@ -1889,17 +1864,17 @@ <translation>Für Octave spenden</translation> </message> <message> - <location line="-123"/> + <location line="-120"/> <source>Step In</source> <translation>Hineinspringen</translation> </message> <message> - <location line="-1082"/> + <location line="-1095"/> <source>Octave</source> <translation>Octave</translation> </message> <message> - <location line="+926"/> + <location line="+939"/> <source>Load Workspace...</source> <translation>Lade Arbeitsumgebung...</translation> </message> @@ -1929,11 +1904,6 @@ <translation>Octave Pakete</translation> </message> <message> - <location line="+3"/> - <source>Share Code</source> - <translation>Code teilen</translation> - </message> - <message> <location line="+20"/> <source>On Disk</source> <translation>Auf der Festplatte</translation> @@ -1980,13 +1950,13 @@ <translation>Ein Verzeichnis höher</translation> </message> <message> - <location line="-1198"/> - <location line="+1201"/> + <location line="-1206"/> + <location line="+1209"/> <source>Browse directories</source> <translation>Verzeichnisse durchsuchen</translation> </message> <message> - <location line="-175"/> + <location line="-172"/> <source>Quit Debug Mode</source> <translation>Debug-Modus beenden</translation> </message> @@ -2042,12 +2012,12 @@ </message> <message> <location line="+3"/> - <location line="+41"/> + <location line="+38"/> <source>Documentation</source> <translation>Dokumentation</translation> </message> <message> - <location line="-30"/> + <location line="-27"/> <source>&Help</source> <translation>&Hilfe</translation> </message> @@ -2060,7 +2030,7 @@ <context> <name>news_reader</name> <message> - <location line="-1492"/> + <location line="-1500"/> <source><html> <body> <p> @@ -2119,18 +2089,18 @@ <context> <name>octave_dock_widget</name> <message> - <location filename="../src/octave-dock-widget.cc" line="+67"/> - <location line="+201"/> + <location filename="../src/octave-dock-widget.cc" line="+69"/> + <location line="+205"/> <source>Undock widget</source> <translation>Fenster lösen</translation> </message> <message> - <location line="-191"/> + <location line="-195"/> <source>Hide widget</source> <translation>Fenster verbergen</translation> </message> <message> - <location line="+136"/> + <location line="+137"/> <source>Dock widget</source> <translation>Fenster andocken</translation> </message> @@ -2224,7 +2194,7 @@ <context> <name>resource_manager</name> <message> - <location filename="../src/resource-manager.cc" line="+246"/> + <location filename="../src/resource-manager.cc" line="+247"/> <source>The settings file %1 does not exist and can not be created. @@ -2919,7 +2889,7 @@ <context> <name>shortcut_manager</name> <message> - <location filename="../src/shortcut-manager.cc" line="+106"/> + <location filename="../src/shortcut-manager.cc" line="+105"/> <source>New File</source> <translation>Neue Datei</translation> </message> @@ -2950,12 +2920,12 @@ </message> <message> <location line="+16"/> - <location line="+143"/> + <location line="+142"/> <source>Preferences</source> <translation>Einstellungen</translation> </message> <message> - <location line="-158"/> + <location line="-157"/> <source>Exit Octave</source> <translation>Octave beenden</translation> </message> @@ -3076,12 +3046,12 @@ </message> <message> <location line="+2"/> - <location line="+234"/> + <location line="+233"/> <source>Editor</source> <translation>Editor</translation> </message> <message> - <location line="-232"/> + <location line="-231"/> <source>Documentation</source> <translation>Dokumentation</translation> </message> @@ -3102,11 +3072,6 @@ </message> <message> <location line="+1"/> - <source>Share Code</source> - <translation>Code teilen</translation> - </message> - <message> - <location line="+1"/> <source>Contribute to Octave</source> <translation>Zu Octave beitragen</translation> </message> @@ -3352,7 +3317,7 @@ <translation>Gehe zu Zeile</translation> </message> <message> - <location line="-125"/> + <location line="-124"/> <source>Step</source> <translatorcomment>Armin: Vorher "Überspringen" im Kontrast zu "Hineinspringen"</translatorcomment> <translation>Einzelschritt</translation> @@ -3369,7 +3334,7 @@ <translation>Fehler melden</translation> </message> <message> - <location line="+21"/> + <location line="+20"/> <source>Close Other Files</source> <translation>Andere Dokumente schließen</translation> </message> @@ -3624,7 +3589,7 @@ <translation>Globale Suche</translation> </message> <message> - <location line="+18"/> + <location line="+19"/> <source>Error</source> <translation>Fehler</translation> </message>
--- a/libgui/languages/en_US.ts Mon Oct 03 19:24:23 2016 +0100 +++ b/libgui/languages/en_US.ts Thu Oct 06 07:36:59 2016 +0200 @@ -121,7 +121,7 @@ <context> <name>QWinTerminalImpl</name> <message> - <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1779"/> + <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1780"/> <source>copied selection to clipboard</source> <translation type="unfinished"></translation> </message> @@ -129,7 +129,7 @@ <context> <name>QtHandles::Figure</name> <message> - <location filename="../graphics/Figure.cc" line="+298"/> + <location filename="../graphics/Figure.cc" line="+297"/> <source>Figure ToolBar</source> <translation type="unfinished"></translation> </message> @@ -180,17 +180,17 @@ </message> <message> <location line="+7"/> - <location line="+463"/> + <location line="+465"/> <source>About Octave</source> <translation type="unfinished"></translation> </message> <message> - <location line="-465"/> + <location line="-467"/> <source>&Help</source> <translation type="unfinished"></translation> </message> <message> - <location line="+504"/> + <location line="+506"/> <location line="+69"/> <source>Save Figure As</source> <translation type="unfinished"></translation> @@ -405,12 +405,12 @@ <location line="+25"/> <location line="+62"/> <location line="+28"/> - <location line="+79"/> + <location line="+81"/> <source>Octave Editor</source> <translation type="unfinished"></translation> </message> <message> - <location line="-462"/> + <location line="-464"/> <source>Octave Files (*.m);;All Files (*)</source> <translation type="unfinished"></translation> </message> @@ -433,12 +433,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+492"/> + <location line="+494"/> <source>&%1 %2</source> <translation type="unfinished"></translation> </message> <message> - <location line="+480"/> + <location line="+481"/> <source>&Save File</source> <translation type="unfinished"></translation> </message> @@ -538,7 +538,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1341"/> + <location line="-1344"/> <source>Could not start custom file editor %1</source> <translation type="unfinished"></translation> @@ -554,7 +554,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+1041"/> + <location line="+1044"/> <source>&Recent Editor Files</source> <translation type="unfinished"></translation> </message> @@ -734,22 +734,22 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1467"/> + <location line="-1470"/> <source>File Encoding:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+403"/> + <location line="+404"/> <source>%1 is a built-in function</source> <translation type="unfinished"></translation> </message> <message> - <location line="+36"/> + <location line="+37"/> <source>Can not find function %1</source> <translation type="unfinished"></translation> </message> <message> - <location line="+911"/> + <location line="+912"/> <source>Find &Next...</source> <translation type="unfinished"></translation> </message> @@ -804,7 +804,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1305"/> + <location line="-1308"/> <source>Could not open file %1 for read: %2.</source> @@ -830,7 +830,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+928"/> + <location line="+931"/> <source>&File</source> <translation type="unfinished"></translation> </message> @@ -873,7 +873,13 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+1146"/> + <location line="+339"/> + <source>Cannot add breakpoint to modified file. +Save and add breakpoint, or cancel?</source> + <translation type="unfinished"></translation> + </message> + <message> + <location line="+812"/> <source>Goto line</source> <translation type="unfinished"></translation> </message> @@ -934,18 +940,18 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1342"/> + <location line="-1347"/> <source>encoding:</source> <translation type="unfinished"></translation> </message> <message> - <location line="+239"/> + <location line="+243"/> <source>Breakpoint condition</source> <translation type="unfinished"></translation> </message> <message> <location line="+88"/> - <location line="+1024"/> + <location line="+1025"/> <location line="+372"/> <location line="+215"/> <location line="+21"/> @@ -955,13 +961,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1737"/> - <source>Cannot add breakpoint to modified file. -Save and add breakpoint, or canel?</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1611"/> + <location line="-126"/> <source>"%1" is not a valid identifier. @@ -1035,7 +1035,7 @@ </message> <message> <location line="+4"/> - <location line="+373"/> + <location line="+377"/> <source>Find Files...</source> <translation type="unfinished"></translation> </message> @@ -1050,12 +1050,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+389"/> + <location line="+391"/> <source>New Directory</source> <translation type="unfinished"></translation> </message> <message> - <location line="-773"/> + <location line="-779"/> <source>Show Octave directory</source> <translation type="unfinished"></translation> </message> @@ -1070,32 +1070,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>filesdockwidget/showFileSize</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showFileType</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showLastModified</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showHiddenFiles</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/useAlternatingRowColors</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+29"/> + <location line="+36"/> <source>One directory up</source> <translation type="unfinished"></translation> </message> @@ -1116,23 +1091,23 @@ </message> <message> <location line="+20"/> - <location line="+382"/> + <location line="+386"/> <source>New File...</source> <translation type="unfinished"></translation> </message> <message> - <location line="-379"/> - <location line="+382"/> + <location line="-383"/> + <location line="+386"/> <source>New Directory...</source> <translation type="unfinished"></translation> </message> <message> - <location line="-329"/> + <location line="-332"/> <source>Activate to open in editor, right click for alternatives</source> <translation type="unfinished"></translation> </message> <message> - <location line="-136"/> + <location line="-137"/> <source>File size</source> <translation type="unfinished"></translation> </message> @@ -1152,7 +1127,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+415"/> + <location line="+419"/> <source>Open</source> <translation type="unfinished"></translation> </message> @@ -1221,12 +1196,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+145"/> + <location line="+146"/> <source>Set directory of file browser</source> <translation type="unfinished"></translation> </message> <message> - <location line="+29"/> + <location line="+30"/> <source>Create File</source> <translation type="unfinished"></translation> </message> @@ -1600,7 +1575,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+107"/> + <location line="+109"/> <source>Copy</source> <translation type="unfinished"></translation> </message> @@ -1661,12 +1636,12 @@ </message> <message> <location line="+758"/> - <location line="+975"/> + <location line="+980"/> <source>About Octave</source> <translation type="unfinished"></translation> </message> <message> - <location line="-301"/> + <location line="-298"/> <source>&File</source> <translation type="unfinished"></translation> </message> @@ -1711,7 +1686,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1537"/> + <location line="-1545"/> <source>Save Workspace As</source> <translation type="unfinished"></translation> </message> @@ -1736,12 +1711,12 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+206"/> + <location line="+201"/> <source>Are you sure you want to exit Octave?</source> <translation type="unfinished"></translation> </message> <message> - <location line="+916"/> + <location line="+929"/> <source>Open an existing file in editor</source> <translation type="unfinished"></translation> </message> @@ -1811,7 +1786,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+36"/> + <location line="+33"/> <source>Contribute</source> <translation type="unfinished"></translation> </message> @@ -1821,17 +1796,17 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-123"/> + <location line="-120"/> <source>Step In</source> <translation type="unfinished"></translation> </message> <message> - <location line="-1082"/> + <location line="-1095"/> <source>Octave</source> <translation type="unfinished"></translation> </message> <message> - <location line="+926"/> + <location line="+939"/> <source>Load Workspace...</source> <translation type="unfinished"></translation> </message> @@ -1861,11 +1836,6 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+3"/> - <source>Share Code</source> - <translation type="unfinished"></translation> - </message> - <message> <location line="+20"/> <source>On Disk</source> <translation type="unfinished"></translation> @@ -1911,13 +1881,13 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-1198"/> - <location line="+1201"/> + <location line="-1206"/> + <location line="+1209"/> <source>Browse directories</source> <translation type="unfinished"></translation> </message> <message> - <location line="-175"/> + <location line="-172"/> <source>Quit Debug Mode</source> <translation type="unfinished"></translation> </message> @@ -1973,12 +1943,12 @@ </message> <message> <location line="+3"/> - <location line="+41"/> + <location line="+38"/> <source>Documentation</source> <translation type="unfinished"></translation> </message> <message> - <location line="-30"/> + <location line="-27"/> <source>&Help</source> <translation type="unfinished"></translation> </message> @@ -1991,7 +1961,7 @@ <context> <name>news_reader</name> <message> - <location line="-1492"/> + <location line="-1500"/> <source><html> <body> <p> @@ -2027,18 +1997,18 @@ <context> <name>octave_dock_widget</name> <message> - <location filename="../src/octave-dock-widget.cc" line="+67"/> - <location line="+201"/> + <location filename="../src/octave-dock-widget.cc" line="+69"/> + <location line="+205"/> <source>Undock widget</source> <translation type="unfinished"></translation> </message> <message> - <location line="-191"/> + <location line="-195"/> <source>Hide widget</source> <translation type="unfinished"></translation> </message> <message> - <location line="+136"/> + <location line="+137"/> <source>Dock widget</source> <translation type="unfinished"></translation> </message> @@ -2130,7 +2100,7 @@ <context> <name>resource_manager</name> <message> - <location filename="../src/resource-manager.cc" line="+246"/> + <location filename="../src/resource-manager.cc" line="+247"/> <source>The settings file %1 does not exist and can not be created. @@ -2804,7 +2774,7 @@ <context> <name>shortcut_manager</name> <message> - <location filename="../src/shortcut-manager.cc" line="+106"/> + <location filename="../src/shortcut-manager.cc" line="+105"/> <source>New File</source> <translation type="unfinished"></translation> </message> @@ -2835,12 +2805,12 @@ </message> <message> <location line="+16"/> - <location line="+143"/> + <location line="+142"/> <source>Preferences</source> <translation type="unfinished"></translation> </message> <message> - <location line="-158"/> + <location line="-157"/> <source>Exit Octave</source> <translation type="unfinished"></translation> </message> @@ -2961,12 +2931,12 @@ </message> <message> <location line="+2"/> - <location line="+234"/> + <location line="+233"/> <source>Editor</source> <translation type="unfinished"></translation> </message> <message> - <location line="-232"/> + <location line="-231"/> <source>Documentation</source> <translation type="unfinished"></translation> </message> @@ -2987,11 +2957,6 @@ </message> <message> <location line="+1"/> - <source>Share Code</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+1"/> <source>Contribute to Octave</source> <translation type="unfinished"></translation> </message> @@ -3254,7 +3219,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="-571"/> + <location line="-570"/> <source>Step</source> <translation type="unfinished"></translation> </message> @@ -3269,7 +3234,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+21"/> + <location line="+20"/> <source>Close Other Files</source> <translation type="unfinished"></translation> </message> @@ -3500,7 +3465,7 @@ <translation type="unfinished"></translation> </message> <message> - <location line="+18"/> + <location line="+19"/> <source>Error</source> <translation type="unfinished"></translation> </message>
--- a/libgui/languages/es_ES.ts Mon Oct 03 19:24:23 2016 +0100 +++ b/libgui/languages/es_ES.ts Thu Oct 06 07:36:59 2016 +0200 @@ -125,7 +125,7 @@ <context> <name>QWinTerminalImpl</name> <message> - <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1779"/> + <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1780"/> <source>copied selection to clipboard</source> <translation>selección copiada al portapapeles</translation> </message> @@ -133,7 +133,7 @@ <context> <name>QtHandles::Figure</name> <message> - <location filename="../graphics/Figure.cc" line="+298"/> + <location filename="../graphics/Figure.cc" line="+297"/> <source>Figure ToolBar</source> <translation>Barra de herramientas de figura</translation> </message> @@ -185,17 +185,17 @@ </message> <message> <location line="+7"/> - <location line="+463"/> + <location line="+465"/> <source>About Octave</source> <translation>Acerca de Octave</translation> </message> <message> - <location line="-465"/> + <location line="-467"/> <source>&Help</source> <translation>&Ayuda</translation> </message> <message> - <location line="+504"/> + <location line="+506"/> <location line="+69"/> <source>Save Figure As</source> <translation>Guardar figura como</translation> @@ -413,12 +413,12 @@ <location line="+25"/> <location line="+62"/> <location line="+28"/> - <location line="+79"/> + <location line="+81"/> <source>Octave Editor</source> <translation>Editor de Octave</translation> </message> <message> - <location line="-462"/> + <location line="-464"/> <source>Octave Files (*.m);;All Files (*)</source> <translation>Archivos de Octave (*.m);;Todos los archivos (*)</translation> </message> @@ -428,12 +428,12 @@ <translation>Nueva función</translation> </message> <message> - <location line="+888"/> + <location line="+890"/> <source>&%1 %2</source> <translation>&%1 %2</translation> </message> <message> - <location line="+480"/> + <location line="+481"/> <source>&Save File</source> <translation>&Guardar archivo</translation> </message> @@ -468,7 +468,7 @@ <translation>Marcador &anterior</translation> </message> <message> - <location line="-1492"/> + <location line="-1495"/> <source>New function name: </source> <translation>Nombre para la nueva función:</translation> @@ -499,7 +499,7 @@ no existe. ¿Desea crearlo?</translation> </message> <message> - <location line="+1186"/> + <location line="+1189"/> <source>Toggle &Bookmark</source> <translation>&Alternar marcadores</translation> </message> @@ -569,7 +569,7 @@ <translation>&Ir a línea...</translation> </message> <message> - <location line="-1425"/> + <location line="-1428"/> <source>File Encoding:</source> <translation>Codificación de archivos:</translation> </message> @@ -602,17 +602,17 @@ ya se encuentra abierto en el editor</translation> </message> <message> - <location line="+61"/> + <location line="+62"/> <source>%1 is a built-in function</source> <translation>%1 es una función integrada</translation> </message> <message> - <location line="+36"/> + <location line="+37"/> <source>Can not find function %1</source> <translation>No se puede encontrar la función %1</translation> </message> <message> - <location line="+862"/> + <location line="+863"/> <source>&Recent Editor Files</source> <translation>Archivos &recientes</translation> </message> @@ -848,12 +848,12 @@ <translation>&Documentación de palabras clave</translation> </message> <message> - <location line="-1171"/> + <location line="-1174"/> <source>The associated file editor tab has disappeared.</source> <translation>La pestaña asociada del editor de texto ha desaparecido.</translation> </message> <message> - <location line="+928"/> + <location line="+931"/> <source>&File</source> <translation>&Archivo</translation> </message> @@ -891,7 +891,14 @@ <translation>Columna:</translation> </message> <message> - <location line="+1146"/> + <location line="+339"/> + <source>Cannot add breakpoint to modified file. +Save and add breakpoint, or cancel?</source> + <translation>No es posible agregar punto de interrupción al archivo modificado. +¿Desea guardar y agregar punto de interrupción o cancelar?</translation> + </message> + <message> + <location line="+812"/> <source>Goto line</source> <translation>Ir a la línea</translation> </message> @@ -950,25 +957,18 @@ <translation>Fines de línea:</translation> </message> <message> - <location line="-1817"/> + <location line="-1822"/> <source>encoding:</source> <translation>Codificación:</translation> </message> <message> - <location line="+239"/> + <location line="+243"/> <source>Breakpoint condition</source> <translatorcomment>Condición de "breakpoint"</translatorcomment> <translation>Condición de punto de interrupción</translation> </message> <message> - <location line="+89"/> - <source>Cannot add breakpoint to modified file. -Save and add breakpoint, or canel?</source> - <translation>No es posible agregar punto de interrupción al archivo modificado. -¿Desea guardar y agregar punto de interrupción o cancelar?</translation> - </message> - <message> - <location line="+1322"/> + <location line="+1412"/> <source>Debug or Save</source> <translation>Depurar programa o guardar</translation> </message> @@ -1000,8 +1000,8 @@ <translation>¿Desea cancelar el cierre, guardar o descartar los cambios?</translation> </message> <message> - <location line="-1015"/> - <location line="+1024"/> + <location line="-1016"/> + <location line="+1025"/> <location line="+372"/> <location line="+215"/> <location line="+21"/> @@ -1074,7 +1074,7 @@ </message> <message> <location line="+4"/> - <location line="+373"/> + <location line="+377"/> <source>Find Files...</source> <translation>Buscar archivos...</translation> </message> @@ -1110,12 +1110,12 @@ </translation> </message> <message> - <location line="+208"/> + <location line="+210"/> <source>New Directory</source> <translation>Nuevo directorio</translation> </message> <message> - <location line="-773"/> + <location line="-779"/> <source>Show Octave directory</source> <translation>Mostrar el directorio de Octave</translation> </message> @@ -1130,37 +1130,7 @@ <translation>Alternar colores de filas</translation> </message> <message> - <location line="+3"/> - <source>filesdockwidget/showFileSize</source> - <translatorcomment>Dudas sobre una traducción adecuada</translatorcomment> - <translation>archivobarrawidget/mostrarTamañoArchivo</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showFileType</source> - <translatorcomment>Dudas sobre una traducción adecuada</translatorcomment> - <translation>archivobarrawidget/mostrarTipoArchivo</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showLastModified</source> - <translatorcomment>Dudas sobre una traducción adecuada</translatorcomment> - <translation>archivobarrawidget/mostrarÚltimaModificación</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showHiddenFiles</source> - <translatorcomment>Dudas sobre una traducción adecuada</translatorcomment> - <translation>archivobarrawidget/mostrarArchivosOcultos</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/useAlternatingRowColors</source> - <translatorcomment>Dudas sobre una traducción adecuada</translatorcomment> - <translation>archivobarrawidget/utilizarFilasColoresAlternos</translation> - </message> - <message> - <location line="+29"/> + <location line="+36"/> <source>One directory up</source> <translation>Directorio superior</translation> </message> @@ -1181,23 +1151,23 @@ </message> <message> <location line="+20"/> - <location line="+382"/> + <location line="+386"/> <source>New File...</source> <translation>Nuevo archivo...</translation> </message> <message> - <location line="-379"/> - <location line="+382"/> + <location line="-383"/> + <location line="+386"/> <source>New Directory...</source> <translation>Nuevo directorio...</translation> </message> <message> - <location line="-329"/> + <location line="-332"/> <source>Activate to open in editor, right click for alternatives</source> <translation>Activar para abrir en el editor. Haga clic derecho para ver las alternativas</translation> </message> <message> - <location line="-136"/> + <location line="-137"/> <source>File size</source> <translation>Tamaño del archivo</translation> </message> @@ -1217,7 +1187,7 @@ <translation>Mostrar ocultos</translation> </message> <message> - <location line="+415"/> + <location line="+419"/> <source>Open</source> <translation>Abrir</translation> </message> @@ -1268,12 +1238,12 @@ <translation>No se puede eliminar un directorio que no esté vacío</translation> </message> <message> - <location line="+145"/> + <location line="+146"/> <source>Set directory of file browser</source> <translation>Seleccionar el directorio del explorador de archivos</translation> </message> <message> - <location line="+29"/> + <location line="+30"/> <source>Create File</source> <translation>Crear archivo</translation> </message> @@ -1667,7 +1637,7 @@ <translation>Historial de comandos</translation> </message> <message> - <location line="+107"/> + <location line="+109"/> <source>Copy</source> <translation>Copiar</translation> </message> @@ -1733,12 +1703,12 @@ </message> <message> <location line="+758"/> - <location line="+975"/> + <location line="+980"/> <source>About Octave</source> <translation>Acerca de Octave</translation> </message> <message> - <location line="-301"/> + <location line="-298"/> <source>&File</source> <translation>&Archivo</translation> </message> @@ -1783,7 +1753,7 @@ <translation>Pegar</translation> </message> <message> - <location line="-1537"/> + <location line="-1545"/> <source>Save Workspace As</source> <translation>Guardar el espacio de trabajo como</translation> </message> @@ -1808,12 +1778,12 @@ <translation>Noticas de la comunidad de Octave</translation> </message> <message> - <location line="+206"/> + <location line="+201"/> <source>Are you sure you want to exit Octave?</source> <translation>¿Está seguro de que desea salir de Octave?</translation> </message> <message> - <location line="+916"/> + <location line="+929"/> <source>Open an existing file in editor</source> <translation>Abrir un archivo existente en el editor</translation> </message> @@ -1883,7 +1853,7 @@ <translation>Explorador de archivos</translation> </message> <message> - <location line="+36"/> + <location line="+33"/> <source>Contribute</source> <translation>Contribuir</translation> </message> @@ -1893,17 +1863,17 @@ <translation>Donar a Octave</translation> </message> <message> - <location line="-123"/> + <location line="-120"/> <source>Step In</source> <translation>Iniciar</translation> </message> <message> - <location line="-1082"/> + <location line="-1095"/> <source>Octave</source> <translation>Octave</translation> </message> <message> - <location line="+926"/> + <location line="+939"/> <source>Load Workspace...</source> <translation>Cargar espacio de trabajo...</translation> </message> @@ -1933,11 +1903,6 @@ <translation>Paquetes de Octave</translation> </message> <message> - <location line="+3"/> - <source>Share Code</source> - <translation>Compartir código</translation> - </message> - <message> <location line="+20"/> <source>On Disk</source> <translation>En disco</translation> @@ -1983,13 +1948,13 @@ <translation>Directorio superior</translation> </message> <message> - <location line="-1198"/> - <location line="+1201"/> + <location line="-1206"/> + <location line="+1209"/> <source>Browse directories</source> <translation>Explorar directorios</translation> </message> <message> - <location line="-175"/> + <location line="-172"/> <source>Quit Debug Mode</source> <translation>Salir del modo de depuración</translation> </message> @@ -2045,12 +2010,12 @@ </message> <message> <location line="+3"/> - <location line="+41"/> + <location line="+38"/> <source>Documentation</source> <translation>Documentación</translation> </message> <message> - <location line="-30"/> + <location line="-27"/> <source>&Help</source> <translation>&Ayuda</translation> </message> @@ -2064,7 +2029,7 @@ <context> <name>news_reader</name> <message> - <location line="-1492"/> + <location line="-1500"/> <source><html> <body> <p> @@ -2124,20 +2089,20 @@ <context> <name>octave_dock_widget</name> <message> - <location filename="../src/octave-dock-widget.cc" line="+67"/> - <location line="+201"/> + <location filename="../src/octave-dock-widget.cc" line="+69"/> + <location line="+205"/> <source>Undock widget</source> <translatorcomment>Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment> <translation>Desacoplar widget</translation> </message> <message> - <location line="-191"/> + <location line="-195"/> <source>Hide widget</source> <translatorcomment>Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment> <translation>Ocultar widget</translation> </message> <message> - <location line="+136"/> + <location line="+137"/> <source>Dock widget</source> <translatorcomment>Uso "widget" por ser el término usual: http://es.wikipedia.org/wiki/Widget</translatorcomment> <translation>Acoplar widget</translation> @@ -2233,7 +2198,7 @@ <context> <name>resource_manager</name> <message> - <location filename="../src/resource-manager.cc" line="+246"/> + <location filename="../src/resource-manager.cc" line="+247"/> <source>The settings file %1 does not exist and can not be created. @@ -2926,7 +2891,7 @@ <context> <name>shortcut_manager</name> <message> - <location filename="../src/shortcut-manager.cc" line="+106"/> + <location filename="../src/shortcut-manager.cc" line="+105"/> <source>New File</source> <translation>Nuevo archivo</translation> </message> @@ -2957,12 +2922,12 @@ </message> <message> <location line="+16"/> - <location line="+143"/> + <location line="+142"/> <source>Preferences</source> <translation>Preferencias</translation> </message> <message> - <location line="-158"/> + <location line="-157"/> <source>Exit Octave</source> <translation>Salir de Octave</translation> </message> @@ -3083,12 +3048,12 @@ </message> <message> <location line="+2"/> - <location line="+234"/> + <location line="+233"/> <source>Editor</source> <translation>Editor</translation> </message> <message> - <location line="-232"/> + <location line="-231"/> <source>Documentation</source> <translation>Documentación</translation> </message> @@ -3109,11 +3074,6 @@ </message> <message> <location line="+1"/> - <source>Share Code</source> - <translation>Compartir código</translation> - </message> - <message> - <location line="+1"/> <source>Contribute to Octave</source> <translation>Colaborar con Octave</translation> </message> @@ -3377,7 +3337,7 @@ <translation>Exportar accesos directos al archivo ...</translation> </message> <message> - <location line="-571"/> + <location line="-570"/> <source>Step</source> <translation>Siguiente instrucción</translation> </message> @@ -3392,7 +3352,7 @@ <translation>Informar de fallo (bug)</translation> </message> <message> - <location line="+21"/> + <location line="+20"/> <source>Close Other Files</source> <translation>Cerrar otros archivos</translation> </message> @@ -3627,7 +3587,7 @@ <translation>Búsqueda global</translation> </message> <message> - <location line="+18"/> + <location line="+19"/> <source>Error</source> <translation>Error</translation> </message>
--- a/libgui/languages/fr_FR.ts Mon Oct 03 19:24:23 2016 +0100 +++ b/libgui/languages/fr_FR.ts Thu Oct 06 07:36:59 2016 +0200 @@ -121,7 +121,7 @@ <context> <name>QWinTerminalImpl</name> <message> - <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1779"/> + <location filename="../qterminal/libqterminal/win32/QWinTerminalImpl.cpp" line="+1780"/> <source>copied selection to clipboard</source> <translation>sélection copiée vers le presse-papiers</translation> </message> @@ -129,7 +129,7 @@ <context> <name>QtHandles::Figure</name> <message> - <location filename="../graphics/Figure.cc" line="+298"/> + <location filename="../graphics/Figure.cc" line="+297"/> <source>Figure ToolBar</source> <translatorcomment>This may be long depending on the context.</translatorcomment> <translation>Barre d'Outils de la Figure</translation> @@ -181,17 +181,17 @@ </message> <message> <location line="+7"/> - <location line="+463"/> + <location line="+465"/> <source>About Octave</source> <translation>À propos d'Octave</translation> </message> <message> - <location line="-465"/> + <location line="-467"/> <source>&Help</source> <translation>&Aide</translation> </message> <message> - <location line="+504"/> + <location line="+506"/> <location line="+69"/> <source>Save Figure As</source> <translation>Enregistrer la Figure Sous</translation> @@ -407,12 +407,12 @@ <location line="+25"/> <location line="+62"/> <location line="+28"/> - <location line="+79"/> + <location line="+81"/> <source>Octave Editor</source> <translation>Éditeur d'Octave</translation> </message> <message> - <location line="-462"/> + <location line="-464"/> <source>Octave Files (*.m);;All Files (*)</source> <translation>Fichiers Octave (*.m);;Tous les fichiers (*)</translation> </message> @@ -437,12 +437,12 @@ est déjà ouvert dans l'éditeur</translation> </message> <message> - <location line="+492"/> + <location line="+494"/> <source>&%1 %2</source> <translation>&%1 %2</translation> </message> <message> - <location line="+480"/> + <location line="+481"/> <source>&Save File</source> <translation>&Enregistrer</translation> </message> @@ -542,7 +542,7 @@ <translation>&Aller à la ligne...</translation> </message> <message> - <location line="-1341"/> + <location line="-1344"/> <source>Could not start custom file editor %1</source> <translation>Impossible de démarrer l'éditeur @@ -559,7 +559,7 @@ <translation>Annuler</translation> </message> <message> - <location line="+1041"/> + <location line="+1044"/> <source>&Recent Editor Files</source> <translation>Fichiers &récents</translation> </message> @@ -739,22 +739,22 @@ <translation>Afficher les Fins de Lign&es</translation> </message> <message> - <location line="-1467"/> + <location line="-1470"/> <source>File Encoding:</source> <translation>Encodage :</translation> </message> <message> - <location line="+403"/> + <location line="+404"/> <source>%1 is a built-in function</source> <translation>%1 est une fonction interne</translation> </message> <message> - <location line="+36"/> + <location line="+37"/> <source>Can not find function %1</source> <translation>Impossible de trouver la fonction %1</translation> </message> <message> - <location line="+911"/> + <location line="+912"/> <source>Find &Next...</source> <translation>Trouver le Suiva&nt...</translation> </message> @@ -809,7 +809,7 @@ <translation>&Documentation sur le mot de clés</translation> </message> <message> - <location line="-1305"/> + <location line="-1308"/> <source>Could not open file %1 for read: %2.</source> @@ -841,7 +841,7 @@ <translation>L'onglet éditeur de fichier associé a disparu.</translation> </message> <message> - <location line="+928"/> + <location line="+931"/> <source>&File</source> <translation>&Fichier</translation> </message> @@ -884,7 +884,14 @@ <translation>col:</translation> </message> <message> - <location line="+1146"/> + <location line="+339"/> + <source>Cannot add breakpoint to modified file. +Save and add breakpoint, or cancel?</source> + <translation>Impossible d'ajouter un point d'arrêt à un fichier modifié. +Sauvegarder et ajouter le point d'arrêt ou annuler?</translation> + </message> + <message> + <location line="+812"/> <source>Goto line</source> <translation>Aller à la ligne</translation> </message> @@ -950,18 +957,18 @@ <translation>Voulez vous annuler la fermeture, enregistrer ou supprimer les modifications ?</translation> </message> <message> - <location line="-1342"/> + <location line="-1347"/> <source>encoding:</source> <translation>encodage :</translation> </message> <message> - <location line="+239"/> + <location line="+243"/> <source>Breakpoint condition</source> <translation>Condition de point d'arrêt</translation> </message> <message> <location line="+88"/> - <location line="+1024"/> + <location line="+1025"/> <location line="+372"/> <location line="+215"/> <location line="+21"/> @@ -971,14 +978,7 @@ <translation>Éditeur d'Octave</translation> </message> <message> - <location line="-1737"/> - <source>Cannot add breakpoint to modified file. -Save and add breakpoint, or canel?</source> - <translation>Impossible d'ajouter un point d'arrêt à un fichier modifié. -Sauvegarder et ajouter le point d'arrêt ou annuler?</translation> - </message> - <message> - <location line="+1611"/> + <location line="-126"/> <source>"%1" is not a valid identifier. @@ -1067,7 +1067,7 @@ </message> <message> <location line="+4"/> - <location line="+373"/> + <location line="+377"/> <source>Find Files...</source> <translation>Rechercher des fichiers...</translation> </message> @@ -1082,12 +1082,12 @@ <translation>Ouvrir dans l'éditeur de texte</translation> </message> <message> - <location line="+389"/> + <location line="+391"/> <source>New Directory</source> <translation>Nouveau répertoire</translation> </message> <message> - <location line="-773"/> + <location line="-779"/> <source>Show Octave directory</source> <translation>Revenir au répertoire d'Octave</translation> </message> @@ -1102,37 +1102,7 @@ <translation>Alterner les couleurs des lignes</translation> </message> <message> - <location line="+3"/> - <source>filesdockwidget/showFileSize</source> - <translatorcomment>Not translated</translatorcomment> - <translation>filesdockwidget/showFileSize</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showFileType</source> - <translatorcomment>Not translated</translatorcomment> - <translation>filesdockwidget/showFileType</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showLastModified</source> - <translatorcomment>Not translated</translatorcomment> - <translation>filesdockwidget/showLastModified</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/showHiddenFiles</source> - <translatorcomment>Not translated</translatorcomment> - <translation>filesdockwidget/showHiddenFiles</translation> - </message> - <message> - <location line="+1"/> - <source>filesdockwidget/useAlternatingRowColors</source> - <translatorcomment>Not translated</translatorcomment> - <translation>filesdockwidget/useAlternatingRowColors</translation> - </message> - <message> - <location line="+29"/> + <location line="+36"/> <source>One directory up</source> <translation>Monter au répertoire parent</translation> </message> @@ -1153,23 +1123,23 @@ </message> <message> <location line="+20"/> - <location line="+382"/> + <location line="+386"/> <source>New File...</source> <translation>Nouveau fichier...</translation> </message> <message> - <location line="-379"/> - <location line="+382"/> + <location line="-383"/> + <location line="+386"/> <source>New Directory...</source> <translation>Nouveau répertoire...</translation> </message> <message> - <location line="-329"/> + <location line="-332"/> <source>Activate to open in editor, right click for alternatives</source> <translation>Activer pour ouvrir dans l'éditeur, click droit pour les alternatives</translation> </message> <message> - <location line="-136"/> + <location line="-137"/> <source>File size</source> <translation>Taille du fichier</translation> </message> @@ -1189,7 +1159,7 @@ <translation>Afficher les fichiers cachés</translation> </message> <message> - <location line="+415"/> + <location line="+419"/> <source>Open</source> <translation>Ouvrir</translation> </message> @@ -1261,12 +1231,12 @@ <translation>Impossible de supprimer un répertoire qui n'est pas vide</translation> </message> <message> - <location line="+145"/> + <location line="+146"/> <source>Set directory of file browser</source> <translation>Définir le répertoire de l'explorateur de fichiers</translation> </message> <message> - <location line="+29"/> + <location line="+30"/> <source>Create File</source> <translation>Créer un fichier</translation> </message> @@ -1658,7 +1628,7 @@ <translation>Historique des commandes</translation> </message> <message> - <location line="+107"/> + <location line="+109"/> <source>Copy</source> <translation>Copier</translation> </message> @@ -1723,12 +1693,12 @@ </message> <message> <location line="+758"/> - <location line="+975"/> + <location line="+980"/> <source>About Octave</source> <translation>À propos d'Octave</translation> </message> <message> - <location line="-301"/> + <location line="-298"/> <source>&File</source> <translation>&Fichier</translation> </message> @@ -1773,7 +1743,7 @@ <translation>Coller</translation> </message> <message> - <location line="-1537"/> + <location line="-1545"/> <source>Save Workspace As</source> <translation>Enregistrer l'espace de travail sous</translation> </message> @@ -1798,12 +1768,12 @@ <translation>Nouvelles de la communauté Octave</translation> </message> <message> - <location line="+206"/> + <location line="+201"/> <source>Are you sure you want to exit Octave?</source> <translation>Voulez vous vraiment quitter Octave ?</translation> </message> <message> - <location line="+916"/> + <location line="+929"/> <source>Open an existing file in editor</source> <translation>Ouvrir un fichier existant dans l'éditeur</translation> </message> @@ -1873,7 +1843,7 @@ <translation>Explorateur de fichiers</translation> </message> <message> - <location line="+36"/> + <location line="+33"/> <source>Contribute</source> <translation>Contribuer</translation> </message> @@ -1883,17 +1853,17 @@ <translation>Donner à Octave</translation> </message> <message> - <location line="-123"/> + <location line="-120"/> <source>Step In</source> <translation>Avancer d'un pas avec entrée</translation> </message> <message> - <location line="-1082"/> + <location line="-1095"/> <source>Octave</source> <translation>Octave</translation> </message> <message> - <location line="+926"/> + <location line="+939"/> <source>Load Workspace...</source> <translation>Charger l'espace de travail...</translation> </message> @@ -1923,11 +1893,6 @@ <translation>Paquets d'Octave</translation> </message> <message> - <location line="+3"/> - <source>Share Code</source> - <translation>Partager Code</translation> - </message> - <message> <location line="+20"/> <source>On Disk</source> <translation>Installée localement</translation> @@ -1973,13 +1938,13 @@ <translation>Monter au répertoire parent</translation> </message> <message> - <location line="-1198"/> - <location line="+1201"/> + <location line="-1206"/> + <location line="+1209"/> <source>Browse directories</source> <translation>Naviguer dans les répertoires</translation> </message> <message> - <location line="-175"/> + <location line="-172"/> <source>Quit Debug Mode</source> <translation>Quitter le mode Déboguage</translation> </message> @@ -2035,12 +2000,12 @@ </message> <message> <location line="+3"/> - <location line="+41"/> + <location line="+38"/> <source>Documentation</source> <translation>Documentation</translation> </message> <message> - <location line="-30"/> + <location line="-27"/> <source>&Help</source> <translation>&Aide</translation> </message> @@ -2053,7 +2018,7 @@ <context> <name>news_reader</name> <message> - <location line="-1492"/> + <location line="-1500"/> <source><html> <body> <p> @@ -2112,18 +2077,18 @@ <context> <name>octave_dock_widget</name> <message> - <location filename="../src/octave-dock-widget.cc" line="+67"/> - <location line="+201"/> + <location filename="../src/octave-dock-widget.cc" line="+69"/> + <location line="+205"/> <source>Undock widget</source> <translation>Détacher la fenêtre</translation> </message> <message> - <location line="-191"/> + <location line="-195"/> <source>Hide widget</source> <translation>Cacher la fenêtre</translation> </message> <message> - <location line="+136"/> + <location line="+137"/> <source>Dock widget</source> <translation>Attacher la fenêtre</translation> </message> @@ -2217,7 +2182,7 @@ <context> <name>resource_manager</name> <message> - <location filename="../src/resource-manager.cc" line="+246"/> + <location filename="../src/resource-manager.cc" line="+247"/> <source>The settings file %1 does not exist and can not be created. @@ -2908,7 +2873,7 @@ <context> <name>shortcut_manager</name> <message> - <location filename="../src/shortcut-manager.cc" line="+106"/> + <location filename="../src/shortcut-manager.cc" line="+105"/> <source>New File</source> <translation>Nouveau Fichier</translation> </message> @@ -2939,12 +2904,12 @@ </message> <message> <location line="+16"/> - <location line="+143"/> + <location line="+142"/> <source>Preferences</source> <translation>Préférences</translation> </message> <message> - <location line="-158"/> + <location line="-157"/> <source>Exit Octave</source> <translation>Quitter Octave</translation> </message> @@ -3065,12 +3030,12 @@ </message> <message> <location line="+2"/> - <location line="+234"/> + <location line="+233"/> <source>Editor</source> <translation>Éditeur</translation> </message> <message> - <location line="-232"/> + <location line="-231"/> <source>Documentation</source> <translation>Documentation</translation> </message> @@ -3091,11 +3056,6 @@ </message> <message> <location line="+1"/> - <source>Share Code</source> - <translation>Partager du Code</translation> - </message> - <message> - <location line="+1"/> <source>Contribute to Octave</source> <translation>Contribuer à Octave</translation> </message> @@ -3359,7 +3319,7 @@ <translation>Exporter les raccourcis vers un fichier ...</translation> </message> <message> - <location line="-571"/> + <location line="-570"/> <source>Step</source> <translation>Avancer d'un pas</translation> </message> @@ -3374,7 +3334,7 @@ <translation>Signaler un bogue</translation> </message> <message> - <location line="+21"/> + <location line="+20"/> <source>Close Other Files</source> <translation>Fermer les autres fichiers</translation> </message> @@ -3609,7 +3569,7 @@ <translation>Recherche globale</translation> </message> <message> - <location line="+18"/> + <location line="+19"/> <source>Error</source> <translation>Erreur</translation> </message>
--- a/libinterp/corefcn/svd.cc Mon Oct 03 19:24:23 2016 +0100 +++ b/libinterp/corefcn/svd.cc Thu Oct 06 07:36:59 2016 +0200 @@ -251,6 +251,12 @@ %!assert (svd ([1, 2; 2, 1]), [3; 1], sqrt (eps)) %!test +a = [1, 2; 3, 4] + [5, 6; 7, 8]*i; +[u,s,v] = svd (a); +assert (a, u * s * v', 128 * eps); + + +%!test %! [u, s, v] = svd ([1, 2; 2, 1]); %! x = 1 / sqrt (2); %! assert (u, [-x, -x; -x, x], sqrt (eps));
--- a/liboctave/numeric/svd.cc Mon Oct 03 19:24:23 2016 +0100 +++ b/liboctave/numeric/svd.cc Thu Oct 06 07:36:59 2016 +0200 @@ -399,7 +399,7 @@ abort (); if (! (jobv == 'N' || jobv == 'O')) - right_sm = right_sm.transpose (); + right_sm = right_sm.hermitian (); } // Instantiations we need.
--- a/scripts/ode/module.mk Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/module.mk Thu Oct 06 07:36:59 2016 +0200 @@ -5,12 +5,11 @@ scripts_ode_PRIVATE_FCN_FILES = \ scripts/ode/private/AbsRel_Norm.m \ scripts/ode/private/integrate_adaptive.m \ - scripts/ode/private/integrate_const.m \ - scripts/ode/private/integrate_n_steps.m \ scripts/ode/private/kahan.m \ scripts/ode/private/known_option_names.m \ + scripts/ode/private/odedefaults.m \ + scripts/ode/private/odemergeopts.m \ scripts/ode/private/ode_event_handler.m \ - scripts/ode/private/ode_struct_value_check.m \ scripts/ode/private/runge_kutta_23.m \ scripts/ode/private/runge_kutta_45_dorpri.m \ scripts/ode/private/runge_kutta_interpolate.m \
--- a/scripts/ode/ode23.m Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/ode23.m Thu Oct 06 07:36:59 2016 +0200 @@ -1,3 +1,4 @@ +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> ## Copyright (C) 2014-2016 Jacopo Corno <jacopo.corno@gmail.com> ## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> ## Copyright (C) 2006-2016 Thomas Treichl <treichl@users.sourceforge.net> @@ -21,7 +22,6 @@ ## -*- texinfo -*- ## @deftypefn {} {[@var{t}, @var{y}] =} ode23 (@var{fun}, @var{trange}, @var{init}) ## @deftypefnx {} {[@var{t}, @var{y}] =} ode23 (@var{fun}, @var{trange}, @var{init}, @var{ode_opt}) -## @deftypefnx {} {[@var{t}, @var{y}] =} ode23 (@dots{}, @var{par1}, @var{par2}, @dots{}) ## @deftypefnx {} {[@var{t}, @var{y}, @var{te}, @var{ye}, @var{ie}] =} ode23 (@dots{}) ## @deftypefnx {} {@var{solution} =} ode23 (@dots{}) ## @@ -39,16 +39,12 @@ ## evaluated. Typically, it is a two-element vector specifying the initial and ## final times (@code{[tinit, tfinal]}). If there are more than two elements ## then the solution will also be evaluated at these intermediate time -## instances unless the integrate function specified is -## @code{integrate_n_steps}. +## instances. ## ## By default, @code{ode23} uses an adaptive timestep with the ## @code{integrate_adaptive} algorithm. The tolerance for the timestep -## computation may be changed by using the option @qcode{"Tau"}, that has a -## default value of @math{1e-6}. If the ODE option @qcode{"TimeStepSize"} is -## not empty, then the stepper called will be @code{integrate_const}. If, in -## addition, the option @qcode{"TimeStepNumber"} is also specified then the -## integrate function @code{integrate_n_steps} will be used. +## computation may be changed by using the options @qcode{"RelTol"}, +## and @qcode{"AbsTol"},. ## ## @var{init} contains the initial value for the unknowns. If it is a row ## vector then the solution @var{y} will be a matrix in which each column is @@ -106,25 +102,25 @@ print_usage (); endif - order = 3; + order = 3; solver = "ode23"; if (nargin >= 4) if (! isstruct (varargin{1})) ## varargin{1:len} are parameters for fun odeopts = odeset (); - odeopts.funarguments = varargin; + funarguments = varargin; elseif (length (varargin) > 1) ## varargin{1} is an ODE options structure opt - odeopts = ode_struct_value_check ("ode23", varargin{1}, "ode23"); - odeopts.funarguments = {varargin{2:length(varargin)}}; + odeopts = varargin{1}; + funarguments = {varargin{2:length(varargin)}}; else # if (isstruct (varargin{1})) - odeopts = ode_struct_value_check ("ode23", varargin{1}, "ode23"); - odeopts.funarguments = {}; + odeopts = varargin{1}; + funarguments = {}; endif else # nargin == 3 odeopts = odeset (); - odeopts.funarguments = {}; + funarguments = {}; endif if (! isnumeric (trange) || ! isvector (trange)) @@ -132,17 +128,14 @@ "ode23: TRANGE must be a numeric vector"); endif - TimeStepNumber = odeget (odeopts, "TimeStepNumber", [], "fast"); - TimeStepSize = odeget (odeopts, "TimeStepSize", [], "fast"); - if (length (trange) < 2 - && (isempty (TimeStepSize) || isempty (TimeStepNumber))) + if (length (trange) < 2) error ("Octave:invalid-input-arg", "ode23: TRANGE must contain at least 2 elements"); elseif (trange(2) == trange(1)) error ("Octave:invalid-input-arg", "ode23: invalid time span, TRANGE(1) == TRANGE(2)"); else - odeopts.direction = sign (trange(2) - trange(1)); + direction = sign (trange(2) - trange(1)); endif trange = trange(:); @@ -164,54 +157,33 @@ "ode23: FUN must be a valid function handle"); endif + ## Start preprocessing, have a look which options are set in odeopts, ## check if an invalid or unused option is set - if (isempty (TimeStepNumber) && isempty (TimeStepSize)) - integrate_func = "adaptive"; - odeopts.stepsizefixed = false; - elseif (! isempty (TimeStepNumber) && ! isempty (TimeStepSize)) - integrate_func = "n_steps"; - odeopts.stepsizefixed = true; - if (sign (TimeStepSize) != odeopts.direction) - warning ("Octave:invalid-input-arg", - ["ode23: option \"TimeStepSize\" has the wrong sign, ", ... - "but will be corrected automatically\n"]); - TimeStepSize = -TimeStepSize; - endif - elseif (isempty (TimeStepNumber) && ! isempty (TimeStepSize)) - integrate_func = "const"; - odeopts.stepsizefixed = true; - if (sign (TimeStepSize) != odeopts.direction) - warning ("Octave:invalid-input-arg", - ["ode23: option \"TimeStepSize\" has the wrong sign, ", - "but will be corrected automatically\n"]); - TimeStepSize = -TimeStepSize; - endif - else - warning ("Octave:invalid-input-arg", - "ode23: assuming an adaptive integrate function\n"); - integrate_func = "adaptive"; - endif + + + persistent defaults = []; + persistent classes = []; + persistent attributes = []; + + + [defaults, classes, attributes] = odedefaults (numel (init), trange(1), + trange(end)); - if (isempty (odeopts.RelTol) && ! odeopts.stepsizefixed) - odeopts.RelTol = 1e-3; - elseif (! isempty (odeopts.RelTol) && odeopts.stepsizefixed) - warning ("Octave:invalid-input-arg", - ["ode23: option \"RelTol\" is ignored", ... - " when fixed time stamps are given\n"]); - endif + defaults = rmfield (defaults, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); + classes = rmfield (classes, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); + attributes = rmfield (attributes, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); - if (isempty (odeopts.AbsTol) && ! odeopts.stepsizefixed) - odeopts.AbsTol = 1e-6; - elseif (! isempty (odeopts.AbsTol) && odeopts.stepsizefixed) - warning ("Octave:invalid-input-arg", - ["ode23: option \"AbsTol\" is ignored", ... - " when fixed time stamps are given\n"]); - else - odeopts.AbsTol = odeopts.AbsTol(:); # Create column vector - endif + odeopts = odemergeopts (odeopts, defaults, classes, attributes, 'ode23'); - odeopts.normcontrol = strcmp (odeopts.NormControl, "on"); + odeopts.funarguments = funarguments; + odeopts.direction = direction; if (! isempty (odeopts.NonNegative)) if (isempty (odeopts.Mass)) @@ -233,47 +205,15 @@ odeopts.haveoutputfunction = ! isempty (odeopts.OutputFcn); endif - odeopts.haveoutputselection = ! isempty (odeopts.OutputSel); - - if (odeopts.Refine > 0) - odeopts.haverefine = true; - else - odeopts.haverefine = false; - endif - - if (isempty (odeopts.InitialStep) && strcmp (integrate_func, "adaptive")) + if (isempty (odeopts.InitialStep)) odeopts.InitialStep = odeopts.direction * ... starting_stepsize (order, fun, trange(1), init, odeopts.AbsTol, odeopts.RelTol, - odeopts.normcontrol); - elseif (isempty (odeopts.InitialStep)) - odeopts.InitialStep = TimeStepSize; - endif - - if (isempty (odeopts.MaxStep) && ! odeopts.stepsizefixed) - odeopts.MaxStep = abs (trange(end) - trange(1)) / 10; + strcmp (odeopts.NormControl, + "on")); endif - odeopts.haveeventfunction = ! isempty (odeopts.Events); - - ## The options 'Jacobian', 'JPattern' and 'Vectorized' will be ignored - ## by this solver because this solver uses an explicit Runge-Kutta method - ## and therefore no Jacobian calculation is necessary - if (! isempty (odeopts.Jacobian)) - warning ("Octave:invalid-input-arg", - "ode23: option \"Jacobian\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.JPattern)) - warning ("Octave:invalid-input-arg", - "ode23: option \"JPattern\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.Vectorized)) - warning ("Octave:invalid-input-arg", - "ode23: option \"Vectorized\" is ignored by this solver\n"); - endif if (! isempty (odeopts.Mass) && isnumeric (odeopts.Mass)) havemasshandle = false; @@ -284,75 +224,38 @@ havemasshandle = false; # mass = diag (ones (length (init), 1), 0); endif - massdependence = ! strcmp (odeopts.MStateDependence, "none"); - - ## Other options that are not used by this solver. - if (! isempty (odeopts.MvPattern)) - warning ("Octave:invalid-input-arg", - "ode23: option \"MvPattern\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.MassSingular)) - warning ("Octave:invalid-input-arg", - "ode23: option \"MassSingular\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.InitialSlope)) - warning ("Octave:invalid-input-arg", - "ode23: option \"InitialSlope\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.MaxOrder)) - warning ("Octave:invalid-input-arg", - "ode23: option \"MaxOrder\" is ignored by this solver\n"); - endif - - if (! isempty (odeopts.BDF)) - warning ("Octave:invalid-input-arg", - "ode23: option \"BDF\" is ignored by this solver\n"); - endif ## Starting the initialization of the core solver ode23 if (havemasshandle) # Handle only the dynamic mass matrix, - if (massdependence) # constant mass matrices have already + if (! strcmp (odeopts.MStateDependence, "none")) # constant mass matrices have already mass = @(t,x) odeopts.Mass (t, x, odeopts.funarguments{:}); fun = @(t,x) mass (t, x, odeopts.funarguments{:}) ... \ fun (t, x, odeopts.funarguments{:}); - else # if (massdependence == false) + else # if ((! strcmp (odeopts.MStateDependence, "none")) == false) mass = @(t) odeopts.Mass (t, odeopts.funarguments{:}); fun = @(t,x) mass (t, odeopts.funarguments{:}) ... \ fun (t, x, odeopts.funarguments{:}); endif endif - switch (integrate_func) - case "adaptive" - solution = integrate_adaptive (@runge_kutta_23, ... - order, fun, trange, init, odeopts); - case "n_steps" - solution = integrate_n_steps (@runge_kutta_23, ... - fun, trange(1), init, ... - TimeStepSize, TimeStepNumber, odeopts); - case "const" - solution = integrate_const (@runge_kutta_23, ... - fun, trange, init, ... - TimeStepSize, odeopts); - endswitch + + solution = integrate_adaptive (@runge_kutta_23, ... + order, fun, trange, init, odeopts); + ## Postprocessing, do whatever when terminating integration algorithm if (odeopts.haveoutputfunction) # Cleanup plotter feval (odeopts.OutputFcn, solution.t(end), ... solution.x(end,:)', "done", odeopts.funarguments{:}); endif - if (odeopts.haveeventfunction) # Cleanup event function handling + if (! isempty (odeopts.Events)) # Cleanup event function handling ode_event_handler (odeopts.Events, solution.t(end), ... - solution.x(end,:)', "done", odeopts.funarguments{:}); + solution.x(end,:)', "done", odeopts.funarguments{:}); endif ## Print additional information if option Stats is set if (strcmp (odeopts.Stats, "on")) - havestats = true; nsteps = solution.cntloop; # cntloop from 2..end nfailed = solution.cntcycles - nsteps; # cntcycl from 1..end nfevals = 3 * solution.cntcycles + 1; # number of ode evaluations @@ -365,8 +268,6 @@ printf ("Number of failed attempts: %d\n", nfailed); printf ("Number of function calls: %d\n", nfevals); endif - else - havestats = false; endif if (nargout == 2) @@ -376,12 +277,12 @@ varargout{1}.x = solution.t; # Time stamps are saved in field x varargout{1}.y = solution.x; # Results are saved in field y varargout{1}.solver = solver; # Solver name is saved in field solver - if (odeopts.haveeventfunction) + if (! isempty (odeopts.Events)) varargout{1}.ie = solution.event{2}; # Index info which event occurred varargout{1}.xe = solution.event{3}; # Time info when an event occurred varargout{1}.ye = solution.event{4}; # Results when an event occurred endif - if (havestats) + if (strcmp (odeopts.Stats, "on")) varargout{1}.stats = struct (); varargout{1}.stats.nsteps = nsteps; varargout{1}.stats.nfailed = nfailed; @@ -394,7 +295,7 @@ varargout = cell (1,5); varargout{1} = solution.t; varargout{2} = solution.x; - if (odeopts.haveeventfunction) + if (! isempty (odeopts.Events)) varargout{3} = solution.event{3}; # Time info when an event occurred varargout{4} = solution.event{4}; # Results when an event occurred varargout{5} = solution.event{2}; # Index info which event occurred @@ -489,10 +390,6 @@ %! opt = odeset; %! [t, y] = ode23 (@fpol, [0 2], [2 0], opt, 12, 13, "KL"); %! assert ([t(end), y(end,:)], [2, fref], 1e-2); -%!test # Solve vdp in fixed step sizes -%! opt = odeset("TimeStepSize",0.1); -%! [t, y] = ode23 (@fpol, [0,2], [2 0], opt); -%! assert (t(:), [0:0.1:2]', 1e-3); %!test # Solve another anonymous function below zero %! ref = [0, 14.77810590694212]; %! [t, y] = ode23 (@(t,y) y, [-2 0], 2); @@ -612,7 +509,4 @@ %! ode23 (@fpol, [0 25], [3 15 1; 3 15 1]); %!error <FUN must be a valid function handle> %! ode23 (1, [0 25], [3 15 1]); -%!error # strange ODEOPT structure -%! opt = struct ("foo", 1); -%! [t, y] = ode23 (@fpol, [0 2], [2 0], opt);
--- a/scripts/ode/ode45.m Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/ode45.m Thu Oct 06 07:36:59 2016 +0200 @@ -1,3 +1,4 @@ +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> ## Copyright (C) 2014-2016 Jacopo Corno <jacopo.corno@gmail.com> ## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> ## Copyright (C) 2006-2012 Thomas Treichl <treichl@users.sourceforge.net> @@ -21,7 +22,6 @@ ## -*- texinfo -*- ## @deftypefn {} {[@var{t}, @var{y}] =} ode45 (@var{fun}, @var{trange}, @var{init}) ## @deftypefnx {} {[@var{t}, @var{y}] =} ode45 (@var{fun}, @var{trange}, @var{init}, @var{ode_opt}) -## @deftypefnx {} {[@var{t}, @var{y}] =} ode45 (@dots{}, @var{par1}, @var{par2}, @dots{}) ## @deftypefnx {} {[@var{t}, @var{y}, @var{te}, @var{ye}, @var{ie}] =} ode45 (@dots{}) ## @deftypefnx {} {@var{solution} =} ode45 (@dots{}) ## @@ -37,16 +37,12 @@ ## evaluated. Typically, it is a two-element vector specifying the initial and ## final times (@code{[tinit, tfinal]}). If there are more than two elements ## then the solution will also be evaluated at these intermediate time -## instances unless the integrate function specified is -## @code{integrate_n_steps}. +## instances. ## ## By default, @code{ode45} uses an adaptive timestep with the ## @code{integrate_adaptive} algorithm. The tolerance for the timestep -## computation may be changed by using the option @qcode{"Tau"}, that has a -## default value of @math{1e-6}. If the ODE option @qcode{"TimeStepSize"} is -## not empty, then the stepper called will be @code{integrate_const}. If, in -## addition, the option @qcode{"TimeStepNumber"} is also specified then the -## integrate function @code{integrate_n_steps} will be used. +## computation may be changed by using the options @qcode{"RelTol"}, +## and @qcode{"AbsTol"}. ## ## @var{init} contains the initial value for the unknowns. If it is a row ## vector then the solution @var{y} will be a matrix in which each column is @@ -89,25 +85,25 @@ print_usage (); endif - order = 5; # runge_kutta_45_dorpri uses local extrapolation + order = 5; # runge_kutta_45_dorpri uses local extrapolation solver = "ode45"; if (nargin >= 4) if (! isstruct (varargin{1})) ## varargin{1:len} are parameters for fun odeopts = odeset (); - odeopts.funarguments = varargin; + funarguments = varargin; elseif (length (varargin) > 1) - ## varargin{1} is an ODE options structure vopt - odeopts = ode_struct_value_check ("ode45", varargin{1}, "ode45"); - odeopts.funarguments = {varargin{2:length(varargin)}}; + ## varargin{1} is an ODE options structure opt + odeopts = varargin{1}; + funarguments = {varargin{2:length(varargin)}}; else # if (isstruct (varargin{1})) - odeopts = ode_struct_value_check ("ode45", varargin{1}, "ode45"); - odeopts.funarguments = {}; + odeopts = varargin{1}; + funarguments = {}; endif else # nargin == 3 odeopts = odeset (); - odeopts.funarguments = {}; + funarguments = {}; endif if (! isnumeric (trange) || ! isvector (trange)) @@ -115,17 +111,15 @@ "ode45: TRANGE must be a numeric vector"); endif - TimeStepNumber = odeget (odeopts, "TimeStepNumber", [], "fast"); - TimeStepSize = odeget (odeopts, "TimeStepSize", [], "fast"); - if (length (trange) < 2 - && (isempty (TimeStepSize) || isempty (TimeStepNumber))) + + if (length (trange) < 2) error ("Octave:invalid-input-arg", "ode45: TRANGE must contain at least 2 elements"); elseif (trange(1) == trange(2)) error ("Octave:invalid-input-arg", "ode45: invalid time span, TRANGE(1) == TRANGE(2)"); else - odeopts.direction = sign (trange(2) - trange(1)); + direction = sign (trange(2) - trange(1)); endif trange = trange(:); @@ -147,54 +141,33 @@ "ode45: FUN must be a valid function handle"); endif + ## Start preprocessing, have a look which options are set in odeopts, ## check if an invalid or unused option is set - if (isempty (TimeStepNumber) && isempty (TimeStepSize)) - integrate_func = "adaptive"; - odeopts.stepsizefixed = false; - elseif (! isempty (TimeStepNumber) && ! isempty (TimeStepSize)) - integrate_func = "n_steps"; - odeopts.stepsizefixed = true; - if (sign (TimeStepSize) != odeopts.direction) - warning ("Octave:invalid-input-arg", - ["ode45: option 'TimeStepSize' has the wrong sign, ", ... - "but will be corrected automatically\n"]); - TimeStepSize = -TimeStepSize; - endif - elseif (isempty (TimeStepNumber) && ! isempty (TimeStepSize)) - integrate_func = "const"; - odeopts.stepsizefixed = true; - if (sign (TimeStepSize) != odeopts.direction) - warning ("Octave:invalid-input-arg", - ["ode45: option 'TimeStepSize' has the wrong sign, ", - "but will be corrected automatically\n"]); - TimeStepSize = -TimeStepSize; - endif - else - warning ("Octave:invalid-input-arg", - "ode45: assuming an adaptive integrate function\n"); - integrate_func = "adaptive"; - endif + + persistent defaults = []; + persistent classes = []; + persistent attributes = []; + + + [defaults, classes, attributes] = odedefaults (numel (init), trange(1), + trange(end)); - if (isempty (odeopts.RelTol) && ! odeopts.stepsizefixed) - odeopts.RelTol = 1e-3; - elseif (! isempty (odeopts.RelTol) && odeopts.stepsizefixed) - warning ("Octave:invalid-input-arg", - ["ode45: option 'RelTol' is ignored", ... - " when fixed time stamps are given\n"]); - endif + defaults = odeset (defaults, 'Refine', 4); + defaults = rmfield (defaults, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); + classes = rmfield (classes, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); + attributes = rmfield (attributes, {"Jacobian", "JPattern", "Vectorized", ... + "MvPattern", "MassSingular", ... + "InitialSlope", "MaxOrder", "BDF"}); - if (isempty (odeopts.AbsTol) && ! odeopts.stepsizefixed) - odeopts.AbsTol = 1e-6; - elseif (! isempty (odeopts.AbsTol) && odeopts.stepsizefixed) - warning ("Octave:invalid-input-arg", - ["ode45: option 'AbsTol' is ignored", ... - " when fixed time stamps are given\n"]); - else - odeopts.AbsTol = odeopts.AbsTol(:); # Create column vector - endif + odeopts = odemergeopts (odeopts, defaults, classes, attributes, 'ode45'); - odeopts.normcontrol = strcmp (odeopts.NormControl, "on"); + odeopts.funarguments = funarguments; + odeopts.direction = direction; if (! isempty (odeopts.NonNegative)) if (isempty (odeopts.Mass)) @@ -216,48 +189,15 @@ odeopts.haveoutputfunction = ! isempty (odeopts.OutputFcn); endif - odeopts.haveoutputselection = ! isempty (odeopts.OutputSel); - - if (odeopts.Refine > 0) - odeopts.haverefine = true; - else - odeopts.haverefine = false; - endif - - if (isempty (odeopts.InitialStep) && strcmp (integrate_func, "adaptive")) - odeopts.InitialStep = ... - odeopts.direction * starting_stepsize (order, fun, trange(1), - init, - odeopts.AbsTol, - odeopts.RelTol, - odeopts.normcontrol); - elseif (isempty (odeopts.InitialStep)) - odeopts.InitialStep = TimeStepSize; - endif + if (isempty (odeopts.InitialStep)) + odeopts.InitialStep = odeopts.direction * ... + starting_stepsize (order, fun, trange(1), + init, odeopts.AbsTol, + odeopts.RelTol, + strcmp (odeopts.NormControl, + "on")); + endif - if (isempty (odeopts.MaxStep) && ! odeopts.stepsizefixed) - odeopts.MaxStep = abs (trange(end) - trange(1)) / 10; - endif - - odeopts.haveeventfunction = ! isempty (odeopts.Events); - - ## The options "Jacobian", "JPattern" and "Vectorized" will be ignored - ## by this solver because this solver uses an explicit Runge-Kutta method - ## and therefore no Jacobian calculation is necessary. - if (! isempty (odeopts.Jacobian)) - warning ("Octave:invalid-input-arg", - "ode45: option 'Jacobian' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.JPattern)) - warning ("Octave:invalid-input-arg", - "ode45: option 'JPattern' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.Vectorized)) - warning ("Octave:invalid-input-arg", - "ode45: option 'Vectorized' is ignored by this solver\n"); - endif if (! isempty (odeopts.Mass) && isnumeric (odeopts.Mass)) havemasshandle = false; @@ -268,76 +208,38 @@ havemasshandle = false; # mass = diag (ones (length (init), 1), 0); endif - massdependence = ! strcmp (odeopts.MStateDependence, "none"); - - ## Other options that are not used by this solver. - if (! isempty (odeopts.MvPattern)) - warning ("Octave:invalid-input-arg", - "ode45: option 'MvPattern' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.MassSingular)) - warning ("Octave:invalid-input-arg", - "ode45: option 'MassSingular' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.InitialSlope)) - warning ("Octave:invalid-input-arg", - "ode45: option 'InitialSlope' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.MaxOrder)) - warning ("Octave:invalid-input-arg", - "ode45: option 'MaxOrder' is ignored by this solver\n"); - endif - - if (! isempty (odeopts.BDF)) - warning ("Octave:invalid-input-arg", - "ode45: option 'BDF' is ignored by this solver\n"); - endif ## Starting the initialization of the core solver ode45 if (havemasshandle) # Handle only the dynamic mass matrix, - if (massdependence) # constant mass matrices have already + if (! strcmp (odeopts.MStateDependence, "none")) # constant mass matrices have already mass = @(t,x) odeopts.Mass (t, x, odeopts.funarguments{:}); fun = @(t,x) mass (t, x, odeopts.funarguments{:}) ... \ fun (t, x, odeopts.funarguments{:}); - else # if (massdependence == false) + else # if ((! strcmp (odeopts.MStateDependence, "none")) == false) mass = @(t) odeopts.Mass (t, odeopts.funarguments{:}); fun = @(t,x) mass (t, odeopts.funarguments{:}) ... \ fun (t, x, odeopts.funarguments{:}); endif endif - switch (integrate_func) - case "adaptive" - solution = integrate_adaptive (@runge_kutta_45_dorpri, - order, fun, trange, init, odeopts); - case "n_steps" - solution = integrate_n_steps (@runge_kutta_45_dorpri, - fun, trange(1), init, - TimeStepSize, TimeStepNumber, odeopts); - case "const" - solution = integrate_const (@runge_kutta_45_dorpri, - fun, trange, init, - TimeStepSize, odeopts); - endswitch + + solution = integrate_adaptive (@runge_kutta_45_dorpri, + order, fun, trange, init, odeopts); + ## Postprocessing, do whatever when terminating integration algorithm if (odeopts.haveoutputfunction) # Cleanup plotter - feval (odeopts.OutputFcn, solution.t(end), + feval (odeopts.OutputFcn, solution.t(end), ... solution.x(end,:)', "done", odeopts.funarguments{:}); endif - if (odeopts.haveeventfunction) # Cleanup event function handling - ode_event_handler (odeopts.Events, solution.t(end), - solution.x(end,:)', "done", - odeopts.funarguments{:}); + if (! isempty (odeopts.Events)) # Cleanup event function handling + ode_event_handler (odeopts.Events, solution.t(end), ... + solution.x(end,:)', "done", odeopts.funarguments{:}); endif ## Print additional information if option Stats is set if (strcmp (odeopts.Stats, "on")) - havestats = true; nsteps = solution.cntloop; # cntloop from 2..end nfailed = solution.cntcycles - nsteps; # cntcycl from 1..end nfevals = 6 * solution.cntcycles + 1; # number of ode evaluations @@ -350,8 +252,6 @@ printf ("Number of failed attempts: %d\n", nfailed); printf ("Number of function calls: %d\n", nfevals); endif - else - havestats = false; endif if (nargout == 2) @@ -361,12 +261,12 @@ varargout{1}.x = solution.t; # Time stamps are saved in field x varargout{1}.y = solution.x; # Results are saved in field y varargout{1}.solver = solver; # Solver name is saved in field solver - if (odeopts.haveeventfunction) + if (! isempty (odeopts.Events)) varargout{1}.ie = solution.event{2}; # Index info which event occurred varargout{1}.xe = solution.event{3}; # Time info when an event occurred varargout{1}.ye = solution.event{4}; # Results when an event occurred endif - if (havestats) + if (strcmp (odeopts.Stats, "on")) varargout{1}.stats = struct (); varargout{1}.stats.nsteps = nsteps; varargout{1}.stats.nfailed = nfailed; @@ -379,7 +279,7 @@ varargout = cell (1,5); varargout{1} = solution.t; varargout{2} = solution.x; - if (odeopts.haveeventfunction) + if (! isempty (odeopts.Events)) varargout{3} = solution.event{3}; # Time info when an event occurred varargout{4} = solution.event{4}; # Results when an event occurred varargout{5} = solution.event{2}; # Index info which event occurred @@ -480,10 +380,6 @@ %! opt = odeset; %! [t, y] = ode45 (@fpol, [0 2], [2 0], opt, 12, 13, "KL"); %! assert ([t(end), y(end,:)], [2, fref], 1e-2); -%!test # Solve vdp in fixed step sizes -%! opt = odeset("TimeStepSize", 0.1); -%! [t, y] = ode45 (@fpol, [0,2], [2 0], opt); -%! assert (t(:), [0:0.1:2]', 1e-2); %!test # Solve another anonymous function below zero %! vref = [0, 14.77810590694212]; %! [t, y] = ode45 (@(t,y) y, [-2 0], 2); @@ -609,7 +505,4 @@ %! ode45 (@fpol, [0 25], [3 15 1; 3 15 1]); %!error <FUN must be a valid function handle> %! ode45 (1, [0 25], [3 15 1]); -%!error # strange ODEOPT structure -%! opt = struct ("foo", 1); -%! [t, y] = ode45 (@fpol, [0 2], [2 0], opt);
--- a/scripts/ode/odeget.m Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/odeget.m Thu Oct 06 07:36:59 2016 +0200 @@ -1,3 +1,5 @@ +## Copyright (C) 2016, Carlo de Falco +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> ## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> ## Copyright (C) 2006-2012 Thomas Treichl <treichl@users.sourceforge.net> ## @@ -39,79 +41,19 @@ function val = odeget (ode_opt, field, default = [], opt = "") - ## Shortcut for quickly extracting option - if (strncmp (opt, "fast", 4)) - try - val = ode_opt.(field); - if (strcmp (opt, "fast_not_empty") && isempty (val)) - val = default; - endif - catch - val = default; - end_try_catch - return; - endif - - if (nargin < 1 || nargin > 4) - print_usage (); - endif - - ## Shortcut for empty option structures - if (isempty (ode_opt)) - if (nargin < 3) - val = []; - else + validateattributes (ode_opt, {'struct'}, {'nonempty'}); + validateattributes (field, {'char'}, {'nonempty'}); + + if (! isfield (ode_opt, field)) + error ('Octave:odeget:InvalidPropName', + 'odeget: Unrecognized property name "%s".', field); + else + val = ode_opt.(field); + if (isempty (val)) val = default; endif - return; endif - - if (! isstruct (ode_opt)) - error ("odeget: ODE_OPT must be a valid ODE_STRUCT"); - elseif (! ischar (field)) - error ("odeget: FIELD must be a string"); - endif - - ## Check if the given struct is a valid ODEOPT struct - ode_struct_value_check ("odeget", ode_opt); - - ## Define all the possible ODEOPT fields - persistent options = known_option_names (); - - exactmatch = true; - match = find (strcmpi (field, options)); - if (isempty (match)) - match = find (strncmpi (field, options, length (field))); - exactmatch = false; - endif - - if (isempty (match)) - ## Possibly a custom user-defined option - try - val = ode_opt.(field); - catch - warning ("Octave:invalid-input-arg", - "odeget: no field '%s' exists in ODE_OPT\n", field); - val = default; - end_try_catch - elseif (numel (match) == 1) - if (! exactmatch) - warning ("odeget:NoExactMatching", - "odeget: no exact match for '%s'. Assuming '%s'.\n", - field, options{match}); - endif - val = []; - try - val = ode_opt.(options{match}); - end_try_catch - if (isempty (val)) - val = default; - endif - else - error ("odeget: no exact match for '%s'. Possible fields found: %s.", - field, strjoin (options(match), ", ")); - endif - + endfunction @@ -129,16 +71,14 @@ %!assert (odeget (odeset (), "Stats"), []) %!assert (odeget (odeset (), "Stats", "on"), "on") %!assert (odeget (odeset (), "Mass"), []) -%!assert (odeget (odeset (), "AbsTol", 1e-6, "fast"), []) -%!assert (odeget (odeset (), "AbsTol", 1e-6, "fast_not_empty"), 1e-6) %!assert (odeget (odeset (), "AbsTol", 1e-9), 1e-9) +%!assert (odeget (odeset ("AbsTol", 1e-9), "AbsTol", []), 1e-9) +%!assert (odeget (odeset ('foo', 42), 'foo'), 42) %!error odeget () %!error odeget (1) %!error odeget (1,2,3,4,5) -%!error <ODE_OPT must be a valid ODE_STRUCT> odeget (1, "opt1") -%!error <FIELD must be a string> odeget (struct ("opt1", 1), 1) -%!warning <no field 'foo' exists> odeget (struct ("opt1", 1), "foo"); -%!warning <no exact match for 'Rel'. Assuming 'RelTol'> odeget (struct ("RelTol", 1), "Rel"); -%!error <Possible fields found: InitialSlope, InitialStep> odeget (odeset (), "Initial") +%!error odeget (1, "opt1") +%!error odeget (struct ("opt1", 1), 1) +%!error odeget (struct ("opt1", 1), "foo");
--- a/scripts/ode/odeset.m Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/odeset.m Thu Oct 06 07:36:59 2016 +0200 @@ -1,3 +1,5 @@ +## Copyright (C) 2016, Carlo de Falco +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> ## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> ## Copyright (C) 2006-2012 Thomas Treichl <treichl@users.sourceforge.net> ## @@ -47,168 +49,59 @@ function odestruct = odeset (varargin) - ## Column vector of all possible ODE options - persistent options = known_option_names (); + persistent p; + + if (isempty (p)) - if (nargin == 0) - ## Special calling syntax to display defaults - if (nargout == 0) - print_options (); - else - odestruct = cell2struct (cell (numel (options), 1), options); - endif - return; + p = inputParser (); + p.addParameter ("AbsTol", []); + p.addParameter ("BDF", []); + p.addParameter ("Events", []); + p.addParameter ("InitialSlope", []); + p.addParameter ("InitialStep", []); + p.addParameter ("Jacobian", []); + p.addParameter ("JConstant", []); + p.addParameter ("JPattern", []); + p.addParameter ("Mass", []); + p.addParameter ("MassConstant", []); + p.addParameter ("MassSingular", []); + p.addParameter ("MaxOrder", []); + p.addParameter ("MaxStep", []); + p.addParameter ("MStateDependence", []); + p.addParameter ("MvPattern", []); + p.addParameter ("NonNegative", []); + p.addParameter ("NormControl", []); + p.addParameter ("OutputFcn", []); + p.addParameter ("OutputSel", []); + p.addParameter ("Refine", []); + p.addParameter ("RelTol", []); + p.addParameter ("Stats", []); + p.addParameter ("Vectorized", []); + p.KeepUnmatched = true; + endif - ## initialize output - odestruct = cell2struct (cell (numel (options), 1), options); - - if (isstruct (varargin{1})) - oldstruct = varargin{1}; - - ## Copy oldstruct values into output odestruct - for [val, name] = oldstruct - - exactmatch = true; - match = find (strcmpi (name, options)); - if (isempty (match)) - match = find (strncmpi (name, options, length (name))); - exactmatch = false; - endif - - if (isempty (match)) - odestruct.(name) = val; - elseif (numel (match) == 1) - if (! exactmatch) - warning ("odeset:NoExactMatching", - "no exact match for '%s'. Assuming '%s'.", - name, options{match}); - endif - odestruct.(options{match}) = val; - else - error ("odeset: no exact match for '%s'. Possible fields found: %s.", - name, strjoin (options(match), ", ")); - endif - - if (nargin == 1) - ## Check if all changes have resulted in a valid ODEOPT struct - ode_struct_value_check ("odeset", odestruct); - return; - endif + if (nargin == 0 && nargout == 0) + print_options (); + else + p.parse (varargin{:}); + odestruct = p.Results; + odestruct_extra = p.Unmatched; - endfor - - ## At this point, odestruct has been initialized with default values, - ## and if oldstruct was present it has overwritten fields in odestruct. - - if (nargin == 2 && isstruct (varargin{2})) - newstruct = varargin{2}; - - ## Update the first struct with the values from the second one - for [val, name] = newstruct - - exactmatch = true; - match = find (strcmpi (name, options)); - if (isempty (match)) - match = find (strncmpi (name, options, length (name))); - exactmatch = false; - endif - - if (isempty (match)) - odestruct.(name) = val; - elseif (numel (match) == 1) - if (! exactmatch) - warning ("odeset:NoExactMatching", - "no exact match for '%s'. Assuming '%s'.", - name, options{match}); - endif - odestruct.(options{match}) = val; - else - error ("odeset: no exact match for '%s'. Possible fields found: %s.", - name, strjoin (options(match), ", ")); - endif - endfor - - ## Check if all changes have resulted in a valid ODEOPT struct - ode_struct_value_check ("odeset", odestruct); - return; - endif + s1 = cellfun (@(x) ifelse (iscell(x), {x}, x), + struct2cell(odestruct), + 'UniformOutput', false); - ## Second argument is not a struct - if (mod (nargin, 2) != 1) - error ("odeset: FIELD/VALUE arguments must occur in pairs"); - endif - if (! all (cellfun ("isclass", varargin(2:2:end), "char"))) - error ("odeset: All FIELD names must be strings"); - endif - - ## Write new field/value pairs into odestruct - for i = 2:2:nargin - name = varargin{i}; - - exactmatch = true; - match = find (strcmpi (name, options)); - if (isempty (match)) - match = find (strncmpi (name, options, length (name))); - exactmatch = false; - endif - - if (isempty (match)) - odestruct.(name) = varargin{i+1}; - elseif (numel (match) == 1) - if (! exactmatch) - warning ("odeset:NoExactMatching", - "no exact match for '%s'. Assuming '%s'.", - name, options{match}); - endif - odestruct.(options{match}) = varargin{i+1}; - else - error ("odeset: no exact match for '%s'. Possible fields found: %s.", - name, strjoin (options(match), ", ")); - endif - endfor - - ## Check if all changes have resulted in a valid ODEOPT struct - ode_struct_value_check ("odeset", odestruct); - - else - ## First input argument was not a struct, must be field/value pairs - if (mod (nargin, 2) != 0) - error ("odeset: FIELD/VALUE arguments must occur in pairs"); - elseif (! all (cellfun ("isclass", varargin(1:2:end), "char"))) - error ("odeset: All FIELD names must be strings"); - endif - - for i = 1:2:nargin - name = varargin{i}; - - exactmatch = true; - match = find (strcmpi (name, options)); - if (isempty (match)) - match = find (strncmpi (name, options, length (name))); - exactmatch = false; - endif - - if (isempty (match)) - odestruct.(name) = varargin{i+1}; - elseif (numel (match) == 1) - if (! exactmatch) - warning ("odeset:NoExactMatching", - "no exact match for '%s'. Assuming '%s'.", - name, options{match}); - endif - odestruct.(options{match}) = varargin{i+1}; - else - error ("odeset: no exact match for '%s'. Possible fields found: %s.", - name, strjoin (options(match), ", ")); - endif - endfor - - ## Check if all changes have resulted in a valid ODEOPT struct - ode_struct_value_check ("odeset", odestruct); - + s2 = cellfun (@(x) ifelse (iscell(x), {x}, x), + struct2cell(odestruct_extra), + 'UniformOutput', false); + + C = [fieldnames(odestruct) s1; + fieldnames(odestruct_extra) s2]; + + odestruct = struct (C'{:}); endif - + endfunction ## function to print all possible options @@ -262,11 +155,7 @@ %! odeoptB = odeset ("AbsTol", 1e-2, "RelTol", 1e-1); %! odeoptC = odeset (odeoptB, "NormControl", "on"); -## All tests that are needed to check if a valid option has been set are -## implemented in ode_struct_value_check.m -## FIXME: xtest currently fails as there are two extra options to control -## fixed step integration options. -%!xtest +%!test %! odeoptA = odeset (); %! assert (isstruct (odeoptA)); %! assert (numfields (odeoptA), 23); @@ -298,10 +187,13 @@ %! end_unwind_protect ## Test input validation -%!error <FIELD/VALUE arguments must occur in pairs> odeset ("opt1") -%!error <FIELD names must be strings> odeset (1, 1) -%!error <FIELD/VALUE arguments must occur in pairs> odeset (odeset (), "opt1") -%!error <FIELD names must be strings> odeset (odeset (), 1, 1) -%!warning <no exact match for 'Rel'. Assuming 'RelTol'> odeset ("Rel", 1); -%!error <Possible fields found: InitialSlope, InitialStep> odeset ("Initial", 1) +%!error <argument 'OPT1' is not a valid parameter> odeset ("opt1") +%!error odeset (1, 1) +%!error <argument 'OPT1' is not a valid parameter> odeset (odeset (), "opt1") +%!error odeset (odeset (), 1, 1) +##FIXME: Add not exact match option +## %!warning <no exact match for 'Rel'. Assuming 'RelTol'> odeset ("Rel", 1); +## %!error <Possible fields found: InitialSlope, InitialStep> odeset ("Initial", 1) + +
--- a/scripts/ode/private/integrate_adaptive.m Mon Oct 03 19:24:23 2016 +0100 +++ b/scripts/ode/private/integrate_adaptive.m Thu Oct 06 07:36:59 2016 +0200 @@ -62,7 +62,7 @@ ## ## @end deftypefn ## -## @seealso{integrate_const, integrate_n_steps} +## @seealso{ode45, ode23} function solution = integrate_adaptive (stepper, order, func, tspan, x0, options) @@ -76,7 +76,7 @@ dt = odeget (options, "InitialStep", [], "fast"); if (isempty (dt)) dt = starting_stepsize (order, func, t, x, options.AbsTol, options.RelTol, - options.normcontrol); + strcmp (options.NormControl, "on")); endif dir = odeget (options, "direction", [], "fast"); @@ -91,7 +91,7 @@ ## Initialize the OutputFcn if (options.haveoutputfunction) - if (options.haveoutputselection) + if (! isempty (options.OutputSel)) solution.retout = x(options.OutputSel,end); else solution.retout = x; @@ -101,7 +101,7 @@ endif ## Initialize the EventFcn - if (options.haveeventfunction) + if (! isempty (options.Events)) ode_event_handler (options.Events, tspan(end), x, "init", options.funarguments{:}); endif @@ -134,7 +134,7 @@ endif err = AbsRel_Norm (x_new, x_old, options.AbsTol, options.RelTol, - options.normcontrol, x_est); + strcmp (options.NormControl, "on"), x_est); ## Accept solution only if err <= 1.0 if (err <= 1) @@ -161,7 +161,7 @@ ## Call Events function only if a valid result has been found. ## Stop integration if eventbreak is true. - if (options.haveeventfunction) + if (! isempty (options.Events)) break_loop = false; for idenseout = 1:numel (t_caught) id = t_caught(idenseout); @@ -192,7 +192,7 @@ approxvals = interp1 ([t_old, t(t_caught), t_new], [x_old, x(:, t_caught), x_new] .', approxtime, 'linear') .'; - if (options.haveoutputselection) + if (! isempty (options.OutputSel)) approxvals = approxvals(options.OutputSel, :); endif for ii = 1:numel (approxtime) @@ -216,7 +216,7 @@ ## Call Events function only if a valid result has been found. ## Stop integration if eventbreak is true. - if (options.haveeventfunction) + if (! isempty (options.Events)) solution.event = ... ode_event_handler (options.Events, t(istep), x(:, istep), [], options.funarguments{:}); @@ -236,7 +236,7 @@ approxvals = interp1 ([t_old, t_new], [x_old, x_new] .', approxtime, 'linear') .'; - if (options.haveoutputselection) + if (! isempty (options.OutputSel)) approxvals = approxvals(options.OutputSel, :); endif for ii = 1:numel (approxtime)
--- a/scripts/ode/private/integrate_const.m Mon Oct 03 19:24:23 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,284 +0,0 @@ -## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {} {@var{solution} =} integrate_const (@var{@@stepper}, @var{@@func}, @var{tspan}, @var{x0}, @var{dt}, @var{options}) -## -## This function file can be called by an ODE solver function in order to -## integrate the set of ODEs on the interval @var{[t0,t1]} with a constant -## timestep @var{dt}. -## -## The function returns a structure @var{solution} with two fieldss: @var{t} -## and @var{y}. @var{t} is a column vector and contains the time stamps. -## @var{y} is a matrix in which each column refers to a different unknown -## of the problem and the row number is the same as the @var{t} row number. -## Thus, each row of the matrix @var{y} contains the values of all unknowns at -## the time value contained in the corresponding row in @var{t}. -## -## The first input argument must be a function handle or inline function -## representing the stepper, i.e., the function responsible for step-by-step -## integration. This function discriminates one method from the others. -## -## The second input argument is the order of the stepper. It is needed to -## compute the adaptive timesteps. -## -## The third input argument is a function handle or inline function that -## defines the ODE: -## -## @ifhtml -## -## @example -## @math{y' = f(t,y)} -## @end example -## -## @end ifhtml -## @ifnothtml -## @math{y' = f(t,y)}. -## @end ifnothtml -## -## The fourth input argument is the time vector which defines the integration -## interval, i.e., @var{[tspan(1), tspan(end)]} and all intermediate elements -## are taken as times at which the solution is required. -## -## The fourth argument contains the initial conditions for the ODEs. -## -## The fifth input argument represents the fixed timestep and the last input -## argument contains some options that may be needed for the stepper. -## @end deftypefn -## -## @seealso{integrate_adaptive, integrate_n_steps} - -function solution = integrate_const (stepper, func, tspan, x0, dt, options) - - solution = struct (); - - ## first values for time and solution - t = tspan(1); - x = x0(:); - - direction = odeget (options, "direction", [], "fast"); - if (sign (dt) != direction) - error ("Octave:invalid-input-arg", - "option 'InitialStep' has a wrong sign"); - endif - - ## setting parameters - k = length (tspan); - counter = 2; - comp = 0.0; - tk = tspan(1); - options.comp = comp; - - ## Initialize the OutputFcn - if (options.haveoutputfunction) - if (options.haveoutputselection) - solution.retout = x(options.OutputSel,end); - else - solution.retout = x; - endif - feval (options.OutputFcn, tspan, solution.retout, "init", - options.funarguments{:}); - endif - - ## Initialize the EventFcn - if (options.haveeventfunction) - ode_event_handler (options.Events, t(end), x, "init", - options.funarguments{:}); - endif - - solution.cntloop = 2; - solution.cntcycles = 1; - cntiter = 0; - solution.unhandledtermination = true; - solution.cntsave = 2; - - z = t; - u = x; - k_vals = feval (func, t , x, options.funarguments{:}); - - while (counter <= k) - ## computing the integration step from t to t+dt - [s, y, ~, k_vals] = stepper (func, z(end), u(:,end), dt, options, k_vals); - - [tk, comp] = kahan (tk,comp, dt); - options.comp = comp; - s(end) = tk; - - if (options.havenonnegative) - x(options.NonNegative,end) = abs (x(options.NonNegative,end)); - y(options.NonNegative,end) = abs (y(options.NonNegative,end)); - y_est(options.NonNegative,end) = abs (y_est(options.NonNegative,end)); - endif - - if (options.haveoutputfunction && options.haverefine) - SaveVUForRefine = u(:,end); - endif - - ## values on this interval for time and solution - z = [t(end);s]; - u = [x(:,end),y]; - - ## if next tspan value is caught, update counter - if ((z(end) == tspan(counter)) - || (abs (z(end) - tspan(counter)) / - (max (abs (z(end)), abs (tspan(counter)))) < 8*eps) ) - counter += 1; - - ## if there is an element in time vector at which the solution is required - ## the program must compute this solution before going on with next steps - elseif (direction * z(end) > direction * tspan(counter) ) - ## initializing counter for the following cycle - i = 2; - while (i <= length (z)) - - ## if next tspan value is caught, update counter - if ((counter <= k) - && (((z(i) == tspan(counter)) - || (abs (z(i) - tspan(counter)) / - (max (abs (z(i)), abs (tspan(counter)))) < 8*eps))) ) - counter += 1; - endif - ## else, loop until there are requested values inside this subinterval - while ((counter <= k) - && direction * z(i) > direction * tspan(counter) ) - ## add the interpolated value of the solution - u = [u(:,1:i-1),u(:,i-1) + (tspan(counter)-z(i-1))/(z(i)-z(i-1))* ... - (u(:,i)-u(:,i-1)),u(:,i:end)]; - ## add the time requested - z = [z(1:i-1);tspan(counter);z(i:end)]; - - ## update counters - counter += 1; - i += 1; - endwhile - - ## if new time requested is not out of this interval - if (counter <= k && direction * z(end) > direction * tspan(counter)) - ## update the counter - i += 1; - else - ## else, stop the cycle and go on with the next iteration - i = length (z)+1; - endif - - endwhile - endif - - x = [x,u(:,2:end)]; - t = [t;z(2:end)]; - solution.cntsave += 1; - solution.cntloop += 1; - cntiter = 0; - - ## Call OutputFcn only if a valid result has been found. - ## Stop integration if function returns false. - if (options.haveoutputfunction) - for cnt = 0:options.Refine # Approximation between told and t - if (options.haverefine) # Do interpolation - approxtime = (cnt + 1) / (options.Refine + 2); - approxvals = (1 - approxtime) * SaveVUForRefine ... - + (approxtime) * y(:,end); - approxtime = s(end) + approxtime*dt; - else - approxvals = x(:,end); - approxtime = t(end); - endif - if (options.haveoutputselection) - approxvals = approxvals(options.OutputSel); - endif - pltret = feval (options.OutputFcn, approxtime, approxvals, [], - options.funarguments{:}); - if (pltret) # Leave refinement loop - break; - endif - endfor - if (pltret) # Leave main loop - solution.unhandledtermination = false; - break; - endif - endif - - ## Call Events function only if a valid result has been found. - ## Stop integration if eventbreak is true. - if (options.haveeventfunction) - solution.event = ode_event_handler (options.Events, t(end), x(:,end), - [], options.funarguments{:}); - if (! isempty (solution.event{1}) && solution.event{1} == 1) - t(solution.cntloop-1,:) = solution.event{3}(end,:); - x(:,solution.cntloop-1) = solution.event{4}(end,:)'; - solution.unhandledtermination = false; - break; - endif - endif - - ## Update counters that count the number of iteration cycles - solution.cntcycles += 1; # Needed for cost statistics - cntiter += 1; # Needed to find iteration problems - - ## Stop solving because, in the last 5,000 steps, no successful valid - ## value has been found - if (cntiter >= 5_000) - error (["integrate_const: Solving was not successful. ", ... - " The iterative integration loop exited at time", ... - " t = %f before the endpoint at tend = %f was reached. ", ... - " This happened because the iterative integration loop", ... - " did not find a valid solution at this time stamp. ", ... - " Try to reduce the value of 'InitialStep' and/or", ... - " 'MaxStep' with the command 'odeset'."], - s(end), tspan(end)); - endif - - ## if this is the last iteration, save the length of last interval - if (counter > k) - j = length (z); - endif - - endwhile - - ## Check if integration of the ode has been successful - if (direction * z(end) < direction * tspan(end)) - if (solution.unhandledtermination == true) - error ("integrate_const:unexpected_termination", - [" Solving was not successful. ", ... - " The iterative integration loop exited at time", ... - " t = %f before the endpoint at tend = %f was reached. ", ... - " This may happen if the stepsize becomes too small. ", ... - " Try to reduce the value of 'InitialStep'", ... - " and/or 'MaxStep' with the command 'odeset'."], - z(end), tspan(end)); - else - warning ("integrate_const:unexpected_termination", - ["Solver was stopped by a call of 'break'", ... - " in the main iteration loop at time", ... - " t = %f before the endpoint at tend = %f was reached. ", ... - " This may happen because the @odeplot function", ... - " returned 'true' or the @event function returned 'true'."], - z(end), tspan(end)); - endif - endif - - ## compute how many values are out of time inerval - d = direction * t((end-(j-1)):end) > direction * tspan(end) * ones (j, 1); - f = sum (d); - - ## remove not-requested values of time and solution - solution.t = t(1:end-f); - solution.x = x(:,1:end-f)'; - -endfunction -
--- a/scripts/ode/private/integrate_n_steps.m Mon Oct 03 19:24:23 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,223 +0,0 @@ -## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {} {@var{solution} =} integrate_n_steps (@var{@@stepper}, @var{@@func}, @var{t0}, @var{x0}, @var{dt}, @var{n}, @var{options}) -## -## This function file can be called by an ODE solver function in order to -## integrate the set of ODEs on the interval @var{[t0,t0 + n*dt]} with a -## constant timestep dt and on a fixed number of steps. -## -## The function returns a structure @var{solution} with two fieldss: @var{t} -## and @var{y}. @var{t} is a column vector and contains the time stamps. -## @var{y} is a matrix in which each column refers to a different unknown -## of the problem and the row number is the same as the @var{t} row number. -## Thus, each row of the matrix @var{y} contains the values of all unknowns at -## the time value contained in the corresponding row in @var{t}. -## -## The first input argument must be a function handle or inline function -## representing the stepper, i.e., the function responsible for step-by-step -## integration. This function discriminates one method from the others. -## -## The second input argument is the order of the stepper. It is needed to -## compute the adaptive timesteps. -## -## The third input argument is a function handle or inline function that -## defines the ODE: -## -## @ifhtml -## -## @example -## @math{y' = f(t,y)} -## @end example -## -## @end ifhtml -## @ifnothtml -## @math{y' = f(t,y)}. -## @end ifnothtml -## -## The third input argument is the starting point for the integration. -## -## The fourth argument contains the initial conditions for the ODEs. -## -## The fifth input argument represents the fixed timestep while the sixth -## contains the number of integration steps. -## -## The last argument is a struct with the options that may be needed by the -## stepper. -## @end deftypefn -## -## @seealso{integrate_adaptive, integrate_const} - -function solution = integrate_n_steps (stepper, func, t0, x0, dt, n, options) - - solution = struct (); - - ## first values for time and solution - x = x0(:); - t = t0; - - direction = odeget (options, "direction", [], "fast"); - if (sign (dt) != direction) - error ("Octave:invalid-input-arg", "option 'InitialStep' has a wrong sign"); - endif - - comp = 0.0; - tk = t0; - options.comp = comp; - - ## Initialize the OutputFcn - if (options.haveoutputfunction) - if (options.haveoutputselection) - solution.retout = x(options.OutputSel,end); - else - solution.retout = x; - endif - feval (options.OutputFcn, tspan, solution.retout, "init", - options.funarguments{:}); - endif - - ## Initialize the EventFcn - if (options.haveeventfunction) - ode_event_handler (options.Events, t(end), x, "init", - options.funarguments{:}); - endif - - solution.cntloop = 2; - solution.cntcycles = 1; - cntiter = 0; - solution.unhandledtermination = true; - solution.cntsave = 2; - - z = t; - u = x; - k_vals = feval (func, t , x, options.funarguments{:}); - - for i = 1:n - ## Compute the integration step from t to t+dt - [s, y, ~, k_vals] = stepper (func, z(end), u(:,end), dt, options, k_vals); - - [tk, comp] = kahan (tk, comp, dt); - options.comp = comp; - s(end) = tk; - - if (options.havenonnegative) - x(options.NonNegative,end) = abs (x(options.NonNegative,end)); - y(options.NonNegative,end) = abs (y(options.NonNegative,end)); - endif - - if (options.haveoutputfunction && options.haverefine) - SaveVUForRefine = u(:,end); - endif - - ## values on this interval for time and solution - z = [t(end);s]; - u = [x(:,end),y]; - - x = [x,u(:,2:end)]; - t = [t;z(2:end)]; - solution.cntsave += 1; - solution.cntloop += 1; - cntiter = 0; - - ## Call OutputFcn only if a valid result has been found. - ## Stop integration if function returns false. - if (options.haveoutputfunction) - for cnt = 0:options.Refine # Approximation between told and t - if (options.haverefine) # Do interpolation - approxtime = (cnt + 1) / (options.Refine + 2); - approxvals = (1 - approxtime) * SaveVUForRefine ... - + (approxtime) * y(:,end); - approxtime = s(end) + approxtime*dt; - else - approxvals = x(:,end); - approxtime = t(end); - endif - if (options.haveoutputselection) - approxvals = approxvals(options.OutputSel); - endif - pltret = feval (options.OutputFcn, approxtime, approxvals, [], - options.funarguments{:}); - if (pltret) # Leave refinement loop - break; - endif - endfor - if (pltret) # Leave main loop - solution.unhandledtermination = false; - break; - endif - endif - - ## Call Events function only if a valid result has been found. - ## Stop integration if eventbreak is true. - if (options.haveeventfunction) - solution.event = ode_event_handler (options.Events, t(end), x(:,end), - [], options.funarguments{:}); - if (! isempty (solution.event{1}) && solution.event{1} == 1) - t(solution.cntloop-1,:) = solution.event{3}(end,:); - x(:,solution.cntloop-1) = solution.event{4}(end,:)'; - solution.unhandledtermination = false; - break; - endif - endif - - ## Update counters that count the number of iteration cycles - solution.cntcycles += 1; # Needed for cost statistics - cntiter += 1; # Needed to find iteration problems - - ## Stop solving because, in the last 5,000 steps, no successful valid - ## value has been found - if (cntiter >= 5_000) - error (["integrate_n_steps: Solving was not successful. ", ... - " The iterative integration loop exited at time", ... - " t = %f before the endpoint at tend = %f was reached. ", ... - " This happened because the iterative integration loop", ... - " did not find a valid solution at this time stamp. ", ... - " Try to reduce the value of 'InitialStep' and/or", ... - " 'MaxStep' with the command 'odeset'."], - s(end), tspan(end)); - endif - endfor - - ## Check if integration of the ode has been successful - #if (direction * z(end) < direction * tspan(end)) - # if (solution.unhandledtermination == true) - # error ("integrate_n_steps:unexpected_termination", - # [" Solving was not successful. ", ... - # " The iterative integration loop exited at time", ... - # " t = %f before the endpoint at tend = %f was reached. ", ... - # " This may happen if the stepsize becomes too small. ", ... - # " Try to reduce the value of 'InitialStep'", ... - # " and/or 'MaxStep' with the command 'odeset'."], - # z(end), tspan(end)); - # else - # warning ("integrate_n_steps:unexpected_termination", - # ["Solver was stopped by a call of 'break'", ... - # " in the main iteration loop at time", ... - # " t = %f before the endpoint at tend = %f was reached. ", ... - # " This may happen because the @odeplot function", ... - # " returned 'true' or the @event function returned 'true'."], - # z(end), tspan(end)); - # endif - #endif - - solution.t = t; - solution.x = x'; - -endfunction -
--- a/scripts/ode/private/ode_struct_value_check.m Mon Oct 03 19:24:23 2016 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,294 +0,0 @@ -## Copyright (C) 2013-2016 Roberto Porcu' <roberto.porcu@polimi.it> -## Copyright (C) 2006-2012 Thomas Treichl <treichl@users.sourceforge.net> -## -## This file is part of Octave. -## -## Octave is free software; you can redistribute it and/or modify it -## under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or (at -## your option) any later version. -## -## Octave is distributed in the hope that it will be useful, but -## WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -## General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with Octave; see the file COPYING. If not, see -## <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {} {} ode_struct_value_check (@var{"caller"}, @var{ode_struct}) -## @deftypefnx {} {} ode_struct_value_check (@var{"caller"), @var{ode_struct}, @var{"solver"}) -## @deftypefnx {} {@var{ode_struct} =} ode_struct_value_check (@dots{}) -## -## Validate the fields and values in the ODE options structure -## @var{ode_struct}. -## -## The first argument @var{caller} is a string with the name of the calling -## function so that warning and error messages properly display the source -## of any problems. -## -## The second argument @var{ode_struct} is a structure with fields and values -## that configure the ODE solvers (@pxref{XREFodeset,,odeset}). -## -## The optional third argument @var{"solver"} is a string with the name of a -## specific ODE solver. This extra information can enable more extensive value -## validation for certain options. -## -## The function does not modify any of the field names or field values, but -## terminates with an error if an invalid value is found. -## -## Normally the function is called with no output. However, the input struct -## is passed unmodified to the output for certain solvers which expect to -## receive the validated ODE structure returned. -## @end deftypefn -## -## @seealso{odeset, odeget} - -function ode_struct = ode_struct_value_check (caller, ode_struct, solver = "") - - for [val, opt] = ode_struct # Cycle over all fields - - switch (opt) - - case "AbsTol" - if (! isempty (val)) - if (! isnumeric (val) || ! isreal (val) - || ! isvector (val) || any (val <= 0)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "BDF" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "Events" - if (! isempty (val)) - if (! isa (val, "function_handle")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "InitialSlope" - if (! isempty (val)) - if (! ischar (val) - && (! isnumeric (val) || (! isvector (val) && ! isreal (val)))) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "InitialStep" - if (! isempty (val)) - if (! isnumeric (val) || ! isreal (val) || ! isscalar (val) - || val <= 0) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "Jacobian" - if (! isempty (val)) - if (! isnumeric (val)) - if (! isa (val, "function_handle") && ! iscell (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - endif - - case "JConstant" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "JPattern" - if (! isempty (val)) - if (! isnumeric (val) && ! isvector (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "Mass" - if (! isempty (val)) - if ((! isnumeric (val) || ! ismatrix (val)) - && ! isa (val, "function_handle")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MassConstant" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MassSingular" - if (! isempty (val)) - if (! any (strcmp (val, {"yes", "no", "maybe"}))) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MaxOrder" - if (! isempty (val)) - if (! isnumeric (val) - || val != fix (val) || val <= 0 || val >= 8) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MaxStep" - if (! isempty (val)) - if (! isnumeric (val) || ! isscalar (val) || val <= 0) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MStateDependence" - if (! isempty (val)) - if (! any (strcmp (val, {"none", "weak", "strong"}))) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "MvPattern" - if (! isempty (val)) - if (! isnumeric (val) && ! isvector (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "NonNegative" - if (! isempty (val)) - if (! isnumeric (val) || ! isvector (val) - || any (val <= 0) || any (val != fix (val))) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "NormControl" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "OutputFcn" - if (! isempty (val)) - if (! isa (val, "function_handle")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "OutputSel" - if (! isempty (val)) - if (! isnumeric (val) || ! isvector (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "Refine" - if (! isempty (val)) - if (! isnumeric (val) || ! isscalar (val) - || val != fix (val) || val < 0 || val > 5) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "RelTol" - if (! isempty (val)) - if (! isnumeric (val) || ! isreal (val) || any (val <= 0)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - if (any (strcmp (solver, {"ode23", "ode23d", "ode45", "ode45d", - "ode54", "ode54d", "ode78", "ode78d"}))) - if (! isscalar (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - endif - - case "Stats" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "Vectorized" - if (! isempty (val)) - if (! strcmp (val, "on") && ! strcmp (val, "off")) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "TimeStepSize" - if (! isempty (val)) - if (! isscalar (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - case "TimeStepNumber" - if (! isempty (val)) - if (! isscalar (val)) - error ("Octave:invalid-input-arg", - [caller ": invalid value assigned to field '%s'"], opt); - endif - endif - - otherwise - warning ("Octave:invalid-input-arg", - [caller ": unknown field '%s' in ODE options\n"], opt); - endswitch - endfor - -endfunction - - -%!demo -%! # Return the checked ODE options structure that is created by -%! # the command odeset. -%! -%! ode_struct_value_check (odeset); - -%!demo -%! # Create the ODE options structure A with odeset and check it -%! # with ode_struct_value_check. This actually is unnecessary -%! # because odeset automatically calls ode_struct_value_check before -%! # returning. -%! -%! A = odeset (); -%! ode_struct_value_check (A); -
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/ode/private/odedefaults.m Thu Oct 06 07:36:59 2016 +0200 @@ -0,0 +1,96 @@ +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +function [defaults, classes, attributes] = odedefaults (n, t0, tf) + +defaults = odeset ('AbsTol', 1e-6, + 'BDF', 'off', + 'Events', [], + 'InitialSlope', zeros(n,1), + 'InitialStep', [], + 'Jacobian', [], + 'JConstant', 'off', + 'JPattern', [], + 'Mass', [], + 'MassConstant', 'off', + 'MassSingular', 'maybe', + 'MaxOrder', 5, + 'MaxStep', 0.1*abs(t0-tf), + 'MStateDependence', 'weak', + 'MvPattern', [], + 'NonNegative', [], + 'NormControl', 'off', + 'OutputFcn', [], + 'OutputSel', [], + 'Refine', 1, + 'RelTol', 1e-3, + 'Stats', 'off', + 'Vectorized', 'off'); + +classes = odeset ('Abstol', {"float"}, + 'BDF', "char", + 'Events', {"function_handle"}, + 'InitialSlope', {"float"}, + 'InitialStep', {"float"}, + 'Jacobian', {"float", "function_handle", "cell"}, + 'JConstant', "char", + 'JPattern', {"float"}, + 'Mass', {"float", "function_handle"}, + 'MassConstant', "char", + 'MassSingular', "char", + 'MaxOrder', {"float"}, + 'MaxStep', {"float"}, + 'MStateDependence', "char", + 'MvPattern', {"float"}, + 'NonNegative', {"float"}, + 'NormControl', "char", + 'OutputFcn', {"function_handle"}, + 'OutputSel', {"float"}, + 'Refine', {"float"}, + 'RelTol', {"float"}, + 'Stats', "char", + 'Vectorized', "char"); + + +##FIXME: How can I check Jacobian where it's a cell????? Maybe it's better to check it inside the solver +##FIXME: Vectorized can be a cell of stings +attributes = odeset ('AbsTol', {"real", "vector", "positive"}, + 'BDF', {"on", "off"}, + 'Events', {}, + 'InitialSlope', {"real", "vector", "numel", n}, + 'InitialStep', {"positive", "scalar"}, + 'Jacobian', {}, + 'JConstant', {"on", "off"}, + 'JPattern', {"vector"}, + 'Mass', {}, + 'MassConstant', {"on", "off"}, + 'MassSingular', {"no", "maybe", "yes"}, + 'MaxOrder', {">=", 0, "<=", 5, "integer"}, + 'MaxStep', {"positive", "scalar", "real"}, + 'MStateDependence', {"weak", "strong", "none"}, + 'MvPattern', {"vector"}, + 'NonNegative', {"vector", "integer", "positive"}, + 'NormControl', {"on", "off"}, + 'OutputFcn', {}, + 'OutputSel', {"vector", "integer", "positive",... + ">", 0, "<=", n}, + 'Refine', {"scalar", ">", 0, "integer"}, + 'RelTol', {"scalar", "positive", "real"}, + 'Stats', {"on", "off"}, + 'Vectorized', {"on", "off"}); +endfunction
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/ode/private/odemergeopts.m Thu Oct 06 07:36:59 2016 +0200 @@ -0,0 +1,42 @@ +## Copyright (C) 2016, Francesco Faccio <francesco.faccio@mail.polimi.it> +## +## This file is part of Octave. +## +## Octave is free software; you can redistribute it and/or modify it +## under the terms of the GNU General Public License as published by +## the Free Software Foundation; either version 3 of the License, or (at +## your option) any later version. +## +## Octave is distributed in the hope that it will be useful, but +## WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +## General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with Octave; see the file COPYING. If not, see +## <http://www.gnu.org/licenses/>. + +function options = odemergeopts (useroptions, options, classes, + attributes, fun_name); + + for [value, key] = options; + + if (isfield (useroptions, key) && ! isempty (useroptions.(key))) + + if (! strcmp (classes.(key), "char")) + validateattributes (useroptions.(key), classes.(key), + attributes.(key), fun_name, key); + + elseif (ischar (useroptions.(key))) + validatestring (useroptions.(key), attributes.(key), fun_name, key); + + else + error ("Octave:invalid-input-arg", + [fun_name ": invalid value assigned to field '%s'"], key); + endif + + options.(key) = useroptions.(key); + + endif + endfor +endfunction