New upstream version 2.5
authorRafael Laboissière <rafael@debian.org>
Fri, 10 Dec 2021 15:04:40 +0000 (12:04 -0300)
committerRafael Laboissière <rafael@debian.org>
Fri, 10 Dec 2021 15:04:40 +0000 (12:04 -0300)
346 files changed:
CMakeLists.txt
ChangeLog.txt
emblem.mgl
examples/CMakeLists.txt
examples/fltk_example.cpp
examples/full_test.cpp
examples/glut_example.cpp
examples/qt_example.cpp
examples/samples.cpp
examples/test.c [new file with mode: 0644]
examples/test.cpp [new file with mode: 0644]
examples/test.f90 [new file with mode: 0644]
examples/test.py [new file with mode: 0644]
examples/test_fltk.cpp [new file with mode: 0644]
fonts/make_bin.cpp
include/config.h.in
include/mgl2/Fl_MathGL.h
include/mgl2/abstract.h
include/mgl2/addon.h
include/mgl2/base.h
include/mgl2/base_cf.h
include/mgl2/canvas.h
include/mgl2/canvas_cf.h
include/mgl2/canvas_wnd.h
include/mgl2/cont.h
include/mgl2/data.h
include/mgl2/data_cf.h
include/mgl2/datac.h
include/mgl2/datac_cf.h
include/mgl2/define.h
include/mgl2/eval.h
include/mgl2/evalc.h
include/mgl2/fit.h
include/mgl2/fltk.h
include/mgl2/font.h
include/mgl2/glut.h
include/mgl2/mgl.h
include/mgl2/mgl_cf.h
include/mgl2/opengl.h
include/mgl2/other.h
include/mgl2/parser.h
include/mgl2/pde.h
include/mgl2/plot.h
include/mgl2/prim.h
include/mgl2/qmathgl.h
include/mgl2/qt.h
include/mgl2/surf.h
include/mgl2/thread.h
include/mgl2/type.h
include/mgl2/vect.h
include/mgl2/volume.h
include/mgl2/window.h
include/mgl2/wnd.h
include/mgl2/wnd_cf.h
include/mgl2/wx.h
include/xpm/arc.xpm
include/xpm/arrow_a.xpm
include/xpm/arrow_d.xpm
include/xpm/arrow_i.xpm
include/xpm/arrow_k.xpm
include/xpm/arrow_n.xpm
include/xpm/arrow_o.xpm
include/xpm/arrow_s.xpm
include/xpm/arrow_t.xpm
include/xpm/arrow_v.xpm
include/xpm/axis.xpm
include/xpm/axis_sh.xpm
include/xpm/barrow_a.xpm
include/xpm/barrow_d.xpm
include/xpm/barrow_i.xpm
include/xpm/barrow_k.xpm
include/xpm/barrow_n.xpm
include/xpm/barrow_o.xpm
include/xpm/barrow_s.xpm
include/xpm/barrow_t.xpm
include/xpm/barrow_v.xpm
include/xpm/box.xpm
include/xpm/crop.xpm
include/xpm/curve.xpm
include/xpm/dash_d.xpm
include/xpm/dash_e.xpm
include/xpm/dash_i.xpm
include/xpm/dash_j.xpm
include/xpm/dash_l.xpm
include/xpm/dash_m.xpm
include/xpm/dash_s.xpm
include/xpm/delete.xpm
include/xpm/diff.xpm
include/xpm/diff2.xpm
include/xpm/func.xpm
include/xpm/integr.xpm
include/xpm/line.xpm
include/xpm/mark_.xpm
include/xpm/mark_a.xpm
include/xpm/mark_cf.xpm
include/xpm/mark_d.xpm
include/xpm/mark_df.xpm
include/xpm/mark_l.xpm
include/xpm/mark_lf.xpm
include/xpm/mark_o.xpm
include/xpm/mark_of.xpm
include/xpm/mark_p.xpm
include/xpm/mark_pf.xpm
include/xpm/mark_r.xpm
include/xpm/mark_rf.xpm
include/xpm/mark_s.xpm
include/xpm/mark_sf.xpm
include/xpm/mark_t.xpm
include/xpm/mark_tf.xpm
include/xpm/mark_v.xpm
include/xpm/mark_vf.xpm
include/xpm/mark_x.xpm
include/xpm/mark_y.xpm
include/xpm/mask_a.xpm
include/xpm/mask_d.xpm
include/xpm/mask_d_.xpm
include/xpm/mask_e.xpm
include/xpm/mask_i.xpm
include/xpm/mask_j.xpm
include/xpm/mask_l.xpm
include/xpm/mask_m.xpm
include/xpm/mask_o.xpm
include/xpm/mask_o_.xpm
include/xpm/mask_p.xpm
include/xpm/mask_r.xpm
include/xpm/mask_s.xpm
include/xpm/mask_s_.xpm
include/xpm/mask_t.xpm
include/xpm/mask_u.xpm
include/xpm/none.xpm
include/xpm/oper.xpm
include/xpm/oper_a.xpm
include/xpm/oper_d.xpm
include/xpm/oper_dir.xpm
include/xpm/oper_m.xpm
include/xpm/oper_of.xpm
include/xpm/oper_s.xpm
include/xpm/option.xpm
include/xpm/pause.xpm
include/xpm/plot.xpm
include/xpm/polygon.xpm
include/xpm/size.xpm
include/xpm/squize.xpm
include/xpm/text.xpm
include/xpm/update.xpm
include/xpm/wire.xpm
json/MainWindow.cpp
lang/CMakeLists.txt
lang/data.i
lang/mgl.i
lang/numpy.i
mathgl_es.po
mathgl_ru.po
mgllab/dialogs.cpp
mgllab/editor.cpp
mgllab/grid.cpp
mgllab/help.cpp
mgllab/mathgl.cpp
mgllab/mgllab.cpp
mgllab/mgllab.h
mgllab/mgllab.rc
mgllab/table.cpp
mgllab/xpm/arc.xpm
mgllab/xpm/arrow_a.xpm
mgllab/xpm/arrow_d.xpm
mgllab/xpm/arrow_i.xpm
mgllab/xpm/arrow_k.xpm
mgllab/xpm/arrow_n.xpm
mgllab/xpm/arrow_o.xpm
mgllab/xpm/arrow_s.xpm
mgllab/xpm/arrow_t.xpm
mgllab/xpm/arrow_v.xpm
mgllab/xpm/axis.xpm
mgllab/xpm/axis_sh.xpm
mgllab/xpm/barrow_a.xpm
mgllab/xpm/barrow_d.xpm
mgllab/xpm/barrow_i.xpm
mgllab/xpm/barrow_k.xpm
mgllab/xpm/barrow_n.xpm
mgllab/xpm/barrow_o.xpm
mgllab/xpm/barrow_s.xpm
mgllab/xpm/barrow_t.xpm
mgllab/xpm/barrow_v.xpm
mgllab/xpm/box.xpm
mgllab/xpm/crop.xpm
mgllab/xpm/curve.xpm
mgllab/xpm/dash_d.xpm
mgllab/xpm/dash_e.xpm
mgllab/xpm/dash_i.xpm
mgllab/xpm/dash_j.xpm
mgllab/xpm/dash_l.xpm
mgllab/xpm/dash_m.xpm
mgllab/xpm/dash_s.xpm
mgllab/xpm/delete.xpm
mgllab/xpm/diff.xpm
mgllab/xpm/diff2.xpm
mgllab/xpm/edit-find.xpm
mgllab/xpm/func.xpm
mgllab/xpm/integr.xpm
mgllab/xpm/line.xpm
mgllab/xpm/mark_.xpm
mgllab/xpm/mark_a.xpm
mgllab/xpm/mark_cf.xpm
mgllab/xpm/mark_d.xpm
mgllab/xpm/mark_df.xpm
mgllab/xpm/mark_l.xpm
mgllab/xpm/mark_lf.xpm
mgllab/xpm/mark_o.xpm
mgllab/xpm/mark_of.xpm
mgllab/xpm/mark_p.xpm
mgllab/xpm/mark_pf.xpm
mgllab/xpm/mark_r.xpm
mgllab/xpm/mark_rf.xpm
mgllab/xpm/mark_s.xpm
mgllab/xpm/mark_sf.xpm
mgllab/xpm/mark_t.xpm
mgllab/xpm/mark_tf.xpm
mgllab/xpm/mark_v.xpm
mgllab/xpm/mark_vf.xpm
mgllab/xpm/mark_x.xpm
mgllab/xpm/mark_y.xpm
mgllab/xpm/mask_a.xpm
mgllab/xpm/mask_d.xpm
mgllab/xpm/mask_d_.xpm
mgllab/xpm/mask_e.xpm
mgllab/xpm/mask_i.xpm
mgllab/xpm/mask_j.xpm
mgllab/xpm/mask_l.xpm
mgllab/xpm/mask_m.xpm
mgllab/xpm/mask_o.xpm
mgllab/xpm/mask_o_.xpm
mgllab/xpm/mask_p.xpm
mgllab/xpm/mask_r.xpm
mgllab/xpm/mask_s.xpm
mgllab/xpm/mask_s_.xpm
mgllab/xpm/mask_t.xpm
mgllab/xpm/mask_u.xpm
mgllab/xpm/none.xpm
mgllab/xpm/oper.xpm
mgllab/xpm/oper_a.xpm
mgllab/xpm/oper_d.xpm
mgllab/xpm/oper_dir.xpm
mgllab/xpm/oper_m.xpm
mgllab/xpm/oper_of.xpm
mgllab/xpm/oper_s.xpm
mgllab/xpm/option.xpm
mgllab/xpm/pause.xpm
mgllab/xpm/plot.xpm
mgllab/xpm/polygon.xpm
mgllab/xpm/size.xpm
mgllab/xpm/squize.xpm
mgllab/xpm/text.xpm
mgllab/xpm/update.xpm
mgllab/xpm/wire.xpm
scripts/MathGLConfig.cmake.in
src/CMakeLists.txt
src/addon.cpp
src/axis.cpp
src/base.cpp
src/base_cf.cpp
src/canvas.cpp
src/canvas_cf.cpp
src/complex.cpp
src/complex_ex.cpp
src/complex_io.cpp
src/cont.cpp
src/cont.hpp
src/crust.cpp
src/data.cpp
src/data_ex.cpp
src/data_gr.cpp
src/data_io.cpp
src/data_png.cpp
src/eval.cpp
src/evalc.cpp
src/evalp.cpp
src/exec_dat.cpp
src/exec_gr.cpp
src/exec_prm.cpp
src/exec_set.cpp
src/export.cpp
src/export_2d.cpp
src/export_3d.cpp
src/fft.cpp
src/fit.cpp
src/font.cpp
src/fractal.cpp
src/interp.hpp
src/obj.cpp
src/opengl.cpp
src/other.cpp
src/parser.cpp
src/pde.cpp
src/pixel.cpp
src/pixel_gen.cpp
src/pixel_pix.cpp
src/plot.cpp
src/prc.cpp
src/prc/PRCbitStream.cc
src/prc/PRCbitStream.h
src/prc/oPRCFile.cc
src/prc/oPRCFile.h
src/prc/writePRC.cc
src/prc/writePRC.h
src/prim.cpp
src/random.cpp [new file with mode: 0644]
src/surf.cpp
src/tex_table.cc
src/vect.cpp
src/volume.cpp
src/window.cpp
texinfo/CMakeLists.txt
texinfo/concept_en.texi
texinfo/concept_ru.texi
texinfo/core_en.texi
texinfo/core_ru.texi
texinfo/data_en.texi
texinfo/data_ru.texi
texinfo/version.texi.in
texinfo/version_hist.txt
texinfo/web_en.texi
texinfo/web_ru.texi
texinfo/widget_en.texi
texinfo/widget_ru.texi
todo.txt
udav/anim_dlg.cpp
udav/dat_pnl.cpp
udav/info_dlg.cpp
udav/mem_pnl.cpp
udav/open_dlg.cpp
udav/plot_pnl.cpp
udav/setup_dlg.cpp
udav/style_dlg.cpp
udav/udav_wnd.cpp
udav_new.png [new file with mode: 0644]
utils/CMakeLists.txt
utils/make_pas.cpp
utils/mglconv.cpp
utils/mgltask.cpp
utils/mglview.cpp
widgets/fltk.cpp
widgets/glut.cpp
widgets/image.cpp
widgets/image.h
widgets/qt.cpp
widgets/wx.cpp

index 52b41b0e98b470b885564054ba4e49bef7ff5c49..136425d78ff5c084f79242b080757cba6f71a87e 100644 (file)
@@ -1,5 +1,12 @@
 cmake_minimum_required(VERSION 3.1.0)
 
+if(POLICY CMP0078)
+    cmake_policy(SET CMP0078 OLD)
+endif()
+if(POLICY CMP0086)
+    cmake_policy(SET CMP0086 OLD)
+endif()
+
 project( MathGL2 )
 
 set(mgl_clean_files )
@@ -16,10 +23,10 @@ endif(NOT CMAKE_BUILD_TYPE)
 
 set(CMAKE_VERBOSE_MAKEFILE ON)
 set(MathGL_VERSION_MAJOR 2)
-set(MathGL_VERSION_MINOR 4)
-set(MathGL_PATCH_VERSION 4)
+set(MathGL_VERSION_MINOR 5)
+set(MathGL_PATCH_VERSION 0)
 set(MathGL_VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION})
-set(MathGL_SOVERSION 7.5.0)
+set(MathGL_SOVERSION 7.6.0)
 string(TIMESTAMP MathGL_DATE UTC)
 
 if(CMAKE_BUILD_TYPE STREQUAL "Debug")
@@ -37,74 +44,77 @@ set(MathGL_INSTALL_LIB_DIR "lib" CACHE PATH "Installation directory for librarie
 set(MathGL_INSTALL_BIN_DIR "bin" CACHE PATH "Installation directory for executables")
 set(MathGL_INSTALL_INCLUDE_DIR "include" CACHE PATH "Installation directory for headers")
 if(WIN32 AND NOT CYGWIN)
-  set(DEF_INSTALL_CMAKE_DIR cmake)
+       set(DEF_INSTALL_CMAKE_DIR cmake)
 else()
-  set(DEF_INSTALL_CMAKE_DIR lib/cmake/mathgl)
+       set(DEF_INSTALL_CMAKE_DIR lib/cmake/mathgl2)
 endif()
 set(MathGL_INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
 # Make relative paths absolute (needed later on)
 foreach(p LIB BIN INCLUDE CMAKE)
-  set(var MathGL_INSTALL_${p}_DIR)
-  if(NOT IS_ABSOLUTE "${${var}}")
-    set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
-  endif()
+       set(var MathGL_INSTALL_${p}_DIR)
+       if(NOT IS_ABSOLUTE "${${var}}")
+               set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
+       endif()
 endforeach()
 
 macro(mgl_po_src)
-    set(l_files )
-    foreach(src_file ${ARGN})
-        get_filename_component(fp ${src_file} ABSOLUTE)
-        file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${fp})
-        list(APPEND l_files "${rel}")
-    endforeach(src_file ${ARGN})
-    set(po_files ${po_files} ${l_files} PARENT_SCOPE)
+       set(l_files )
+       foreach(src_file ${ARGN})
+               get_filename_component(fp ${src_file} ABSOLUTE)
+               file(RELATIVE_PATH rel ${CMAKE_SOURCE_DIR} ${fp})
+               list(APPEND l_files "${rel}")
+       endforeach(src_file ${ARGN})
+       set(po_files ${po_files} ${l_files} PARENT_SCOPE)
 endmacro(mgl_po_src)
 
 function(mgl_add_lib mgl_tmp_lib)
-       if(${mgl_tmp_lib} MATCHES mgl)
-               set(mgllib mgl)
-               set(mgllib2 mgl2)
-       else(${mgl_tmp_lib} MATCHES mgl)
-               set(mgllib mgl-${mgl_tmp_lib})
-               set(mgllib2 mgl2-${mgl_tmp_lib})
-       endif(${mgl_tmp_lib} MATCHES mgl)
-       set(mgl_src_lst ${ARGV})
-       list(REMOVE_AT mgl_src_lst 0)
-       add_library(${mgllib} SHARED ${mgl_src_lst})
-       add_library(${mgllib}-static STATIC ${mgl_src_lst})
-       set_target_properties(${mgllib} PROPERTIES SOVERSION ${MathGL_SOVERSION})
-       set_target_properties(${mgllib} PROPERTIES DEFINE_SYMBOL "mgl_EXPORTS")
-       set_target_properties(${mgllib} PROPERTIES C_VISIBILITY_PRESET hidden)
-       set_target_properties(${mgllib} PROPERTIES CXX_VISIBILITY_PRESET hidden)
-       set_target_properties(${mgllib} PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
-       target_compile_definitions(${mgllib}-static PUBLIC MGL_STATIC_DEFINE)
-       if(MSVC)
-          set(mgl_lib_static "-static")
-           if(CMAKE_BUILD_TYPE STREQUAL "Debug")
-               set(mgl_lib_end "d")
-          else(CMAKE_BUILD_TYPE STREQUAL "Debug")
-               set(mgl_lib_end)
-           endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
-       elseif(MSVC)
-          set(mgl_lib_static)
-           set_target_properties(${mgllib} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-          set_target_properties(${mgllib}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
-       endif(MSVC)
-       if(enable-mgl2)
-               set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_end}")
-               set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_static}${mgl_lib_end}")
-       else(enable-mgl2)
-               set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_end}")
-               set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_static}${mgl_lib_end}")
-       endif(enable-mgl2)
-
-       install(
-               TARGETS ${mgllib} ${mgllib}-static
-               EXPORT MathGLTargets
-               RUNTIME DESTINATION ${MathGL_INSTALL_BIN_DIR}
-               ARCHIVE DESTINATION ${MathGL_INSTALL_LIB_DIR}
-               LIBRARY DESTINATION ${MathGL_INSTALL_LIB_DIR}
-       )
+       if(${mgl_tmp_lib} MATCHES mgl)
+               set(mgllib mgl)
+               set(mgllib2 mgl2)
+       else(${mgl_tmp_lib} MATCHES mgl)
+               set(mgllib mgl-${mgl_tmp_lib})
+               set(mgllib2 mgl2-${mgl_tmp_lib})
+       endif(${mgl_tmp_lib} MATCHES mgl)
+       set(mgl_src_lst ${ARGV})
+       list(REMOVE_AT mgl_src_lst 0)
+       add_library(${mgllib} SHARED ${mgl_src_lst})
+       add_library(${mgllib}-static STATIC ${mgl_src_lst})
+       set_target_properties(${mgllib} PROPERTIES SOVERSION ${MathGL_SOVERSION})
+       set_target_properties(${mgllib} PROPERTIES DEFINE_SYMBOL "mgl_EXPORTS")
+       set_target_properties(${mgllib} PROPERTIES C_VISIBILITY_PRESET hidden)
+       set_target_properties(${mgllib} PROPERTIES CXX_VISIBILITY_PRESET hidden)
+       set_target_properties(${mgllib} PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
+       target_compile_definitions(${mgllib}-static PUBLIC MGL_STATIC_DEFINE)
+       if(MSVC)
+               set(mgl_lib_static "-static")
+               set (CMAKE_DEBUG_POSTFIX "d")
+               set_target_properties(${mgllib} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
+               set_target_properties(${mgllib}-static PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
+#              if(CMAKE_BUILD_TYPE STREQUAL "Debug")
+#                      set(mgl_lib_end "d")
+#              else(CMAKE_BUILD_TYPE STREQUAL "Debug")
+#                      set(mgl_lib_end)
+#              endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
+       elseif(MSVC)
+               set(mgl_lib_static)
+               set_target_properties(${mgllib} PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+       set_target_properties(${mgllib}-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
+       endif(MSVC)
+       if(enable-mgl2)
+                       set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_end}")
+                       set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib2}${mgl_lib_static}${mgl_lib_end}")
+       else(enable-mgl2)
+                       set_target_properties(${mgllib} PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_end}")
+                       set_target_properties(${mgllib}-static PROPERTIES OUTPUT_NAME "${mgllib}${mgl_lib_static}${mgl_lib_end}")
+       endif(enable-mgl2)
+
+       install(
+                       TARGETS ${mgllib} ${mgllib}-static
+                       EXPORT MathGLTargets
+                       RUNTIME DESTINATION ${MathGL_INSTALL_BIN_DIR}
+                       ARCHIVE DESTINATION ${MathGL_INSTALL_LIB_DIR}
+                       LIBRARY DESTINATION ${MathGL_INSTALL_LIB_DIR}
+       )
 endfunction(mgl_add_lib mgl_tmp_lib)
 
 MACRO(MGL_DEPENDENT_OPTION option doc default depends1 force1 depends2 force2)
@@ -200,13 +210,18 @@ MGL_DEPENDENT_OPTION(enable-hdf4 "Enable hdf4 support" OFF "NOT enable-lgpl" ON
 MGL_DEPENDENT_OPTION(enable-hdf5 "Enable hdf5 support" OFF "NOT enable-lgpl" ON "NOT enable-all" ON)
 CMAKE_DEPENDENT_OPTION(enable-pdf "Enable pdf support" OFF "NOT enable-all" ON)
 CMAKE_DEPENDENT_OPTION(enable-gif "Enable gif support" OFF "NOT enable-all" ON)
+CMAKE_DEPENDENT_OPTION(enable-arma "Enable Armadillo support" OFF "NOT enable-all" ON)
 CMAKE_DEPENDENT_OPTION(enable-glut "Enable glut support" OFF "NOT enable-all-widgets" ON)
 CMAKE_DEPENDENT_OPTION(enable-fltk "Enable fltk widget" OFF "NOT enable-all-widgets" ON)
 CMAKE_DEPENDENT_OPTION(enable-wx "Enable wxWidget widget" OFF "NOT enable-all-widgets" ON)
-CMAKE_DEPENDENT_OPTION(enable-qt4 "Enable Qt4 widget" OFF "NOT enable-all-widgets" ON)
+CMAKE_DEPENDENT_OPTION(enable-qt "Enable Qt4 and/or Qt5 widget(s)" OFF "NOT enable-all-widgets" ON)
+option(enable-qt4 "Enable Qt4 widget" OFF)
 CMAKE_DEPENDENT_OPTION(enable-qt4asqt "Set Qt4 as default libmgl-qt" OFF "enable-qt4" OFF)
-CMAKE_DEPENDENT_OPTION(enable-qt5 "Enable Qt5 widget" OFF "NOT enable-all-widgets" ON)
+option(enable-qt5 "Enable Qt5 widget" OFF)
 CMAKE_DEPENDENT_OPTION(enable-qt5asqt "Set Qt5 as default libmgl-qt" OFF "enable-qt5" OFF)
+CMAKE_DEPENDENT_OPTION(enable-freetype "Enable freetype support" OFF "NOT enable-all" ON)
+set(PY3VERSION_DOTTED "3.8" CACHE STRING "Used python version")
+string(REPLACE "." "" PY3VERSION_NODOT ${PY3VERSION_DOTTED})
 
 # msvc fwprintf print char* for the specifier of "%s" format
 if(MSVC AND MSVC_VERSION GREATER 1899)
@@ -227,6 +242,19 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
        unset(CMAKE_REQUIRED_FLAGS)
 endif(${CMAKE_SIZEOF_VOID_P} EQUAL 4)
 
+if(enable-qt)
+       FIND_PACKAGE(Qt4 4.8)
+       if(Qt4_FOUND)
+               set(enable-qt4 ON)
+               find_package(Qt5 COMPONENTS Widgets)
+               if(Qt5Widgets_FOUND)
+                       set(enable-qt5 ON)
+               endif(Qt5Widgets_FOUND)
+       else(Qt4_FOUND)
+               set(enable-qt5 ON)
+       endif(Qt4_FOUND)
+endif(enable-qt)
+
 if(enable-qt4 OR enable-qt5)
        set(QT_ENABLED ON)
        if(enable-qt4asqt AND enable-qt5asqt)
@@ -403,18 +431,31 @@ else(enable-pthr-widget OR enable-pthread)
        set(MGL_HAVE_PTHREAD 0)
 endif(enable-pthr-widget OR enable-pthread)
 
+if(enable-arma)
+       find_package(Armadillo)
+       if(ARMADILLO_FOUND)
+               set(MGL_HAVE_ARMA 1)
+       else(ARMADILLO_FOUND)
+               set(MGL_HAVE_ARMA 0)
+       endif(ARMADILLO_FOUND)
+else(enable-arma)
+       set(MGL_HAVE_ARMA 0)
+endif(enable-arma)
+
+
 if(enable-openmp)
-        find_package(OpenMP)
-        if(OPENMP_FOUND)
-                set(MGL_HAVE_OMP 1)
-                set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
-                set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-        else(OPENMP_FOUND)
-                message(SEND_ERROR "Couldn't find OpenMP. You can enable POSIX threads instead.")
-                set(MGL_HAVE_OMP 0)
-        endif(OPENMP_FOUND)
+       find_package(OpenMP)
+       if(OPENMP_FOUND)
+               set(MGL_HAVE_OMP 1)
+               set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
+               set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+               set (MGL_DEP_LIBS OpenMP::OpenMP_CXX ${MGL_DEP_LIBS})
+       else(OPENMP_FOUND)
+               message(SEND_ERROR "Couldn't find OpenMP. You can enable POSIX threads instead.")
+               set(MGL_HAVE_OMP 0)
+       endif(OPENMP_FOUND)
 else(enable-openmp)
-        set(MGL_HAVE_OMP 0)
+       set(MGL_HAVE_OMP 0)
 endif(enable-openmp)
 
 if(enable-gsl)
@@ -483,10 +524,17 @@ if(enable-hdf5)
                        message(SEND_ERROR "Couldn't find HDF5 library.")
                endif(NOT HDF5_FOUND)
        endif(NOT HDF5_FOUND)
+       
+       string(REPLACE "." ";" HDF_VERSION_LIST ${HDF5_VERSION})
+       list(GET HDF_VERSION_LIST 0 HDF_VERSION_MAJOR)
+       list(GET HDF_VERSION_LIST 1 HDF_VERSION_MINOR)
+
        set(MGL_DEP_LIBS ${HDF5_LIBRARIES} ${HDF5_C_SHARED_LIBRARY} ${MGL_DEP_LIBS})
        include_directories(${HDF5_INCLUDE_DIRS})
 else(enable-hdf5)
        set(MGL_HAVE_HDF5 0)
+       set(HDF_VERSION_MAJOR 0)
+       set(HDF_VERSION_MINOR 0)
 endif(enable-hdf5)
 
 if(enable-jpeg)
@@ -514,6 +562,18 @@ else(enable-zlib)
        set(MGL_HAVE_ZLIB 0)
 endif(enable-zlib)
 
+if(enable-freetype)
+       set(MGL_HAVE_FREETYPE 1)
+       include(FindFreetype)
+       if(NOT FREETYPE_FOUND)
+               message(SEND_ERROR "Couldn't find FreeType library.")
+       endif(NOT FREETYPE_FOUND)
+       set(MGL_DEP_LIBS ${FREETYPE_LIBRARIES} ${MGL_DEP_LIBS})
+       include_directories(${FREETYPE_INCLUDE_DIRS})
+else(enable-freetype)
+       set(MGL_HAVE_FREETYPE 0)
+endif(enable-freetype)
+
 if(enable-png)
        set(MGL_HAVE_PNG 1)
        if(NOT MGL_HAVE_ZLIB)
index 784be90abcd72cdbed542e6d56f45b61814eea3c..54ec6e1e0fdc175370db3358b988f39d069a021a 100644 (file)
@@ -1,3 +1,30 @@
+2.5 Released 8 December 2021
+
+* Add 'keep' for keeping the data phase/sign or value along line i and j in given direction
+* Add functions 'sum', 'prod' at formula evaluation, like "sum(_i^2,5)" will produce "30"=0+1^2+2^2+3^2+4^2, and "prod(1+_i,5)" will produce 5!="120". You can nest them for variables _i,_j,...,_z, like "sum(sum(_j+_i^2,5),5)" will give "200".
+* Add functions 'value', 'spline' at formula evaluation, like "value(a,5)" will give value of 6-th element of a, i.e. a[5].
+* Add user-defined functions fn1()...fn9() at formula evaluation, like "fn1(3)\x^_1" will produce "x^3".
+* Add mglODEs() (i.e. 'ode') for solving PDE/cascade/etc: ode res 'eqs' 'vars' 'bnd_kind' ini [dt tmax]. Here 'eqs' may contain relative pointer, like 'u(j+1)-2*u(j)+u(j-1)', and can be complex. Variables have 'j' for current index, 't' for current time.
+* Add 'lines' to draw a set of lines with arrows between points.
+* Add 'dcont' to draw a set of curves, which are intersection of two isosurfaces at given level.
+* Add 'first', 'last' to get array of first/last indexes of values larger specified one along given direction.
+* Add 'bernoulli', 'binomial', 'brownian', 'discrete', 'exponential', 'gaussian', 'shuffle', 'uniform', 'uniformint' for data filling by random numbers with different distributions.
+* Add 'readbin' to read data from binary files.
+* Add 'texparse' to enable/disable TeX-like command parsing at text output.
+* Update ODE: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same).
+* Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI.
+* Add style 'p' in command 'smooth' to use parabolic smoothing of arbitrary points.
+* Allow 'background' for scaling image, centering image and tessellate image as mosaic.
+* Allow filling 'background' by the specified color.
+* Allow masks for 'candle', 'area', 'region', 'bars', 'barh', 'chart', 'tape', 'face', 'polygon', 'ellipse', 'rhomb'.
+* Allow single value specification for contour level in 'cont', 'tricont', 'contd', 'contp', 'contv', 'tricontv', 'cont3', 'dcont'.
+* Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands 'save' and 'savehdf' can save single value now.
+* Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays.
+* Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...).
+* Add Armadillo interface for mglData and mglDataC.
+* If nsub parameter of command 'hist' is negative (nsub<0) then the linear interpolation is used instead of spline one.
+* Add dark text colors for mgllab.
+
 2.4.4 Released 8 July 2019
 
 * mglData now have operator() which work as SubData() function.
index a3f2473d2765c1eb43f859c90c53810d21d7cf3a..8915bc157fbaf9d7bd28bcede69547f1b1f337f1 100644 (file)
@@ -31,6 +31,8 @@ modify a '-2*((2*x-1)^2 + (2*y-1)^2 + (2*z-1)^4 - (2*z-1)^2 - 0.1)'
 alpha on:light off
 cloud a 'wyrRk'
 
+write 'emplem.jpg'
+
 stop
 cut 0 -1 -1 1 0 1.1
 surf3 a -1 'BbcyrR'
index 7c25819cdce255c3ecc7b085392cae5e09cc7096..026391079e708d3fa666518ab0373aeb66438a5b 100644 (file)
@@ -1,3 +1,4 @@
+file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${CMAKE_BINARY_DIR}/examples)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${CMAKE_BINARY_DIR}/examples)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${CMAKE_BINARY_DIR}/examples)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/samples.cpp DESTINATION ${CMAKE_BINARY_DIR}/examples)
index 9dc8db33f87290c5a42dfede306af099945f2b20..87f128657d11df4ef10a1b052245b5f9b4707912 100644 (file)
@@ -18,6 +18,7 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
  ***************************************************************************/\r
 #include "mgl2/fltk.h"\r
+#include <thread>\r
 //-----------------------------------------------------------------------------\r
 #if defined(WIN32) || defined(_MSC_VER) || defined(__BORLANDC__)\r
 #include <windows.h>\r
@@ -32,6 +33,7 @@ void long_calculations()      // just delay which correspond to simulate calculations
        sleep(1);       // which can be very long\r
 #endif\r
 }\r
+#define PTHREAD_SAMPLE3\r
 //-----------------------------------------------------------------------------\r
 #if defined(PTHREAD_SAMPLE1)   // first variant of multi-threading usage of mglFLTK window\r
 mglFLTK *gr=NULL;\r
@@ -51,11 +53,11 @@ void *calc(void *)
                        gr->Update();           // update window\r
                }\r
        }\r
-       exit(0);\r
+       exit(0);        return NULL;\r
 }\r
 int main(int argc,char **argv)\r
 {\r
-       mgl_textdomain(argv?argv[0]:NULL);\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
        static pthread_t thr;\r
        pthread_create(&thr,0,calc,0);\r
        pthread_detach(thr);\r
@@ -66,7 +68,7 @@ int main(int argc,char **argv)
 mglPoint pnt;  // some global variable for changeable data\r
 int main(int argc,char **argv)\r
 {\r
-       mgl_textdomain(argv?argv[0]:NULL);\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
        mglFLTK gr("test");\r
        gr.RunThr();    // <-- need MathGL version which use pthread\r
        for(int i=0;i<10;i++)   // do calculation\r
@@ -81,6 +83,34 @@ int main(int argc,char **argv)
        }\r
        return 0;       // finish calculations and close the window\r
 }\r
+#elif defined(PTHREAD_SAMPLE3) // another variant of multi-threading usage of mglFLTK window. Work only if pthread was enabled for MathGL\r
+mglFLTK *gr=NULL;\r
+void calc()\r
+{\r
+       mglPoint pnt;\r
+       for(int i=0;i<10;i++)           // do calculation\r
+       {\r
+               long_calculations();    // which can be very long\r
+               pnt.Set(2*mgl_rnd()-1,2*mgl_rnd()-1);\r
+               if(gr)\r
+               {\r
+                       gr->Clf();                      // make new drawing\r
+                       gr->Line(mglPoint(),pnt,"Ar2");\r
+                       char str[10] = "i=0";   str[2] = '0'+i;\r
+                       gr->Puts(mglPoint(),str);\r
+                       gr->Update();           // update window\r
+               }\r
+       }\r
+       exit(0);\r
+}\r
+int main(int argc,char **argv)\r
+{\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
+//     static pthread_t thr;\r
+       std::thread(calc).detach();\r
+       gr = new mglFLTK;\r
+       gr->Run();      return 0;\r
+}\r
 #else          // just default samples\r
 //-----------------------------------------------------------------------------\r
 int test_wnd(mglGraph *gr);\r
index e7e115440c80bb01bd271fbe68ee454f16262f35..afb5e0d807b5ee6ba7560ebd4ca5a8818aa2f373 100644 (file)
@@ -74,11 +74,22 @@ void mgls_prepare3v(mglData *ex, mglData *ey, mglData *ez);
 void save(mglGraph *gr,const char *name,const char *suf);\r
 void test(mglGraph *gr)\r
 {\r
+//     gr->Box();      gr->WritePNG("1.png");  return;\r
+       \r
        mglParse par;\r
-       par.Execute(gr,"new f 100 'x^3':save f 'test.dat':axis:box:fplot ':test.dat:-1:1'");\r
-       par.Execute(gr,"text 0 0 'ab' '@'");\r
+       par.Execute(gr,"colorbar;size -2;crange 0 1;value 90");\r
+//     par.Execute(gr,"fplot 'x';legend 'рус':legend");\r
+//     par.Execute(gr,"fsurf 'x*y':rasterize:clf:fplot 'sin(x)' '2q':axis");\r
+//     par.Execute(gr,"xrange 0 1:new x 10 '3*x':echo x\nnew a 10 'value([0,1,-1],3*x)':echo a\nnew b 10 'spline([0,1,-1],3*x)':echo b");\r
+//     par.Execute(gr,"new a 1 'sum(_i^2,5)':echo a:new b 1 'prod(1+_i,5)':echo b\n"\r
+//     "new c 1 'dsum(_i,5)':echo c:new d 1 'sum(sum(_j+_i^2,5),5)':echo d");\r
+//     par.Execute(gr,"define n 30\nnew a n n n 'x^2+y^2'\nnew b n n n 'z^4+2*x^4-2*y^4'\nrotate 40 60:box:axis\n"\r
+//             "dcont [0.5,0.5] a b '2k'\nlight on:alpha on\nsurf3 a 0.5 'r':surf3 b 0.5 'g'");\r
+//     par.Execute(gr,"new f 100 'x^3':save f 'test.dat':axis:box:fplot ':test.dat:-1:1'");\r
+//     par.Execute(gr,"text 0 0 'ab' '@'");\r
 //     par.Execute(gr,"new a 3 3 'x*y'\nsubplot 2 1 0 '':dens a:dens a 'k+/'\n"\r
 //     "subplot 2 1 1 '':mask '+' 'ff00182424f800' 30:dens a '3+'");\r
+       gr->WritePNG("1.png");\r
        return;\r
        \r
        dual c(0,M_PI/2), r=mgl_ipowc(c,2);\r
@@ -152,6 +163,18 @@ void mgl_generate_texi()
        fclose(fs);     fclose(fp);     fclose(fq);\r
 }\r
 \r
+void mgl_generate_slides()\r
+{\r
+       FILE *fp = fopen("samples.tex","w");\r
+       FILE *fs = fopen("samples.cpp","r");\r
+       for(size_t i=0;samp[i].name && samp[i].name[0];i++)\r
+       {\r
+               fprintf(fp,"\n\\begin{frame}[fragile]{Пример \\href{http://mathgl.sourceforge.net/doc_en/%s-sample.html}{\\texttt{%s}}}\n%s\n", samp[i].name, samp[i].name, samp[i].info);\r
+               fprintf(fp,"\\begin{center}\n\\includegraphics[width=0.7\\linewidth]{png/%s}\n\\end{center}\n\\end{frame}\n", samp[i].name);\r
+       }\r
+       fclose(fp);     fclose(fs);\r
+}\r
+\r
 static struct option longopts[] =\r
 {\r
        { "big",        no_argument,    &big,           1 },\r
@@ -343,7 +366,7 @@ int main(int argc,char **argv)
                        default:        usage();        return 0;\r
                }\r
 \r
-       if(dotest==1)   printf("Global (before):%s\n",mglGlobalMess.c_str());\r
+       if(dotest==1)   printf("Global (before):%s\n",mgl_get_global_warn());\r
        gr = new mglGraph;\r
        if(     type==11|| type==12|| type==5 || type==9)       width=height;\r
        switch(big)\r
@@ -367,7 +390,7 @@ int main(int argc,char **argv)
                gr->WriteSVG("test.svg");\r
                gr->WriteEPS("test.eps");\r
                printf("Messages:%s\n",gr->Message());\r
-               printf("Global:%s\n",mglGlobalMess.c_str());\r
+               printf("Global:%s\n",mgl_get_global_warn());\r
                delete gr;      return 0;\r
        }\r
        else if(dotest==2)      // NOTE mgl_gen_fnt[###][6] have to be updated if new glyphs will be added to built-in font\r
@@ -396,6 +419,7 @@ int main(int argc,char **argv)
                clock_t beg,end;\r
                while(s->name[0])       // all samples\r
                {\r
+                       if(!strcmp(s->name,"icon"))     {       s++;    continue;       }\r
                        char *buf = new char[strlen(s->mgl)+ll];\r
                        strcpy(buf,s->mgl);     strcat(buf,mmgl_dat_prepare);\r
                        fprintf(fp,"\n@item %s",s->name);\r
@@ -410,7 +434,7 @@ int main(int argc,char **argv)
                                else    par.Execute(gr,buf);\r
                                gr->Finish();\r
                                end = clock();\r
-                               fprintf(fp," @tab %.3g",double(end-beg)/CLOCKS_PER_SEC);\r
+                               fprintf(fp," @tab %.2g",double(end-beg)/CLOCKS_PER_SEC);\r
                                printf("\t%d->%g",qual[i],double(end-beg)/CLOCKS_PER_SEC);\r
                                fflush(fp);     fflush(stdout);\r
                        }\r
@@ -427,6 +451,7 @@ int main(int argc,char **argv)
        }\r
        else if(dotest==6)\r
        {\r
+               mgl_generate_slides();\r
                mgl_generate_texi();\r
                delete gr;      return 0;\r
        }\r
@@ -439,6 +464,7 @@ int main(int argc,char **argv)
        {\r
                while(s->name[0])       // all samples\r
                {\r
+                       if(!strcmp(s->name,"icon"))     {       s++;    continue;       }\r
                        gr->DefaultPlotParam(); gr->Clf();\r
                        if(use_mgl)\r
                        {\r
index 07a70f5c79ab5c6af7f5bf64057cc9fd3139d425..54c5239d5ad7f5bc3b0e5fd146ede51f10bbae67 100644 (file)
@@ -56,7 +56,7 @@ printf("i=%d, gr=%p\n",i,gr); fflush(stdout);
 }\r
 int main(int argc,char **argv)\r
 {\r
-       mgl_textdomain(argv?argv[0]:NULL);\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
        static pthread_t thr;\r
        pthread_create(&thr,0,calc,0);\r
        pthread_detach(thr);\r
index c27b101cac22a0eea2716e3afa7fa5e5efcd6723..9afdf375f47591a2c28864ec5f3721157bad40b9 100644 (file)
@@ -55,7 +55,7 @@ void *calc(void *)
 }\r
 int main(int argc,char **argv)\r
 {\r
-       mgl_textdomain(argv?argv[0]:NULL);\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
        static pthread_t thr;\r
        pthread_create(&thr,0,calc,0);\r
        pthread_detach(thr);\r
@@ -88,7 +88,7 @@ int Foo::Draw(mglGraph *gr)
 }\r
 int main(int argc,char **argv)\r
 {\r
-       mgl_textdomain(argv?argv[0]:NULL);\r
+       mgl_textdomain(argv?argv[0]:NULL,"");\r
        Foo *foo = new Foo;\r
        mglQT gr(foo,"MathGL examples");\r
        foo->Gr = &gr;\r
index c49e49ebfa53c9238cc536e0fd7178cccecb7de8..71f8ecb318910d81eee3361304dd64cacdbcaaa2 100644 (file)
@@ -837,6 +837,21 @@ void smgl_fonts(mglGraph *gr)      // font typefaces
        gr->LoadFont("");
 }
 //-----------------------------------------------------------------------------
+const char *mmgl_background="define $f udav_new.png\n#background '$f' 's'\n"
+"subplot 2 2 0 '':box\nbackground '$f' 'a'\ntext 0.5 0.1 'Default' 'a'\n"
+"subplot 2 2 1 '':box\nbackground '$f' 'ca'\ntext 0.5 0.1 'Centering' 'a'\n"
+"subplot 2 2 2 '':box\nbackground '$f' 'ma'\ntext 0.5 0.1 'Mosaic' 'a'\n"
+"subplot 2 2 3 '':box\nbackground '$f' 'sa'\ntext 0.5 0.1 'Scaling' 'a'";
+void smgl_background(mglGraph *gr)
+{
+       const char *fname = "udav_new.png";
+       gr->SubPlot(2,2,0,"");  gr->Box();      gr->LoadBackground(fname,"a");  gr->Puts(0.5,0.1,"Default","a");
+       gr->SubPlot(2,2,1,"");  gr->Box();      gr->LoadBackground(fname,"ca"); gr->Puts(0.5,0.1,"Centering","a");
+       gr->SubPlot(2,2,2,"");  gr->Box();      gr->LoadBackground(fname,"ma"); gr->Puts(0.5,0.1,"Mosaic","a");
+       gr->SubPlot(2,2,3,"");  gr->Box();      gr->LoadBackground(fname,"sa"); gr->Puts(0.5,0.1,"Scaling","a");
+       //gr->LoadBackground(fname,"s");
+}
+//-----------------------------------------------------------------------------
 const char *mmgl_bars="new ys 10 3 '0.8*sin(pi*(x+y/4+1.25))+0.2*rnd':origin 0 0 0\n"
 "subplot 3 2 0 '':title 'Bars plot (default)':box:bars ys\nsubplot 3 2 1 '':title '2 colors':box:bars ys 'cbgGyr'\n"
 "subplot 3 2 4 '':title '\"\\#\" style':box:bars ys '#'\n"
@@ -1667,6 +1682,40 @@ void smgl_surf3ca(mglGraph *gr)
        gr->Box();      gr->Surf3CA(c,d,c);
 }
 //-----------------------------------------------------------------------------
+const char *mmgl_dcont="call 'prepare3d'\ntitle 'DCont plot':rotate 50 60:light on:alpha on:box:surf3 c 0 'r':surf3 d 0 'b'\ndcont 0 c d '2k'";
+void smgl_dcont(mglGraph *gr)
+{
+       mglData c,d,v;  mgls_prepare3d(&c,&d);
+       if(big!=3)      gr->Title("DCont plot");
+       gr->Rotate(50,60);      gr->Light(true);        gr->Alpha(true);
+       gr->Box();      gr->Surf3(0,c,"r");     gr->Surf3(0,d,"b");
+       gr->DCont(v,c,d,"2k");
+}
+//-----------------------------------------------------------------------------
+const char *mmgl_daisy="title 'Advanced formulas'\nnew b 256 256 'dsum(fn1(_i*pi/5),10)\\exp(-64*(x*cos(_1)-y*sin(_1))^2-16*(0.5+y*cos(_1)+x*sin(_1))^2)'\ncrange b:dens b 'BbwrR'";
+void smgl_daisy(mglGraph *gr)
+{
+       if(big!=3)      gr->Title("Advanced formulas");
+       mglData b(256,256);
+       gr->Fill(b,"dsum(fn1(_i*pi/5),10)\\exp(-64*(x*cos(_1)-y*sin(_1))^2-16*(0.5+y*cos(_1)+x*sin(_1))^2)");
+       gr->SetRange('c',b);    gr->Dens(b,"BbwrR");
+}
+//-----------------------------------------------------------------------------
+const char *mmgl_keep="yrange 0 pi\nnew !a 100 300 'exp(-6*x^2+10i*(x+y^2))'"
+"subplot 2 1 0 '':box\ndens real(a) 'BbwrR'\ntext 1.1 0.5 '\to' 'a'"
+"keep a 'y' 50\nsubplot 2 1 1 '':box\ndens real(a) 'BbwrR'";
+void smgl_keep(mglGraph *gr)
+{
+       gr->SetRange('y',0,M_PI);
+       mglDataC a(100,300);    gr->Fill(a,"exp(-6*x^2+10i*(x+y^2))");
+       gr->SubPlot(2,1,0,"");  gr->Box();
+       gr->Dens(a.Real(),"BbwrR");
+       gr->Puts(1.1,0.5,"\\to","a");
+       a.Keep("y",50);
+       gr->SubPlot(2,1,1,"");  gr->Box();
+       gr->Dens(a.Real(),"BbwrR");
+}
+//-----------------------------------------------------------------------------
 const char *mmgl_cut="call 'prepare2d'\ncall 'prepare3d'\nsubplot 2 2 0:title 'Cut on (default)':rotate 50 60:light on:box:surf a; zrange -1 0.5\n"
 "subplot 2 2 1:title 'Cut off':rotate 50 60:box:surf a; zrange -1 0.5; cut off\n"
 "subplot 2 2 2:title 'Cut in box':rotate 50 60:box:alpha on\ncut 0 -1 -1 1 0 1.1:surf3 c\ncut 0 0 0 0 0 0\t# restore back\n"
@@ -1695,6 +1744,23 @@ void smgl_traj(mglGraph *gr)
        gr->Box();      gr->Plot(x,y);  gr->Traj(x,y,y1,y2);
 }
 //-----------------------------------------------------------------------------
+const char *mmgl_lines="subplot 1 1 0 '':title 'Lines plot'\n"
+"new x1 11 '0.3*cos(pi*i/5)'\nnew y1 11 '0.3*sin(pi*i/5)'\nnew x2 11 '0.7*cos(pi*i/5)'\nnew y2 11 '0.7*sin(pi*i/5)'\nplot x1 y1\nlines x1 y1 x2 y2 '_A'";
+void smgl_lines(mglGraph *gr)
+{
+       mglData x1(11),y1(11),x2(11),y2(11);
+       for(long i=0;i<11;i++)
+       {
+               x1.a[i] = 0.3*cos(M_PI*i/5);
+               y1.a[i] = 0.3*sin(M_PI*i/5);
+               x2.a[i] = 0.7*cos(M_PI*i/5);
+               y2.a[i] = 0.7*sin(M_PI*i/5);
+       }
+       if(big!=3)      {gr->SubPlot(1,1,0,""); gr->Title("Lines plot");}
+       gr->Plot(x1,y1);
+       gr->Lines(x1,y1,x2,y2,"_A");
+}
+//-----------------------------------------------------------------------------
 const char *mmgl_mesh="call 'prepare2d'\ntitle 'Mesh plot':rotate 50 60:box:mesh a";
 void smgl_mesh(mglGraph *gr)
 {
@@ -1803,6 +1869,14 @@ void smgl_belt(mglGraph *gr)
        gr->Rotate(50,60);      gr->Box();      gr->Belt(a);
 }
 //-----------------------------------------------------------------------------
+const char *mmgl_beltc="call 'prepare2d'\ntitle 'BeltC plot':rotate 50 60:box:beltc a b";
+void smgl_beltc(mglGraph *gr)
+{
+       mglData a,b;    mgls_prepare2d(&a,&b);
+       if(big!=3)      gr->Title("BeltC plot");
+       gr->Rotate(50,60);      gr->Box();      gr->BeltC(a,b);
+}
+//-----------------------------------------------------------------------------
 const char *mmgl_dens="call 'prepare2d'\nnew a1 30 40 3 '0.6*sin(2*pi*x+pi*(z+1)/2)*sin(3*pi*y+pi*z) + 0.4*cos(3*pi*(x*y)+pi*(z+1)^2/2)'\n"
 "subplot 2 2 0 '':title 'Dens plot (default)':box:dens a\n"
 "subplot 2 2 1:title '3d variant':rotate 50 60:box:dens a\n"
@@ -2845,6 +2919,26 @@ void smgl_ifs2d(mglGraph *gr)
        gr->Axis();     gr->Plot(f.SubData(0), f.SubData(1),"r#o ","size 0.05");
 }
 //-----------------------------------------------------------------------------
+const char *mmgl_icon="setsize 200 200\nzrange 0 2\n\ndefine $s 0.8\nnew x 200 '$s*(x+1)/2*sin(2*pi*x)'\n"
+"new y 200 '$s*(x+1)/2*cos(2*pi*x)'\nnew z 200 '$s*(2-(x+1))+0.1'\n"
+"new r 200 '0.02+0.07*(x+1)'\n\nsubplot 1 1 0 '#'\nfsurf 'v*cos(2*pi*u)' 'v*sin(2*pi*u)-0.05' 'v/2' 'Yyyww'\n"
+"light on\nrotate 65 80\ntube x y z+0.15 r\ndefine $r 0.13\n"
+"fsurf '0+$r*cos(2*pi*u)*cos(2*pi*v)' '0.03+$r*cos(2*pi*u)*sin(2*pi*v)' '2*$s+0.25+$r*sin(2*pi*u)' 'r'\n"
+"define $r 0.155\nfsurf '$r*cos(2*pi*u)*cos(2*pi*v)' '$s+$r*cos(2*pi*u)*sin(2*pi*v)' '0.25+$r*sin(2*pi*u)' 'b'\n";
+void smgl_icon(mglGraph *gr)
+{
+       gr->SetSize(200,200);   gr->SetRange('z',0,2);
+       mglData x(200); gr->Fill(x,"0.8*(x+1)/2*sin(2*pi*x)");
+       mglData y(200); gr->Fill(y,"0.8*(x+1)/2*cos(2*pi*x)");
+       mglData z(200); gr->Fill(z,"0.8*(2-(x+1))+0.25");
+       mglData r(200); gr->Fill(r,"0.02+0.07*(x+1)");
+       gr->SubPlot(1,1,0,"#");
+       gr->FSurf("v*cos(2*pi*u)","v*sin(2*pi*u)-0.05","v/2","Yyyww");
+       gr->Light(true);        gr->Rotate(65,80);      gr->Tube(x,y,z,r);
+       gr->FSurf("0.13*cos(2*pi*u)*cos(2*pi*v)","0.03+0.13*cos(2*pi*u)*sin(2*pi*v)","1.85+0.13*sin(2*pi*u)","r");
+       gr->FSurf("0.155*cos(2*pi*u)*cos(2*pi*v)","0.8+0.155*cos(2*pi*u)*sin(2*pi*v)","0.25+0.155*sin(2*pi*u)","b");
+}
+//-----------------------------------------------------------------------------
 const char *mmgl_ifs3d="list A [0,0,0,0,.18,0,0,0,0,0,0,0,.01] [.85,0,0,0,.85,.1,0,-0.1,0.85,0,1.6,0,.85]\\\n"
 "\t[.2,-.2,0,.2,.2,0,0,0,0.3,0,0.8,0,.07] [-.2,.2,0,.2,.2,0,0,0,0.3,0,0.8,0,.07]\n"
 "ifs3d f A 100000\ntitle 'IFS 3d sample':rotate 50 60\n"
@@ -3342,26 +3436,29 @@ void all_prims(mglGraph *gr)    // test drawing of all kinds
 //-----------------------------------------------------------------------------
 const char *mmgl_minmax="define $p 30\n"
 "new h 300 300 '-sqrt(1-x^2-y^2)*(3*x*y^2*$p-x^3*$p+6*y)/(3*sqrt(2))+x*y+(y^2+x^2)*$p/3 -7*(y^2+x^2)^2*$p/24+y^2+3*x^2'\n"
-"\nminmax e h\n\ncrange h:dens h:box\nfplot 'sin(2*pi*t)' 'cos(2*pi*t)' '0' 'k'\nplot e(0)*2-1 e(1)*2-1 '. c'";
+"\nminmax e h\nsubplot 1 1 0 '':title 'MinMax sample'\ncrange h:dens h:box\n"
+"fplot 'sin(2*pi*t)' 'cos(2*pi*t)' '0' 'k'\nplot e(0)*2-1 e(1)*2-1 '. c'";
 void smgl_minmax(mglGraph *gr) // test minmax
 {
        mglData h(300,300);
        gr->Fill(h,"-sqrt(1-x^2-y^2)*(3*x*y^2*30-x^3*30+6*y)/(3*sqrt(2))+x*y+(y^2+x^2)*10 -7*(y^2+x^2)^2*30/24+y^2+3*x^2");
        mglData e=h.MinMax();
+       if(big!=3)      {       gr->SubPlot(1,1,0,"");  gr->Title("MinMax sample");     }
        gr->SetRange('c',h);    gr->Dens(h);    gr->Box();
        gr->FPlot("sin(2*pi*t)","cos(2*pi*t)","0","k");
        e*=2;   e-=1;
-//     for(long i=0;i<x.nx;i++)        {       x.a[i]=e.a[2*i]*2-1;    y.a[i]=e.a[2*i+1]*2-1;  }
        gr->Plot(e(0),e(1),". c");
 }
 //-----------------------------------------------------------------------------
-const char *mmgl_conts="new a 10 10 'sin(2*pi*x*y)'\nrotate 40 60\n"
+const char *mmgl_conts="new a 10 10 'sin(2*pi*x*y)'\ntitle 'Conts sample':rotate 40 60:box\n"
 "dens a '#'\ncont [0,0] a 'r'\nconts r 0 a\nplot 2*r(0)-1 2*r(1)-1 1+r(2) '2c'";
 void smgl_conts(mglGraph *gr)  // test conts
 {
        mglData a(10,10);       gr->Fill(a,"sin(2*pi*x*y)");
        mglData v, r=a.Conts(0);
-       gr->Rotate(40,60);      gr->Dens(a,"#");        gr->Cont(v,a,"r");
+       if(big!=3)      {       gr->Title("Conts sample");      }
+       gr->Rotate(40,60);      gr->Box();
+       gr->Dens(a,"#");        gr->Cont(v,a,"r");
        mglData x(r.ny),y(r.ny),z(r.ny);
        for(long i=0;i<x.nx;i++)        {       x[i]=r[r.nx*i]*2-1;     y[i]=r[r.nx*i+1]*2-1;   z[i]=1; }
        gr->Plot(x,y,z,"2c");
@@ -3454,9 +3551,11 @@ mglSample samp[] = {
        {"aspect", smgl_aspect, mmgl_aspect, "Example of @ref{subplot}, @ref{inplot}, @ref{rotate}, @ref{aspect}, @ref{shear}."},
        {"axial", smgl_axial, mmgl_axial, "Function @ref{axial} draw surfaces of rotation for contour lines. You can draw wire surfaces (@samp{#} style) or ones rotated in other directions (@samp{x}, @samp{z} styles)."},
        {"axis", smgl_axis, mmgl_axis, "Different forms of @ref{axis} position."},
+       {"background", smgl_background, mmgl_background, "Load @ref{background} from an image file."},
        {"barh", smgl_barh, mmgl_barh, "Function @ref{barh} is the similar to @ref{bars} but draw horizontal bars."},
        {"bars", smgl_bars, mmgl_bars, "Function @ref{bars} draw vertical bars. It have a lot of options: bar-above-bar (@samp{a} style), fall like (@samp{f} style), 2 colors for positive and negative values, wired bars (@samp{#} style), 3D variant."},
        {"belt", smgl_belt, mmgl_belt, "Function @ref{belt} draw surface by belts. You can use @samp{x} style for drawing lines in other direction."},
+       {"beltc", smgl_beltc, mmgl_beltc, "Function @ref{beltc} draw surface by belts. You can use @samp{x} style for drawing lines in other direction."},
        {"bifurcation", smgl_bifurcation, mmgl_bifurcation, "Function @ref{bifurcation} draw Bifurcation diagram for multiple stationary points of the map (like logistic map)."},
        {"box", smgl_box, mmgl_box, "Different styles of bounding @ref{box}."},
        {"boxplot", smgl_boxplot, mmgl_boxplot, "Function @ref{boxplot} draw box-and-whisker diagram."},
@@ -3480,10 +3579,12 @@ mglSample samp[] = {
 //     {"crust", smgl_crust, mmgl_crust, ""},  // TODO: open after triangulation
        {"curvcoor", smgl_curvcoor, mmgl_curvcoor, "Some common curvilinear coordinates."},
        {"cut", smgl_cut, mmgl_cut, "Example of point cutting (@ref{cut}."},
+       {"daisy", smgl_daisy, mmgl_daisy, "Example of subfunctions and summation in textual formulas."},
        {"dat_diff", smgl_dat_diff, mmgl_dat_diff, "Example of @ref{diff} and @ref{integrate}."},
        {"dat_extra", smgl_dat_extra, mmgl_dat_extra , "Example of @ref{envelop}, @ref{sew}, @ref{smooth} and @ref{resize}."},
        {"data1", smgl_data1, mmgl_data1, ""},
        {"data2", smgl_data2, mmgl_data2, ""},
+       {"dcont", smgl_dcont, mmgl_dcont, "Function @ref{dcont} draw lines of intersections of two isosurfaces."},
        {"dens", smgl_dens, mmgl_dens, "Function @ref{dens} draw density plot (also known as color-map) for surface."},
        {"dens3", smgl_dens3, mmgl_dens3, "Function @ref{dens3} draw ordinary density plots but at slices of 3D data."},
        {"dens_xyz", smgl_dens_xyz, mmgl_dens_xyz, "Functions @ref{densz}, @ref{densy}, @ref{densx} draw density plot on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field."},
@@ -3506,15 +3607,18 @@ mglSample samp[] = {
        {"fonts", smgl_fonts, mmgl_fonts, "Example of @ref{font} typefaces."},
        {"grad", smgl_grad, mmgl_grad, "Function @ref{grad} draw gradient lines for matrix."},
        {"hist", smgl_hist, mmgl_hist, "Example of @ref{hist} (histogram)."},
+       {"icon", smgl_icon, mmgl_icon, "Default UDAV and mgllab icon."},
        {"ifs2d", smgl_ifs2d, mmgl_ifs2d, "Function @ref{ifs2d} generate points for fractals using iterated function system in 2d case."},
        {"ifs3d", smgl_ifs3d, mmgl_ifs3d, "Function @ref{ifs3d} generate points for fractals using iterated function system in 3d case."},
        {"indirect",smgl_indirect,mmgl_indirect, "Comparison of @ref{subdata} vs @ref{evaluate}/"},
        {"inplot", smgl_inplot, mmgl_inplot, "Example of @ref{inplot}, @ref{multiplot}, @ref{columnplot}, @ref{gridplot}, @ref{shearplot}, @ref{stickplot}."},
        {"iris", smgl_iris, mmgl_iris, "Function @ref{iris} draw Iris plot for columns of data array."},
+       {"keep", smgl_keep, mmgl_keep, "Function @ref{keep} conserve initial phase along specified direction(s)."},
        {"label", smgl_label, mmgl_label, "Function @ref{label} print text at data points. The string may contain @samp{%x}, @samp{%y}, @samp{%z} for x-, y-, z-coordinates of points, @samp{%n} for point index."},
        {"lamerey", smgl_lamerey, mmgl_lamerey, "Function @ref{lamerey} draw Lamerey diagram."},
        {"legend", smgl_legend, mmgl_legend , "Example of @ref{legend} styles."},
        {"light", smgl_light, mmgl_light, "Example of @ref{light} with different types."},
+       {"lines", smgl_lines, mmgl_lines, "Function @ref{lines} draw a set of lines."},
        {"loglog", smgl_loglog, mmgl_loglog, "Example of log- and log-log- axis labels."},
        {"map", smgl_map, mmgl_map, "Example of @ref{map}."},
        {"mark", smgl_mark, mmgl_mark, "Example of @ref{mark}."},
diff --git a/examples/test.c b/examples/test.c
new file mode 100644 (file)
index 0000000..24fbc33
--- /dev/null
@@ -0,0 +1,19 @@
+// gcc test.c -lmgl
+#include <mgl2/mgl_cf.h>
+int main()
+{
+       HMDT dat = mgl_create_data_size(30,40,1);       // data to for plotting
+       for(long i=0;i<30;i++)   for(long j=0;j<40;j++)
+               mgl_data_set_value(dat, 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.),i,j,0);
+       HMGL gr = mgl_create_graph(600, 400);   // class for plot drawing
+       mgl_set_ranges(gr,0,2,0,2,0,1);                 // ranges of coordinates
+       mgl_rotate(gr,50,60,0);                                 // rotate axis
+       mgl_set_light(gr,1);                                    // enable lighting
+       mgl_surf(gr,dat,"","");                                 // plot surface
+       mgl_cont(gr,dat,"y","");                                // plot yellow contour lines
+       mgl_axis(gr,"xyzt","","");                              // draw axis
+       mgl_puts(gr,1,1,1.2,"\\i f = \\dfrac{1}{1+(5x-5)^2+(5y-5)^2}","",-1);
+       mgl_write_frame(gr,"sample.png","");    // save it
+       mgl_delete_data(dat);                                   // free used memory
+       mgl_delete_graph(gr);
+}
diff --git a/examples/test.cpp b/examples/test.cpp
new file mode 100644 (file)
index 0000000..39248db
--- /dev/null
@@ -0,0 +1,17 @@
+// g++ test.cpp -lmgl
+#include <mgl2/mgl.h>
+int main()
+{
+       mglData dat(30,40);     // data to for plotting
+       for(long i=0;i<30;i++)   for(long j=0;j<40;j++)
+               dat.a[i+30*j] = 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.);
+       mglGraph gr;            // class for plot drawing
+       gr.SetRanges(0,2,0,2,0,1);      // ranges of coordinates
+       gr.Rotate(50,60);       // rotate axis
+       gr.Light(true);         // enable lighting
+       gr.Surf(dat);           // plot surface
+       gr.Cont(dat,"y");       // plot yellow contour lines
+       gr.Axis();                      // draw axis
+       gr.Puts(mglPoint(1,1,1.2),"\\i f = \\dfrac{1}{1+(5x-5)^2+(5y-5)^2}");
+       gr.WriteFrame("sample.png");    // save it
+}
diff --git a/examples/test.f90 b/examples/test.f90
new file mode 100644 (file)
index 0000000..4101ea1
--- /dev/null
@@ -0,0 +1,24 @@
+! gfortran test.f90 -lmgl -fdefault-real-8
+program test
+integer(8) :: dat, gr, mgl_create_data_size, mgl_create_graph
+real(8) :: v
+dat = mgl_create_data_size(30,40,1) ! data to for plotting
+do i=0,29
+  do j=0, 39
+    v = 1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.)
+    call mgl_data_set_value(dat, v,i,j,0)
+  end do
+end do
+gr = mgl_create_graph(600, 400)      ! class for plot drawing
+call mgl_set_ranges(gr,0.,2.,0.,2.,0.,1.)  ! ranges of coordinates
+call mgl_rotate(gr,50.,60.,0.)          ! rotate axis
+call mgl_set_light(gr,1)             ! enable lighting
+call mgl_surf(gr,dat,"","")          ! plot surface
+call mgl_cont(gr,dat,"y","")         ! plot yellow contour lines
+call mgl_axis(gr,"xyzt","","")       ! draw axis
+call mgl_puts(gr,1.,1.,1.2,"\i f = \dfrac{1}{1+(5x-5)^2+(5y-5)^2}","",-1.)
+call mgl_write_frame(gr,"sample.png","") ! save it
+call mgl_delete_data(dat)            ! free used memory
+call mgl_delete_graph(gr) 
+end program
+
diff --git a/examples/test.py b/examples/test.py
new file mode 100644 (file)
index 0000000..2b31d1c
--- /dev/null
@@ -0,0 +1,16 @@
+# python test.py
+from mathgl import *
+dat = mglData()        # data to for plotting
+dat.Create(30,40)
+for i in range(0,30):
+  for j in range(0,40):
+    dat.SetVal(1/(1+(i-15)*(i-15)/9.+(j-20)*(j-20)/16.),i,j)
+gr = mglGraph()     # class for plot drawing
+gr.SetRanges(0,2,0,2,0,1)      # ranges of coordinates
+gr.Rotate(50,60)       # rotate axis
+gr.Light(True)         # enable lighting
+gr.Surf(dat)           # plot surface
+gr.Cont(dat,"y")       # plot yellow contour lines
+gr.Axis()                      # draw axis
+gr.Puts(mglPoint(1,1,1.2),"\i f = \dfrac{1}{1+(5x-5)^2+(5y-5)^2}")
+gr.WriteFrame("sample.png")    # save it
diff --git a/examples/test_fltk.cpp b/examples/test_fltk.cpp
new file mode 100644 (file)
index 0000000..3e45b4f
--- /dev/null
@@ -0,0 +1,13 @@
+// g++ test_fltk.cpp -lmgl-fltk -lmgl
+#include <mgl2/fltk.h>
+int sample(mglGraph *gr)
+{
+  gr->Rotate(60,40);  gr->Box();
+  return 0;
+}
+//-----------------------------------------------------
+int main(int argc,char **argv)
+{
+  mglFLTK gr(sample,"MathGL examples");
+  return gr.Run();
+}
index 600745f0ec5b6066ae8b6f3d4f504d0439c1b371..b5fa7068afad67f34853e82da91a8ffea8a96a99 100644 (file)
 #include <getopt.h>
 #include "mgl2/font.h"
 //-----------------------------------------------------------------------------
+extern mglFont *mglDefFont;
+void mgl_init()        // TODO try to add ld option: "-init mgl_init"
+{
+       static bool ini=true;
+       if(ini)
+       {
+               ini = false;
+               mglDefFont = new mglFont(MGL_DEF_FONT_NAME);
+       }
+}
 int main(int argc, char *argv[])
 {
        mglFont fnt;
index 6367a08604666f8ba89c9631def81618d443c7a8..ed22fd8f1e744cc12bb553e487225c83f1c3497a 100644 (file)
 #endif
 
 #define MGL_SIZEOF_LONG        ${SIZEOF_LONG}
+#define MGL_HAVE_FREETYPE      ${MGL_HAVE_FREETYPE}
 #define MGL_HAVE_LTDL  ${MGL_HAVE_LTDL}
 #define MGL_HAVE_RVAL  ${MGL_HAVE_RVAL}
 #define MGL_HAVE_ZLIB  ${MGL_HAVE_ZLIB}
 #define MGL_HAVE_PNG   ${MGL_HAVE_PNG}
 #define MGL_HAVE_GSL   ${MGL_HAVE_GSL}
 #define MGL_HAVE_OPENGL        ${MGL_HAVE_OPENGL}
+#define MGL_HAVE_ARMA  ${MGL_HAVE_ARMA}
 #define MGL_HAVE_OMP   ${MGL_HAVE_OMP}
 #define MGL_HAVE_JPEG  ${MGL_HAVE_JPEG}
 #define MGL_HAVE_GIF   ${MGL_HAVE_GIF}
 #define MGL_HAVE_PDF   ${MGL_HAVE_PDF}
 #define MGL_HAVE_HDF4  ${MGL_HAVE_HDF4}
 #define MGL_HAVE_HDF5  ${MGL_HAVE_HDF5}
+#define MGL_HDF5_VER_MAJOR     ${HDF_VERSION_MAJOR}
+#define MGL_HDF5_VER_MINOR     ${HDF_VERSION_MINOR}
 #define MGL_USE_GETTEXT        ${MGL_USE_LIBINTL}
 #define MGL_FONT_PATH  "${MGL_FONT_PATH}"
 #define MGL_HAVE_FL_COPY       ${MGL_HAVE_FL_COPY}
index b533c4868a4d7e80c143a014ddb618f940051438..bb4019a860cf7650571d86b5c46084efea9803ff 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -33,6 +33,7 @@
 #include <FL/Fl_Progress.H>\r
 #include <mgl2/fltk.h>\r
 class mglCanvas;\r
+class Fl_Double_Window;\r
 //-----------------------------------------------------------------------------\r
 /// Class is FLTK widget which display MathGL graphics\r
 class MGL_EXPORT Fl_MathGL : public Fl_Widget\r
@@ -41,7 +42,6 @@ class MGL_EXPORT Fl_MathGL : public Fl_Widget
 public:\r
        Fl_Valuator     *tet_val;       ///< pointer to external tet-angle validator\r
        Fl_Valuator     *phi_val;       ///< pointer to external phi-angle validator\r
-       mglCanvas *gr;                  ///< Built-in mglCanvas instance (mglCanvasFLTK is used by default)\r
        std::string prim;               ///< manual primitives\r
        bool use_pthr;                  ///< use pthread for update plot\r
 \r
@@ -60,6 +60,9 @@ public:
        /// Set function for parameters\r
        inline void set_prop(void (*func)(char id, const char *val, void *par), void *par)\r
        {       prop_func=func; prop_par=par;   }\r
+       /// Set function for handling events. Note, use Fl::event_key() for getting pressed keybutton\r
+       inline void set_handle(int (*func)(int val, void *par), void *par)\r
+       {       hndl_func=func; hndl_par=par;   }\r
 \r
        /// Refresh image (without executing update)\r
        void refresh();\r
@@ -86,11 +89,12 @@ public:
        /// NOTE: Fl_MathGL will automatically delete this object\r
        void set_graph(HMGL gr);\r
        /// Set grapher object instead of built-in one. \r
-       /// NOTE: Fl_MathGL will automatically delete this object\r
        inline void set_graph(mglGraph *Gr)\r
        {       set_graph(Gr->Self());  }\r
        /// Get pointer to grapher\r
        inline HMGL get_graph() {       return (HMGL)gr;        }\r
+       /// Nullify grapher object for disabling double free. NOTE: this is internal function.\r
+       void no_graph() {gr=0;};\r
 \r
        /// Get mglDraw pointer or NULL\r
        inline mglDraw *get_class()\r
@@ -106,7 +110,7 @@ public:
        /// Ask to stop of script parsing\r
        void stop(bool stop=true);\r
        /// Enable/disable key handling as in mglview (default is false)\r
-       inline void set_handle_key(bool val)    {       handle_keys=true;       }\r
+       inline void set_handle_key(bool val)    {       handle_keys=val;        }\r
        /// Get id of last clicked object\r
        inline int get_last_id()        {       return last_id; }\r
        void draw_plot();       ///< Single thread drawing itself\r
@@ -114,12 +118,16 @@ public:
        inline bool running()   {       return run;     }\r
 \r
 protected:\r
+       mglCanvas *gr;                  ///< Built-in mglCanvas instance (mglCanvasFL is used by default)\r
        void *draw_par;         ///< Parameters for drawing function draw_func().\r
        /// Drawing function for window procedure. It should return the number of frames.\r
        int (*draw_func)(mglBase *gr, void *par);\r
        void *prop_par; ///< Parameters for prop_func().\r
        /// Function for setting properties.\r
        void (*prop_func)(char id, const char *val, void *par);\r
+       void *hndl_par; ///< Parameters for hndl_func().\r
+       /// Function for handling events.\r
+       int (*hndl_func)(int val, void *par);\r
        mglDraw *draw_cl;\r
        int last_id;                            ///< last selected object id\r
 \r
@@ -161,13 +169,13 @@ public:
        void (*reload)(void*);  ///< Callback function for reloading\r
 \r
        /// Toggle transparency (alpha) button\r
-       void toggle_alpha()     {       toggle(alpha, alpha_bt, _("Graphics/Alpha"));   }\r
+       void toggle_alpha();\r
        /// Toggle lighting button\r
-       void toggle_light()     {       toggle(light, light_bt, _("Graphics/Light"));   }\r
+       void toggle_light();\r
        /// Toggle slideshow button\r
-       void toggle_sshow()     {       toggle(sshow, anim_bt, _("Graphics/Animation/Slideshow"));      }\r
+       void toggle_sshow();\r
        /// Toggle grid drawing button\r
-       void toggle_grid()      {       toggle(grid, grid_bt, _("Graphics/Grid"));      }\r
+       void toggle_grid();\r
        /// Toggle mouse zoom button\r
        void toggle_zoom()      {       toggle(zoom, zoom_bt);  }\r
        /// Toggle mouse rotate button\r
@@ -179,7 +187,7 @@ public:
        /// Check if slideshow running\r
        bool is_sshow()         {       return sshow;   }\r
        /// Toggle pause calculation button\r
-       void toggle_pause()     {       toggle(pauseC, pause_bt, _("Graphics/Pause calc"));     exec_pause();   }\r
+       void toggle_pause();\r
        /// Adjust image sizes to the current widget sizes\r
        void adjust()\r
        {       mgl_set_size(FMGL->get_graph(),scroll->w(),scroll->h());        FMGL->size(scroll->w(),scroll->h());    update();       }\r
@@ -207,8 +215,8 @@ public:
        }\r
        void dlg_window(const char *title="");  ///< Create/label dialog window\r
        void add_widget(char id, const char *args);     ///< Add widget to dialog\r
-       void dlg_show() {       dlg_finish();   dlg_wnd->show();        }       ///< Show window\r
-       void dlg_hide() {       dlg_wnd->hide();        }       ///< Close window\r
+       void dlg_show()       ///< Show window\r
+       void dlg_hide()       ///< Close window\r
        void get_values();      ///< Get all values from dialog window\r
        void set_progress(int value, int maximal);      ///< Set progress\r
 \r
index 99c9e72ee2860e4b799fbc64789152e15240356d..c8c53b8900c33740d43f0e7ce6cd09321d831a26 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -46,8 +46,10 @@ std::string MGL_EXPORT mgl_data_to_string(HCDT d, long ns);
 std::string MGL_EXPORT mgl_datac_to_string(HCDT d, long ns);\r
 /// Get section separated by symbol ch. This is analog of QString::section().\r
 std::string MGL_EXPORT mgl_str_arg(const std::string &str, char ch, int n1, int n2=-1);\r
+std::wstring MGL_EXPORT mgl_wcs_arg(const std::wstring &str, wchar_t ch, int n1, int n2);\r
 /// Get sections separated by symbol ch\r
 std::vector<std::string> MGL_EXPORT mgl_str_args(const std::string &str, char ch);\r
+std::vector<std::wstring> MGL_EXPORT mgl_wcs_args(const std::wstring &str, wchar_t ch);\r
 /// Get string from real number\r
 std::string MGL_EXPORT mgl_str_num(double val);\r
 /// Get string from complex number\r
@@ -106,6 +108,12 @@ void MGL_EXPORT mgl_data_export_(uintptr_t *dat, const char *fname, const char *
 /// Save data to HDF file\r
 void MGL_EXPORT mgl_data_save_hdf(HCDT d,const char *fname,const char *data,int rewrite);\r
 void MGL_EXPORT mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char *data, int *rewrite,int l,int n);\r
+/// Save value to HDF file\r
+void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite);\r
+void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite);\r
+void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite);\r
+void MGL_EXPORT mgl_real_save_hdf_(double *val,const char *fname,const char *data,int *rewrite,int,int);\r
+void MGL_EXPORT mgl_int_save_hdf_(long *val, const char *fname, const char *data, int *rewrite, int, int);\r
 /// Get information about the data (sizes and momentum) to string\r
 MGL_EXPORT const char *mgl_data_info(HCDT dat);\r
 int MGL_EXPORT mgl_data_info_(uintptr_t *dat, char *out, int len);\r
@@ -226,6 +234,9 @@ struct MGL_EXPORT mglNum
        {       d=n.d;  c=n.c;  s=n.s;  return n;       }\r
 };\r
 //-----------------------------------------------------------------------------\r
+/// List of user-defined data arrays\r
+MGL_EXPORT extern std::vector<mglDataA*> mglDataList;\r
+//-----------------------------------------------------------------------------\r
 /// Abstract class for data array\r
 class MGL_EXPORT mglDataA\r
 {\r
@@ -237,8 +248,14 @@ public:
        void (*func)(void *);   ///< Callback function for destroying\r
        void *o;                ///< Pointer to external object\r
 \r
-       mglDataA()      {       temp=false;     func=0; o=0;    }\r
-       virtual ~mglDataA()     {       if(func)        func(o);        }\r
+       mglDataA()      {       mgl_init();     mglDataList.push_back(this);    temp=false;     func=0; o=0;    }\r
+       virtual ~mglDataA()\r
+       {\r
+               for(long i = mglDataList.size()-1; i>=0; i--)\r
+                       if(mglDataList[i] == this)\r
+                       {       mglDataList.erase(mglDataList.begin()+i);       break;  }\r
+               if(func)        func(o);\r
+       }\r
        /// Set name for data variable (can be used in mgl_formula_calc() or in MGL scripts)\r
        inline void Name(const char *name)              {       s = name;       }\r
        inline void Name(const wchar_t *name)   {       s = name;       }\r
@@ -384,7 +401,7 @@ struct MGL_EXPORT mglColorID
        mglColor col;\r
 };\r
 MGL_EXPORT extern mglColorID mglColorIds[31];\r
-MGL_EXPORT extern std::string mglGlobalMess;   ///< Buffer for receiving global messages\r
+// MGL_EXPORT extern std::string mglGlobalMess;        ///< Buffer for receiving global messages\r
 //-----------------------------------------------------------------------------\r
 #endif\r
 \r
index 2b7edd819beb6352cdcb37e2dc5f1f18965e29fc..42cece6657c6f8b14948802a518cf5eaaed25b12 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -55,7 +55,7 @@ void MGL_EXPORT mgl_test(const char *str, ...);
 /// Print info message
 void MGL_EXPORT mgl_info(const char *str, ...);
 /// Locate next data block (block started by -----)
-MGL_EXPORT FILE *mgl_next_data(const char *fname,int p);
+MGL_EXPORT FILE *mgl_next_data(const char *fname,long p);
 /// Enable executing MGL script if mgl_fgetstr() meet '#MGL fname.mgl [args]. Default value is 0 (false).
 void MGL_EXPORT mgl_fgetstr_mgl(int enable);
 
index c247c433e85fd4a29fc3f3a44ec75ece13e05fc5..5d06b83d93c7bb38a4b3d76e7379a80d006d13bc 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -267,7 +267,8 @@ struct MGL_EXPORT mglGlyph
        mglGlyph(long Nt, long Nl):nt(0),nl(0),trig(0),line(0)  {       Create(Nt,Nl);  }\r
        ~mglGlyph()     {       if(trig)        delete []trig;  if(line)        delete []line;  }\r
 \r
-       void Create(long Nt, long Nl);\r
+       void Create(long Nt, long Nl);  ///< Allocate memory for given sizes\r
+       void Load(wchar_t id, const char *fname);       ///< Load glyph 'id' from TTF/OTF file 'fname'\r
        bool operator==(const mglGlyph &g) const MGL_FUNC_PURE;\r
        inline bool operator!=(const mglGlyph &g) const MGL_FUNC_PURE\r
        {       return !(*this==g);     }\r
@@ -383,11 +384,11 @@ public:
        inline void set(bool v,uint32_t fl)     {       Flag = v ? Flag|fl : Flag&(~fl);        }\r
 \r
        /// Set axis range scaling -- simplified way to shift/zoom axis range -- need to replot whole image!\r
-       inline void ZoomAxis(mglPoint p1=mglPoint(0,0,0,0), mglPoint p2=mglPoint(1,1,1,1))      {       AMin = p1;      AMax = p2;      }\r
+       inline void ZoomAxis(const mglPoint &p1=mglPoint(0,0,0,0), const mglPoint &p2=mglPoint(1,1,1,1))        {       AMin = p1;      AMax = p2;      }\r
        /// Set values of mglGraph::Min and mglGraph::Max\r
        inline void SetRanges(mreal x1, mreal x2, mreal y1, mreal y2, mreal z1=0, mreal z2=0, mreal c1=0, mreal c2=0)\r
        {       SetRanges(mglPoint(x1,y1,z1,c1),mglPoint(x2,y2,z2,c2)); }\r
-       void SetRanges(mglPoint v1, mglPoint v2);\r
+       void SetRanges(const mglPoint &v1, const mglPoint &v2);\r
        /// Set values of mglGraph::Cmin and mglGraph::Cmax as minimal and maximal values of data a\r
        void CRange(HCDT a, bool add = false, mreal fact=0);\r
        void CRange(mreal v1,mreal v2,bool add=false);\r
@@ -425,7 +426,7 @@ public:
        /// Set additional cutting box\r
        inline void SetCutBox(mreal x1, mreal y1, mreal z1, mreal x2, mreal y2, mreal z2)\r
        {       CutMin.Set(x1,y1,z1);   CutMax.Set(x2,y2,z2);   }\r
-       inline void SetCutBox(mglPoint v1, mglPoint v2) {       CutMin=v1;      CutMax=v2;      }\r
+       inline void SetCutBox(const mglPoint &v1, const mglPoint &v2)   {       CutMin=v1;      CutMax=v2;      }\r
        /// Reset mask to solid state\r
        inline void ResetMask() {       mask = MGL_SOLID_MASK;  MaskAn = DefMaskAn;     }\r
        /// Set default mask rotation angle\r
@@ -495,6 +496,7 @@ public:
        /// Copy font from another mglGraph instance\r
        void CopyFont(mglBase *gr);\r
        /// Set default font size\r
+       void SetFontHscale(mreal val);\r
        inline void SetFontSize(mreal val)      {       FontSize=val>0 ? val:-FontSize*val;     }\r
        inline mreal GetFontSize() const        {       return FontSize;        }\r
        mreal TextWidth(const char *text, const char *font, mreal size) const MGL_FUNC_PURE;\r
@@ -531,15 +533,15 @@ public:
 \r
        // ~~~~~~~~~~~~~~~~~~~~~~ Developer functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r
        /// Add point to the Pnt and return its position\r
-       inline long AddPnt(mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1)\r
+       inline long AddPnt(const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1)\r
        {       return AddPnt(&B,p,c,n,a,scl);  }\r
-       long AddPnt(const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1);\r
+       long AddPnt(const mglMatrix *M, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1);\r
        bool AddPntQ(mglPnt &q, const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1);\r
-       inline bool AddPntQ(mglPnt &q, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1)\r
+       inline bool AddPntQ(mglPnt &q, mglPoint p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1)\r
        {       return AddPntQ(q,&B,p,c,n,a,scl);       }\r
-       inline bool AddPntQ(long id, const mglMatrix *M, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1)\r
+       inline bool AddPntQ(long id, const mglMatrix *M, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1)\r
        {       return AddPntQ(Pnt[id],M,p,c,n,a,scl);  }\r
-       inline bool AddPntQ(long id, mglPoint p, mreal c=-1, mglPoint n=mglPoint(NAN), mreal a=-1, int scl=1)\r
+       inline bool AddPntQ(long id, const mglPoint &p, mreal c=-1, const mglPoint &n=mglPoint(NAN), mreal a=-1, int scl=1)\r
        {       return AddPntQ(Pnt[id],&B,p,c,n,a,scl); }\r
        inline void SetPntOff(size_t id)        {       Pnt[id].x=NAN;  }\r
        long AllocPnts(size_t num);\r
@@ -548,9 +550,9 @@ public:
        bool CopyNtoC(mglPnt &q, long k, mreal c);\r
        inline bool CopyNtoC(long id, long k, mreal c)\r
        {       return (id>=0)?CopyNtoC(Pnt[id],k,c):false;     }\r
-       long CopyProj(long from, mglPoint p, mglPoint n, short sub=0);\r
-       bool CopyProj(mglPnt &q, long from, mglPoint p, mglPoint n, short sub=0);\r
-       void CopyProj(long id, long from, mglPoint p, mglPoint n, short sub=0)\r
+       long CopyProj(long from, const mglPoint &p, const mglPoint &n, short sub=0);\r
+       bool CopyProj(mglPnt &q, long from, const mglPoint &p, const mglPoint &n, short sub=0);\r
+       void CopyProj(long id, long from, const mglPoint &p, const mglPoint &n, short sub=0)\r
        {       if(id>=0)       CopyProj(Pnt[id],from,p,n,sub); }\r
        void DisablePnt(long id)        {       Pnt[id].x = NAN;        }\r
        void SetRGBA(long k, const mglColor &c)\r
@@ -655,6 +657,7 @@ public:
        void SetEventFunc(void (*func)(void *), void *par)      {       event_cb=func;  event_par=par;  }\r
 \r
 protected:\r
+       bool limit_pm1;         ///< limit coordinates in range [-1,+1] for OpenGL only\r
        volatile bool Stop;     ///< Flag that execution should be terminated.\r
        void (*event_cb)(void *);       ///< Function to be called for event processing\r
        void *event_par;        ///< Parameter for event processing function\r
index 963b46a6b74c97070c4f224f064acad4ae9699e3..a8c6e908a4ce4cd9065e36af172c6e13a7a5f99d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -132,6 +132,9 @@ void MGL_EXPORT mgl_set_facenum_(uintptr_t *gr, int *num);
 /// Clear unused points and primitives. Useful only in combination with mgl_set_facenum().\r
 void MGL_EXPORT mgl_clear_unused(HMGL gr);\r
 void MGL_EXPORT mgl_clear_unused_(uintptr_t *gr);\r
+/// Set TeX parsing at text drawing\r
+void MGL_EXPORT mgl_set_tex_parse(HMGL gr, int val);\r
+void MGL_EXPORT mgl_set_tex_parse_(uintptr_t *gr, int *val);\r
 \r
 /// Set ambient light brightness\r
 void MGL_EXPORT mgl_set_ambbr(HMGL gr, double i);\r
index c1be2bf3ca7c1ba4d3e043702abf6095b9f19063..d3fde2fd351fa07a6923656a2e41723f56911bf9 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -204,8 +204,16 @@ using mglBase::Light;
 \r
        /// Rasterize current plot and set it as background image\r
        void Rasterize();\r
-       /// Load image for background from file\r
+       /// Load image for background from file (basic variant)\r
        void LoadBackground(const char *fname, double alpha=1);\r
+       /// Load image for background from file. \r
+       /** Parameter 'how' can be:\r
+        *   'a' for filling current subplot only;\r
+        *   's' for spline-based resizing;\r
+        *   'f' for fixing aspect ratio at resizing;\r
+        *   'c' for centering image;\r
+        *   't' for tessellate image. */\r
+       void LoadBackground(const char *fname, const char *how, double alpha=1);\r
        /// Fill background image by specified color\r
        void FillBackground(const mglColor &cc);\r
 \r
@@ -216,7 +224,7 @@ using mglBase::Light;
        mglPoint CalcXYZ(int xs, int ys, bool real=false) const MGL_FUNC_PURE;\r
        /// Calculate screen point {xs,ys} for 3D coordinate {x,y,z}\r
        void CalcScr(mglPoint p, int *xs, int *ys) const;\r
-       mglPoint CalcScr(mglPoint p) const;\r
+       mglPoint CalcScr(const mglPoint &p) const;\r
        /// Set object/subplot id\r
        inline void SetObjId(long id)   {       ObjId = id;     }\r
        /// Get object id\r
@@ -291,7 +299,7 @@ using mglBase::Light;
        /// Set the ticks parameters\r
        void SetTicks(char dir, mreal d=0, int ns=0, mreal org=NAN, const wchar_t *lbl=0);\r
        /// Auto adjust ticks\r
-       void AdjustTicks(const char *dir="xyzc", bool force=false, std::string stl="");\r
+       void AdjustTicks(const char *dir="xyzc", bool force=false, const std::string &stl="");\r
        /// Tune ticks\r
        inline void SetTuneTicks(int tune, mreal pos=1.15)\r
        {       TuneTicks = tune;       FactorPos = pos;        }\r
index 657a9552ea3ae968d6497236c0ee3fab53c1ab76..57b467f137c429d2b513125179c382517f8ee554 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -31,6 +31,9 @@ uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height);
 /// Delete HMGL object\r
 void MGL_EXPORT mgl_delete_graph(HMGL gr);\r
 void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr);\r
+/// Return pointer to built-in (default) HMGL object\r
+HMGL MGL_EXPORT mgl_default_graph();\r
+uintptr_t MGL_EXPORT mgl_default_graph_();\r
 /// Set size of frame in pixels. Normally this function is called internally.\r
 void MGL_EXPORT mgl_set_size(HMGL gr, int width, int height);\r
 void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height);\r
@@ -175,7 +178,7 @@ void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch,int);
  *      ‘-’ for printing usual ‘-’ in ticks labels;\r
  *      ‘0123456789’ for precision at printing ticks labels.*/\r
 void MGL_EXPORT mgl_colorbar_ext(HMGL gr, const char *sch, double x, double y, double w, double h);\r
-void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int);\r
+void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int);\r
 /// Draw colorbar with manual colors at edge of axis\r
 /** Parameter \a sch may contain:\r
  *      ‘<>^_’ for positioning at left, at right, at top or at bottom correspondingly;\r
@@ -205,7 +208,7 @@ void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch
  *      ‘-’ for printing usual ‘-’ in ticks labels;\r
  *      ‘0123456789’ for precision at printing ticks labels.*/\r
 void MGL_EXPORT mgl_colorbar_val_ext(HMGL gr, HCDT dat, const char *sch,double x, double y, double w, double h);\r
-void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int);\r
+void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h,int);\r
 \r
 /// Add string to legend\r
 void MGL_EXPORT mgl_add_legend(HMGL gr, const char *text,const char *style);\r
@@ -444,6 +447,17 @@ void MGL_EXPORT mgl_clf_str_(uintptr_t *gr, const char *col, int);
 /// Load background image\r
 void MGL_EXPORT mgl_load_background(HMGL gr, const char *fname, double alpha);\r
 void MGL_EXPORT mgl_load_background_(uintptr_t *gr, const char *fname, mreal *alpha, int);\r
+/// Load background image\r
+/** Parameter 'how' can be:\r
+       *   'a' for filling current subplot only;\r
+       *   's' for scaling (resizing) image to whole area;\r
+       *   'c' for centering image;\r
+       *   'm' for tessellate image as mosaic. */\r
+void MGL_EXPORT mgl_load_background_ext(HMGL gr, const char *fname, const char *how, double alpha);\r
+void MGL_EXPORT mgl_load_background_ext_(uintptr_t *gr, const char *fname, const char *how, mreal *alpha, int,int);\r
+/// Fill background by specified color. Colors r,g,b should be in range [0,1].\r
+void MGL_EXPORT mgl_fill_background(HMGL gr, double r, double g, double b);\r
+void MGL_EXPORT mgl_fill_background_(uintptr_t *gr, double *r, double *g, double *b);\r
 \r
 /// Put further plotting in m-th cell of nx*ny grid of the image.\r
 /** String \a style may contain:\r
index 18f1b73084683ca0dc129063e4754cbb7525dd60..d9a3f53b44486b0abbd7262a4f7e0ee250209549 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -46,7 +46,7 @@ public:
        void SetCurFig(int c);\r
        void ResetFrames();\r
        inline mglPoint GetMousePos() const     {       return LastMousePos;}\r
-       inline void SetMousePos(mglPoint p)     {       LastMousePos=p; }\r
+       inline void SetMousePos(const mglPoint &p)      {       LastMousePos=p; }\r
        inline void Setup(bool clf_upd=true, bool showpos=false)\r
        {       set(showpos,MGL_SHOW_POS);      set(clf_upd,MGL_CLF_ON_UPD);\r
                if(!clf_upd)    ResetFrames();  }\r
index 239742c32dcfad54b3e3e7aafa89ba888a1f801b..c1bcc36ef025ed8afe976f61d22794653614f148 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -38,11 +38,24 @@ void MGL_EXPORT mgl_text_y(HMGL gr, HCDT y, const char *text, const char *font,
 void MGL_EXPORT mgl_text_y_(uintptr_t *gr, uintptr_t *y, const char *text, const char *font, const char *opt,int, int l,int n);\r
 void MGL_EXPORT mgl_textw_y(HMGL gr, HCDT y, const wchar_t *text, const char *font, const char *opt);\r
 \r
+\r
+void MGL_EXPORT mgl_dcont_gen(HMGL gr, double val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt);\r
 void MGL_EXPORT mgl_cont_gen(HMGL gr, double val, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl, const char *opt);\r
 void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl, const char *opt);\r
 //void MGL_EXPORT mgl_contv_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl);\r
 //void MGL_EXPORT mgl_axial_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *stl);\r
 \r
+/// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically\r
+/** Style ‘t’/‘T’ draw contour labels below/above contours.\r
+ *  If v==NULL then curve levels is selected equidistantly in color range. */\r
+void MGL_EXPORT mgl_dcont_xyz(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt);\r
+void MGL_EXPORT mgl_dcont_xyz_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int);\r
+/// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data\r
+/** Style ‘t’/‘T’ draw contour labels below/above contours.\r
+ *  If v==NULL then curve levels is selected equidistantly in color range. */\r
+void MGL_EXPORT mgl_dcont(HMGL gr, HCDT v, HCDT a, HCDT b, const char *sch, const char *opt);\r
+void MGL_EXPORT mgl_dcont_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int,int);\r
+\r
 /// Draw contour lines at manual levels for 2d data specified parametrically\r
 /** Style ‘_’ to draw contours at bottom of axis box.\r
  * Style ‘t’/‘T’ draw contour labels below/above contours. */\r
index faec67a1d184d8305e69fdfe5c2949c193a72b6d..4ec83eac1233423e41a82fa09188ec087e1ae594 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
 \r
 #include "mgl2/data_cf.h"\r
 #include "mgl2/pde.h"\r
+\r
+#if MGL_HAVE_ARMA\r
+#include <armadillo>\r
+#endif\r
 //-----------------------------------------------------------------------------\r
 #include <stdarg.h>\r
 //-----------------------------------------------------------------------------\r
@@ -34,6 +38,7 @@ class MGL_EXPORT mglData : public mglDataA
 {\r
 public:\r
 using mglDataA::Momentum;\r
+using mglDataA::Last;\r
        long nx;                ///< number of points in 1st dimensions ('x' dimension)\r
        long ny;                ///< number of points in 2nd dimensions ('y' dimension)\r
        long nz;                ///< number of points in 3d dimensions ('z' dimension)\r
@@ -144,6 +149,17 @@ using mglDataA::Momentum;
                va_end(vl);\r
        }\r
 \r
+#if MGL_HAVE_ARMA\r
+       inline void Set(const arma::vec &d)\r
+       {       Create(d.n_elem);       for(long i=0;i<nx;i++)  a[i] = d[i];    }\r
+       inline void Set(const arma::mat &d)\r
+       {       Create(d.n_rows,d.n_cols);      for(long i=0;i<nx*ny;i++)       a[i] = d[i];    }\r
+       inline void Set(const arma::cube &d)\r
+       {       Create(d.n_rows,d.n_cols,d.n_slices);   for(long i=0;i<nx*ny*nz;i++)    a[i] = d[i];    }\r
+       inline arma::mat arma_mat(long k=0) const { return arma::mat(a+k*nx*ny,ny,nx);  }\r
+       inline arma::cube arma_cube() const {return arma::cube(a,nx,ny,nz);}\r
+#endif\r
+\r
        /// Create or recreate the array with specified size and fill it by zero\r
        inline void Create(long mx,long my=1,long mz=1)\r
        {       mgl_data_create(this,mx,my,mz); }\r
@@ -229,6 +245,34 @@ using mglDataA::Momentum;
        inline void Put(const mglDataA &dat, long i=-1, long j=-1, long k=-1)\r
        {       mgl_data_put_dat(this,&dat,i,j,k);      }\r
 \r
+       /// Fills data by integer random numbers of uniform distribution in range [lo,hi]\r
+       inline void RndInteger(long lo, long hi)\r
+       {       mgl_data_rnd_integer(this, lo, hi);     }\r
+       /// Fills data by random numbers of uniform distribution in range [lo,hi]\r
+       inline void RndUniform(mreal lo, mreal hi)\r
+       {       mgl_data_rnd_uniform(this, lo, hi);     }\r
+       /// Fills data by random numbers of Bernoulli distribution\r
+       inline void RndBernoulli(mreal p=0.5)\r
+       {       mgl_data_rnd_bernoulli(this, p);        }\r
+       /// Fills data by random numbers of binomial distribution\r
+       inline void RndBinomial(long trials, mreal p=0.5)\r
+       {       mgl_data_rnd_binomial(this, trials, p); }\r
+       /// Fills data by random numbers of Gaussian distribution\r
+       inline void RndGaussian(mreal mu=0.0, mreal sigma=1.0)\r
+       {       mgl_data_rnd_gaussian(this, mu, sigma); }\r
+       /// Fills data by random numbers of exponential distribution\r
+       inline void RndExponential(mreal lambda)\r
+       {       mgl_data_rnd_exponential(this, lambda); }\r
+       /// Fills data by random numbers of discrete distribution according A\r
+       inline void RndDiscrete(const mglDataA &A)\r
+       {       mgl_data_rnd_discrete(this, &A);        }\r
+       /// Shuffles elements or slices of data array\r
+       inline void RndShuffle(char dir='a')\r
+       {       mgl_shuffle(this, dir); }\r
+       /// Fills data by fractional brownian motions along x-direction\r
+       inline void RndBrownian(mreal y1, mreal y2, mreal sigma, mreal alpha)\r
+       {       mgl_data_brownian(this, y1, y2, sigma, alpha);  }\r
+       \r
        /// Read data from tab-separated text file with auto determining size\r
        inline bool Read(const char *fname)\r
        {       return mgl_data_read(this,fname); }\r
@@ -253,6 +297,10 @@ using mglDataA::Momentum;
        /// Scan textual file for template and fill data array\r
        inline int ScanFile(const char *fname, const char *templ)\r
        {       return mgl_data_scan_file(this,fname, templ);   }\r
+       /// Read data from binary file of type: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char.\r
+       /** NOTE: this function may not correctly read binary files written in different CPU kind! */\r
+       inline bool ReadBin(const char *fname, int type)\r
+       {       return mgl_data_read_bin(this, fname, type);    }\r
 \r
 \r
        /// Get column (or slice) of the data filled by formulas of named columns\r
@@ -295,6 +343,13 @@ using mglDataA::Momentum;
        /// Get array which is result of summation in given direction or directions\r
        inline mglData Sum(const char *dir) const\r
        {       return mglData(true,mgl_data_sum(this,dir));    }\r
+       /// Get array of positions of first value large val\r
+       inline mglData First(const char *dir, mreal val) const\r
+       {       return mglData(true,mgl_data_first_dir(this,dir,val));  }\r
+       /// Get array of positions of last value large val\r
+       inline mglData Last(const char *dir, mreal val) const\r
+       {       return mglData(true,mgl_data_last_dir(this,dir,val));   }\r
+\r
        /// Get array which is result of maximal values in given direction or directions\r
        inline mglData Max(const char *dir) const\r
        {       return mglData(true,mgl_data_max_dir(this,dir));        }\r
@@ -397,6 +452,10 @@ using mglDataA::Momentum;
        /// Project the periodical data to range [v1,v2] (like mod() function). Separate branches by NAN if sep=true.\r
        inline void Coil(mreal v1, mreal v2, bool sep=true)\r
        {       mgl_data_coil(this, v1, v2, sep);       }\r
+       /// Keep the data sign/value along line i and j in given direction. \r
+       /** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of sign.*/\r
+       inline void Keep(const char *how, long i, long j=0)\r
+       {       mgl_data_keep(this, how, i, j); }\r
 \r
        /// Apply Hankel transform\r
        inline void Hankel(const char *dir)     {       mgl_data_hankel(this,dir);      }\r
@@ -564,6 +623,9 @@ inline mglData mglRay(const char *ham, mglPoint r0, mglPoint p0, mreal dt=0.1, m
 /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt\r
 inline mglData mglODE(const char *func, const char *var, const mglDataA &ini, mreal dt=0.1, mreal tmax=10)\r
 {      return mglData(true, mgl_ode_solve_str(func,var, &ini, dt, tmax));      }\r
+/// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 of size n*m over time interval [0,tmax] with time step dt\r
+inline mglData mglODEs(const char *func, const char *var, char brd, const mglDataA &ini, mreal dt=0.1, mreal tmax=10)\r
+{      return mglData(true, mgl_ode_solve_set(func,var, brd, &ini, dt, tmax)); }\r
 //-----------------------------------------------------------------------------\r
 /// Get array as solution of tridiagonal system of equations a[i]*x[i-1]+b[i]*x[i]+c[i]*x[i+1]=d[i]\r
 /** String \a how may contain:\r
@@ -624,12 +686,16 @@ inline mglData mglGSplineInit(const mglDataA &xdat, const mglDataA &ydat)
 inline mreal mglGSpline(const mglDataA &coef, mreal dx, mreal *d1=0, mreal *d2=0)\r
 {      return mgl_gspline(&coef, dx, d1,d2);   }\r
 //-----------------------------------------------------------------------------\r
+/// Evaluate formula 'str' for given list of variables 'vars'. \r
+/** NOTE: you need to delete returned data array!*/\r
+HMDT MGL_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &vars);\r
+//-----------------------------------------------------------------------------\r
 /// Wrapper class for expression evaluating\r
 class MGL_EXPORT mglExpr\r
 {\r
        HMEX ex;\r
-       mglExpr(const mglExpr &){}      // copying is not allowed\r
-       const mglExpr &operator=(const mglExpr &t){return t;}   // copying is not allowed\r
+       mglExpr(const mglExpr &){ex=0;} // copying is not allowed\r
+       const mglExpr &operator=(const mglExpr &t){ex=0;        return t;}      // copying is not allowed\r
 public:\r
        mglExpr(const char *expr)               {       ex = mgl_create_expr(expr);     }\r
 #if MGL_HAVE_RVAL\r
@@ -816,7 +882,7 @@ public:
 \r
        /// Create or recreate the array with specified size and fill it by zero\r
        inline void Create(long mx,long my=1,long mz=1) {       nx=mx;  ny=my;  nz=mz;  setD(); }\r
-       inline void SetRanges(mglPoint p1, mglPoint p2) {       v1=p1;  v2=p2;  setD(); }\r
+       inline void SetRanges(const mglPoint &p1, const mglPoint &p2)   {       v1=p1;  v2=p2;  setD(); }\r
        /// Set formula to be used as dfunction\r
        inline void SetFormula(const char *eq)\r
        {\r
@@ -907,7 +973,7 @@ class MGL_EXPORT mglDataT : public mglDataA
 {\r
        const mglDataA &dat;\r
        long ind;\r
-       const mglDataT &operator=(const mglDataT &d)    {       return d;       }\r
+       const mglDataT &operator=(const mglDataT &d)    {       ind=0;  return d;       }\r
 public:\r
        mglDataT(const mglDataT &d) : dat(d.dat), ind(d.ind)    {       s = d.s;        }\r
        mglDataT(const mglDataA &d, long col=0) : dat(d), ind(col)      {}\r
@@ -957,7 +1023,7 @@ class MGL_EXPORT mglDataR : public mglDataA
 {\r
        const mglDataA &dat;\r
        long ind;\r
-       const mglDataR &operator=(const mglDataR &d)    {       return d;       }\r
+       const mglDataR &operator=(const mglDataR &d)    {       ind=0;  return d;       }\r
 public:\r
        mglDataR(const mglDataR &d) : dat(d.dat), ind(d.ind)    {       s = d.s;        }\r
        mglDataR(const mglDataA &d, long row=0) : dat(d), ind(row)      {}\r
index 418a296132ddbf8c835fae7c9e9b9dae32e8287e..f493a278ef57594396e72d023136d84017e38c1d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -119,6 +119,10 @@ int MGL_EXPORT mgl_data_read_range_(uintptr_t *d, const char *fname, mreal *n1,
 /// Read data from tab-separated text files with auto determining size which filenames are satisfied to template (like "t_*.dat")\r
 int MGL_EXPORT mgl_data_read_all(HMDT dat, const char *templ, int as_slice);\r
 int MGL_EXPORT mgl_data_read_all_(uintptr_t *d, const char *fname, int *as_slice,int l);\r
+/// Read data from binary file of type: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char.\r
+/** NOTE: this function may not correctly read binary files written in different CPU kind! */\r
+int MGL_EXPORT mgl_data_read_bin(HMDT dat, const char *fname, int type);\r
+int MGL_EXPORT mgl_data_read_bin_(uintptr_t *d, const char *fname,int *type,int l);\r
 /// Import data array from PNG file according color scheme\r
 void MGL_EXPORT mgl_data_import(HMDT dat, const char *fname, const char *scheme,mreal v1,mreal v2);\r
 void MGL_EXPORT mgl_data_import_(uintptr_t *dat, const char *fname, const char *scheme,mreal *v1,mreal *v2,int,int);\r
@@ -151,6 +155,10 @@ void MGL_EXPORT mgl_data_limit_(uintptr_t *dat, mreal *v);
 /// Project the periodical data to range [v1,v2] (like mod() function). Separate branches by NAN if sep=true.\r
 void MGL_EXPORT mgl_data_coil(HMDT dat, mreal v1, mreal v2, int sep);\r
 void MGL_EXPORT mgl_data_coil_(uintptr_t *dat, mreal *v1, mreal *v2, int *sep);\r
+/// Keep the data sign/value along line i and j in given direction. \r
+/** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of sign.*/\r
+void MGL_EXPORT mgl_data_keep(HMDT dat, const char *how, long i, long j);\r
+void MGL_EXPORT mgl_data_keep_(uintptr_t *d, const char *how, long *i, long *j, int);\r
 \r
 /// Get sub-array of the data with given fixed indexes\r
 HMDT MGL_EXPORT mgl_data_subdata(HCDT dat, long xx,long yy,long zz);\r
@@ -170,7 +178,9 @@ uintptr_t MGL_EXPORT mgl_data_section_(uintptr_t *d, uintptr_t *ids, const char
 HMDT MGL_EXPORT mgl_data_section_val(HCDT dat, long id, char dir, mreal val);\r
 uintptr_t MGL_EXPORT mgl_data_section_val_(uintptr_t *d, int *id, const char *dir, mreal *val,int);\r
 /// Get contour lines for dat[i,j]=val. NAN values separate the the curves\r
-HMDT mgl_data_conts(mreal val, HCDT dat);\r
+HMDT MGL_EXPORT mgl_data_conts(mreal val, HCDT dat);\r
+/// Evaluate formula 'str' for given list of variables.\r
+HMDT MGL_EXPORT mgl_formula_calc(const char *str, long n, ...);\r
 \r
 /// Equidistantly fill the data to range [x1,x2] in direction dir\r
 void MGL_EXPORT mgl_data_fill(HMDT dat, mreal x1,mreal x2,char dir);\r
@@ -315,6 +325,12 @@ void MGL_EXPORT mgl_data_smooth_(uintptr_t *dat, const char *dirs, mreal *delta,
 /// Get array which is result of summation in given direction or directions\r
 HMDT MGL_EXPORT mgl_data_sum(HCDT dat, const char *dir);\r
 uintptr_t MGL_EXPORT mgl_data_sum_(uintptr_t *dat, const char *dir,int);\r
+/// Get array of positions of first value large val\r
+HMDT MGL_EXPORT mgl_data_first_dir(HCDT dat, const char *dir, double val);\r
+uintptr_t MGL_EXPORT mgl_data_first_dir_(uintptr_t *d, const char *dir, double *val,int l);\r
+/// Get array of positions of last value large val\r
+HMDT MGL_EXPORT mgl_data_last_dir(HCDT dat, const char *dir, double val);\r
+uintptr_t MGL_EXPORT mgl_data_last_dir_(uintptr_t *d, const char *dir, double *val,int l);\r
 /// Get array which is result of maximal values in given direction or directions\r
 HMDT MGL_EXPORT mgl_data_max_dir(HCDT dat, const char *dir);\r
 uintptr_t MGL_EXPORT mgl_data_max_dir_(uintptr_t *dat, const char *dir,int);\r
@@ -524,7 +540,59 @@ uintptr_t MGL_EXPORT mgl_data_roots_(const char *func, uintptr_t *ini, const cha
 HMDT MGL_EXPORT mgl_find_roots_txt(const char *func, const char *vars, HCDT ini);\r
 uintptr_t MGL_EXPORT mgl_find_roots_txt_(const char *func, const char *vars, uintptr_t *ini,int,int);\r
 /// Find roots for set of nonlinear equations defined by function\r
-bool MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par);\r
+int MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par);\r
+\r
+/// Gets integer random numbers of uniform distribution in range [lo,hi]\r
+mreal MGL_EXPORT mgl_rnd_integer(long lo, long hi);\r
+double MGL_EXPORT mgl_rnd_integer_(int *lo, int *hi);\r
+/// Gets random numbers of uniform distribution in range [lo,hi]\r
+mreal MGL_EXPORT mgl_rnd_uniform(mreal lo, mreal hi);\r
+double MGL_EXPORT mgl_rnd_uniform_(double *lo, double *hi);\r
+/// Gets random numbers of Bernoulli distribution\r
+mreal MGL_EXPORT mgl_rnd_bernoulli(mreal p);\r
+double MGL_EXPORT mgl_rnd_bernoulli_(double *p);\r
+/// Gets random numbers of binomial distribution\r
+long MGL_EXPORT mgl_rnd_binomial(long trials, mreal p);\r
+int MGL_EXPORT mgl_rnd_binomial_(int *trials, double *p);\r
+/// Gets random numbers of gaussian distribution\r
+mreal MGL_EXPORT mgl_rnd_gaussian(mreal mu, mreal sigma);\r
+double MGL_EXPORT mgl_rnd_gaussian_(double *mu, double *sigma);\r
+/// Gets random numbers of exponential distribution\r
+mreal MGL_EXPORT mgl_rnd_exponential(mreal lambda);\r
+double MGL_EXPORT mgl_rnd_exponential_(double *lambda);\r
+/// Gets random numbers of discrete distribution according A. It assumes A to be 1d.\r
+long MGL_EXPORT mgl_rnd_discrete(HCDT A);\r
+double MGL_EXPORT mgl_rnd_discrete_(uintptr_t *d);\r
+\r
+/// Fills data by integer random numbers of uniform distribution in range [lo,hi]\r
+void MGL_EXPORT mgl_data_rnd_integer(HMDT d, long lo, long hi);\r
+void MGL_EXPORT mgl_data_rnd_integer_(uintptr_t *d, int *lo, int *hi);\r
+/// Fills data by random numbers of uniform distribution in range [lo,hi]\r
+void MGL_EXPORT mgl_data_rnd_uniform(HMDT d, mreal lo, mreal hi);\r
+void MGL_EXPORT mgl_data_rnd_uniform_(uintptr_t *d, double *lo, double *hi);\r
+/// Fills data by random numbers of bernoulli distribution\r
+void MGL_EXPORT mgl_data_rnd_bernoulli(HMDT d, mreal p);\r
+void MGL_EXPORT mgl_data_rnd_bernoulli_(uintptr_t *d, double *p);\r
+/// Fills data by random numbers of binomial distribution\r
+void MGL_EXPORT mgl_data_rnd_binomial(HMDT d, long trials, mreal p);\r
+void MGL_EXPORT mgl_data_rnd_binomial_(uintptr_t *d, double *p);\r
+/// Fills data by random numbers of gaussian distribution\r
+void MGL_EXPORT mgl_data_rnd_gaussian(HMDT d, mreal mu, mreal sigma);\r
+void MGL_EXPORT mgl_data_rnd_gaussian_(uintptr_t *d, double *mu, double *s);\r
+/// Fills data by random numbers of exponential distribution\r
+void MGL_EXPORT mgl_data_rnd_exponential(HMDT d, mreal lambda);\r
+void MGL_EXPORT mgl_data_rnd_exponential_(uintptr_t *d, double *l);\r
+/// Fills data by random numbers of discrete distribution according A\r
+void MGL_EXPORT mgl_data_rnd_discrete(HMDT d, HCDT A);\r
+void MGL_EXPORT mgl_data_rnd_discrete_(uintptr_t *d, uintptr_t *A);\r
+/// Shuffles elements or slices of data array\r
+void MGL_EXPORT mgl_shuffle(HMDT d, char dir);\r
+void MGL_EXPORT mgl_shuffle_(uintptr_t *d, char *dir, int);\r
+/// Fills data by fractional brownian motions along x-direction\r
+void MGL_EXPORT mgl_data_brownian(HMDT d, mreal y1, mreal y2, mreal sigma, mreal alpha);\r
+void MGL_EXPORT mgl_data_brownian_(uintptr_t *d, double *y1, double *y2, double *sigma, double *alpha);\r
+\r
+\r
 //-----------------------------------------------------------------------------\r
 #ifdef __cplusplus\r
 }\r
index f2c0251d247e4d4f1ded02f9f431126fcfa0fd73..857e10824b31e40e002db3cdd7f6572917c4981b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
 \r
 #include "mgl2/data.h"\r
 #include "mgl2/datac_cf.h"\r
+\r
+#if MGL_HAVE_ARMA\r
+#include <armadillo>\r
+#endif\r
 //-----------------------------------------------------------------------------\r
 #include <vector>\r
 #include <string>\r
@@ -36,6 +40,7 @@ class MGL_EXPORT mglDataC : public mglDataA
 {\r
 public:\r
 using mglDataA::Momentum;\r
+using mglDataA::Last;\r
        long nx;                ///< number of points in 1st dimensions ('x' dimension)\r
        long ny;                ///< number of points in 2nd dimensions ('y' dimension)\r
        long nz;                ///< number of points in 3d dimensions ('z' dimension)\r
@@ -146,6 +151,23 @@ using mglDataA::Momentum;
        {       if(d.size()>0)  {       Create(d.size());       for(long i=0;i<nx;i++)  a[i] = d[i];    }\r
                else    Create(1);      }\r
 \r
+#if MGL_HAVE_ARMA\r
+       inline void Set(const arma::cx_mat &d)\r
+       {       Create(d.n_rows,d.n_cols);      for(long i=0;i<nx*ny;i++)       a[i] = d[i];    }\r
+       inline void Set(const arma::mat &d)\r
+       {       Create(d.n_rows,d.n_cols);      for(long i=0;i<nx*ny;i++)       a[i] = d[i];    }\r
+       inline void Set(const arma::cx_cube &d)\r
+       {       Create(d.n_rows,d.n_cols,d.n_slices);   for(long i=0;i<nx*ny*nz;i++)    a[i] = d[i];    }\r
+       inline void Set(const arma::cube &d)\r
+       {       Create(d.n_rows,d.n_cols,d.n_slices);   for(long i=0;i<nx*ny*nz;i++)    a[i] = d[i];    }\r
+       inline void Set(const arma::cx_vec &d)\r
+       {       Create(d.n_elem);       for(long i=0;i<nx;i++)  a[i] = d[i];    }\r
+       inline void Set(const arma::vec &d)\r
+       {       Create(d.n_elem);       for(long i=0;i<nx;i++)  a[i] = d[i];    }\r
+       inline arma::cx_mat arma_mat(long k=0) const { return arma::cx_mat(a+k*nx*ny,ny,nx);  }\r
+       inline arma::cx_cube arma_cube() const {return arma::cx_cube(a,nx,ny,nz);}\r
+#endif\r
+\r
        /// Create or recreate the array with specified size and fill it by zero\r
        inline void Create(long mx,long my=1,long mz=1)\r
        {       mgl_datac_create(this,mx,my,mz);        }\r
@@ -326,6 +348,13 @@ using mglDataA::Momentum;
        /// Create n-th points distribution of this data values in range [v1, v2] with weight w\r
        inline mglData Hist(const mglDataA &w, long n,mreal v1=0,mreal v2=1, long nsub=0) const\r
        {       return mglData(true,mgl_data_hist_w(this,&w,n,v1,v2,nsub));     }\r
+       /// Get array of positions of first value, which abs() is  large val\r
+       inline mglData First(const char *dir, mreal val) const\r
+       {       return mglData(true,mgl_data_first_dir(this,dir,val));  }\r
+       /// Get array of positions of last value, which abs() is large val\r
+       inline mglData Last(const char *dir, mreal val) const\r
+       {       return mglData(true,mgl_data_last_dir(this,dir,val));   }\r
+\r
        /// Get array which is result of maximal values in given direction or directions\r
        inline mglData Max(const char *dir) const\r
        {       return mglData(true,mgl_data_max_dir(this,dir));        }\r
@@ -369,9 +398,13 @@ using mglDataA::Momentum;
         *  By default quadratic averaging over 5 points is used. */\r
        inline void Smooth(const char *dirs="xyz",mreal delta=0)\r
        {       mgl_datac_smooth(this,dirs,delta);      }\r
-       /// Limit the data to be inside [-v,v], keeping the original sign\r
+       /// Limit the data to be inside [-v,v], keeping the original phase\r
        inline void Limit(mreal v)\r
        {       mgl_datac_limit(this, v);       }\r
+       /// Keep the data phase/value along line i and j in given direction. \r
+       /** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of phase.*/\r
+       inline void Keep(const char *how, long i, long j=0)\r
+       {       mgl_datac_keep(this, how, i, j);        }\r
 \r
        /// Set as the data envelop\r
        inline void Envelop(char dir='x')       {       mgl_datac_envelop(this,dir);    }\r
@@ -384,6 +417,9 @@ using mglDataA::Momentum;
        /// Fourier transform\r
        inline void FFT(const char *dir)        {       mgl_datac_fft(this,dir);        }\r
        /// Calculate one step of diffraction by finite-difference method with parameter q\r
+       /** Parameter \a how may contain:\r
+        * ‘x‘,‘y‘,‘z‘ or ‘r‘  for directions or axial along x,\r
+        * ‘e‘,‘g‘,‘0‘,‘1‘,‘2‘,‘3‘ for boundary conditions: exponential, Gaussian, zero, constant, linear, quadratic.*/\r
        inline void Diffraction(const char *how, mreal q)       {       mgl_datac_diffr(this,how,q);    }\r
        /// Apply wavelet transform\r
        /** Parameter \a dir may contain:\r
@@ -474,7 +510,7 @@ using mglDataA::Momentum;
        void set_v(mreal val, long i,long j=0,long k=0) {       a[i+nx*(j+ny*k)]=val;   }\r
 #else\r
        /// Get the value in given cell of the data with border checking\r
-       mreal v(long i,long j=0,long k=0) const {       return mgl_abs(mgl_datac_get_value(this,i,j,k));        }\r
+       mreal v(long i,long j=0,long k=0) const {       return abs(mgl_datac_get_value(this,i,j,k));    }\r
        /// Set the value in given cell of the data\r
        void set_v(mreal val, long i,long j=0,long k=0) {       mgl_datac_set_value(this,val,i,j,k);    }\r
 #endif\r
@@ -524,6 +560,9 @@ inline mglDataC mglQO3dc(const char *ham, const mglDataA &ini_re, const mglDataA
 /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt\r
 inline mglDataC mglODEc(const char *func, const char *var, const mglDataA &ini, mreal dt=0.1, mreal tmax=10)\r
 {      return mglDataC(true, mgl_ode_solve_str_c(func,var, &ini, dt, tmax));   }\r
+/// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 of size n*m over time interval [0,tmax] with time step dt\r
+inline mglDataC mglODEcs(const char *func, const char *var, char brd, const mglDataA &ini, mreal dt=0.1, mreal tmax=10)\r
+{      return mglDataC(true, mgl_ode_solve_set_c(func,var, brd, &ini, dt, tmax));      }\r
 //-----------------------------------------------------------------------------\r
 /// Get array as solution of tridiagonal system of equations a[i]*x[i-1]+b[i]*x[i]+c[i]*x[i+1]=d[i]\r
 /** String \a how may contain:\r
@@ -551,6 +590,10 @@ inline mglDataC mglGSplineCInit(const mglDataA &xdat, const mglDataA &ydat)
 inline dual mglGSplineC(const mglDataA &coef, mreal dx, dual *d1=0, dual *d2=0)\r
 {      return mgl_gsplinec(&coef, dx, reinterpret_cast<mdual*>(d1), reinterpret_cast<mdual*>(d2));     }\r
 //-----------------------------------------------------------------------------\r
+/// Evaluate formula 'str' for given list of variables 'vars'.\r
+/** NOTE: you need to delete returned data array!*/\r
+HADT MGL_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &vars);\r
+//-----------------------------------------------------------------------------\r
 #define _DN_(a)        ((mglDataC *)*(a))\r
 #define _DC_           ((mglDataC *)*d)\r
 //-----------------------------------------------------------------------------\r
@@ -559,8 +602,8 @@ inline dual mglGSplineC(const mglDataA &coef, mreal dx, dual *d1=0, dual *d2=0)
 class MGL_EXPORT mglExprC\r
 {\r
        HAEX ex;\r
-       mglExprC(const mglExprC &){}    // copying is not allowed\r
-       const mglExprC &operator=(const mglExprC &t){return t;} // copying is not allowed\r
+       mglExprC(const mglExprC &){ex=0;}       // copying is not allowed\r
+       const mglExprC &operator=(const mglExprC &t){ex=0;      return t;}      // copying is not allowed\r
 public:\r
        mglExprC(const char *expr)              {       ex = mgl_create_cexpr(expr);    }\r
        ~mglExprC()     {       mgl_delete_cexpr(ex);   }\r
index 5f5730caed733384e52a2cfb8895f1a7dac38998..afca6f38a5ae6176c67b79284eee06e60cbdfe37 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -183,6 +183,8 @@ uintptr_t MGL_EXPORT mgl_datac_section_(uintptr_t *d, uintptr_t *ids, const char
 /** If section id is negative then reverse order is used (i.e. -1 give last section). */\r
 HADT MGL_EXPORT mgl_datac_section_val(HCDT dat, long id, char dir, mreal val);\r
 uintptr_t MGL_EXPORT mgl_datac_section_val_(uintptr_t *d, int *id, const char *dir, mreal *val,int);\r
+/// Evaluate formula 'str' for given list of variables.\r
+HADT MGL_EXPORT mgl_formula_calc_c(const char *str, long n, ...);\r
 \r
 /// Equidistantly fill the data to range [x1,x2] in direction dir\r
 void MGL_EXPORT mgl_datac_fill(HADT dat, mdual x1,mdual x2,char dir);\r
@@ -213,10 +215,15 @@ void MGL_EXPORT mgl_datac_modify_(uintptr_t *dat, const char *eq,int *dim,int);
 void MGL_EXPORT mgl_datac_modify_vw(HADT dat, const char *eq,HCDT vdat,HCDT wdat);\r
 void MGL_EXPORT mgl_datac_modify_vw_(uintptr_t *dat, const char *eq, uintptr_t *vdat, uintptr_t *wdat,int);\r
 \r
-/// Limit the data to be inside [-v,v], keeping the original sign\r
+/// Limit the data to be inside [-v,v], keeping the original phase\r
 void MGL_EXPORT mgl_datac_limit(HADT dat, mreal v);\r
 void MGL_EXPORT mgl_datac_limit_(uintptr_t *dat, mreal *v);\r
 \r
+/// Keep the data phase/value along line i and j in given direction. \r
+/** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of phase.*/\r
+void MGL_EXPORT mgl_datac_keep(HADT dat, const char *how, long i, long j);\r
+void MGL_EXPORT mgl_datac_keep_(uintptr_t *d, const char *how, long *i, long *j, int);\r
+\r
 /// Put value to data element(s)\r
 void MGL_EXPORT mgl_datac_put_val(HADT dat, mdual val, long i, long j, long k);\r
 void MGL_EXPORT mgl_datac_put_val_(uintptr_t *dat, mdual *val, int *i, int *j, int *k);\r
@@ -321,6 +328,9 @@ void MGL_EXPORT mgl_datac_fft_(uintptr_t *dat, const char *dir,int);
 HADT MGL_EXPORT mgl_datac_correl(HCDT dat1, HCDT dat2, const char *dir);\r
 uintptr_t MGL_EXPORT mgl_datac_correl_(uintptr_t *dat1, uintptr_t *dat2, const char *dir,int);\r
 /// Calculate one step of diffraction by finite-difference method with parameter q\r
+/** Parameter \a how may contain:\r
+ * ‘x‘,‘y‘,‘z‘ or ‘r‘  for directions or axial along x,\r
+ * ‘e‘,‘g‘,‘0‘,‘1‘,‘2‘,‘3‘ for boundary conditions: exp, Gaussian, zero, constant, linear, quadratic.*/\r
 void MGL_EXPORT mgl_datac_diffr(HADT dat, const char *how, mreal q);\r
 void MGL_EXPORT mgl_datac_diffr_(uintptr_t *d, const char *how, double q,int l);\r
 /// Apply wavelet transform\r
index 21b2175845dee0bf96ad8072b442e2f93b560e23..6ec43a254f17eaf31f9cb6ded6faa4219226d461 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -61,6 +61,8 @@
 #if MGL_HAVE_ATTRIBUTE\r
 #define MGL_FUNC_CONST __attribute__((const))\r
 #define MGL_FUNC_PURE  __attribute__((pure))\r
+#define MGL_FUNC_INIT  __attribute__((constructor))\r
+#define MGL_FUNC_FINI  __attribute__((destructor))\r
 #else\r
 #define MGL_FUNC_CONST\r
 #define MGL_FUNC_PURE\r
@@ -146,7 +148,6 @@ typedef size_t msize;
 \r
 #if !MGL_SYS_NAN\r
 #include <float.h>\r
-#include <math.h>\r
 const unsigned long long mgl_nan[2] = {0x7fffffffffffffff, 0x7fffffff};\r
 const unsigned long long mgl_inf[2] = {0x7ff0000000000000, 0x7f800000};\r
 #define NANd    (*(double*)mgl_nan)\r
@@ -293,6 +294,7 @@ extern MGL_EXPORT uint64_t mgl_mask_val[16];
 #include <vector>\r
 #include <complex>\r
 typedef std::complex<mreal> dual;\r
+typedef std::complex<double> ddual;\r
 //-----------------------------------------------------------------------------\r
 inline bool mgl_isrange(double a, double b)\r
 {      return fabs(a-b)>MGL_MIN_VAL && a-a==0. && b-b==0.;     }\r
@@ -351,7 +353,9 @@ typedef cmdual mdual;
 #endif\r
 #endif\r
 //-----------------------------------------------------------------------------\r
-extern float mgl_cos[360];     ///< contain cosine with step 1 degree\r
+extern float MGL_EXPORT mgl_cos[360];  ///< contain cosine with step 1 degree\r
+void MGL_EXPORT MGL_FUNC_INIT mgl_init();      ///< initialize MathGL structures\r
+void MGL_EXPORT MGL_FUNC_FINI mgl_fini();      ///< free MathGL structures\r
 //-----------------------------------------------------------------------------\r
 /// Calculate sqrt(x*x+y*y)\r
 double MGL_EXPORT_CONST mgl_hypot(double x, double y);\r
@@ -388,6 +392,9 @@ void MGL_EXPORT mgl_set_global_warn_(const char *text,int);
 /// Get text of global warning message(s)\r
 MGL_EXPORT_PURE const char *mgl_get_global_warn();\r
 int MGL_EXPORT mgl_get_global_warn_(char *out, int len);\r
+/// Clear global warning message\r
+void MGL_EXPORT mgl_clear_global_warn();\r
+void MGL_EXPORT mgl_clear_global_warn_();\r
 /// Setup gettext usage. NOTE: Russian translation MUST be installed.\r
 void MGL_EXPORT mgl_textdomain(const char *argv0, const char *locale);\r
 void MGL_EXPORT mgl_textdomain_(const char *locale, int);\r
index b63647f1e7d80640c8b499679c6fe0226082ed4e..33c126220061292e911540a6c65d216c343acce1 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 7ca0f2dbebabf28acbfc1cfb184c1c934206af03..912fa7f7bcfc760c42096ff98db040c9ca02bd55 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 157f14cefb5f8c9b4c0728bd37ae7e297db427e2..86eb5dc38fe6b72b6a98602096f87f429d6a17c1 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index bd8b1a9e9e3658516415979fa7bd58a7e4c8eeb9..bd034d03394eb20e7a9f004a1631b3839137923f 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 28499abe503b826ec633ff2b78891b31df8df062..b017e1552abadbf76ef3a166dfaa8d901c9efb6b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -67,7 +67,8 @@ class MGL_EXPORT mglFont
 {\r
 public:\r
        mglBase *gr;    ///< mglBase class used for drawing characters\r
-       mglFont(const char *name=0, const char *path=0);\r
+       mglFont();\r
+       mglFont(const char *name, const char *path=0);\r
        virtual ~mglFont();\r
        bool parse;             ///< Parse LaTeX symbols\r
 \r
@@ -99,6 +100,8 @@ public:
        /// Get width of text string for font specified by string\r
        float Width(const wchar_t *str,const char *how, float *y1=0, float *y2=0) const;\r
 \r
+       /// Set height scaling factor\r
+       inline void HeightScale(float s=1)      {       Hscale = s>0?s:1;       }\r
        /// Get internal code for symbol\r
        inline long Internal(unsigned s) const  {       return mgl_internal_code(s,glyphs);     }\r
        /// Return number of glyphs\r
@@ -115,7 +118,8 @@ protected:
        std::vector<mglGlyphDescr> glyphs;      ///< information about know glyphs\r
        float fact[4];  ///< Divider for width of glyph\r
        short *Buf;             ///< Buffer for glyph descriptions\r
-       size_t numb;            ///< Buffer size\r
+       size_t numb;    ///< Buffer size\r
+       float Hscale;   ///< Height scaling\r
 \r
        /// Print text string for font specified by integer constant\r
        float Puts(const wchar_t *str,int font,int align, float c1,float c2) const;\r
index 83c345ced8eb0afd6e18e6e5ce3c47d5d64cf1f3..4248ecf39cf548fe97946afc5ac84e678aee0bcb 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 22632996f0912bcf38df38740ecb9aeb55410432..7a082ea49d577878273c0923e289eab747ec83ef 100644 (file)
 /// Wrapper class for all graphics\r
 class MGL_EXPORT mglGraph\r
 {\r
-       mglGraph(const mglGraph &) {}   // copying is not allowed\r
-       const mglGraph &operator=(const mglGraph &t)    {       return t;       }\r
+       mglGraph(const mglGraph &) {gr=0;}      // copying is not allowed\r
+       const mglGraph &operator=(const mglGraph &t)    {       gr=0;   return t;       }\r
 protected:\r
        HMGL gr;\r
 public:\r
        HMPR pr;        ///< Pointer to associated MGL parser\r
-       mglGraph(int kind=0, int width=600, int height=400)\r
+       mglGraph(int kind=-1)\r
        {       pr = NULL;\r
-               if(kind==-1)    gr=NULL;\r
+               if(kind==0)     gr=mgl_create_graph(600, 400);\r
 #if MGL_HAVE_OPENGL\r
                else if(kind==1)        gr=mgl_create_graph_gl();\r
 #else\r
                else if(kind==1)\r
-               {       gr=mgl_create_graph(width, height);\r
+               {       gr=mgl_default_graph(); mgl_use_graph(gr,1);\r
                        SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL.");    }\r
 #endif\r
-               else    gr=mgl_create_graph(width, height);\r
+               else    {       gr=mgl_default_graph(); mgl_use_graph(gr,1);    }\r
+       }\r
+       mglGraph(int kind, int width, int height)\r
+       {       pr = NULL;\r
+               if(kind==0)     gr=mgl_create_graph(width, height);\r
+#if MGL_HAVE_OPENGL\r
+               else if(kind==1)        gr=mgl_create_graph_gl();\r
+#else\r
+               else if(kind==1)\r
+               {       gr=mgl_default_graph(); mgl_use_graph(gr,1);\r
+                       SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL.");    }\r
+#endif\r
+               else    {       gr=mgl_default_graph(); mgl_use_graph(gr,1);    mgl_set_size(gr,width,height);  }\r
        }\r
        mglGraph(HMGL graph)\r
        {       pr = NULL;      gr = graph;             mgl_use_graph(gr,1);    }\r
@@ -109,6 +121,8 @@ public:
        inline void SetMeshNum(int num)                 {       mgl_set_meshnum(gr, num);       }\r
        /// Set number of visible faces (use 0 to draw all of them)\r
        inline void SetFaceNum(int num)                 {       mgl_set_facenum(gr, num);       }\r
+       /// Set TeX parsing at text drawing\r
+       inline void SetTeXparse(bool val)               {       mgl_set_tex_parse(gr, val);     }\r
 \r
        /// Set cutting for points outside of bounding box\r
        inline void SetCut(bool cut)                            {       mgl_set_cut(gr, cut);   }\r
@@ -169,6 +183,8 @@ public:
        static inline void SetGlobalWarn(const char *text)      {       mgl_set_global_warn(text);      }\r
        /// Get text of global warning message(s)\r
        static inline const char *GlobalWarn()  {       return mgl_get_global_warn();   }\r
+       /// Clear global warning message\r
+       static inline void ClearGlobalWarn()    {       mgl_clear_global_warn();        }\r
        /// Suppress printing warnings to stderr\r
        static inline void SuppressWarn(bool on)        {       mgl_suppress_warn(on);  }\r
        /// Check if MathGL version is valid (return false) or not (return true)\r
@@ -575,9 +591,20 @@ public:
        /// Clear unused points and primitives. Useful only in combination with SetFaceNum().\r
        inline void ClearUnused()       {       mgl_clear_unused(gr);   }\r
 \r
-       /// Load background image\r
+       /// Load background image (basic variant: no scaling, whole image)\r
        inline void LoadBackground(const char *fname, double alpha=1)\r
        {       mgl_load_background(gr,fname,alpha);    }\r
+       /// Load image for background from file. \r
+       /** Parameter 'how' can be:\r
+        *   'a' for filling current subplot only;\r
+        *   's' for scaling (resizing) image to whole area;\r
+        *   'c' for centering image;\r
+        *   'm' for tessellate image as mosaic. */\r
+       inline void LoadBackground(const char *fname, const char *how, double alpha=1)\r
+       {       mgl_load_background_ext(gr,fname,how,alpha);    }\r
+       /// Fill background image by specified color. Colors r,g,b should be in range [0,1].\r
+       inline void FillBackground(const mglColor &cc)\r
+       {       mgl_fill_background(gr, cc.r,cc.g,cc.b);        }\r
        /// Force drawing the image and use it as background one\r
        inline void Rasterize()                 {       mgl_rasterize(gr);      }\r
 \r
@@ -940,6 +967,17 @@ public:
        inline void Region(const mglDataA &x1, const mglDataA &y1, const mglDataA &x2, const mglDataA &y2, const char *pen="", const char *opt="")\r
        {       mgl_region_3d(gr, &x1, &y1, NULL, &x2, &y2, NULL, pen, opt);    }\r
 \r
+       /// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2}\r
+       inline void Lines(const mglDataA &x1, const mglDataA &y1, const mglDataA &z1, const mglDataA &x2, const mglDataA &y2, const mglDataA &z2, const char *pen="", const char *opt="")\r
+       {       mgl_lines_xyz(gr, &x1, &y1, &z1, &x2, &y2, &z2, pen, opt);      }\r
+       /// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin}\r
+       inline void Lines(const mglDataA &x1, const mglDataA &y1, const mglDataA &x2, const mglDataA &y2, const char *pen="", const char *opt="")\r
+       {       mgl_lines_xy(gr, &x1, &y1, &x2, &y2, pen, opt); }\r
+       /// Draw lines with arrows between: points {x1,y} and {x2,y} with y in y-axis range if \a pen contain 'x'; or points {x,y1} and {x,y2} with x in x-axis range.\r
+       inline void Lines(const mglDataA &y1, const mglDataA &y2, const char *pen="", const char *opt="")\r
+       {       if(mglchr(pen,'x'))     mgl_lines_x(gr, &y1, &y2, pen, opt);\r
+               else    mgl_lines(gr, &y1, &y2, pen, opt);      }\r
+\r
        /// Draw vertical lines from points {x,y,z} to axis plane\r
        inline void Stem(const mglDataA &x, const mglDataA &y, const mglDataA &z, const char *pen="", const char *opt="")\r
        {       mgl_stem_xyz(gr, &x, &y, &z, pen, opt); }\r
@@ -1474,6 +1512,25 @@ public:
        inline void Axial(const mglDataA &z, const char *sch="", const char *opt="")\r
        {       mgl_axial(gr, &z, sch, opt);    }\r
 \r
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically\r
+       /** Style ‘t’/‘T’ draw contour labels below/above contours. */\r
+       inline void DCont(const mglDataA &v, const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="")\r
+       {       mgl_dcont_xyz(gr, &v, &x, &y, &z, &a, &b, sch, opt);    }\r
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data\r
+       /** Style ‘t’/‘T’ draw contour labels below/above contours. */\r
+       inline void DCont(const mglDataA &v, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="")\r
+       {       mgl_dcont(gr, &v, &a, &b, sch, opt);    }\r
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically\r
+       /** Style ‘t’/‘T’ draw contour labels below/above contours.\r
+        * Option "value" set the number of isosurfaces (default is 3). */\r
+       inline void DCont(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="")\r
+       {       mgl_dcont_xyz(gr, NULL, &x, &y, &z, &a, &b, sch, opt);  }\r
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data\r
+       /** Style ‘t’/‘T’ draw contour labels below/above contours.\r
+        * Option "value" set the number of isosurfaces (default is 3). */\r
+       inline void DCont(const mglDataA &a, const mglDataA &b, const char *sch="", const char *opt="")\r
+       {       mgl_dcont(gr, NULL, &a, &b, sch, opt);  }\r
+\r
        /// Draw grid lines for density plot at slice for 3d data specified parametrically\r
        /** Style ‘x’ or ‘z’ produce plot perpendicular to x- or z-direction correspondingly.*/\r
        inline void Grid3(const mglDataA &x, const mglDataA &y, const mglDataA &z, const mglDataA &a, const char *stl="", double sVal=-1, const char *opt="")\r
index 66d3f16f35d37bd99d019b35a19d21a65130449a..90b399c3d74cfda7d45b98fc552d6be365fbed48 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 98cf1f469b2e2efd8d7a76f4ab74b508d825b1a7..6b669c5258de2fa19855e29c746cf4e8307e9b7d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index c299ba7b731741d08ec6b8fb6660592638dd9821..be93b452ed511a60713ffceedcec650898a4436b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 488c5779d5401d123d6786641f9d2294691c1d80..b5f82963ccf60d32982f8f775593635d05e4f21d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -51,7 +51,7 @@ struct mglCommand
        ///     12 - axis, 13 - primitives, 14 - axis setup, 15 - text/legend, 16 - data transform\r
        int type;\r
 };\r
-extern mglCommand mgls_prg_cmd[], mgls_dat_cmd[], mgls_grf_cmd[], mgls_set_cmd[], mgls_prm_cmd[];\r
+extern mglCommand mgls_prg_cmd[], mgls_dat_cmd[], mgls_grf_cmd[], mgls_set_cmd[], mgls_prm_cmd[], mgls_rnd_cmd[];\r
 //-----------------------------------------------------------------------------\r
 /// Structure for function name and position.\r
 struct mglFunc\r
index acf12832da07e0e816908feac778508c6bd2f8e4..7d2c6ec3b9ba62a590ff3c82cf0fb5ef0d4eaa06 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -64,6 +64,10 @@ HMDT MGL_EXPORT mgl_ode_solve(void (*func)(const mreal *x, mreal *dx, void *par)
 HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax);
 /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt
 HADT MGL_EXPORT mgl_ode_solve_str_c(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax);
+/// Saves result of ODE solving of n*m equations for m variables var with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt
+HMDT MGL_EXPORT mgl_ode_solve_set(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax);
+/// Saves result of ODE solving of n*m equations for m variables var with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt
+HADT MGL_EXPORT mgl_ode_solve_set_c(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax);
 /// Saves result of ODE solving of n equations with right part func and initial conditions x0 over time interval [0,tmax] with time step dt. Function bord (if not NULL) is called each time step to apply border reflection.
 HMDT MGL_EXPORT mgl_ode_solve_ex(void (*func)(const mreal *x, mreal *dx, void *par), int n, const mreal *x0, mreal dt, mreal tmax, void *par, void (*bord)(mreal *x, const mreal *xp, void *par));
 /// Finds ray with starting point r0, p0 (and prepares ray data for mgl_qo2d_solve)
index 90312dfb95766166fedde201ffacd9d7a7d03b2e..bc6649f8dcd00b43b7a22014a54908aec268ac42 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -253,6 +253,19 @@ void MGL_EXPORT mgl_candle_yv_(uintptr_t *gr, uintptr_t *v1, uintptr_t *v2, uint
 void MGL_EXPORT mgl_candle(HMGL gr, HCDT v, HCDT y1, HCDT y2, const char *pen, const char *opt);\r
 void MGL_EXPORT mgl_candle_(uintptr_t *gr, uintptr_t *y, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int);\r
 \r
+/// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2}\r
+void MGL_EXPORT mgl_lines_xyz(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT y2, HCDT z2, const char *pen, const char *opt);\r
+void MGL_EXPORT mgl_lines_xyz_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *z1, uintptr_t *x2, uintptr_t *y2, uintptr_t *z2, const char *pen, const char *opt,int,int);\r
+/// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin}\r
+void MGL_EXPORT mgl_lines_xy(HMGL gr, HCDT x1, HCDT y1, HCDT x2, HCDT y2, const char *pen, const char *opt);\r
+void MGL_EXPORT mgl_lines_xy_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *x2, uintptr_t *y2, const char *pen, const char *opt,int,int);\r
+/// Draw lines with arrows between points {x1,y} and {x2,y} with y in y-axis range\r
+void MGL_EXPORT mgl_lines_x(HMGL gr, HCDT x1, HCDT x2, const char *pen, const char *opt);\r
+void MGL_EXPORT mgl_lines_x_(uintptr_t *gr, uintptr_t *x1, uintptr_t *x2, const char *pen, const char *opt,int,int);\r
+/// Draw lines lines with arrows between {x,y1} and {x,y2} with x in x-axis range\r
+void MGL_EXPORT mgl_lines(HMGL gr, HCDT y1, HCDT y2 ,const char *pen, const char *opt);\r
+void MGL_EXPORT mgl_lines_(uintptr_t *gr, uintptr_t *y1, uintptr_t *y2, const char *pen, const char *opt,int,int);\r
+\r
 #ifdef __cplusplus\r
 }\r
 #endif\r
index 102a76c778821dc344038ccd22ea99034cb0bc34..7a7b824e3c40c8cd0025a04a6f648610b05ab9a4 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 228ddc513c797014bf9338028de30a9d8265c05a..ac4d8ff489e50fb71b9271633dbcd20f4bea025a 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -43,9 +43,8 @@ public:
        bool enableMouse;       ///< Enable mouse handlers\r
        bool enableWheel;       ///< Enable mouse wheel handlers\r
        QString primitives;     ///< Manual primitives, defined by user\r
-       mglCanvas *gr;          ///< Built-in mglCanvas instance (mglCanvasQT is used by default)\r
 \r
-       QMathGL(QWidget *parent = 0, Qt::WindowFlags f = 0);\r
+       QMathGL(QWidget *parent = 0, Qt::WindowFlags f = Qt::WindowFlags());\r
        virtual ~QMathGL();\r
        double getRatio();\r
        void setPopup(QMenu *p) {       popup = p;      }       ///< Set popup menu pointer\r
@@ -54,6 +53,9 @@ public:
        inline void setGraph(mglGraph *GR)\r
        {       setGraph(GR->Self());   }\r
        inline HMGL getGraph()  {       return (HMGL)gr;        }\r
+       /// Nullify grapher object for disabling double free. NOTE: this is internal function.\r
+       void noGraph()  {gr=0;};\r
+\r
        /// Set drawing functions and its parameter\r
        void setDraw(int (*func)(mglBase *gr, void *par), void *par);\r
        void setDraw(mglDraw *dr);\r
@@ -185,6 +187,7 @@ protected:
        void wheelEvent(QWheelEvent *);\r
        void mouseDoubleClickEvent(QMouseEvent *);\r
 \r
+       mglCanvas *gr;          ///< Built-in mglCanvas instance (mglCanvasQT is used by default)\r
        void *draw_par;         ///< Parameters for drawing function mglCanvasWnd::DrawFunc.\r
        /// Drawing function for window procedure. It should return the number of frames.\r
        int (*draw_func)(mglBase *gr, void *par);\r
index f1fa0eaa8f21182e72cc7dee553310fddd461f6d..3e4adcd5f214db76a5f4b78b44fe89f94ec4622b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index c8283548ee88a4b6dce4229a0882f3fbc3cc2b13..f1dc4d26a4498a10e6ce615f71f31b3da37ca925 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 537c9b0bc478f8593e042a432d81f8bfe1e53a0c..a8d8cf7579b66b1ac6f4b5403561b96e87ba04cd 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
index 4f18f71fdee102f2440545047af5afe54207d209..1fcb1261650d16617e7398cf7452d16624dbeeab 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -194,6 +194,12 @@ struct MGL_EXPORT mglString
 #if MGL_HAVE_RVAL
        mglString(mglString &&d):s(d.s),w(d.w)  {       d.s=NULL;       d.w=NULL;       }
 #endif
+       mglString(wchar_t ch)
+       {
+               s=new char[2];  w=new wchar_t[2];
+               s[0] = char(ch&0xff);   w[0] = ch;
+               s[1] = w[1] = 0;
+       }
        mglString(const char *str)
        {
                if(str)
index cf8c5c1549ddcad7e0a14a9f8088c60485c966d6..b03a9fbcd6f14340ce2b879562bcb1bef496fc6b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index c5efca9835e7df45f7065311acd1f1c6b7ceb105..dc803a7942eea63290fae22455d78c5db4c0caa7 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index d20f3484fe18b3487dce7756fbb6dd718d84ce75..f39c2168c59c0105d583552e3de408367ae14cbc 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 0af0811c2969ecac9b726a675e26c6505e9fb751..ae48ff9bf5f6be6b724bc4addd85a2de9383452e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index ee707337557fd1bd2e85cfab22586aad419c56d6..3a0c451b868cccab6d0bba378e4b2992f968fbbe 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index b7d208ed62d60d06667e49a527dcf307b39b708e..f722d5d6cbf0bd4076e812d3f895f18f8ee19bfc 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 28f80a10666a598a27f5fa38089158f1a3a53ee6..3416cf102901061ed5b7b0233f0d54137faf33c4 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arc_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 457c0aacb72caca084b8ebc63b9b05b76a98629e..f841dd41b4fba5a6881b3e502126c689fbc72bd3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 834f703628352540a82bbf3512ab9ddeac6a2bb9..fa5ae6e0b678254281bf2273647990f949a2e229 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a8c617e227b36d98fcc45b5401f3915d61136050..3bc2959e16d3dee26b1ecd58327f0d83ff3df5d9 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " ..             ",
index 840d32577cb2066459fe7418730d5692647c0f70..339201b542dbfa6b83299c4cf0b654c5d1d31457 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_k_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " ..             ",
index 305238be0ac1ae7f4257343a3239de55d3fb44c7..52f3587bc5fd0660fdd037172e806be36faae1df 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_n_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 6f4b5835ade1338714ac0ea6da4368d4b1c4db23..807fb0c2f00126349aa2dee521b3fd71687fb27e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index ddeeb7f4df3c438f24b3a359b0d75006aef4b49f..7bc281347171033f10d9ad01e77ddd8b8ab9fa8e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 71ff9dc1544db6a1f57dcc13a77b33dfa9eda4e4..f6c1f91cd75c0f92d5a89f1be49be979fce76335 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 038a3e5d8fba7a07607b5972e8742bbf47e48298..c5eb9c4490088898e94ba2ade0a98f818512eaf3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 65014f12f6e852043c1286bc9d06855af9f419bf..9be05e5e406e6b37b5282b8f8829b8d1d8301a82 100644 (file)
@@ -2,7 +2,7 @@
 static const char * axis_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 " ..             ",
 "  .             ",
index d09869f44cd9ef6751128c26032e9f548c68dedc..775288f585a04b95503672e32000985112bdb08e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * axis_sh_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #FF0000",
 "                ",
 "  .             ",
index 8545b8f1c71e0bbb100ff085965c0e9dfc576492..575390598f624dc9c49ebbd7de678d66610a9681 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index fe133deeb68a494e6bdf5bb6224ef039169dd054..00c426239d22e5e0c8c7cf7c88a6c3e680c28f96 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 54e91ad564828be3f03cdf9633eb3677771f60e3..e4104b3a6f329f8fe78880ea22bbb081cf56d415 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "             .. ",
index be962b170dc5ee847cc51242362392c3761b3be7..820c9a8e601e2ef34c38969c7b322c8b5c7c864e 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_k_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "             .. ",
index 7d2b54c3eb8cde01554edbddbcc9632d028bfac7..c5c54d68761be3efc8e9c970cf1d8bf91f5e7da8 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_n_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a0ea26486d8365e77302f09d792341d3acc56f0f..86601cebed5f61203c3b7ab75952b7ad85cfbf04 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index f19c4d8c25e854bd0e0bb7aa97d827a465b5dad1..08af6b55df326444721cb3630e37f1079050fd47 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 06e23d5b04a6e4234f87556d674de4fc9e65c44c..30456941851779ae08150eb272206dc0328eccba 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index b31d4d236eb09f9059b80a34fa2ca44beeba3ec9..3b54b24f9f643f87f4d315bade7b496952258513 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 23260d1a9ed42c7283823cbf0e8bb7788dbafb64..a60f05481c60c2601c4c8de252848dd8e7036667 100644 (file)
@@ -1,22 +1,23 @@
 /* XPM */
 static const char * box_xpm[] = {
-"16 16 3 1",
+"16 16 4 1",
 "      c None",
 ".     c #000000",
 "+     c #666666",
+"=     c #ffffff",
 "                ",
 "      ......... ",
-"     .+      .. ",
-"    . +     . . ",
-"   .  +    .  . ",
-"  .   +   .   . ",
-" .........    . ",
-" .    +  .    . ",
-" .    +  .    . ",
-" .    +++.++++. ",
-" .   +   .   .  ",
-" .  +    .  .   ",
-" . +     . .    ",
-" .+      ..     ",
+"     .+======.. ",
+"    .=+=====.=. ",
+"   .==+====.==. ",
+"  .===+===.===. ",
+" .........====. ",
+" .====+==.====. ",
+" .====+==.====. ",
+" .====+++.++++. ",
+" .===+===.===.  ",
+" .==+====.==.   ",
+" .=+=====.=.    ",
+" .+======..     ",
 " .........      ",
 "                "};
index e18a730f760b3d0498f978060edd4996a6ebc78b..474cf189b355780baae8f526f1d2eb2b04c4b29a 100644 (file)
@@ -2,7 +2,7 @@
 static const char * crop_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "     .          ",
 "                ",
index 88e37e35f481afb3000f3baa68f8f27e054b8b30..eb613c88c20c0d1ae13e58fd0e5a5700d21a5ef0 100644 (file)
@@ -2,7 +2,7 @@
 static const char * curve_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "               .",
 "               .",
 "              . ",
index 6892ce6855a0f4ec23169ab8fccb5d2b9e346d41..f2e4e7205b106cfabd5e9763bbf8e89f955cae9e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 13eaf63c9cab614b5854d18a4e772350f0881d55..97db0c5ff1019ec885aadcc55057f5d1cf7e37e2 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_e_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 2ad1f1c400ed7986c257d1b7eaf09f7ed2ae9383..f012469bd250a2054eeefa70a7d0f2f57ef2bde5 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 70a9cc4c08e9aed009cbadf246aef49642247bde..c5ffeb375c993a49c98bd4a32811d2a177c59942 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_j_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 4346c08fe05e49a37ba307a167c697717678794e..f735a733d287dad713162ccff847bd6ea98e3759 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_l_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 7cd2b39d4dcd9311735618ee494f3595d044f90d..83a3794658b5729d54b66d8ca626e68a98280add 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_m_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 4edb6c5cb9b63bcd3acf950aaa3125fd95ddff11..92d9a116420362b01bc2abdfda46edbe21fb5afa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a191ea2678652612e2b59bc735d21182e0f927e9..14158c68b717b4418831c0f722f8427f6c7a086d 100644 (file)
@@ -1,21 +1,22 @@
 /* XPM */
 static const char * delete_xpm[] = {
-"16 16 2 1",
+"16 16 3 1",
 "      c none",
 ".     c #000000",
+"=     c #afafaf",
 "                ",
 "                ",
 "                ",
-"  ...      ...  ",
-"   ...    ...   ",
-"    ...  ...    ",
-"     ......     ",
-"      ....      ",
-"      ....      ",
-"     ......     ",
-"    ...  ...    ",
-"   ...    ...   ",
-"  ...      ...  ",
+"   ..      ..   ",
+"   .=.    .=.   ",
+"    .=.  .=.    ",
+"     .=..=.     ",
+"      .==.      ",
+"      .==.      ",
+"     .=..=.     ",
+"    .=.  .=.    ",
+"   .=.    .=.   ",
+"   ..      ..   ",
 "                ",
 "                ",
 "                "};
index b90448a3ce612cd6d20167a5a9fbf9adc38af42d..7083646140912819aa1716e3d814db3cb8bfbcef 100644 (file)
@@ -2,7 +2,7 @@
 static const char * diff_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "   ..           ",
index 7a2d7ebf66bc7c18b9f646f0571a62309b704201..283abc7c8eaf533eda61c6cf415c7e4673473672 100644 (file)
@@ -2,8 +2,8 @@
 static const char * diff2_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f7f",
+"+     c #7FaFaF",
 "                ",
 "                ",
 "                ",
index e62cfe73e4cbc280204a252cf6432fed8fb58478..dd7336940a6102f22983b869e5f49bf7c90454ba 100644 (file)
@@ -2,7 +2,7 @@
 static const char * func_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index ddccb223f9a1fda67834027ad317bdfb29381331..4bd93d2ca8e574aa62827f118575b035e5bf9215 100644 (file)
@@ -1,9 +1,8 @@
 /* XPM */
 static const char * integr_xpm[] = {
-"16 16 3 1",
+"16 16 2 1",
 "      c None",
-".     c #000000",
-"+     c #808080",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
@@ -16,7 +15,7 @@ static const char * integr_xpm[] = {
 "    . .  .  .   ",
 "    . .  .  .   ",
 "    .  ... . .  ",
-"   .     +      ",
+"   .            ",
 "                ",
 "                ",
 "                "};
index aff1af3fc3d86c9c6b3cc43ba8cbdd0b248a8b12..fc5d2f942747bf0ca05db3e4956f08e2ef2bf42e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * line_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "               .",
 "              . ",
 "             .  ",
index b372f5a213244db6e75f04656916e5cc94792ee9..002fcf6278c744ee32a28483cd77fdf63add7b72 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark__xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 29f34cbdea8e0b0caad6ab44c600a2926d86b741..04c5ac6cd8926473e1add99f6558d3b1b7876e05 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "    .       .   ",
 "     .     .    ",
index f743a3148082f73dcdd1631a22174ec848180faa..e2b24cde78a20542a0c3ec7d8a325158cfd6d4c9 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_cf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 678d75ea6e659f0452e646d4629dbb51cb2f3ddb..e3be02536000947fc6d1390cd530a743575fd9ad 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      .  .      ",
 "     .    .     ",
index 582d4203a31a19cb8821f79a76a429ac4597b394..a6e73edf5f7a11d3ba3ad35eec9bb3d778739d81 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_df_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      ....      ",
 "     ......     ",
index 9edd3e0b07547e501e7e91af4bf61b74534f20a1..f3aa86992f0052601b3f41f375e7712ee159850c 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_l_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "          ..    ",
 "        .. .    ",
 "       .   .    ",
index 2585eb47d436698f39e0baa42634198d72b1f009..9c8b3fa9d3461840a1b4f15af1c9a4bab3bda493 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_lf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "          ..    ",
 "        ....    ",
 "       .....    ",
index 3154cdc4acd71cd8c58a1c45c96b1bc4d30444a0..bc9874afeac28bbdd1b96caaf5e8b2a0d260f13b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 3eeaf389f00006a999bc4aaf4b166fe0f6072ac3..a3fa73985cc8dc07e6d930e7d6d8f8a73438f1b4 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_of_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..........   ",
 "  ............  ",
index 3f40cfbc99f6b73d88454f03f7a019f62d6a7e73..c48b2f1af288576739134f5694408c29c6d957aa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_p_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "        .       ",
 "        .       ",
 "        .       ",
index ea9cdac83c92b80b6b1e48fc2e2652e9310d8a6d..1b85e50e0392f5a96b1edb118b78af9d218881fd 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_pf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 ".       .      .",
 ".       .      .",
index 845901453a0ca5185ff90d59f9b14d4c7d520655..3c8c49b92cb7f2497d9d93c821aaf47b34a77b81 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_r_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "    ..          ",
 "    . ..        ",
 "    .   .       ",
index cedcd01e21153674a0149ceb9a505d6b0bfa067a..844e2cd0fcf9ccf81fa658506fdd411d43fdfb47 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_rf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "    ..          ",
 "    ....        ",
 "    .....       ",
index 1a4c0128ec2fea86c9869f91519f0547f63c585e..c4fab4fddccf9403aaa804b40ab4c46ffbfb0582 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 ".              .",
 ".              .",
index 5a89f1de39d6fbe6e7fd82d420efd02f758a8ab0..b132874754c7d0810529a415b782aa1a05535daa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_sf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 "................",
 "................",
index 1e6b398f34edd7d81dd4b3bd9137a2473dfa10d5..514853985be19172df9c429c93d9399b87d6312d 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      .  .      ",
 "     .    .     ",
index 48f61c16932d2425caf5e7de9632ffe78e794af9..964c45ace394c8a8f8f44cb9166dd6061ebd8f80 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_tf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      ....      ",
 "     ......     ",
index 9f03771688a617e0bafc661654bdc4232bd5c2cd..9c09de0043e2d76c18cdc10cf56ce685051d2f97 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 39d7e996d8d93bfbb709d99a3e1c0292468e9732..e2f523513d56ec22531fa040f5a294c798d2259b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_vf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 8d7ee78c5421a1bdbb2e890044fc2469f1df8735..ad17eb9cec884bfc7113c5c7296a92867108fb54 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_x_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 ".              .",
 " .            . ",
 "  .          .  ",
index b5135fdcd14859a177b4b600c41307f4886dbe98..958cb393383908176aa8442d241e3423bddf8148 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_y_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "   .         .  ",
index 6949dd9bc2fcce72352fb9a5142776ad7cfcc179..4893723ddc6c1c33821d7a3a63261adfe1bf08d0 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_a_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "##............##",
 "##............##",
 "..##........##..",
index dc7f66dce57b36858fd6ac807455ffa8d19bb650..6c96ab9526d0f7a6c75ad62bcacddb042040eba3 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_d_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "........##......",
index d3eee468f4aa5197f5728618939ab3c121f9f9f2..99e8d034a60a7c587f2d5f2462a5026585e8ae9a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_D_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "........##......",
index 2e6b5280cd2542d7c6f275c99fbd4eb9ee71efa2..f729a1d5b8f1935bf4fb0a0c186138c45b1d6b00 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_e_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index a24c1ca0fa180c262516216976b138a0c4ecbf26..ee9cff63054d1e6438200b11f04c802cb4d1914a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_i_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index fcc072f8b2751ab2be543235a2205248d817c4fa..7e8eadcf1436c298719cf62706c2c7687493be83 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_j_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index a062db64efc707ebc4aa60afb205888ccdbb02dc..17335f48c87fe962aa3c218195ef6cdb5e78a75b 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_l_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "..........####..",
index e717d969c1c78e3a5b1233aaef24956e444f2892..de4f3080e7ab0af420d5899b83666ca027cafa78 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_m_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 3664bc4869f9a808fdac4020cfa54c03674e2ea0..f9b9fa362780e97c1c0c939930c19ce7f7a330a5 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_o_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index fbecff88283f8689485a4e9c5c5f36e5895b4d6e..211df44347d1daefca19b25ab54980685305be44 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_O_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index d29f774845137b665c84a6726f4bc06ef8733609..a49e02760bdfab62e43da5f9c898d8370fd92008 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_p_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "........##......",
 "........##......",
 "........##......",
index 47f2aa54d3c59216d25cc76b86606cda516fab8b..245913728c1b55c7e624311dd03bbc1cd53f9b35 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_r_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "..####..........",
index a5e1e826f5cd81efddd1d53d514ab8c91413768b..b83be52cda12d120ed34f0cde27c08bd5432542a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_s_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 652db363020b21ece8692cd7276758c584c37f93..2ff6574000b6c1cb9785ea5cb2cea7fbeee8c8f0 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_S_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index d153fc833271e3aaf5783ee3dc796de673c3b14c..5052969a06d9a3a627a4b78f1da9d163ff1a042b 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_t_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 61996fca06667c047541a4dc5b0a7c65a9d17ef1..6873046b63e76276715a5e59c2552ec66d5e19ed 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_u_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index e81575fd7d390649bcae537492fedc7893b93faa..3ca0ca5447853b6d835033329351b6a543e351c0 100644 (file)
@@ -2,7 +2,7 @@
 static const char * none_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 "..            ..",
 ". .          . .",
index ca6a51d9643f9241769376be473054dad82425dc..c4939d0747c8b7210d25eb212ef1332c79b127f8 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "   .            ",
 "   .            ",
index afa1a80b9079a566fbb68f43af0e570962cee94b..ddf42bcb632fe7a2e8e6e322ac10b7a08dd4a627 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index 2b89d5ed72a874481a778f6f318a742f8b72000e..ff8bd60e01cdf5b8c39d0b529791fa43b671a792 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index f6f7b8a62038930ef583e34745df7e6390529c02..0a3f03cfe257e380e47a5fef12ef707533ba2199 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_dir_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "   .            ",
 "  .   .         ",
 "  .   .         ",
index f2f8db1056c3a597e186f82de138c1cba156ac94..5eb90f18995c653e237bf16a9471c3267aa7b7e3 100644 (file)
@@ -2,8 +2,8 @@
 static const char * oper_m_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f7f",
+"+     c #7FAFAF",
 "                ",
 "                ",
 "                ",
index c22a9ba0783bbd1c616be68cd68833d509df8f3b..be3e1699f4ce7f5bc73ec164fa8b9a47d290f074 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_of_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #FF0000",
 "   .        ++  ",
 "  .   .     ++  ",
index 6bda134b6920a0d32fd317caf750b2b797ce1cba..a83db2af9059b1f2175c4178b317811f5b3bf37b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index d7dd6d6b2804acac9fa0c9ff1b7a7fc83e07b28e..3ef30d8187e2f5bceadb07269e222380342da810 100644 (file)
@@ -2,8 +2,8 @@
 static const char * option_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F0000",
+".     c #7f0000",
+"+     c #FF0000",
 "                ",
 "                ",
 "                ",
index e09d88b03b8c27c15916b293653d84f1824ddd85..e2421eb61064de116779ed02af37e665e37f5cce 100644 (file)
@@ -2,7 +2,7 @@
 static const char * pause_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #777777",
+".     c #afafaf",
 "q     c #000000",
 "                ",
 "                ",
index acc1eeaa2459f2984754f06e44a92a330ea78be6..70bb211a1963ab4dd5981ee349d35303ec36ae10 100644 (file)
@@ -2,7 +2,7 @@
 static const char * plot_xpm[] = {
 "16 16 4 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #0000FF",
 "@     c #FF0000",
 "                ",
index ecbdb8f5fab628937e241f9ad9df165ea952a1b5..6941429dca573495352728aebf6ac62924d5b7c3 100644 (file)
@@ -2,7 +2,7 @@
 static const char *polygon_xpm[]={
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "       ..       ",
 "      .  .      ",
index 3a1d846ae0aa47dfc15c149d8c6c88605f97c613..be90e125000232734889c46c9c0e4788945e5925 100644 (file)
@@ -2,7 +2,7 @@
 static const char * size_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " .............. ",
index fa68e6a0c23e9270caedff33d5fdc2bcf6608608..25aeb58de1ddad73a8524b30648775737fae37da 100644 (file)
@@ -2,8 +2,8 @@
 static const char * squize_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f00",
+"+     c #7FFF7F",
 "                ",
 "                ",
 "     ......     ",
index 56317c0ebb4960041d093ee6c78bbdf35e2e9f69..137dcb221f02753e74278438eebecb960dd33ab3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * text_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "  ............  ",
 "  ............  ",
index 5ee1dd64fa849b65a1172ee86fa0b4a9056f8014..c7f53d2cb404a91edc3ec12056602ad5c7375ffd 100644 (file)
@@ -2,7 +2,7 @@
 static const char *update_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #00007F",
+".     c #007ffF",
 "                ",
 "                ",
 "      ....      ",
index b67d50b41e3b5f26126beb253dfd8028614f3227..6996fa5df1526e3f29afd18529c3d5b203d6bf59 100644 (file)
@@ -2,7 +2,7 @@
 static const char * wire_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index 748251dee87837c690e5e1b06d55f2bd494f85c1..e6d03b415aeb14ca145cd1a6242c88597bc1cfbe 100644 (file)
@@ -43,7 +43,7 @@ MainWindow::MainWindow(QWidget* const parent) : QMainWindow(parent), ui(new Ui::
        // inject backend object each time javascript object is cleared
        connect(ui->webView->page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(injectBackendObject()));
        // set url to load
-       ui->webView->load(QUrl(QString("file:///%1/../../json/%2").arg(qApp->applicationDirPath()).arg("index.html")));
+       ui->webView->load(QUrl(QString("file:///%1/../../json/%2").arg(qApp->applicationDirPath(),"index.html")));
 }
 //-----------------------------------------------------------------------------
 void MainWindow::injectBackendObject()
index da245d2c6267e0da46b2cb8958bec9a007321543..475dabec995f63fb36977e1a3dae0432429490bc 100644 (file)
@@ -18,17 +18,17 @@ endif(NOT SWIG_FOUND)
 INCLUDE(${SWIG_USE_FILE})
 
 if(enable-python)
-       set(Python_ADDITIONAL_VERSIONS 2.7)
-       FIND_PACKAGE(PythonInterp)
+       set(Python_ADDITIONAL_VERSIONS ${PY3VERSION_DOTTED})
+       FIND_PACKAGE(PythonInterp ${PY3VERSION_DOTTED} REQUIRED)
        if(NOT PYTHONINTERP_FOUND)
                message(SEND_ERROR "Couldn't find python interpreter.")
        endif(NOT PYTHONINTERP_FOUND)
-       FIND_PACKAGE(PythonLibs)
+       FIND_PACKAGE(PythonLibs ${PY3VERSION_DOTTED} REQUIRED)
        if(NOT PYTHONLIBS_FOUND)
                message(SEND_ERROR "Couldn't find python development libraries.")
        endif(NOT PYTHONLIBS_FOUND)
        execute_process(
-               COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.get_include()"
+               COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print (numpy.get_include())"
                OUTPUT_VARIABLE NUMPY_INCLUDE_PATH
                RESULT_VARIABLE NUMPY_ERR
                OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -39,11 +39,11 @@ if(enable-python)
 
        include_directories(${PYTHON_INCLUDE_DIR}  ${NUMPY_INCLUDE_PATH})
        execute_process(
-               COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}')"
+               COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib(prefix='${CMAKE_INSTALL_PREFIX}'))"
                OUTPUT_VARIABLE MGL_PYTHON_SITE_PACKAGES
                OUTPUT_STRIP_TRAILING_WHITESPACE)
        set(SWIG_MODULE_mathgl_EXTRA_DEPS numpy.i ${src_imp_dep})
-       if(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+       if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
                SWIG_ADD_MODULE(mathgl python mathgl.i)
        else(${CMAKE_VERSION} VERSION_LESS "3.8.0")
                SWIG_ADD_LIBRARY(mathgl LANGUAGE python SOURCES mathgl.i)
@@ -58,8 +58,8 @@ if(enable-python)
        )
        add_custom_target(mgl_python_module ALL DEPENDS _mathgl mathgl.pyc)
 
-       install(FILES ${MathGL2_BINARY_DIR}/lang/mathgl.py ${MathGL2_BINARY_DIR}/lang/mathgl.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES})
-       install (TARGETS _mathgl LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES})
+       install(FILES ${MathGL2_BINARY_DIR}/lang/mathgl.py ${MathGL2_BINARY_DIR}/lang/__pycache__/mathgl.cpython-${PY3VERSION_NODOT}.pyc DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/mathgl/__pycache__)
+       install (TARGETS _mathgl LIBRARY DESTINATION ${MGL_PYTHON_SITE_PACKAGES}/mathgl)
        set(mgl_clean_files ${mgl_clean_files} mathgl.py)
 endif(enable-python)
 
index 6d289d5547b8afb51ed6cb559e6dfe633946b7cb..8f2fe0d05ba47ad23e90a7d2ba43d7330a92df68 100644 (file)
@@ -30,7 +30,6 @@ public:
        bool link;              ///< use external data (i.e. don't free it)
 
        /// Initiate by other mglData variable
-       mglData(const mglData &d)       {       a=0;    mgl_data_set(this,&d);          }       // NOTE: must be constructor for mglData& to exclude copy one
        mglData(const mglData *d)       {       a=0;    mgl_data_set(this, d);          }
        mglData(bool, mglData *d)       // NOTE: Variable d will be deleted!!!
        {       if(d)
@@ -185,6 +184,34 @@ public:
        /// Make new id
        inline void NewId()     {       id.clear();     }
 
+       /// Fills data by integer random numbers of uniform distribution in range [lo,hi]
+       inline void RndInteger(long lo, long hi)
+       {       mgl_data_rnd_integer(this, lo, hi);     }
+       /// Fills data by random numbers of uniform distribution in range [lo,hi]
+       inline void RndUniform(mreal lo, mreal hi)
+       {       mgl_data_rnd_uniform(this, lo, hi);     }
+       /// Fills data by random numbers of Bernoulli distribution
+       inline void RndBernoulli(mreal p=0.5)
+       {       mgl_data_rnd_bernoulli(this, p);        }
+       /// Fills data by random numbers of binomial distribution
+       inline void RndBinomial(long trials, mreal p=0.5)
+       {       mgl_data_rnd_binomial(this, trials, p); }
+       /// Fills data by random numbers of Gaussian distribution
+       inline void RndGaussian(mreal mu=0.0, mreal sigma=1.0)
+       {       mgl_data_rnd_gaussian(this, mu, sigma); }
+       /// Fills data by random numbers of exponential distribution
+       inline void RndExponential(mreal lambda)
+       {       mgl_data_rnd_exponential(this, lambda); }
+       /// Fills data by random numbers of discrete distribution according A
+       inline void RndDiscrete(const mglData &A)
+       {       mgl_data_rnd_discrete(this, &A);        }
+       /// Shuffles elements or slices of data array
+       inline void RndShuffle(char dir='a')
+       {       mgl_shuffle(this, dir); }
+       /// Fills data by fractional brownian motions along x-direction
+       inline void RndBrownian(mreal y1, mreal y2, mreal sigma, mreal alpha)
+       {       mgl_data_brownian(this, y1, y2, sigma, alpha);  }
+       
        /// Read data from tab-separated text file with auto determining size
        inline bool Read(const char *fname)
        {       return mgl_data_read(this,fname); }
@@ -221,6 +248,11 @@ public:
        /// Scan textual file for template and fill data array
        inline int ScanFile(const char *fname, const char *templ)
        {       return mgl_data_scan_file(this,fname, templ);   }
+       /// Read data from binary file of type: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char.
+       /** NOTE: this function may not correctly read binary files written in different CPU kind! */
+       inline bool ReadBin(const char *fname, int type)
+       {       return mgl_data_read_bin(this, fname, type);    }
+
 
        /// Get column (or slice) of the data filled by formulas of named columns
        inline mglData Column(const char *eq) const
@@ -246,6 +278,9 @@ public:
        {       return mglData(true,mgl_data_section(this,&ids,dir,val));       }
        inline mglData Section(long id, char dir='y', mreal val=NAN) const
        {       return mglData(true,mgl_data_section_val(this,id,dir,val));     }
+       /// Get contour lines for dat[i,j]=val. NAN values separate the the curves.
+       inline mglData Conts(mreal val)
+       {       return mglData(true,mgl_data_conts(val,this));  }
 
        /// Get trace of the data array
        inline mglData Trace() const
@@ -259,12 +294,22 @@ public:
        /// Get array which is result of summation in given direction or directions
        inline mglData Sum(const char *dir) const
        {       return mglData(true,mgl_data_sum(this,dir));    }
+       /// Get array of positions of first value large val
+       inline mglData First(const char *dir, mreal val) const
+       {       return mglData(true,mgl_data_first_dir(this,dir,val));  }
+       /// Get array of positions of last value large val
+       inline mglData Last(const char *dir, mreal val) const
+       {       return mglData(true,mgl_data_last_dir(this,dir,val));   }
+
        /// Get array which is result of maximal values in given direction or directions
        inline mglData Max(const char *dir) const
        {       return mglData(true,mgl_data_max_dir(this,dir));        }
        /// Get array which is result of minimal values in given direction or directions
        inline mglData Min(const char *dir) const
        {       return mglData(true,mgl_data_min_dir(this,dir));        }
+       /// Get positions of local maximums and minimums
+       inline mglData MinMax() const
+       {       return mglData(true,mgl_data_minmax(this));     }
        /// Get the data which is direct multiplication (like, d[i,j] = this[i]*a[j] and so on)
        inline mglData Combine(const mglData &dat) const
        {       return mglData(true,mgl_data_combine(this,&dat));       }
@@ -340,7 +385,9 @@ public:
         *  ‘x’, ‘y’, ‘z’ for 1st, 2nd or 3d dimension;
         *  ‘dN’ for linear averaging over N points;
         *  ‘3’ for linear averaging over 3 points;
-        *  ‘5’ for linear averaging over 5 points.
+        *  ‘5’ for linear averaging over 5 points;
+        *  ‘^’ for finding upper bound;
+        *  ‘_’ for finding lower bound.
         *  By default quadratic averaging over 5 points is used. */
        inline void Smooth(const char *dirs="xyz",mreal delta=0)
        {       mgl_data_smooth(this,dirs,delta);       }
@@ -356,6 +403,10 @@ public:
        /// Project the periodical data to range [v1,v2] (like mod() function). Separate branches by NAN if sep=true.
        inline void Coil(mreal v1, mreal v2, bool sep=true)
        {       mgl_data_coil(this, v1, v2, sep);       }
+       /// Keep the data sign/value along line i and j in given direction. 
+       /** Parameter "how" may contain: 'x','y' or 'z' for direction (default is 'y'); 'a' for keeping amplitude instead of sign.*/
+       inline void Keep(const char *how, long i, long j=0)
+       {       mgl_data_keep(this, how, i, j); }
 
        /// Apply Hankel transform
        inline void Hankel(const char *dir)     {       mgl_data_hankel(this,dir);      }
@@ -516,6 +567,9 @@ inline mglData mglRay(const char *ham, mglPoint r0, mglPoint p0, mreal dt=0.1, m
 /// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 over time interval [0,tmax] with time step dt
 inline mglData mglODE(const char *func, const char *var, const mglData &ini, mreal dt=0.1, mreal tmax=10)
 {      return mglData(true, mgl_ode_solve_str(func,var, &ini, dt, tmax));      }
+/// Saves result of ODE solving for var complex variables with right part func (separated by ';') and initial conditions x0 of size n*m over time interval [0,tmax] with time step dt
+inline mglData mglODEs(const char *func, const char *var, char brd, const mglData &ini, mreal dt=0.1, mreal tmax=10)
+{      return mglData(true, mgl_ode_solve_set(func,var, brd, &ini, dt, tmax)); }
 //-----------------------------------------------------------------------------
 /// Get array as solution of tridiagonal system of equations a[i]*x[i-1]+b[i]*x[i]+c[i]*x[i+1]=d[i]
 /** String \a how may contain:
index 48badd96deae2a44d18f3b37d5a406a058d8800c..7e20a4eac7e3c072993cb9b0422110d13a26fe5b 100644 (file)
 /// Wrapper class for all graphics
 class mglGraph
 {
-       mglGraph(const mglGraph &t) {}  // copying is not allowed
-       const mglGraph &operator=(const mglGraph &t)    {       return t;       }
+       mglGraph(const mglGraph &) {gr=0;}      // copying is not allowed
+       const mglGraph &operator=(const mglGraph &t)    {       gr=0;   return t;       }
 protected:
        HMGL gr;
 public:
-       inline mglGraph(int kind=0, int width=600, int height=400)
-       {
-               if(kind==-1)    gr=NULL;
+       HMPR pr;        ///< Pointer to associated MGL parser
+       mglGraph(int kind=-1)
+       {       pr = NULL;
+               if(kind==0)     gr=mgl_create_graph(600, 400);
 #if MGL_HAVE_OPENGL
                else if(kind==1)        gr=mgl_create_graph_gl();
 #else
                else if(kind==1)
-               {       gr=mgl_create_graph(width, height);
+               {       gr=mgl_default_graph(); mgl_use_graph(gr,1);
                        SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL.");    }
 #endif
-               else    gr=mgl_create_graph(width, height);
+               else    {       gr=mgl_default_graph(); mgl_use_graph(gr,1);    }
        }
-       inline mglGraph(HMGL graph)
-       {       gr = graph;             mgl_use_graph(gr,1);    }
+       mglGraph(int kind, int width, int height)
+       {       pr = NULL;
+               if(kind==0)     gr=mgl_create_graph(width, height);
+#if MGL_HAVE_OPENGL
+               else if(kind==1)        gr=mgl_create_graph_gl();
+#else
+               else if(kind==1)
+               {       gr=mgl_default_graph(); mgl_use_graph(gr,1);
+                       SetGlobalWarn("OpenGL support was disabled. Please, enable it and rebuild MathGL.");    }
+#endif
+               else    {       gr=mgl_default_graph(); mgl_use_graph(gr,1);    mgl_set_size(gr,width,height);  }
+       }
+       mglGraph(HMGL graph)
+       {       pr = NULL;      gr = graph;             mgl_use_graph(gr,1);    }
        virtual ~mglGraph()
        {       if(mgl_use_graph(gr,-1)<1)      mgl_delete_graph(gr);   }
        /// Get pointer to internal HMGL object
@@ -97,6 +110,8 @@ public:
        inline void SetMeshNum(int num)                 {       mgl_set_meshnum(gr, num);       }
        /// Set number of visible faces (use 0 to draw all of them)
        inline void SetFaceNum(int num)                 {       mgl_set_facenum(gr, num);       }
+       /// Set TeX parsing at text drawing
+       inline void SetTeXparse(bool val)               {       mgl_set_tex_parse(gr, val);     }
 
        /// Set cutting for points outside of bounding box
        inline void SetCut(bool cut)                            {       mgl_set_cut(gr, cut);   }
@@ -157,6 +172,8 @@ public:
        static inline void SetGlobalWarn(const char *text)      {       mgl_set_global_warn(text);      }
        /// Get text of global warning message(s)
        static inline const char *GlobalWarn()  {       return mgl_get_global_warn();   }
+       /// Clear global warning message
+       static inline void ClearGlobalWarn()    {       mgl_clear_global_warn();        }
        /// Suppress printing warnings to stderr
        static inline void SuppressWarn(bool on)        {       mgl_suppress_warn(on);  }
        /// Check if MathGL version is valid (return false) or not (return true)
@@ -563,9 +580,20 @@ public:
        /// Clear unused points and primitives. Useful only in combination with SetFaceNum().
        inline void ClearUnused()       {       mgl_clear_unused(gr);   }
 
-       /// Load background image
+       /// Load background image (basic variant: no scaling, whole image)
        inline void LoadBackground(const char *fname, double alpha=1)
        {       mgl_load_background(gr,fname,alpha);    }
+       /// Load image for background from file. 
+       /** Parameter 'how' can be:
+        *   'a' for filling current subplot only;
+        *   's' for scaling (resizing) image to whole area;
+        *   'c' for centering image;
+        *   'm' for tessellate image as mosaic. */
+       void LoadBackground(const char *fname, const char *how, double alpha=1)
+       {       mgl_load_background_ext(gr,fname,how,alpha);    }
+       /// Fill background image by specified color
+       void FillBackground(const mglColor &cc)
+       {       mgl_fill_background(gr, cc.r,cc.g,cc.b);        }
        /// Force drawing the image and use it as background one
        inline void Rasterize()                 {       mgl_rasterize(gr);      }
 
@@ -927,6 +955,17 @@ public:
        inline void Region(const mglData &x1, const mglData &y1, const mglData &x2, const mglData &y2, const char *pen="", const char *opt="")
        {       mgl_region_3d(gr, &x1, &y1, NULL, &x2, &y2, NULL, pen, opt);    }
 
+       /// Draw lines with arrows between points {x1,y1,z1} and {x2,y2,z2}
+       inline void Lines(const mglData &x1, const mglData &y1, const mglData &z1, const mglData &x2, const mglData &y2, const mglData &z2, const char *pen="", const char *opt="")
+       {       mgl_lines_xyz(gr, &x1, &y1, &z1, &x2, &y2, &z2, pen, opt);      }
+       /// Draw lines with arrows between points {x1,y1,zMin} and {x2,y2,zMin}
+       inline void Lines(const mglData &x1, const mglData &y1, const mglData &x2, const mglData &y2, const char *pen="", const char *opt="")
+       {       mgl_lines_xy(gr, &x1, &y1, &x2, &y2, pen, opt); }
+       /// Draw lines with arrows between: points {x1,y} and {x2,y} with y in y-axis range if \a pen contain 'x'; or points {x,y1} and {x,y2} with x in x-axis range.
+       inline void Lines(const mglData &y1, const mglData &y2, const char *pen="", const char *opt="")
+       {       if(mglchr(pen,'x'))     mgl_lines_x(gr, &y1, &y2, pen, opt);
+               else    mgl_lines(gr, &y1, &y2, pen, opt);      }
+
        /// Draw vertical lines from points {x,y,z} to axis plane
        inline void Stem(const mglData &x, const mglData &y, const mglData &z, const char *pen="", const char *opt="")
        {       mgl_stem_xyz(gr, &x, &y, &z, pen, opt); }
@@ -1363,6 +1402,10 @@ public:
         * Option "value" set the number of contour levels (default is 7). */
        inline void Cont(const mglData &z, const char *sch="", const char *opt="")
        {       mgl_cont(gr, &z, sch, opt);     }
+       /// Draw contour lines at a[i,j]=val specified parametrically
+       /** Style 't'/'T' draw contour labels below/above contours.*/
+       inline void ContGen(mreal val, const mglData &a, const mglData &x, const mglData &y, const mglData &z, const char *sch="", const char *opt="")
+       {       mgl_cont_gen(gr, val, &a, &x, &y, &z, sch, opt);        }
 
        /// Draw solid contours at manual levels for 2d data specified parametrically
        /** Style ‘_’ to draw contours at bottom of axis box. */
@@ -1382,6 +1425,9 @@ public:
         * Option "value" set the number of contour levels (default is 7). */
        inline void ContF(const mglData &z, const char *sch="", const char *opt="")
        {       mgl_contf(gr, &z, sch, opt);    }
+       /// Draw solid contours between a[i,j]=v1 and a[i,j]=v2 specified parametrically */
+       inline void ContFGen(mreal v1, mreal v2, const mglData &a, const mglData &x, const mglData &y, const mglData &z, const char *sch="", const char *opt="")
+       {       mgl_contf_gen(gr, v1,v2, &a, &x, &y, &z, sch, opt);     }
 
        /// Draw solid contours at manual levels for 2d data specified parametrically with specified colors
        /** Style ‘_’ to draw contours at bottom of axis box. */
@@ -1452,6 +1498,25 @@ public:
        inline void Axial(const mglData &z, const char *sch="", const char *opt="")
        {       mgl_axial(gr, &z, sch, opt);    }
 
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically
+       /** Style ‘t’/‘T’ draw contour labels below/above contours. */
+       inline void DCont(const mglData &v, const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *sch="", const char *opt="")
+       {       mgl_dcont_xyz(gr, &v, &x, &y, &z, &a, &b, sch, opt);    }
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data
+       /** Style ‘t’/‘T’ draw contour labels below/above contours. */
+       inline void DCont(const mglData &v, const mglData &a, const mglData &b, const char *sch="", const char *opt="")
+       {       mgl_dcont(gr, &v, &a, &b, sch, opt);    }
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data specified parametrically
+       /** Style ‘t’/‘T’ draw contour labels below/above contours.
+        * Option "value" set the number of isosurfaces (default is 3). */
+       inline void DCont(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const mglData &b, const char *sch="", const char *opt="")
+       {       mgl_dcont_xyz(gr, NULL, &x, &y, &z, &a, &b, sch, opt);  }
+       /// Draw curves of cross-section of isosurfaces a and b at manual levels for 3d data
+       /** Style ‘t’/‘T’ draw contour labels below/above contours.
+        * Option "value" set the number of isosurfaces (default is 3). */
+       inline void DCont(const mglData &a, const mglData &b, const char *sch="", const char *opt="")
+       {       mgl_dcont(gr, NULL, &a, &b, sch, opt);  }
+
        /// Draw grid lines for density plot at slice for 3d data specified parametrically
        /** Style ‘x’ or ‘z’ produce plot perpendicular to x- or z-direction correspondingly.*/
        inline void Grid3(const mglData &x, const mglData &y, const mglData &z, const mglData &a, const char *stl="", double sVal=-1, const char *opt="")
@@ -2315,3 +2380,5 @@ public:
        void DeleteAll()        {       mgl_parser_del_all(pr); }
 };
 //-----------------------------------------------------------------------------
+//mglGraph mglGr;
+//-----------------------------------------------------------------------------
index 25d1f1a2e2cba54352ff66a822871a491acbf7ae..441356e9af5f4c9310dad7bddcd9107ab89b7e91 100644 (file)
     if (PyDict_Check(    py_obj)) return "dict"        ;
     if (PyList_Check(    py_obj)) return "list"        ;
     if (PyTuple_Check(   py_obj)) return "tuple"       ;
-    if (PyFile_Check(    py_obj)) return "file"        ;
     if (PyModule_Check(  py_obj)) return "module"      ;
-    if (PyInstance_Check(py_obj)) return "instance"    ;
 
-    return "unknow type";
+    return "unknown type";
   }
 
   /* Given a NumPy typecode, return a string describing the type.
index 4e829b9e55ca7755f8c566c32b2234c3afa756cb..2403115308a877909b5581b6be9e51550a12842a 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: MathGL2 2.4.2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-07-06 19:59+0300\n"
+"POT-Creation-Date: 2021-12-03 16:47+0300\n"
 "PO-Revision-Date: 2018-03-24 11:08-0400\n"
 "Last-Translator: Diego Sejas Viscarra <dsejas.math@protonmail.com>\n"
 "Language-Team: \n"
@@ -18,7 +18,7 @@ msgstr ""
 "X-Generator: Poedit 2.0.4\n"
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
-#: mgllab/mgllab.cpp:433
+#: mgllab/mgllab.cpp:424
 #, c-format
 msgid ""
 "\t-1 str       set str as argument $1 for script\n"
@@ -104,7 +104,7 @@ msgstr ""
 "(c) Alexey Balakin, 2007\n"
 "http://mathgl.sourceforge.net/"
 
-#: src/parser.cpp:1066
+#: src/parser.cpp:1075
 #, c-format
 msgid ""
 "\n"
@@ -113,7 +113,7 @@ msgstr ""
 "\n"
 "Cambiar datos temporales en línea %ld"
 
-#: src/parser.cpp:1064
+#: src/parser.cpp:1073
 #, c-format
 msgid ""
 "\n"
@@ -122,7 +122,7 @@ msgstr ""
 "\n"
 "Texto demasiado largo en línea %ld"
 
-#: src/parser.cpp:1065
+#: src/parser.cpp:1074
 #, c-format
 msgid ""
 "\n"
@@ -131,7 +131,7 @@ msgstr ""
 "\n"
 "Desbalance de ' en línea %ld"
 
-#: src/parser.cpp:1062
+#: src/parser.cpp:1071
 #, c-format
 msgid ""
 "\n"
@@ -140,7 +140,7 @@ msgstr ""
 "\n"
 "Argumento(s) incorrecto(s) en línea %ld"
 
-#: src/parser.cpp:1063
+#: src/parser.cpp:1072
 #, c-format
 msgid ""
 "\n"
@@ -184,7 +184,7 @@ msgstr " Nuevo"
 msgid " Save"
 msgstr " Guardar"
 
-#: mgllab/mgllab.cpp:242
+#: mgllab/mgllab.cpp:233
 msgid " Yes "
 msgstr " Sí "
 
@@ -444,43 +444,43 @@ msgstr "'|' guión largo"
 msgid "'~' waves"
 msgstr "'~' ondas"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "0 - special plot"
 msgstr "0 - gráfico especial"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "1 - other plot"
 msgstr "1 - otro gráfico"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "10 - dd plot"
 msgstr "10 - gráfico dd"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "11 - vector plot"
 msgstr "11 - gráfico vectorial"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "12 - axis"
 msgstr "12 - eje"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "13 - primitives"
 msgstr "13 - primitivas"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "14 - axis setup"
 msgstr "14 - configurar eje"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "15 - text/legend"
 msgstr "15 - texto/leyenda"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "16 - data transform"
 msgstr "16 - transformar datos"
 
-#: udav/info_dlg.cpp:47
+#: udav/info_dlg.cpp:49
 msgid "1D plot"
 msgstr "Gráfico 1D"
 
@@ -492,11 +492,11 @@ msgstr "Gráficos 1D"
 msgid "1D view"
 msgstr "Vista 1D"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "2 - setup"
 msgstr "2 - configuración"
 
-#: udav/info_dlg.cpp:47
+#: udav/info_dlg.cpp:49
 msgid "2D plot"
 msgstr "Gráfico 2D"
 
@@ -508,7 +508,7 @@ msgstr "Gráficos 2D"
 msgid "2D view"
 msgstr "Vista 2D"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "3 - data handle"
 msgstr "3 - referencia a datos"
 
@@ -524,27 +524,27 @@ msgstr "Gráficos 3D"
 msgid "3D view"
 msgstr "Vista 3D"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "4 - data create"
 msgstr "4 - crear datos"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "5 - subplot"
 msgstr "5 - subgráfica"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "6 - program flow"
 msgstr "6 - flujo de programa"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "7 - 1d plot"
 msgstr "7 - gráfico 1d"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "8 - 2d plot"
 msgstr "8 - gráfico 2d"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "9 - 3d plot"
 msgstr "9 - gráfico 3d"
 
@@ -560,7 +560,7 @@ msgstr ""
 msgid "@<-  Prev"
 msgstr "@<-  Prev."
 
-#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:347
+#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:338
 msgid "About"
 msgstr "Acerca de"
 
@@ -590,7 +590,7 @@ msgstr "Añadir curva"
 msgid "Add curve which properties can be changed later by mouse."
 msgstr "Añadir curva configurable por el mouse."
 
-#: src/exec_dat.cpp:1666
+#: src/exec_dat.cpp:1728
 msgid "Add data or number"
 msgstr "Añadir datos o número"
 
@@ -607,7 +607,7 @@ msgid "Add inplot"
 msgstr "Añadir gráfico interno"
 
 # Anadir a la leyenda?
-#: src/exec_set.cpp:792
+#: src/exec_set.cpp:800
 msgid "Add legend entry"
 msgstr "Añadir entrada a leyenda"
 
@@ -669,7 +669,7 @@ msgstr "Añadir texto"
 msgid "Add text which properties can be changed later by mouse."
 msgstr "Añadir texto configurable por el mouse."
 
-#: src/exec_prm.cpp:658
+#: src/exec_prm.cpp:662
 msgid "Add title for current subplot/inplot"
 msgstr "Añadir titulo al subgráfica/gráfica interna"
 
@@ -678,19 +678,19 @@ msgid "Add to"
 msgstr "Añadir a"
 
 # user-defined
-#: src/exec_set.cpp:793
+#: src/exec_set.cpp:801
 msgid "Add user-defined symbol"
 msgstr "Añadir símbolo personalizado"
 
-#: widgets/fltk.cpp:877
+#: widgets/fltk.cpp:883
 msgid "Adjust picture size to fill drawing area"
 msgstr "Ajustar imagen al área de dibujo"
 
-#: widgets/fltk.cpp:840 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337
+#: widgets/fltk.cpp:846 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337
 msgid "Adjust size"
 msgstr "Ajustar tamaño"
 
-#: src/exec_set.cpp:794
+#: src/exec_set.cpp:802
 msgid "Adjust ticks for best view"
 msgstr "Optimizar marcas de los ejes"
 
@@ -793,7 +793,7 @@ msgstr "Proporción de escala y a escala z"
 msgid "Aspect x/z"
 msgstr "Aspecto x/z"
 
-#: src/exec_set.cpp:800
+#: src/exec_set.cpp:808
 msgid "Attach light settings to inplot"
 msgstr "Vincular configuración de luz a gráfico interno"
 
@@ -817,7 +817,7 @@ msgstr "Ejecutar script automáticamente al cargarlo"
 msgid "Automatically save before redrawing (F5)"
 msgstr "Guardar automáticamente antes de graficar (F5)"
 
-#: src/data.cpp:1488
+#: src/data.cpp:1557
 #, c-format
 msgid ""
 "Averages are:\n"
@@ -855,12 +855,12 @@ msgstr "B - azul marino"
 msgid "Backward"
 msgstr "Retroceder"
 
-#: src/font.cpp:1021
+#: src/font.cpp:1005
 #, c-format
 msgid "Bad '%ls' at %zu\n"
 msgstr "\"%ls\" incorrecto en %zu\n"
 
-#: src/parser.cpp:769
+#: src/parser.cpp:778
 #, c-format
 msgid "Bad arguments for %ls: %ld instead of %d\n"
 msgstr "Error en argumentos de %ls: %ld en vez de %d\n"
@@ -877,7 +877,7 @@ msgstr "Básicas"
 msgid "Begin"
 msgstr "Inicio"
 
-#: src/parser.cpp:1483
+#: src/parser.cpp:1492
 msgid "Begin of do-while loop"
 msgstr "Inicio de bucle \"do while\""
 
@@ -905,7 +905,7 @@ msgstr "yrange requiere dos valores"
 msgid "Both fields in zrange must be filled"
 msgstr "zrange requiere dos valores"
 
-#: src/parser.cpp:1480
+#: src/parser.cpp:1489
 msgid "Break for-loop"
 msgstr "Salir de bucle \"for\""
 
@@ -940,8 +940,8 @@ msgstr "Cálculos"
 
 #. TODO
 #. connect(hidden,SIGNAL(cursorPositionChanged()),this,SLOT(hiddenClicked()));
-#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:341
-#: mgllab/mgllab.cpp:572
+#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:332
+#: mgllab/mgllab.cpp:567
 msgid "Calculator"
 msgstr "Calculadora"
 
@@ -950,21 +950,21 @@ msgstr "Calculadora"
 #: udav/dat_pnl.cpp:510 udav/dat_pnl.cpp:552 udav/dat_pnl.cpp:629
 #: udav/opt_dlg.cpp:78 udav/setup_dlg.cpp:145 udav/files_dlg.cpp:58
 #: udav/style_dlg.cpp:206 udav/data_dlg.cpp:90 udav/subplot_dlg.cpp:219
-#: mgllab/editor.cpp:282 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197
+#: mgllab/editor.cpp:286 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197
 #: mgllab/dialogs.cpp:120 mgllab/dialogs.cpp:164 mgllab/dialogs.cpp:410
 #: mgllab/dialogs.cpp:584 mgllab/dialogs.cpp:749 mgllab/dialogs.cpp:1071
-#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:497
+#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:490
 #: mgllab/table.cpp:101 mgllab/table.cpp:179 mgllab/table.cpp:353
 #: mgllab/table.cpp:556 mgllab/table.cpp:619 mgllab/table.cpp:675
 msgid "Cancel"
 msgstr "Cancelar"
 
-#: src/crust.cpp:589
+#: src/crust.cpp:588
 msgid "Cannot triangulate this set!"
 msgstr "¡Imposible triangular conjunto!"
 
 # Area de imagen? Area de figura?
-#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:370 mgllab/mgllab.cpp:371
+#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:361 mgllab/mgllab.cpp:362
 msgid "Canvas"
 msgstr "Área de dibujo"
 
@@ -985,7 +985,7 @@ msgstr "Cambiar (tamaño de) datos"
 msgid "Change canvas size to fill whole region (F6)."
 msgstr "Maximizar el área de dibujo (F6)."
 
-#: src/exec_set.cpp:804
+#: src/exec_set.cpp:812
 msgid "Change current directory"
 msgstr "Cambiar directorio actual"
 
@@ -1005,7 +1005,7 @@ msgstr "Cambiar valores y cerrar esta ventana"
 msgid "Change font"
 msgstr "Cambiar fuente"
 
-#: src/exec_set.cpp:855
+#: src/exec_set.cpp:864
 msgid "Change view angles - use 'rotate' for plot rotation"
 msgstr "Modificar ángulos - use \"rotate\" para rotar gráfico"
 
@@ -1018,17 +1018,17 @@ msgstr "Borrar"
 msgid "Clear all"
 msgstr "Borrar todo"
 
-#: src/exec_set.cpp:805
+#: src/exec_set.cpp:813
 msgid "Clear legend entries"
 msgstr "Borrar entradas de leyenda"
 
-#: src/exec_set.cpp:806
+#: src/exec_set.cpp:814
 msgid "Clear picture"
 msgstr "Borrar imagen"
 
 #. o = new Fl_Button(180, 130, 25, 25);o->image(img_save);     o->tooltip("img_save");
-#: widgets/fltk.cpp:1106 widgets/qt.cpp:1108 udav/find_dlg.cpp:52
-#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:566 mgllab/help.cpp:289
+#: widgets/fltk.cpp:1118 widgets/qt.cpp:1108 udav/find_dlg.cpp:52
+#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:570 mgllab/help.cpp:289
 #: mgllab/help.cpp:349 mgllab/help.cpp:465
 msgid "Close"
 msgstr "Cerrar"
@@ -1075,7 +1075,7 @@ msgstr ""
 msgid "Column expr"
 msgstr "Exp. de columna"
 
-#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:320
+#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:311
 msgid "Command"
 msgstr "Comando"
 
@@ -1099,27 +1099,27 @@ msgstr "Opciones de comando"
 msgid "Comments"
 msgstr "Comentarios"
 
-#: src/exec_prm.cpp:646
+#: src/exec_prm.cpp:650
 msgid "Computes the attractor of an IFS"
 msgstr "Calcula el atractor de un IFS"
 
-#: src/exec_prm.cpp:647
+#: src/exec_prm.cpp:651
 msgid "Computes the attractor of an IFS for 3d case"
 msgstr "Calcula el atractor de un IFS para el caso 3d"
 
-#: src/exec_prm.cpp:648
+#: src/exec_prm.cpp:652
 msgid "Computes the attractor of an IFS with parameters from *.ifs file"
 msgstr "Calcula el atractor de un IFS con parámetros de un archivo *.ifs"
 
-#: src/exec_prm.cpp:642
+#: src/exec_prm.cpp:646
 msgid "Computes the flame fractal"
 msgstr "Calcula un fractal de flama"
 
-#: src/parser.cpp:1499
+#: src/parser.cpp:1508
 msgid "Condition of do-while loop"
 msgstr "Condición de un bucle do-while"
 
-#: src/parser.cpp:1489 src/parser.cpp:1493
+#: src/parser.cpp:1498 src/parser.cpp:1502
 msgid "Conditional operator"
 msgstr "Operador condicional"
 
@@ -1136,11 +1136,11 @@ msgstr "Copiar coordenadas del último clic. a memoria"
 msgid "Copy data"
 msgstr "Copiar datos"
 
-#: src/exec_dat.cpp:1674
+#: src/exec_dat.cpp:1736
 msgid "Copy data from another variable"
 msgstr "Copiar datos de otra variable"
 
-#: widgets/fltk.cpp:837
+#: widgets/fltk.cpp:843
 msgid "Copy graphics"
 msgstr "Copiar gráfico"
 
@@ -1148,7 +1148,7 @@ msgstr "Copiar gráfico"
 msgid "Copy graphics to clipboard (Ctrl+Shift+G)."
 msgstr "Copiar gráfico a memoria (Ctrl+Shift+G)."
 
-#: widgets/fltk.cpp:881
+#: widgets/fltk.cpp:887
 msgid "Copy image to clipboard"
 msgstr "Copiar imagen a memoria"
 
@@ -1164,11 +1164,11 @@ msgstr "Copiar rango de números a memoria (Ctrl+Shift+C)."
 msgid "Copy selected text or data to clipboard (Ctrl+C)."
 msgstr "Copiar texto seleccionado o datos a memoria (Ctrl+C)."
 
-#: mgllab/editor.cpp:512
+#: mgllab/editor.cpp:516
 msgid "Copy selection to clipboard"
 msgstr "Copiar selección a memoria"
 
-#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:310
+#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:301
 msgid "Copy text"
 msgstr "Copiar texto"
 
@@ -1180,7 +1180,7 @@ msgstr "Cos-FFT"
 msgid "Cos-Fourier transform along direction(s)"
 msgstr "Cos-transformada de Fourier en dirrección(es)"
 
-#: src/exec_dat.cpp:1676
+#: src/exec_dat.cpp:1738
 msgid "Cos-Fourier transform at some direction"
 msgstr "Cos-transformada de Fourier en una dirección"
 
@@ -1217,7 +1217,7 @@ msgstr "Crear datos e I/O"
 msgid "Create data and IO"
 msgstr "Crear datos e I/O"
 
-#: src/exec_dat.cpp:1702
+#: src/exec_dat.cpp:1765
 msgid "Create histogram (distribution) of data values"
 msgstr "Crear histograma (distribución) de valores de datos"
 
@@ -1225,11 +1225,11 @@ msgstr "Crear histograma (distribución) de valores de datos"
 msgid "Create new"
 msgstr "Crear nuevo"
 
-#: src/exec_dat.cpp:1762
+#: src/exec_dat.cpp:1828
 msgid "Create new 1D data and fill it in range"
 msgstr "Crear nuevos datos 1D y llenar en rango"
 
-#: src/exec_dat.cpp:1717
+#: src/exec_dat.cpp:1782
 msgid "Create new data"
 msgstr "Crear nuevos datos"
 
@@ -1245,7 +1245,7 @@ msgstr "Crear arreglo y llenarlo con ceros"
 msgid "Create new empty script window (Ctrl+N)."
 msgstr "Crear ventana para nuevo script (Ctrl+N)."
 
-#: src/parser.cpp:1494
+#: src/parser.cpp:1503
 msgid "Creates new variable from list of numbers or data"
 msgstr "Crear nueva variable de una lista de números o datos"
 
@@ -1261,7 +1261,7 @@ msgstr "Cortar (bordes) de datos"
 msgid "Crop data"
 msgstr "Cortar datos"
 
-#: src/exec_dat.cpp:1677
+#: src/exec_dat.cpp:1739
 msgid "Crop edge of data"
 msgstr "Cortar borde de datos"
 
@@ -1273,7 +1273,7 @@ msgstr "Cortar bordes de datos. Útil para cortar área con ceros."
 msgid "CumSum"
 msgstr "SumCum"
 
-#: src/exec_dat.cpp:1678
+#: src/exec_dat.cpp:1740
 msgid "Cumulative summation along direction(s)"
 msgstr "Suma acumulativa en la(s) dirección(es)"
 
@@ -1289,7 +1289,7 @@ msgstr "Fuente actual"
 msgid "Cut selected text to clipboard (Ctrl+X)."
 msgstr "Cortar texto seleccionado a memoria (Ctrl+X)."
 
-#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:309
+#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:300
 msgid "Cut text"
 msgstr "Cortar texto"
 
@@ -1341,11 +1341,12 @@ msgstr "Información sobre datos y vista previa."
 msgid "Data name"
 msgstr "Nombre de datos"
 
-#: udav/info_dlg.cpp:42
+#. mgl->autoResize = true;     // TODO: something strange here !!!
+#: udav/info_dlg.cpp:43
 msgid "Data preview"
 msgstr "Vista previa de datos"
 
-#: udav/info_dlg.cpp:43
+#: udav/info_dlg.cpp:44
 msgid "Data preview for current slice."
 msgstr "Vista previa de datos para porción actual."
 
@@ -1365,19 +1366,19 @@ msgstr "Decrementar ángulo \\theta en 10 grados."
 msgid "Decrease font size"
 msgstr "Reducir tamaño de fuente"
 
-#: src/parser.cpp:1485
+#: src/parser.cpp:1494
 msgid "Define constant or parameter"
 msgstr "Definir constante o parámetro"
 
-#: src/parser.cpp:1484
+#: src/parser.cpp:1493
 msgid "Define parameter as character"
 msgstr "Definir parámetro como caracter"
 
-#: src/parser.cpp:1486
+#: src/parser.cpp:1495
 msgid "Define parameter as numerical value"
 msgstr "Definir parámetro como valor numérico"
 
-#: src/parser.cpp:1479
+#: src/parser.cpp:1488
 msgid "Define parameter from user input"
 msgstr "Definir parámetro de input del usuario"
 
@@ -1397,7 +1398,7 @@ msgstr "Borrar @b todos@. los datos."
 msgid "Delete ALL data arrays"
 msgstr "Borrar TODOS los datos"
 
-#: src/exec_dat.cpp:1681
+#: src/exec_dat.cpp:1743
 msgid "Delete data or slice of data"
 msgstr "Borrar datos o porción de los datos"
 
@@ -1421,7 +1422,7 @@ msgstr "Borrar gráfico seleccionado."
 msgid "Description"
 msgstr "Descripción"
 
-#: src/exec_dat.cpp:1682
+#: src/exec_dat.cpp:1744
 msgid "Detect curves for maximums of data array"
 msgstr "Analizar curvas en busca de máximos"
 
@@ -1437,11 +1438,11 @@ msgstr "Diferenciar datos en la(s) dirección(es)"
 msgid "Diffuse"
 msgstr "Difuso"
 
-#: src/exec_dat.cpp:1686
+#: src/exec_dat.cpp:1748
 msgid "Dilate data larger val"
 msgstr "Dilatar datos mayores a val"
 
-#: src/exec_dat.cpp:1671
+#: src/exec_dat.cpp:1733
 msgid "Direct multiplication of arrays"
 msgstr "Multiplicación directa de arreglos"
 
@@ -1462,7 +1463,7 @@ msgstr "Distancia entre celdas"
 msgid "Divide by"
 msgstr "Dividir por"
 
-#: src/exec_dat.cpp:1687
+#: src/exec_dat.cpp:1749
 msgid "Divide by data or number"
 msgstr "Dividir por datos o número"
 
@@ -1470,11 +1471,11 @@ msgstr "Dividir por datos o número"
 msgid "Do"
 msgstr "Hacer"
 
-#: src/exec_dat.cpp:1751
+#: src/exec_dat.cpp:1817
 msgid "Do STFA transform"
 msgstr "Transformada STFA"
 
-#: src/exec_dat.cpp:1757 src/exec_dat.cpp:1758
+#: src/exec_dat.cpp:1823 src/exec_dat.cpp:1824
 msgid "Do integral transform of data"
 msgstr "Transformada integral de datos"
 
@@ -1491,7 +1492,7 @@ msgstr "¿Desea borrar todos los datos?"
 msgid "Do you want to save the changes to the document?"
 msgstr "¿Desea guardar los cambios del documento?"
 
-#: mgllab/editor.cpp:282
+#: mgllab/editor.cpp:286
 msgid "Don't Save"
 msgstr "No guardar"
 
@@ -1499,443 +1500,453 @@ msgstr "No guardar"
 msgid "Double diff."
 msgstr "Doble dif."
 
-#: src/exec_gr.cpp:1141
+#: src/exec_gr.cpp:1213
 msgid "Draw Bifurcation diagram"
 msgstr "Diagrama de bifurcación"
 
-#: src/exec_gr.cpp:1177
+#: src/exec_gr.cpp:1250
 msgid "Draw Iris plots"
 msgstr "Gráfica de Iris"
 
-#: src/exec_gr.cpp:1179
+#: src/exec_gr.cpp:1252
 msgid "Draw Lamerey diagram"
 msgstr "Diagrama de Lamerey"
 
 # apertura-alto-bajo-clausura?
-#: src/exec_gr.cpp:1183
+#: src/exec_gr.cpp:1257
 msgid "Draw Open-High-Low-Close (OHLC) diagram"
 msgstr "Diagrama OHLC"
 
-#: src/exec_gr.cpp:1186
+#: src/exec_gr.cpp:1260
 msgid "Draw Poincare map"
 msgstr "Mapa de Poincaré"
 
-#: src/exec_gr.cpp:1192
+#: src/exec_gr.cpp:1266
 msgid "Draw STFA diagram"
 msgstr "Diagrama STFA"
 
-#: src/exec_gr.cpp:1204
+#: src/exec_gr.cpp:1278
 msgid "Draw TeX mark at point position"
 msgstr "Graficar marca de TeX en posición"
 
-#: src/exec_prm.cpp:624
+#: src/exec_prm.cpp:628
 msgid "Draw angle arc"
 msgstr "Graficar arco"
 
-#: src/exec_gr.cpp:1134
+#: src/exec_gr.cpp:1206
 msgid "Draw area plot for 1D data"
 msgstr "Gráfica de área para datos 1D"
 
-#: src/exec_gr.cpp:1137
+#: src/exec_gr.cpp:1209
 msgid "Draw bars for 1D data"
 msgstr "Gráfica de barras para 1D"
 
-#: src/exec_gr.cpp:1139
+#: src/exec_gr.cpp:1211
 msgid "Draw belts"
 msgstr "Gráfica de correas"
 
-#: src/exec_gr.cpp:1140
+#: src/exec_gr.cpp:1212
 msgid "Draw belts colored by other data"
 msgstr "Gráfica de correas coloreada por otros datos"
 
-#: src/exec_gr.cpp:1202
+#: src/exec_gr.cpp:1276
 msgid "Draw binormales for 1D data"
 msgstr "Gráfica de binormales para datos 1D"
 
-#: src/exec_prm.cpp:651
+#: src/exec_prm.cpp:655
 msgid "Draw bitmap (logo) along axis range"
 msgstr "Graficar imagen (logo) en el rango de ejes"
 
-#: src/exec_prm.cpp:628
+#: src/exec_prm.cpp:632
 msgid "Draw bounding box"
 msgstr "Graficar bordes"
 
-#: src/exec_gr.cpp:1143
+#: src/exec_gr.cpp:1215
 msgid "Draw boxes"
 msgstr "Diagrama de cajas"
 
-#: src/exec_gr.cpp:1142
+#: src/exec_gr.cpp:1214
 msgid "Draw boxplot for 2D data"
 msgstr "Diagrama de cajas para datos 2D"
 
-#: src/exec_gr.cpp:1144
+#: src/exec_gr.cpp:1216
 msgid "Draw candlestick chart"
 msgstr "Diagrama de velas"
 
-#: src/exec_gr.cpp:1145
+#: src/exec_gr.cpp:1217
 msgid "Draw chart"
 msgstr "Gráfica de cuadros"
 
-#: src/exec_prm.cpp:629
+#: src/exec_prm.cpp:633
 msgid "Draw circle"
 msgstr "Graficar círculo"
 
-#: src/exec_gr.cpp:1146
+#: src/exec_gr.cpp:1218
 msgid "Draw cloud"
 msgstr "Gráfica de nube"
 
-#: src/exec_prm.cpp:631
+#: src/exec_prm.cpp:635
 msgid "Draw colorbar"
 msgstr "Graficar barra de colores"
 
-#: src/exec_prm.cpp:632
+#: src/exec_prm.cpp:636
 msgid "Draw cone"
 msgstr "Dibujar cono"
 
-#: src/exec_gr.cpp:1147
+#: src/exec_gr.cpp:1219
 msgid "Draw cones for 1D data"
 msgstr "Gráfica de conos para datos 1D"
 
-#: src/exec_gr.cpp:1148
+#: src/exec_gr.cpp:1220
 msgid "Draw contour lines"
 msgstr "Gráfica de curvas de nivel"
 
-#: src/exec_gr.cpp:1158
+#: src/exec_gr.cpp:1230
 msgid "Draw contour lines at x-slice (or x-plane)"
 msgstr "Curvas de nivel en el plano x"
 
-#: src/exec_gr.cpp:1159
+#: src/exec_gr.cpp:1231
 msgid "Draw contour lines at y-slice (or y-plane)"
 msgstr "Curvas de nivel en el plano y"
 
-#: src/exec_gr.cpp:1160
+#: src/exec_gr.cpp:1232
 msgid "Draw contour lines at z-slice (or z-plane)"
 msgstr "Curvas de nivel en el plano z"
 
-#: src/exec_gr.cpp:1149
+#: src/exec_gr.cpp:1221
 msgid "Draw contour lines for 3D data"
 msgstr "Gráfica de curvas de nivel para datos 3D"
 
-#: src/exec_gr.cpp:1209
+#: src/exec_gr.cpp:1283
 msgid "Draw contour lines for surface of triangles"
 msgstr "Curvas de nivel para superficie de triángulos"
 
-#: src/exec_gr.cpp:1156
+#: src/exec_gr.cpp:1228
 msgid "Draw contour lines on parametric surface"
 msgstr "Curvas de nivel sobre superficie paramétrica"
 
-#: src/exec_gr.cpp:1157
+#: src/exec_gr.cpp:1229
 msgid "Draw contour tubes"
 msgstr "Cilindros de nivel"
 
-#: src/exec_gr.cpp:1210
+#: src/exec_gr.cpp:1284
 msgid "Draw contour tubes for surface of triangles"
 msgstr "Cilindros de nivel para superficie de triángulos"
 
-#: src/exec_prm.cpp:633
+#: src/exec_prm.cpp:637
 msgid "Draw curve"
 msgstr "Graficar curva"
 
-#: src/exec_gr.cpp:1212
+#: src/exec_gr.cpp:1286
 msgid "Draw curve by tube"
 msgstr "Graficar curva tubular"
 
-#: src/exec_gr.cpp:1162
+#: src/exec_gr.cpp:1234
+#, fuzzy
+msgid "Draw curves of cross-section of isosurfaces a,b for 3D data"
+msgstr "Isosuperficie para datos 3D"
+
+#: src/exec_gr.cpp:1235
 msgid "Draw density plot"
 msgstr "Gráfica de densidad"
 
-#: src/exec_gr.cpp:1163
+#: src/exec_gr.cpp:1236
 msgid "Draw density plot at slices of 3D data"
 msgstr "Gráfica de densidad para secciones de datos 3D data"
 
-#: src/exec_gr.cpp:1164
+#: src/exec_gr.cpp:1237
 msgid "Draw density plot at x-slice (or x-plane)"
 msgstr "Gráfica de densidad en el plano x"
 
-#: src/exec_gr.cpp:1165
+#: src/exec_gr.cpp:1238
 msgid "Draw density plot at y-slice (or y-plane)"
 msgstr "Gráfica de densidad en el plano y"
 
-#: src/exec_gr.cpp:1166
+#: src/exec_gr.cpp:1239
 msgid "Draw density plot at z-slice (or z-plane)"
 msgstr "Gráfica de densidad en el plano z"
 
 # Esquema de gotas?
-#: src/exec_gr.cpp:1167
+#: src/exec_gr.cpp:1240
 msgid "Draw dew plot"
 msgstr "Gráfica de gotas"
 
-#: src/exec_gr.cpp:1168
+#: src/exec_gr.cpp:1241
 msgid "Draw dots for arbitrary data points"
 msgstr "Diagrama de puntos para datos arbitrarios"
 
-#: src/exec_prm.cpp:634
+#: src/exec_prm.cpp:638
 msgid "Draw drop"
 msgstr "Graficar gota"
 
-#: src/exec_prm.cpp:635
+#: src/exec_prm.cpp:639
 msgid "Draw ellipse"
 msgstr "Graficar elipse"
 
-#: src/exec_prm.cpp:636
+#: src/exec_prm.cpp:640
 msgid "Draw error box"
 msgstr "Graficar caja de error"
 
-#: src/exec_gr.cpp:1169
+#: src/exec_gr.cpp:1242
 msgid "Draw error boxes"
 msgstr "Graficar cajas de error"
 
-#: src/exec_prm.cpp:637
+#: src/exec_prm.cpp:641
 msgid "Draw face (quadrangle)"
 msgstr "Graficar faceta (cuadrángulo)"
 
-#: src/exec_prm.cpp:638
+#: src/exec_prm.cpp:642
 msgid "Draw face perpendicular to x-axis"
 msgstr "Graficar faceta perpendicular al eje x"
 
-#: src/exec_prm.cpp:639
+#: src/exec_prm.cpp:643
 msgid "Draw face perpendicular to y-axis"
 msgstr "Graficar faceta perpendicular al eje y"
 
-#: src/exec_prm.cpp:640
+#: src/exec_prm.cpp:644
 msgid "Draw face perpendicular to z-axis"
 msgstr "Graficar faceta perpendicular al eje z"
 
-#: src/exec_gr.cpp:1189
+#: src/exec_gr.cpp:1263
 msgid "Draw filled region (ribbon) between 2 curves"
 msgstr "Graficar región rellena (banda) entre dos curbas"
 
-#: src/exec_gr.cpp:1184
+#: src/exec_gr.cpp:1258
 msgid "Draw flow pipes for vector field"
 msgstr "Graficar tubos de flujo de campo vectorial"
 
-#: src/exec_gr.cpp:1171
+#: src/exec_gr.cpp:1244
 msgid "Draw flow threads for vector field"
 msgstr "Graficar líneas de flujo para campo vectorial"
 
-#: src/exec_gr.cpp:1173
+#: src/exec_gr.cpp:1246
 msgid "Draw flow threads from plain for vector field"
 msgstr "Graficar de líneas de flujo desde plano para campo vectorial"
 
-#: src/exec_gr.cpp:1174
+#: src/exec_gr.cpp:1247
 msgid "Draw gradient lines for scalar field"
 msgstr "Graficar líneas de gradiente para campo escalar"
 
-#: src/exec_prm.cpp:645
+#: src/exec_prm.cpp:649
 msgid "Draw grid"
 msgstr "Graficar grilla"
 
-#: src/exec_gr.cpp:1176
+#: src/exec_gr.cpp:1249
 msgid "Draw grid at slices of 3D data"
 msgstr "Graficar grilla para cortes de datos 3D"
 
-#: src/exec_gr.cpp:1175
+#: src/exec_gr.cpp:1248
 msgid "Draw grid for data array(s)"
 msgstr "Graficar grilla para arreglo(s) de datos"
 
-#: src/exec_gr.cpp:1136
+#: src/exec_gr.cpp:1208
 msgid "Draw horizontal bars for 1D data"
 msgstr "Graficar barras horizontales pata datos 1D"
 
-#: src/exec_gr.cpp:1205
+#: src/exec_gr.cpp:1279
 msgid "Draw horizontal tiles"
 msgstr "Graficar baldosas horizontales"
 
-#: src/exec_gr.cpp:1206
+#: src/exec_gr.cpp:1280
 msgid "Draw horizontal tiles with variable size"
 msgstr "Baldosas horizontales con tamaño variable"
 
-#: src/exec_gr.cpp:1194
+#: src/exec_gr.cpp:1268
 msgid "Draw isosurface for 3D data"
 msgstr "Isosuperficie para datos 3D"
 
-#: src/exec_gr.cpp:1197
+#: src/exec_gr.cpp:1271
 msgid "Draw isosurface for 3D data colored and transpared by other data"
 msgstr ""
 "Isosuperficie para datos 3D coloreados y con transparencia de otros datos"
 
-#: src/exec_gr.cpp:1196
+#: src/exec_gr.cpp:1270
 msgid "Draw isosurface for 3D data colored by other data"
 msgstr "Isosuperficie para datos 3D coloreada por otros datos"
 
-#: src/exec_gr.cpp:1195
+#: src/exec_gr.cpp:1269
 msgid "Draw isosurface for 3D data transpared by other data"
 msgstr "Isosuperficie para datos 3D con transparencia de otros datos"
 
-#: src/exec_gr.cpp:1178
+#: src/exec_gr.cpp:1251
 msgid "Draw label at arbitrary position"
 msgstr "Etiqueta en posición arbitraria"
 
-#: src/exec_prm.cpp:630
+#: src/exec_prm.cpp:634
 #, fuzzy
 msgid "Draw label for colorbar"
 msgstr "Etiqueta para eje t"
 
-#: src/exec_prm.cpp:659
+#: src/exec_prm.cpp:663
 msgid "Draw label for t-axis"
 msgstr "Etiqueta para eje t"
 
-#: src/exec_prm.cpp:660
+#: src/exec_prm.cpp:664
 msgid "Draw label for x-axis"
 msgstr "Etiqueta para el eje x"
 
-#: src/exec_prm.cpp:661
+#: src/exec_prm.cpp:665
 msgid "Draw label for y-axis"
 msgstr "Etiqueta para el eje y"
 
-#: src/exec_prm.cpp:662
+#: src/exec_prm.cpp:666
 msgid "Draw label for z-axis"
 msgstr "Etiqueta para el eje z"
 
-#: src/exec_prm.cpp:649
+#: src/exec_prm.cpp:653
 msgid "Draw legend"
 msgstr "Graficar leyenda"
 
-#: src/exec_prm.cpp:650
+#: src/exec_prm.cpp:654
 msgid "Draw line"
 msgstr "Graficar recta"
 
-#: src/exec_gr.cpp:1180
+#: src/exec_gr.cpp:1253
+#, fuzzy
+msgid "Draw lines with arrows for 1D data"
+msgstr "Gráfica de barras para 1D"
+
+#: src/exec_gr.cpp:1254
 msgid "Draw mapping plot"
 msgstr "Gráfica de mapeo"
 
-#: src/exec_gr.cpp:1181
+#: src/exec_gr.cpp:1255
 msgid "Draw mark plot for 1D data"
 msgstr "Gráfica de marcas para datos 1D"
 
-#: src/exec_gr.cpp:1182
+#: src/exec_gr.cpp:1256
 msgid "Draw mesh surface"
 msgstr "Graficar grilla de superficie"
 
-#: src/exec_prm.cpp:627
+#: src/exec_prm.cpp:631
 msgid "Draw point (ball)"
 msgstr "Graficar punto (esfera)"
 
-#: src/exec_prm.cpp:652
+#: src/exec_prm.cpp:656
 msgid "Draw polygon"
 msgstr "Graficar polígono"
 
-#: src/exec_gr.cpp:1138
+#: src/exec_gr.cpp:1210
 msgid "Draw quasi-optical beam"
 msgstr "Graficar haz cuasióptico"
 
-#: src/exec_gr.cpp:1188
+#: src/exec_gr.cpp:1262
 msgid "Draw radar chart"
 msgstr "Diagrama de radar"
 
-#: src/exec_gr.cpp:1161
+#: src/exec_gr.cpp:1233
 msgid "Draw reconstructed surface for arbitrary data points"
 msgstr "Graficar superficie reconstruida para puntos arbitrarios"
 
-#: src/exec_prm.cpp:653
+#: src/exec_prm.cpp:657
 msgid "Draw rectangle"
 msgstr "Graficar rectángulo"
 
-#: src/exec_prm.cpp:654
+#: src/exec_prm.cpp:658
 msgid "Draw rhombus"
 msgstr "Graficar rombo"
 
-#: src/exec_gr.cpp:1153
+#: src/exec_gr.cpp:1225
 msgid "Draw solid contour lines at x-slice (or x-plane)"
 msgstr "Curvas de nivel rellenas en el plano x"
 
-#: src/exec_gr.cpp:1154
+#: src/exec_gr.cpp:1226
 msgid "Draw solid contour lines at y-slice (or y-plane)"
 msgstr "Curvas de nivel rellenas en el plano y"
 
-#: src/exec_gr.cpp:1155
+#: src/exec_gr.cpp:1227
 msgid "Draw solid contour lines at z-slice (or z-plane)"
 msgstr "Curvas de nivel rellenas en el plano z"
 
-#: src/exec_gr.cpp:1152
+#: src/exec_gr.cpp:1224
 msgid "Draw solid contour lines for 3D data"
 msgstr "Isosuperficies rellenas para datos 3D"
 
-#: src/exec_gr.cpp:1151
+#: src/exec_gr.cpp:1223
 msgid "Draw solid contours"
 msgstr "Curvas de nivel rellenas"
 
-#: src/exec_gr.cpp:1150
+#: src/exec_gr.cpp:1222
 msgid "Draw solid contours with manual colors"
 msgstr "Curvas de nivel rellenas con coloración manual"
 
-#: src/exec_gr.cpp:1193
+#: src/exec_gr.cpp:1267
 msgid "Draw solid surface"
 msgstr "Graficar superficie sólida"
 
-#: src/exec_gr.cpp:1200
+#: src/exec_gr.cpp:1274
 msgid "Draw solid surface colored and transpared by other data"
 msgstr "Superficie sólida con color y transparencia de otros datos"
 
-#: src/exec_gr.cpp:1199
+#: src/exec_gr.cpp:1273
 msgid "Draw solid surface colored by other data"
 msgstr "Superficie sólida con coloración de otros datos"
 
-#: src/exec_gr.cpp:1198
+#: src/exec_gr.cpp:1272
 msgid "Draw solid surface transpared by other data"
 msgstr "Superficie sólida con transparencia de otros datos"
 
-#: src/exec_prm.cpp:655
+#: src/exec_prm.cpp:659
 msgid "Draw sphere"
 msgstr "Graficar esfera"
 
-#: src/exec_gr.cpp:1190
+#: src/exec_gr.cpp:1264
 msgid "Draw stem plot for 1D data"
 msgstr "Gráfica de tallos para datos 1D"
 
-#: src/exec_gr.cpp:1191
+#: src/exec_gr.cpp:1265
 msgid "Draw step plot for 1D data"
 msgstr "Gráfica escalonada para datos 1D"
 
-#: src/exec_gr.cpp:1207
+#: src/exec_gr.cpp:1281
 msgid "Draw surface of curve rotation"
 msgstr "Graficar superficie de rotación"
 
-#: src/exec_gr.cpp:1187
+#: src/exec_gr.cpp:1261
 msgid "Draw surface of quadrangles"
 msgstr "Graficar superficie de cuadrángulos"
 
-#: src/exec_gr.cpp:1211
+#: src/exec_gr.cpp:1285
 msgid "Draw surface of triangles"
 msgstr "Graficar superficie de triángulos"
 
-#: src/exec_gr.cpp:1135
+#: src/exec_gr.cpp:1207
 msgid "Draw surfaces of contour lines rotation"
 msgstr "Superficie de rotación de curvas de nivel"
 
-#: src/exec_gr.cpp:1201
+#: src/exec_gr.cpp:1275
 msgid "Draw table with data values"
 msgstr "Graficar tabla de valores"
 
-#: src/exec_gr.cpp:1203
+#: src/exec_gr.cpp:1277
 msgid "Draw tension plot for 1D data"
 msgstr "Gráfica de tensión para datos 1D"
 
-#: src/exec_prm.cpp:657
+#: src/exec_prm.cpp:661
 msgid "Draw text at some position or along curve"
 msgstr "Texto en posición especifica o curva"
 
-#: src/exec_prm.cpp:656
+#: src/exec_prm.cpp:660
 msgid "Draw user-defined symbol at given position and direction"
 msgstr "Símbolo personalizado en posición y dirección dadas"
 
-#: src/exec_gr.cpp:1185
+#: src/exec_gr.cpp:1259
 msgid "Draw usual plot for 1D data"
 msgstr "Gráfica estándar para datos 1D"
 
-#: src/exec_gr.cpp:1213
+#: src/exec_gr.cpp:1287
 msgid "Draw vector field"
 msgstr "Campo vectorial"
 
-#: src/exec_gr.cpp:1214
+#: src/exec_gr.cpp:1288
 msgid "Draw vector field at slices of 3D data"
 msgstr "Campo vectorial de cortes de datos 3D"
 
-#: src/exec_gr.cpp:1208
+#: src/exec_gr.cpp:1282
 msgid "Draw vectors along a curve"
 msgstr "Vectores a lo largo de curva"
 
-#: src/exec_gr.cpp:1170
+#: src/exec_gr.cpp:1243
 msgid "Draw waterfalls"
 msgstr "Gráfica de cascadas"
 
@@ -1956,7 +1967,7 @@ msgstr "E - verde pasto oscuro"
 msgid "Edges"
 msgstr "Bordes"
 
-#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:307
+#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:298
 msgid "Edit"
 msgstr "Editar"
 
@@ -1968,13 +1979,13 @@ msgstr "Editor arreglo de datos seleccionado"
 msgid "Elliptic"
 msgstr "Elíptico"
 
-#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:489
+#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:481
 msgid "Enable keywords completion"
 msgstr "Completar palabras clave"
 
 #. pure = new QCheckBox(_("Disable face drawing (faster) for mouse rotation/shift/zoom."), this);
 #. pure->setChecked(mglAutoPure);      v->addWidget(pure);     pure->setEnabled(false);
-#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:491
+#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:483
 msgid "Enable mouse wheel for zooming"
 msgstr "Rueda del mouse para el zoom"
 
@@ -2075,11 +2086,11 @@ msgstr "Ingresar valor para argumento %s"
 msgid "Envelop"
 msgstr "Envoltura"
 
-#: src/exec_dat.cpp:1690
+#: src/exec_dat.cpp:1752
 msgid "Erode data larger val"
 msgstr "Erosionar datos"
 
-#: mgllab/editor.cpp:348
+#: mgllab/editor.cpp:352
 #, c-format
 msgid ""
 "Error reading from file '%s':\n"
@@ -2094,7 +2105,7 @@ msgstr ""
 msgid "Error to call external viewer\n"
 msgstr "Error al ejecutar visor externo\n"
 
-#: mgllab/editor.cpp:359
+#: mgllab/editor.cpp:363
 #, c-format
 msgid ""
 "Error writing to file '%s':\n"
@@ -2103,7 +2114,7 @@ msgstr ""
 "Error al escribir al archivo \"%s\"s:\n"
 "%s."
 
-#: src/exec_dat.cpp:1691
+#: src/exec_dat.cpp:1753
 msgid ""
 "Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat"
 msgstr ""
@@ -2111,11 +2122,11 @@ msgstr ""
 "k=kdat"
 
 #. {"defpal",_("Define parameter as palette color"),"defpal $N val", 0, 6},
-#: src/parser.cpp:1488
+#: src/parser.cpp:1497
 msgid "Execute if condition is false"
 msgstr "Ejecutar si condición es falsa"
 
-#: mgllab/mgllab.cpp:487
+#: mgllab/mgllab.cpp:479
 msgid "Execute script after loading"
 msgstr "Ejecutar script al cargarlo"
 
@@ -2123,7 +2134,7 @@ msgstr "Ejecutar script al cargarlo"
 msgid "Execute script and redraw graphics (F5)."
 msgstr "Ejecutar script y volver a graficar (F5)."
 
-#: src/parser.cpp:1481
+#: src/parser.cpp:1490
 msgid "Execute script in external file"
 msgstr "Ejecutar script de archivo externo"
 
@@ -2131,7 +2142,7 @@ msgstr "Ejecutar script de archivo externo"
 msgid "Existing data arrays"
 msgstr "Arreglos de datos existentes"
 
-#: mgllab/mgllab.cpp:305
+#: mgllab/mgllab.cpp:296
 msgid "Exit"
 msgstr "Salir"
 
@@ -2147,7 +2158,7 @@ msgstr "Integrales exp"
 msgid "Export Data?"
 msgstr "¿Exportar datos?"
 
-#: widgets/fltk.cpp:815
+#: widgets/fltk.cpp:821
 msgid "Export as ..."
 msgstr "Exportar como ..."
 
@@ -2159,7 +2170,7 @@ msgstr "Exportar como 2D ..."
 msgid "Export as 3D ..."
 msgstr "Exportar como 3D ..."
 
-#: src/exec_dat.cpp:1692 mgllab/table.cpp:846
+#: src/exec_dat.cpp:1754 mgllab/table.cpp:846
 msgid "Export data to PNG file"
 msgstr "Exportar a PNG"
 
@@ -2172,7 +2183,7 @@ msgstr "Exportar a GIF"
 msgid "Export to PNG"
 msgstr "Exportar a PNG"
 
-#: src/exec_dat.cpp:1693
+#: src/exec_dat.cpp:1755
 msgid "Extend data array"
 msgstr "Extender arreglo de datos"
 
@@ -2180,11 +2191,11 @@ msgstr "Extender arreglo de datos"
 msgid "Extract data"
 msgstr "Extraer datos"
 
-#: src/exec_dat.cpp:1752
+#: src/exec_dat.cpp:1818
 msgid "Extract sub-array"
 msgstr "Extraer subarreglo"
 
-#: src/exec_dat.cpp:1744
+#: src/exec_dat.cpp:1810
 msgid "Extract sub-array between values"
 msgstr "Extraer subarreglo entre valores"
 
@@ -2194,7 +2205,7 @@ msgstr "Factorizar"
 
 #. file menu
 #: widgets/qt.cpp:1083 udav/udav_wnd.cpp:281 udav/dat_pnl.cpp:681
-#: mgllab/mgllab.cpp:292 mgllab/table.cpp:750
+#: mgllab/mgllab.cpp:283 mgllab/table.cpp:750
 msgid "File"
 msgstr "Archivo"
 
@@ -2202,7 +2213,7 @@ msgstr "Archivo"
 msgid "File %1 saved"
 msgstr "Archivo %1 guardado"
 
-#: mgllab/mgllab.cpp:242
+#: mgllab/mgllab.cpp:233
 msgid "File exist. Overwrite it?"
 msgstr "¿Sobreescribir archivo existente?"
 
@@ -2210,7 +2221,7 @@ msgstr "¿Sobreescribir archivo existente?"
 msgid "File name"
 msgstr "Nombre de archivo"
 
-#: mgllab/mgllab.cpp:318
+#: mgllab/mgllab.cpp:309
 msgid "File path"
 msgstr "Ubicación de archivo"
 
@@ -2218,7 +2229,7 @@ msgstr "Ubicación de archivo"
 msgid "File to export"
 msgstr "Archivo a exportar"
 
-#: mgllab/editor.cpp:267 mgllab/mgllab.cpp:412
+#: mgllab/editor.cpp:271 mgllab/mgllab.cpp:403
 msgid "File/Recent files"
 msgstr "Archivo/Archivos recientes"
 
@@ -2230,19 +2241,19 @@ msgstr "Llenar"
 msgid "Fill data by formula"
 msgstr "Llenar datos por fórmula"
 
-#: src/exec_dat.cpp:1700
+#: src/exec_dat.cpp:1763
 msgid "Fill data by global spline of Vdat"
 msgstr "Llenar datos con spline global de Vdat"
 
-#: src/exec_dat.cpp:1736
+#: src/exec_dat.cpp:1802
 msgid "Fill data by interpolation of Vdat"
 msgstr "Llenar datos por interpolación de Vdat"
 
-#: src/exec_dat.cpp:1679
+#: src/exec_dat.cpp:1741
 msgid "Fill data by triangulated values"
 msgstr "Llenar datos con valores triángulados"
 
-#: src/exec_dat.cpp:1695
+#: src/exec_dat.cpp:1757
 msgid "Fill data linearly in range [v1, v2]"
 msgstr "Llenar datos linealmente en rango [v1, v2]"
 
@@ -2250,19 +2261,57 @@ msgstr "Llenar datos linealmente en rango [v1, v2]"
 msgid "Fill in range"
 msgstr "Llenar en rango"
 
-#: src/exec_dat.cpp:1696
+#: src/exec_dat.cpp:1758
 msgid "Fill x-,k-samples for transforms"
 msgstr "Llenar muestreo x o k para transformada"
 
-#: udav/find_dlg.cpp:48 mgllab/editor.cpp:560
+#: src/random.cpp:350
+msgid "Fills by fractional brownian motion"
+msgstr ""
+
+#: src/random.cpp:356
+msgid "Fills by random integers uniformly chosen in [lo, hi)"
+msgstr ""
+
+#: src/random.cpp:348
+msgid ""
+"Fills by random numbers according to Bernoulli distribution with probability "
+"p"
+msgstr ""
+
+#: src/random.cpp:353
+msgid "Fills by random numbers according to Gaussian distribution"
+msgstr ""
+
+#: src/random.cpp:349
+msgid ""
+"Fills by random numbers according to binomial distribution in n coin flips "
+"with probability p"
+msgstr ""
+
+#: src/random.cpp:351
+msgid "Fills by random numbers according to discrete distribution"
+msgstr ""
+
+#: src/random.cpp:352
+msgid ""
+"Fills by random numbers according to exponential distribution with "
+"probability p"
+msgstr ""
+
+#: src/random.cpp:355
+msgid "Fills by random numbers uniformly chosen in [lo,hi)"
+msgstr ""
+
+#: udav/find_dlg.cpp:48 mgllab/editor.cpp:564
 msgid "Find"
 msgstr "Buscar"
 
-#: src/exec_dat.cpp:1675
+#: src/exec_dat.cpp:1737
 msgid "Find correlation between data arrays"
 msgstr "Correlación entre arreglos de datos"
 
-#: src/exec_dat.cpp:1689
+#: src/exec_dat.cpp:1751
 msgid "Find envelop for the data"
 msgstr "Envoltura para datos"
 
@@ -2270,55 +2319,65 @@ msgstr "Envoltura para datos"
 msgid "Find envelope along direction(s)"
 msgstr "Envoltura a lo largo de dirección(es)"
 
+#: src/exec_dat.cpp:1759
+#, fuzzy
+msgid "Find first indexes of values larger val over direction"
+msgstr "Valor minimal en una dirección"
+
 #: udav/dat_pnl.cpp:804
 msgid "Find histogram of data."
 msgstr "Histograma de datos."
 
-#: src/exec_dat.cpp:1711
+#: src/exec_dat.cpp:1773
+#, fuzzy
+msgid "Find last indexes of values larger val over direction"
+msgstr "Valor maximal en una dirección"
+
+#: src/exec_dat.cpp:1776
 msgid "Find maximal value over direction"
 msgstr "Valor maximal en una dirección"
 
-#: src/exec_dat.cpp:1712
+#: src/exec_dat.cpp:1777
 msgid "Find minimal value over direction"
 msgstr "Valor minimal en una dirección"
 
-#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:316
+#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:307
 msgid "Find next"
 msgstr "Buscar siguiente"
 
-#: mgllab/editor.cpp:516
+#: mgllab/editor.cpp:520
 msgid "Find or replace text"
 msgstr "Buscar o reemplazar texto"
 
-#: src/exec_dat.cpp:1748
+#: src/exec_dat.cpp:1814
 msgid "Find root Dat[i,j,k]=val (inverse evaluate)"
 msgstr "Encontrar raíz Dat[i,j,k]=val (evaluación inversa)"
 
-#: src/exec_dat.cpp:1740
+#: src/exec_dat.cpp:1806
 msgid "Find roots using data as initial values"
 msgstr "Encontrar raíces usando datos como valores iniciales"
 
-#: src/exec_dat.cpp:1754
+#: src/exec_dat.cpp:1820
 msgid "Find summation over direction"
 msgstr "Suma en una dirección"
 
-#: src/exec_dat.cpp:1760
+#: src/exec_dat.cpp:1826
 msgid "Find triangles of randomly placed points"
 msgstr "Triangulación de puntos arbitrarios"
 
-#: udav/find_dlg.cpp:36 mgllab/editor.cpp:559
+#: udav/find_dlg.cpp:36 mgllab/editor.cpp:563
 msgid "Find what:"
 msgstr "Buscar:"
 
-#: udav/text_pnl.cpp:546 mgllab/editor.cpp:558
+#: udav/text_pnl.cpp:546 mgllab/editor.cpp:562
 msgid "Find/Replace"
 msgstr "Buscar/Reemplazar"
 
-#: mgllab/mgllab.cpp:315
+#: mgllab/mgllab.cpp:306
 msgid "Find|Replace"
 msgstr "Buscar|Reemplazar"
 
-#: src/parser.cpp:1490
+#: src/parser.cpp:1499
 msgid "Finish if/else block"
 msgstr "Terminar bloque \"if/else\""
 
@@ -2330,11 +2389,11 @@ msgstr "Primera celda"
 msgid "First slice"
 msgstr "Primera sección"
 
-#: src/exec_dat.cpp:1697 src/exec_dat.cpp:1698
+#: src/exec_dat.cpp:1760 src/exec_dat.cpp:1761
 msgid "Fit data to formula"
 msgstr "Ajustar datos a fórmula"
 
-#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:322
+#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:313
 msgid "Fitted formula"
 msgstr "Fórmula ajustada"
 
@@ -2350,11 +2409,11 @@ msgstr "Niebla"
 msgid "Fog dist."
 msgstr "Dist. niebla"
 
-#: mgllab/mgllab.cpp:548
+#: mgllab/mgllab.cpp:543
 msgid "Folder for help files"
 msgstr "Fólder de archivos de ayuda"
 
-#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:319
+#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:310
 msgid "Folder path"
 msgstr "Ubicación de directorio"
 
@@ -2362,7 +2421,7 @@ msgstr "Ubicación de directorio"
 msgid "Font"
 msgstr "Fuente"
 
-#: mgllab/mgllab.cpp:539
+#: mgllab/mgllab.cpp:534
 msgid "Font file name"
 msgstr "Nombre de archivo de fuente"
 
@@ -2370,11 +2429,11 @@ msgstr "Nombre de archivo de fuente"
 msgid "Font files (*.vfm)"
 msgstr "Archivos de fuente (*.vfm)"
 
-#: mgllab/mgllab.cpp:478
+#: mgllab/mgllab.cpp:470
 msgid "Font kind"
 msgstr "Tipo de fuente"
 
-#: mgllab/mgllab.cpp:480
+#: mgllab/mgllab.cpp:472
 msgid "Font size"
 msgstr "Tamaño de fuente"
 
@@ -2386,7 +2445,7 @@ msgstr "Estilo de fuente"
 msgid "FontSize"
 msgstr "FontSize"
 
-#: src/parser.cpp:1491
+#: src/parser.cpp:1500
 msgid "For loop"
 msgstr "Bucle \"for\""
 
@@ -2403,7 +2462,7 @@ msgstr "Cuadro %1 de %2"
 msgid "From"
 msgstr "Desde"
 
-#: mgllab/mgllab.cpp:607
+#: mgllab/mgllab.cpp:602
 msgid "Function"
 msgstr "Función"
 
@@ -2421,45 +2480,45 @@ msgstr "Formato GIF deshabilitado. Habilítelo y recompile MathGL."
 msgid "General setup"
 msgstr "Config. general"
 
-#: src/exec_dat.cpp:1708
+#: src/exec_dat.cpp:1771
 msgid "Get Jacobian"
 msgstr "Obtener Jacobiano"
 
-#: src/exec_dat.cpp:1673
+#: src/exec_dat.cpp:1735
 msgid "Get contour lines for dat[i,j]=val, separated by NAN"
 msgstr ""
 
-#: src/exec_dat.cpp:1670
+#: src/exec_dat.cpp:1732
 msgid "Get data column filled by formula on column ids"
 msgstr "Llenar columna de datos por fórmula en ids de columnas"
 
-#: src/exec_dat.cpp:1743
+#: src/exec_dat.cpp:1809
 msgid "Get formated data from file"
 msgstr "Obtener datos con formato de archivo"
 
-#: src/exec_dat.cpp:1672
+#: src/exec_dat.cpp:1734
 msgid ""
 "Get indexes or resort data for found connected surfaces dependent on j,k"
 msgstr ""
 
-#: src/exec_dat.cpp:1715
+#: src/exec_dat.cpp:1780
 msgid "Get momentum along direction"
 msgstr "Obtener el momento en una dirección"
 
-#: src/exec_dat.cpp:1694
+#: src/exec_dat.cpp:1756
 #, fuzzy
 msgid "Get positions of local maximums and minimums"
 msgstr "Especificar posición de gráfica en matriz"
 
-#: src/exec_dat.cpp:1725
+#: src/exec_dat.cpp:1790
 msgid "Get pulse properties"
 msgstr "Obtener propiedades de pulso"
 
-#: src/exec_dat.cpp:1756
+#: src/exec_dat.cpp:1822
 msgid "Get trace of array"
 msgstr "Obtener la traza de un arreglo"
 
-#: src/base_cf.cpp:85
+#: src/base_cf.cpp:86
 #, c-format
 msgid "Global message - %s\n"
 msgstr "Mensaje global - %s\n"
@@ -2489,7 +2548,7 @@ msgid "Go to the specified slice for 3D data."
 msgstr "Ir a la sección especificada de datos 3D."
 
 #: widgets/qt.cpp:1112 widgets/qt.cpp:1114 udav/plot_pnl.cpp:66
-#: mgllab/mgllab.cpp:334
+#: mgllab/mgllab.cpp:325
 msgid "Graphics"
 msgstr "Gráfica"
 
@@ -2497,157 +2556,148 @@ msgstr "Gráfica"
 msgid "Graphics setup"
 msgstr "Config. gráfica"
 
-#: widgets/fltk.cpp:964
+#: widgets/fltk.cpp:970
 msgid "Graphics/Adjust size"
 msgstr "Gráfica/Ajustar tamaño"
 
-#. /< Parameter for handling animation
-#. /< Callback function for next frame
-#. /< Callback function for prev frame
-#. /< Callback function for delay
-#. /< Callback function for reloading
-#. / Toggle transparency (alpha) button
-#: widgets/fltk.cpp:958 include/mgl2/Fl_MathGL.h:164
+#. -----------------------------------------------------------------------------
+#: widgets/fltk.cpp:964 widgets/fltk.cpp:1094
 msgid "Graphics/Alpha"
 msgstr "Gráfica/Alfa"
 
-#: widgets/fltk.cpp:993
+#: widgets/fltk.cpp:999
 msgid "Graphics/Animation/Next frame"
 msgstr "Gráfica/Animación/Sgte. cuadro"
 
-#: widgets/fltk.cpp:994
+#: widgets/fltk.cpp:1000
 msgid "Graphics/Animation/Prev frame"
 msgstr "Gráfica/Animación/Ant. cuadro"
 
-#: mgllab/mgllab.cpp:386
+#: mgllab/mgllab.cpp:377
 msgid "Graphics/Animation/Setup animation"
 msgstr "Gráfica/Animación/Animación"
 
-#. / Toggle slideshow button
-#: widgets/fltk.cpp:992 include/mgl2/Fl_MathGL.h:168
+#: widgets/fltk.cpp:998 widgets/fltk.cpp:1096
 msgid "Graphics/Animation/Slideshow"
 msgstr "Gráfica/Animación/Presentacion"
 
-#: widgets/fltk.cpp:968
+#: widgets/fltk.cpp:974
 msgid "Graphics/Copy click coor."
 msgstr "Gráfica/Copiar coord. al clicar"
 
-#: widgets/fltk.cpp:967
+#: widgets/fltk.cpp:973
 msgid "Graphics/Copy graphics"
 msgstr "Gráfica/Copiar gráfica"
 
-#: widgets/fltk.cpp:981
+#: widgets/fltk.cpp:987
 msgid "Graphics/Export/as BMP"
 msgstr "Gráfica/Exportar/como BMP"
 
-#: widgets/fltk.cpp:979
+#: widgets/fltk.cpp:985
 msgid "Graphics/Export/as GIF"
 msgstr "Gráfica/Exportar/como GIF"
 
-#: widgets/fltk.cpp:976
+#: widgets/fltk.cpp:982
 msgid "Graphics/Export/as JPEG"
 msgstr "Gráfica/Exportar/como JPEG"
 
-#: widgets/fltk.cpp:987
+#: widgets/fltk.cpp:993
 msgid "Graphics/Export/as OBJ"
 msgstr "Gráfica/Exportar/como OBJ"
 
-#: widgets/fltk.cpp:988
+#: widgets/fltk.cpp:994
 msgid "Graphics/Export/as OFF"
 msgstr "Gráfica/Exportar/como OFF"
 
-#: widgets/fltk.cpp:972
+#: widgets/fltk.cpp:978
 msgid "Graphics/Export/as PNG"
 msgstr "Gráfica/Exportar/como PNG"
 
-#: widgets/fltk.cpp:986
+#: widgets/fltk.cpp:992
 msgid "Graphics/Export/as PRC"
 msgstr "Gráfica/Exportar/como PRC"
 
-#: widgets/fltk.cpp:989
+#: widgets/fltk.cpp:995
 msgid "Graphics/Export/as STL"
 msgstr "Gráfica/Exportar/como STL"
 
-#: widgets/fltk.cpp:982
+#: widgets/fltk.cpp:988
 msgid "Graphics/Export/as SVG"
 msgstr "Gráfica/Exportar/como SVG"
 
-#: widgets/fltk.cpp:985
+#: widgets/fltk.cpp:991
 msgid "Graphics/Export/as TeX"
 msgstr "Gráfica/Exportar/como TeX"
 
-#: widgets/fltk.cpp:990
+#: widgets/fltk.cpp:996
 msgid "Graphics/Export/as XYZ"
 msgstr "Gráfica/Exportar/como XYZ"
 
-#: widgets/fltk.cpp:984
+#: widgets/fltk.cpp:990
 msgid "Graphics/Export/as bitmap EPS"
 msgstr "Gráfica/Exportar/como mapa de bits EPS"
 
-#: widgets/fltk.cpp:973
+#: widgets/fltk.cpp:979
 msgid "Graphics/Export/as solid PNG"
 msgstr "Gráfica/Exportar/como PNG sólido"
 
-#: widgets/fltk.cpp:983
+#: widgets/fltk.cpp:989
 msgid "Graphics/Export/as vector EPS"
 msgstr "Gráfica/Exportar/como EPS vectorial"
 
-#. / Toggle grid drawing button
-#: widgets/fltk.cpp:960 include/mgl2/Fl_MathGL.h:170
+#: widgets/fltk.cpp:966 widgets/fltk.cpp:1097
 msgid "Graphics/Grid"
 msgstr "Gráfica/Grilla"
 
-#. / Toggle lighting button
-#: widgets/fltk.cpp:959 include/mgl2/Fl_MathGL.h:166
+#: widgets/fltk.cpp:965 widgets/fltk.cpp:1095
 msgid "Graphics/Light"
 msgstr "Gráfica/Luz"
 
-#. / Toggle pause calculation button
-#: widgets/fltk.cpp:969 include/mgl2/Fl_MathGL.h:182 mgllab/mgllab.cpp:387
+#: widgets/fltk.cpp:975 widgets/fltk.cpp:1098 mgllab/mgllab.cpp:378
 msgid "Graphics/Pause calc"
 msgstr "Gráfica/Pausar calc."
 
-#: mgllab/mgllab.cpp:385
+#: mgllab/mgllab.cpp:376
 msgid "Graphics/Primitive"
 msgstr "Gráfica/Primitiva"
 
-#: widgets/fltk.cpp:963
+#: widgets/fltk.cpp:969
 msgid "Graphics/Redraw"
 msgstr "Gráfica/Redibujar"
 
-#: widgets/fltk.cpp:965
+#: widgets/fltk.cpp:971
 msgid "Graphics/Reload data"
 msgstr "Gráfica/Volver a cargar datos"
 
-#: widgets/fltk.cpp:962
+#: widgets/fltk.cpp:968
 msgid "Graphics/Restore"
 msgstr "Gráfica/Reestablecer"
 
-#: widgets/fltk.cpp:966
+#: widgets/fltk.cpp:972
 msgid "Graphics/Stop"
 msgstr "Gráfica/Detener"
 
-#: widgets/fltk.cpp:1000
+#: widgets/fltk.cpp:1006
 msgid "Graphics/Transform/Move down"
 msgstr "Gráfica/Transformar/Mover abajo"
 
-#: widgets/fltk.cpp:996
+#: widgets/fltk.cpp:1002
 msgid "Graphics/Transform/Move left"
 msgstr "Gráfica/Transformar/Mover izq."
 
-#: widgets/fltk.cpp:1001
+#: widgets/fltk.cpp:1007
 msgid "Graphics/Transform/Move right"
 msgstr "Gráfica/Transformar/Mover der."
 
-#: widgets/fltk.cpp:997
+#: widgets/fltk.cpp:1003
 msgid "Graphics/Transform/Move up"
 msgstr "Gráfica/Transformar/Mover arriba"
 
-#: widgets/fltk.cpp:998
+#: widgets/fltk.cpp:1004
 msgid "Graphics/Transform/Zoom in"
 msgstr "Gráfica/Transformar/Acercar"
 
-#: widgets/fltk.cpp:999
+#: widgets/fltk.cpp:1005
 msgid "Graphics/Transform/Zoom out"
 msgstr "Gráfica/Transformar/Alejar"
 
@@ -2664,12 +2714,13 @@ msgstr "Grupos de comandos de MGL"
 msgid "H - darkgray"
 msgstr "H - gris oscuro"
 
-#: src/data_io.cpp:1092
+#: src/data_io.cpp:1204
 msgid "HDF4 support was disabled. Please, enable it and rebuild MathGL."
 msgstr "Formato HDF4 deshabilitado. Habilítelo y recompile MathGL."
 
-#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1191
-#: src/data_io.cpp:1193 src/data_io.cpp:1195 src/data_io.cpp:1197
+#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1359
+#: src/data_io.cpp:1361 src/data_io.cpp:1363 src/data_io.cpp:1365
+#: src/data_io.cpp:1367 src/data_io.cpp:1369 src/data_io.cpp:1371
 msgid "HDF5 support was disabled. Please, enable it and rebuild MathGL."
 msgstr "Formato HDF5 deshabilitado. Habilítelo y recompile MathGL."
 
@@ -2681,7 +2732,7 @@ msgstr "Hankel"
 msgid "Hankel transform along direction(s)"
 msgstr "Transformada de Hankel en alguna(s) dirección(es)"
 
-#: src/exec_dat.cpp:1701
+#: src/exec_dat.cpp:1764
 msgid "Hankel transform at some direction"
 msgstr "Transformada de Hankel en alguna dirección"
 
@@ -2690,8 +2741,8 @@ msgid "Height of selected cells"
 msgstr "Altura de celdas seleccionadas"
 
 #: widgets/qt.cpp:1293 udav/help_pnl.cpp:57 udav/udav_wnd.cpp:231
-#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:344 mgllab/mgllab.cpp:345
-#: mgllab/mgllab.cpp:373
+#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:335 mgllab/mgllab.cpp:336
+#: mgllab/mgllab.cpp:364
 msgid "Help"
 msgstr "Ayuda"
 
@@ -2703,7 +2754,7 @@ msgstr ""
 "Aquí puede especificar opciones de comando.\n"
 "Úselas para configuración adicional del gráfico."
 
-#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:313
+#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:304
 msgid "Hidden plots"
 msgstr "Gráficos ocultos"
 
@@ -2715,11 +2766,11 @@ msgstr "Ocultar seleccionados"
 msgid "Hide selected plots."
 msgstr "Ocultar gráficos seleccionados."
 
-#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:490
+#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:482
 msgid "Highlight current object(s)"
 msgstr "Resaltar objeto(s) actuales"
 
-#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:346
+#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:337
 msgid "Hints"
 msgstr "Consejos"
 
@@ -2739,7 +2790,7 @@ msgstr "Hiperbólicas"
 msgid "ID"
 msgstr "ID"
 
-#: mgllab/mgllab.cpp:348
+#: mgllab/mgllab.cpp:339
 msgid "Icon list"
 msgstr "Lista de íconos"
 
@@ -2751,11 +2802,11 @@ msgstr "Id de sección en la tercera dimensión (z)"
 msgid "Image size"
 msgstr "Tamaño de imagen"
 
-#: src/exec_dat.cpp:1724
+#: src/exec_dat.cpp:1789
 msgid "Immediately display the progress of calculation"
 msgstr "Mostrar inmediatamente el progreso de cálculo"
 
-#: src/exec_dat.cpp:1723
+#: src/exec_dat.cpp:1788
 msgid "Immediately print the message"
 msgstr "Mostrar inmediatamente el mensaje"
 
@@ -2763,7 +2814,7 @@ msgstr "Mostrar inmediatamente el mensaje"
 msgid "Import Data?"
 msgstr "¿Importar datos?"
 
-#: src/exec_dat.cpp:1704 mgllab/table.cpp:842
+#: src/exec_dat.cpp:1767 mgllab/table.cpp:842
 msgid "Import data from PNG file"
 msgstr "Importar datos de archivo PNG"
 
@@ -2775,7 +2826,7 @@ msgstr "Importar de PNG"
 msgid "In range"
 msgstr "En rango"
 
-#: src/exec_dat.cpp:1699
+#: src/exec_dat.cpp:1762
 msgid "In-place Fourier transform"
 msgstr "Transformada de Gabor"
 
@@ -2803,20 +2854,20 @@ msgstr "Aumentar tamaño de fuente"
 msgid "Info"
 msgstr "Info"
 
-#: udav/info_dlg.cpp:55 mgllab/help.cpp:335
+#: udav/info_dlg.cpp:57 mgllab/help.cpp:335
 msgid "Information"
 msgstr "Información"
 
-#: mgllab/mgllab.cpp:321
+#: mgllab/mgllab.cpp:312
 msgid "Inplot"
 msgstr "Gráfica interna"
 
 #. insert menu
-#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:317
+#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:308
 msgid "Insert"
 msgstr "Insertar"
 
-#: mgllab/editor.cpp:519
+#: mgllab/editor.cpp:523
 msgid "Insert MGL command"
 msgstr "Insertar comando de MGL"
 
@@ -2824,19 +2875,11 @@ msgstr "Insertar comando de MGL"
 msgid "Insert as 'list'"
 msgstr "Insertar como \"list\""
 
-#: mgllab/editor.cpp:487
-msgid "Insert file content?"
-msgstr "¿Insertar contenido de archivo?"
-
-#: mgllab/mgllab.cpp:158
-msgid "Insert file name?"
-msgstr "¿Insertar nombre de archivo?"
-
-#: mgllab/editor.cpp:521
+#: mgllab/editor.cpp:525
 msgid "Insert filename"
 msgstr "Insertar nombre de archivo"
 
-#: mgllab/editor.cpp:523
+#: mgllab/editor.cpp:527
 msgid "Insert inplot command"
 msgstr "Insertar comando de gráfica interna"
 
@@ -2844,7 +2887,7 @@ msgstr "Insertar comando de gráfica interna"
 msgid "Insert last fitted formula with found coefficients."
 msgstr "Insertar última fórmula ajustada con coeficientes encontrados."
 
-#: src/exec_dat.cpp:1706
+#: src/exec_dat.cpp:1769
 msgid "Insert slice of data"
 msgstr "Insertar sección de datos"
 
@@ -2856,7 +2899,7 @@ msgstr "Insertar al script como comando 'list'"
 msgid "Integrate"
 msgstr "Integrar"
 
-#: src/exec_dat.cpp:1707 udav/dat_pnl.cpp:615
+#: src/exec_dat.cpp:1770 udav/dat_pnl.cpp:615
 msgid "Integrate data along direction(s)"
 msgstr "Integrar datos en una(s) dirección(es)"
 
@@ -2880,7 +2923,7 @@ msgstr "Formato JPEG deshabilitado. Habilítelo y recompile MathGL."
 msgid "Jacobi"
 msgstr "Jacobi"
 
-#: src/exec_dat.cpp:1709
+#: src/exec_dat.cpp:1772
 msgid "Join data arrays"
 msgstr "Juntar arreglos de datos"
 
@@ -2892,6 +2935,10 @@ msgstr "Mantener vacío para poner al principio del script principal."
 msgid "Keep only each n-th element of the data array."
 msgstr "Mantener solo cada n-ésimo elemento del arreglo."
 
+#: src/exec_dat.cpp:1774
+msgid "Keep phase/amplitude along line"
+msgstr ""
+
 #: mgllab/mathgl.cpp:200
 msgid "Keep slides in memory (faster animation but require more memory)"
 msgstr "Mantener cuadros en memoria (animación rápida, ocupa mas memoria)"
@@ -2918,7 +2965,7 @@ msgstr ""
 " * otros argumentos son números (ej.: zval);\n"
 " * argumentos en [] son opcionales."
 
-#: udav/info_dlg.cpp:50
+#: udav/info_dlg.cpp:52
 msgid "Kind of plots: lines for 1D, density for 2D."
 msgstr "Tipo de gráficos: líneas para 1D, densidad para 2D."
 
@@ -2939,7 +2986,7 @@ msgstr "Etiqueta"
 msgid "Language for UDAV"
 msgstr "Lenguaje para UDAV"
 
-#: mgllab/mgllab.cpp:493
+#: mgllab/mgllab.cpp:486
 msgid "Language for mgllab"
 msgstr "Lenguaje para mgllab"
 
@@ -2980,7 +3027,7 @@ msgstr "Posición de luz no indicada. Ignorar."
 msgid "Light settings"
 msgstr "Config. de luz"
 
-#: src/exec_dat.cpp:1710
+#: src/exec_dat.cpp:1775
 msgid "Limit data to be inside [-v,v]"
 msgstr "Limitar datos al rango [-v,v]"
 
@@ -3008,7 +3055,7 @@ msgstr "Lista de datos disponibles."
 msgid "Load Data?"
 msgstr "¿Cargar datos?"
 
-#: src/exec_set.cpp:821
+#: src/exec_set.cpp:829
 msgid "Load commands from external DLL"
 msgstr "Cargar comandos de librería externa"
 
@@ -3028,7 +3075,7 @@ msgstr ""
 "Cargar datos de archivo. Estos se borraran solo al\n"
 "cerrar UDAV, sin advertencia explicita (Ctrl+Shift+O)."
 
-#: src/exec_set.cpp:822
+#: src/exec_set.cpp:830
 msgid "Load fontfaces"
 msgstr "Cargar fuentes"
 
@@ -3036,7 +3083,7 @@ msgstr "Cargar fuentes"
 msgid "Load from file"
 msgstr "Cargar de archivo"
 
-#: src/exec_prm.cpp:626
+#: src/exec_prm.cpp:630
 msgid "Load image for background"
 msgstr "Cargar imagen como fondo"
 
@@ -3065,7 +3112,7 @@ msgstr "Borde inferior para determinar color o alfa"
 msgid "M - purple"
 msgstr "M - púrpura"
 
-#: src/parser.cpp:1074
+#: src/parser.cpp:1083
 msgid "MGL Parser"
 msgstr "Intérprete MGL"
 
@@ -3073,11 +3120,11 @@ msgstr "Intérprete MGL"
 msgid "MGL commands for selected group"
 msgstr "Comandos de MGL para grupo seleccionado"
 
-#: mgllab/mgllab.cpp:229
+#: mgllab/mgllab.cpp:220
 msgid "MGL files \t*.mgl"
 msgstr "Archivos MGL \t*.mgl"
 
-#: mgllab/mgllab.cpp:182
+#: mgllab/mgllab.cpp:173
 msgid ""
 "MGL files \t*.mgl\n"
 "DAT files \t*.{dat,csv}"
@@ -3145,7 +3192,7 @@ msgstr "Guiones peronalizados"
 msgid "Manual mask"
 msgstr "Máscaras personalozadas"
 
-#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:323
+#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:314
 msgid "Manual primitives"
 msgstr "Primitivas personalizadas"
 
@@ -3173,7 +3220,7 @@ msgstr "Ángulo de rotacion de máscara"
 msgid "Mask size"
 msgstr "Tamaño de máscara"
 
-#: udav/find_dlg.cpp:42 mgllab/editor.cpp:563
+#: udav/find_dlg.cpp:42 mgllab/editor.cpp:567
 msgid "Match case"
 msgstr "Match case"
 
@@ -3181,7 +3228,7 @@ msgstr "Match case"
 msgid "MathGL - about"
 msgstr "MathGL - acerca de"
 
-#: src/base.cpp:265
+#: src/base.cpp:276
 #, c-format
 msgid "MathGL message - %s\n"
 msgstr "Mensaje de MathGL - %s\n"
@@ -3222,7 +3269,7 @@ msgstr "Valor maximal de Y para o para llenado de coord."
 msgid "Maximal value of Z for cutting or for coordinate filling"
 msgstr "Valor maximal de Z para corte o para llenado de coord."
 
-#: src/data.cpp:1480
+#: src/data.cpp:1549
 #, c-format
 msgid "Maximum is %g\t at x = %ld\ty = %ld\tz = %ld\n"
 msgstr "Maximo es %g\t en x = %ld\ty = %ld\tz = %ld\n"
@@ -3231,7 +3278,7 @@ msgstr "Maximo es %g\t en x = %ld\ty = %ld\tz = %ld\n"
 msgid "Maximum of"
 msgstr "Maximo de"
 
-#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:375
+#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:366
 msgid "Memory"
 msgstr "Memoria"
 
@@ -3243,7 +3290,7 @@ msgstr "Mesh num"
 msgid "MeshNum"
 msgstr "MeshNum"
 
-#: mgllab/mgllab.cpp:342
+#: mgllab/mgllab.cpp:333
 msgid "Messages"
 msgstr "Mensajes"
 
@@ -3279,7 +3326,7 @@ msgstr "Valor minimal de Y para corte o para llenado de coord."
 msgid "Minimal value of Z for cutting or for coordinate filling"
 msgstr "Valor minimal de Z para corte o para llenado de coord."
 
-#: src/data.cpp:1483
+#: src/data.cpp:1552
 #, c-format
 msgid "Minimum is %g\t at x = %ld\ty = %ld\tz = %ld\n"
 msgstr "Minimo es %g\t en x = %ld\ty = %ld\tz = %ld\n"
@@ -3297,11 +3344,11 @@ msgstr "Reflejar"
 msgid "Mirror data along direction(s)"
 msgstr "Reflejar datos en una(s) dirección(es)"
 
-#: src/exec_dat.cpp:1713
+#: src/exec_dat.cpp:1778
 msgid "Mirror data at some direction"
 msgstr "Reflejar datos en alguna(s) dirección(es)"
 
-#: src/exec_dat.cpp:1714
+#: src/exec_dat.cpp:1779
 msgid "Modify data values by formula"
 msgstr "Modificar datos por fórmula"
 
@@ -3373,7 +3420,7 @@ msgstr "Mover arriba"
 msgid "Multiply by"
 msgstr "Multiplicar por"
 
-#: src/exec_dat.cpp:1716
+#: src/exec_dat.cpp:1781
 msgid "Multiply by data or number"
 msgstr "Multiplicar por datos o número"
 
@@ -3424,7 +3471,7 @@ msgstr "Nuevo gráfico interno"
 msgid "New order of dimensions"
 msgstr "Nuevo orden de dimensiones"
 
-#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:293
+#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:284
 msgid "New script"
 msgstr "Nuevo script"
 
@@ -3456,7 +3503,7 @@ msgstr "Siguiente sección"
 msgid "Next slide"
 msgstr "Siguiente cuadro"
 
-#: mgllab/help.cpp:135 mgllab/mgllab.cpp:242
+#: mgllab/help.cpp:135 mgllab/mgllab.cpp:233
 msgid "No"
 msgstr "No"
 
@@ -3479,7 +3526,7 @@ msgstr "No se ingreso dirección/fórmula. No proceder."
 msgid "No filename."
 msgstr "No se ingreso nombre de archivo."
 
-#: mgllab/editor.cpp:585 mgllab/editor.cpp:607 mgllab/editor.cpp:632
+#: mgllab/editor.cpp:589 mgllab/editor.cpp:611 mgllab/editor.cpp:636
 #, c-format
 msgid "No occurrences of '%s' found!"
 msgstr "¡No se encontró ningun '%s'!"
@@ -3496,7 +3543,7 @@ msgstr "No se encontró el texto"
 msgid "No text rotation"
 msgstr "No hay ángulo para texto"
 
-#: widgets/fltk.cpp:838
+#: widgets/fltk.cpp:844
 msgid "Normal view"
 msgstr "Vista normal"
 
@@ -3504,11 +3551,11 @@ msgstr "Vista normal"
 msgid "Normalize"
 msgstr "Normalizar"
 
-#: src/exec_dat.cpp:1718
+#: src/exec_dat.cpp:1783
 msgid "Normalize data"
 msgstr "Normalizar datos"
 
-#: src/exec_dat.cpp:1719
+#: src/exec_dat.cpp:1784
 msgid "Normalize data slice by slice"
 msgstr "Normalizar datos sección por sección"
 
@@ -3536,11 +3583,11 @@ msgstr "Parámetro numérico"
 msgid "Numeric value"
 msgstr "Valor numérico"
 
-#: src/exec_dat.cpp:1683
+#: src/exec_dat.cpp:1745
 msgid "Numerically differentiate data"
 msgstr "Diferenciar numéricamente datos"
 
-#: src/exec_dat.cpp:1684
+#: src/exec_dat.cpp:1746
 msgid "Numerically double differentiate data"
 msgstr "Diferenciar numéricamente dos veces datos"
 
@@ -3567,7 +3614,7 @@ msgstr "OBJ"
 #: udav/data_dlg.cpp:92 udav/subplot_dlg.cpp:221 mgllab/mathgl.cpp:198
 #: mgllab/dialogs.cpp:121 mgllab/dialogs.cpp:165 mgllab/dialogs.cpp:411
 #: mgllab/dialogs.cpp:585 mgllab/dialogs.cpp:750 mgllab/dialogs.cpp:1072
-#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:498
+#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:491
 #: mgllab/table.cpp:621
 msgid "OK"
 msgstr "OK"
@@ -3576,11 +3623,11 @@ msgstr "OK"
 msgid "Only current slice will be inserted"
 msgstr "Solo la sección actual sera insertada"
 
-#: mgllab/mgllab.cpp:181
+#: mgllab/mgllab.cpp:172
 msgid "Open File?"
 msgstr "¿Abrir archivo?"
 
-#: src/exec_dat.cpp:1721
+#: src/exec_dat.cpp:1786
 msgid "Open all data arrays from HDF file"
 msgstr "Cargar todos los arreglos del archivo HDF"
 
@@ -3600,7 +3647,7 @@ msgstr "Abrir dialogo de creacion de datos nuevos."
 msgid "Open file"
 msgstr "Abrir archivo"
 
-#: mgllab/mgllab.cpp:294
+#: mgllab/mgllab.cpp:285
 msgid "Open file ..."
 msgstr "Abrir archivo ..."
 
@@ -3608,7 +3655,7 @@ msgstr "Abrir archivo ..."
 msgid "Open printer dialog and print graphics (Ctrl+P)"
 msgstr "Abrir dialogo de impresion e imprimir gráfica (Ctrl+P)"
 
-#: mgllab/editor.cpp:507
+#: mgllab/editor.cpp:511
 msgid "Open script or data file"
 msgstr "Abrir script o archivo de datos"
 
@@ -3629,7 +3676,7 @@ msgid "Operations"
 msgstr "Operaciones"
 
 #: udav/prop_dlg.cpp:91 udav/newcmd_dlg.cpp:72 mgllab/dialogs.cpp:746
-#: mgllab/mgllab.cpp:325
+#: mgllab/mgllab.cpp:316
 msgid "Options"
 msgstr "Opciones"
 
@@ -3671,7 +3718,7 @@ msgstr "PNG"
 msgid "PNG Files \t*.png"
 msgstr "Archivos PNG \t*.png"
 
-#: src/canvas_cf.cpp:495 src/canvas_cf.cpp:497 src/data_png.cpp:118
+#: src/canvas_cf.cpp:546 src/canvas_cf.cpp:548 src/data_png.cpp:118
 #: src/export.cpp:75 src/export.cpp:109
 msgid "PNG support was disabled. Please, enable it and rebuild MathGL."
 msgstr "Formato PNG deshabilitado. Habilítelo y recompile MathGL."
@@ -3696,11 +3743,11 @@ msgstr "Pegar datos"
 msgid "Paste range of numbers from clipboard (Ctrl+Shift+P)."
 msgstr "Pegar rango de números desde memoria (Ctrl+Shift+P)."
 
-#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:311
+#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:302
 msgid "Paste text"
 msgstr "Pegar texto"
 
-#: mgllab/editor.cpp:514
+#: mgllab/editor.cpp:518
 msgid "Paste text from clipboard"
 msgstr "Pegar texto desde memoria"
 
@@ -3708,11 +3755,11 @@ msgstr "Pegar texto desde memoria"
 msgid "Paste text or data from clipboard (Ctrl+V)."
 msgstr "Pegar texto o datos desde memoria (Ctrl+V)."
 
-#: mgllab/mgllab.cpp:484
+#: mgllab/mgllab.cpp:476
 msgid "Path for MathGL font (without extension)"
 msgstr "Dirreccion de fuentes de MathGL (sin extension)"
 
-#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:481
+#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:473
 msgid "Path for help files"
 msgstr "Direccion de archivos de ayuda"
 
@@ -3725,15 +3772,15 @@ msgid "Pause calculation"
 msgstr "Paudar calculos"
 
 #. Wnd->connect(a, SIGNAL(triggered()), QMGL, SLOT(setPause()));
-#: widgets/fltk.cpp:921 widgets/qt.cpp:1287
+#: widgets/fltk.cpp:927 widgets/qt.cpp:1287
 msgid "Pause on/off external calculations"
 msgstr "Pausar on/off calculos externos"
 
-#: src/exec_dat.cpp:1738
+#: src/exec_dat.cpp:1804
 msgid "Perform Runge-Kutta step"
 msgstr "Ejecutar un paso de Runge-Kutta"
 
-#: widgets/fltk.cpp:890
+#: widgets/fltk.cpp:896
 msgid "Phi angle (rotate in x*y plane)"
 msgstr "Ángulo phi (rotar en plano xy)"
 
@@ -3745,7 +3792,7 @@ msgstr "Mover editor arriba"
 msgid "Plot ID"
 msgstr "ID del gráfico"
 
-#: src/exec_prm.cpp:643
+#: src/exec_prm.cpp:647
 msgid "Plot curve by formula"
 msgstr "Gráficar curva por fórmula"
 
@@ -3766,15 +3813,15 @@ msgstr ""
 "Graficar datos en ventana nueva de script. Puede elejir\n"
 "el tipo de gráfica, estilo, etc."
 
-#: mgllab/mgllab.cpp:340
+#: mgllab/mgllab.cpp:331
 msgid "Plot setup"
 msgstr "Gráfica"
 
-#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:324
+#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:315
 msgid "Plot style"
 msgstr "Estilo de gráfica"
 
-#: src/exec_prm.cpp:644
+#: src/exec_prm.cpp:648
 msgid "Plot surface by formula"
 msgstr "Graficar superficie por fórmula"
 
@@ -3794,11 +3841,11 @@ msgstr "Seccion prev."
 msgid "Prev slide"
 msgstr "Seccion prev."
 
-#: udav/info_dlg.cpp:51
+#: udav/info_dlg.cpp:53
 msgid "Preview"
 msgstr "Vista previa"
 
-#: mgllab/mgllab.cpp:581
+#: mgllab/mgllab.cpp:576
 msgid "Previous expressions"
 msgstr "Expresiones previas"
 
@@ -3810,15 +3857,15 @@ msgstr "Primitivas"
 msgid "Primitives ..."
 msgstr "Primitivas ..."
 
-#: src/exec_set.cpp:854
+#: src/exec_set.cpp:863
 msgid "Print MathGL version or check if it is valid"
 msgstr "Imprimir version de MathGL o verificar su validez"
 
-#: src/exec_dat.cpp:1688
+#: src/exec_dat.cpp:1750
 msgid "Print content of the data"
 msgstr "Imprimir contenido de datos"
 
-#: src/exec_dat.cpp:1727
+#: src/exec_dat.cpp:1792
 msgid "Print fitted formula"
 msgstr "Imprimir fórmula ajustada"
 
@@ -3826,15 +3873,15 @@ msgstr "Imprimir fórmula ajustada"
 msgid "Print graphics"
 msgstr "Imprimir gráfica"
 
-#: src/exec_dat.cpp:1680
+#: src/exec_dat.cpp:1742
 msgid "Print list of data names in HDF file"
 msgstr "Imprimir lista de nombres de datos de archivo HDF"
 
-#: src/exec_dat.cpp:1705
+#: src/exec_dat.cpp:1768
 msgid "Print message or information about the data"
 msgstr "Imprimir mensaje o información acerca de datos"
 
-#: mgllab/mgllab.cpp:297
+#: mgllab/mgllab.cpp:288
 msgid "Print plot"
 msgstr "Imprimir gráfica"
 
@@ -3842,7 +3889,7 @@ msgstr "Imprimir gráfica"
 msgid "Print script"
 msgstr "Imprimir script"
 
-#: src/exec_prm.cpp:641
+#: src/exec_prm.cpp:645
 msgid "Print string from file"
 msgstr "Imprimir texto de archivo"
 
@@ -3862,11 +3909,11 @@ msgstr "Imprimiendo..."
 msgid "Program flow"
 msgstr "Flujo de programa"
 
-#: src/exec_dat.cpp:1669
+#: src/exec_dat.cpp:1731
 msgid "Project periodical data in [v1,v2]"
 msgstr "Proyectar datos periódicos en [v1,v2]"
 
-#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:337 mgllab/mgllab.cpp:476
+#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:328 mgllab/mgllab.cpp:468
 msgid "Properties"
 msgstr "Propiedades"
 
@@ -3878,7 +3925,7 @@ msgstr "Propiedades del arreglo seleccionado"
 msgid "Pulse prop."
 msgstr "Prop. de pulso"
 
-#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:615
+#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:610
 msgid "Put function"
 msgstr "Usar función"
 
@@ -3894,7 +3941,7 @@ msgstr "Poner en el arreglo actual"
 msgid "Put to script"
 msgstr "Poner en script"
 
-#: src/exec_dat.cpp:1726
+#: src/exec_dat.cpp:1791
 msgid "Put value (numeric or array) to given data element"
 msgstr "Poner valor (numérico o arreglo) al elemento dado"
 
@@ -3912,35 +3959,40 @@ msgstr "Salir"
 msgid "R - maroon"
 msgstr "R - carmesí"
 
-#: src/exec_set.cpp:835
+#: src/exec_set.cpp:843
 msgid "Rasterize plot and save to background"
 msgstr "Rasterizar gráfica y guardar de fondo"
 
-#: src/exec_dat.cpp:1732
+#: src/exec_dat.cpp:1797
 msgid "Read and join data from several files"
 msgstr "Leer y juntar datos de varios archivos"
 
-#: src/exec_dat.cpp:1731
+#: src/exec_dat.cpp:1798
+#, fuzzy
+msgid "Read data from binary file of specified type"
+msgstr "Leer datos de archivo con tamaño indicado en la 1ra fila"
+
+#: src/exec_dat.cpp:1796
 msgid "Read data from file"
 msgstr "Leer datos de archivo"
 
-#: src/exec_dat.cpp:1734
+#: src/exec_dat.cpp:1800
 msgid "Read data from file with sizes specified in first row"
 msgstr "Leer datos de archivo con tamaño indicado en la 1ra fila"
 
-#: src/exec_dat.cpp:1733
+#: src/exec_dat.cpp:1799
 msgid "Read data with name 'id' from HDF file"
 msgstr "Leer datos con nombre 'id' de archivo HDF"
 
-#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:382
+#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:373
 msgid "Ready"
 msgstr "Listo"
 
-#: src/exec_dat.cpp:1735
+#: src/exec_dat.cpp:1801
 msgid "Rearrange data dimensions"
 msgstr "Reordenar dimensiones de datos"
 
-#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:298
+#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:289
 msgid "Recent files"
 msgstr "Archivos recientes"
 
@@ -3965,7 +4017,7 @@ msgstr "Volver a graficar"
 msgid "Redraw picture for $0 equal to"
 msgstr "Volver a graficar para $0 igual a"
 
-#: widgets/fltk.cpp:839
+#: widgets/fltk.cpp:845
 msgid "Redraw plot"
 msgstr "Volver a graficar"
 
@@ -3973,7 +4025,7 @@ msgstr "Volver a graficar"
 msgid "Refresh"
 msgstr "Actualizar"
 
-#: widgets/fltk.cpp:873
+#: widgets/fltk.cpp:879
 msgid "Refresh the picture"
 msgstr "Actualizar la imagen"
 
@@ -3985,31 +4037,31 @@ msgstr "Posición relativa al i-ésimo color"
 msgid "Reload"
 msgstr "Recargar"
 
-#: widgets/fltk.cpp:841
+#: widgets/fltk.cpp:847
 msgid "Reload data"
 msgstr "Recargar datos"
 
-#: widgets/fltk.cpp:879
+#: widgets/fltk.cpp:885
 msgid "Reload data and refresh the picture"
 msgstr "REcargar datos y actualizar imagen"
 
-#: src/exec_dat.cpp:1668
+#: src/exec_dat.cpp:1730
 msgid "Remove duplicate rows"
 msgstr "Borrar filas duplicadas"
 
-#: src/exec_dat.cpp:1745
+#: src/exec_dat.cpp:1811
 msgid "Remove jump into the data, like phase jumps"
 msgstr "Remover saltos en datos, como saltos de fase"
 
-#: udav/find_dlg.cpp:50 mgllab/editor.cpp:562
+#: udav/find_dlg.cpp:50 mgllab/editor.cpp:566
 msgid "Replace"
 msgstr "Reemplazar"
 
-#: mgllab/editor.cpp:565
+#: mgllab/editor.cpp:569
 msgid "Replace all"
 msgstr "Reemplazar todo"
 
-#: udav/find_dlg.cpp:39 mgllab/editor.cpp:561
+#: udav/find_dlg.cpp:39 mgllab/editor.cpp:565
 msgid "Replace by:"
 msgstr "Reemplazar con:"
 
@@ -4017,7 +4069,7 @@ msgstr "Reemplazar con:"
 msgid "Replace expression by its numerical value."
 msgstr "Reemplazar expresiones con sus valore numericos."
 
-#: mgllab/editor.cpp:631
+#: mgllab/editor.cpp:635
 #, c-format
 msgid "Replaced %ld occurrences."
 msgstr "%ld ocurrencias reemplazadas."
@@ -4051,7 +4103,7 @@ msgstr "Reservar espacio para etiquetas a la der. (estilo '>')"
 msgid "Reserve space for labels at top side (style '^')"
 msgstr "Reservar espacio para etiquetas arriba (estilo '^')"
 
-#: src/exec_set.cpp:836
+#: src/exec_set.cpp:844
 msgid "Reset settings and clear picture"
 msgstr "Reestablecer config. y limpiar imagen"
 
@@ -4063,7 +4115,7 @@ msgstr "Reescalar"
 msgid "Resize (interpolate) the data to specified sizes (Ctrl+Shift+R)."
 msgstr "Reescalar (interpolar) datos a tamaño especificado (Ctrl+Shift+R)."
 
-#: src/exec_dat.cpp:1737
+#: src/exec_dat.cpp:1803
 msgid "Resize data array"
 msgstr "Reescalar datos"
 
@@ -4075,7 +4127,7 @@ msgstr "Reescalar datos con suavizado"
 msgid "Restore"
 msgstr "Reestablecer"
 
-#: widgets/fltk.cpp:870
+#: widgets/fltk.cpp:876
 msgid "Restore default graphics rotation, zoom and perspective"
 msgstr "Reestablecer rotacion , zoom y perspectiva por defecto"
 
@@ -4104,7 +4156,7 @@ msgstr "Resulto (tendra tamaño "
 msgid "Resulting string"
 msgstr "Texto resultante"
 
-#: src/parser.cpp:1497
+#: src/parser.cpp:1506
 msgid "Return from function"
 msgstr "Salida de la función"
 
@@ -4120,7 +4172,7 @@ msgstr "Esquina superior der."
 msgid "Roll"
 msgstr "Roll"
 
-#: src/exec_dat.cpp:1739
+#: src/exec_dat.cpp:1805
 msgid "Roll data along direction(s)"
 msgstr "Roll data along direction(s)"
 
@@ -4145,11 +4197,11 @@ msgstr "Rotar a la izq."
 msgid "Rotate on"
 msgstr "Rotate on"
 
-#: widgets/fltk.cpp:866
+#: widgets/fltk.cpp:872
 msgid "Rotate picture by holding left mouse button"
 msgstr "Rotar figura al presionando el botón izq. del mouse"
 
-#: src/exec_set.cpp:837
+#: src/exec_set.cpp:845
 msgid "Rotate plot"
 msgstr "Rotar gráfica"
 
@@ -4177,7 +4229,7 @@ msgstr ""
 "Correr animación (Ctrl+F5). Si no se especifican\n"
 "parámetros, se mostrará el dialogo de animación."
 
-#: widgets/fltk.cpp:912
+#: widgets/fltk.cpp:918
 msgid "Run/Stop slideshow (graphics animation)"
 msgstr "Correr/detener animación"
 
@@ -4197,7 +4249,7 @@ msgstr "SVG"
 msgid "Saturation"
 msgstr "Saturacion"
 
-#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:282
+#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:286
 msgid "Save"
 msgstr "Guardar"
 
@@ -4205,7 +4257,7 @@ msgstr "Guardar"
 msgid "Save Data?"
 msgstr "¿Guardar datos?"
 
-#: widgets/fltk.cpp:595 mgllab/mgllab.cpp:229
+#: widgets/fltk.cpp:601 mgllab/mgllab.cpp:220
 msgid "Save File As?"
 msgstr "Guardar archivo como"
 
@@ -4213,7 +4265,7 @@ msgstr "Guardar archivo como"
 msgid "Save JPEG frames"
 msgstr "Guardar cuadros JPEG"
 
-#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:296
+#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:287
 msgid "Save as ..."
 msgstr "Guardar como ..."
 
@@ -4221,7 +4273,7 @@ msgstr "Guardar como ..."
 msgid "Save data"
 msgstr "Guardar datos"
 
-#: src/exec_dat.cpp:1742
+#: src/exec_dat.cpp:1808
 msgid "Save data to HDF5 file"
 msgstr "Guardar datos a archivo HDF5"
 
@@ -4229,15 +4281,15 @@ msgstr "Guardar datos a archivo HDF5"
 msgid "Save data to a file (Ctrl+Shift+S)."
 msgstr "Guardar datos a archivo (Ctrl+Shift+S)."
 
-#: src/exec_dat.cpp:1741 mgllab/table.cpp:844
+#: src/exec_dat.cpp:1807 mgllab/table.cpp:844
 msgid "Save data to file"
 msgstr "Guardar datos a archivo"
 
-#: mgllab/mgllab.cpp:295
+#: mgllab/mgllab.cpp:286
 msgid "Save file"
 msgstr "Guardar archivo"
 
-#: mgllab/mgllab.cpp:488
+#: mgllab/mgllab.cpp:480
 msgid "Save file before redrawing"
 msgstr "Guardar archivo antes de volver a graficar"
 
@@ -4249,7 +4301,7 @@ msgstr "Guardar script"
 msgid "Save script to a file (Ctrl+S)"
 msgstr "Guardar script a archivo (Ctrl+S)"
 
-#: mgllab/editor.cpp:509
+#: mgllab/editor.cpp:513
 msgid "Save script to file"
 msgstr "Guardar script a archivo"
 
@@ -4273,11 +4325,11 @@ msgstr "Escalar y rotar"
 msgid "Script"
 msgstr "Script"
 
-#: udav/find_dlg.cpp:43 mgllab/editor.cpp:564
+#: udav/find_dlg.cpp:43 mgllab/editor.cpp:568
 msgid "Search backward"
 msgstr "Buscar atras"
 
-#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:312
+#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:303
 msgid "Select all"
 msgstr "Seleccionar todo"
 
@@ -4297,7 +4349,7 @@ msgstr "Seleccionar argumento de datos"
 msgid "Select direction"
 msgstr "Seleccionar dirección"
 
-#: mgllab/editor.cpp:654
+#: mgllab/editor.cpp:658
 msgid "Select file name"
 msgstr "Seleccionar nombre de archivo"
 
@@ -4305,7 +4357,7 @@ msgstr "Seleccionar nombre de archivo"
 msgid "Select first the proper kind of arguments"
 msgstr "Seleccione primero los tipos adecuados de argumentos"
 
-#: mgllab/editor.cpp:667
+#: mgllab/editor.cpp:671
 msgid "Select folder name"
 msgstr "Seleccionar nombre de directorio"
 
@@ -4313,7 +4365,7 @@ msgstr "Seleccionar nombre de directorio"
 msgid "Select kind of plot"
 msgstr "Seleccionar tipo de gráfica"
 
-#: src/exec_set.cpp:853
+#: src/exec_set.cpp:862
 msgid "Select variant of plot style(s)"
 msgstr "Seleccionar variante de estilo(s) de gráfica"
 
@@ -4321,55 +4373,55 @@ msgstr "Seleccionar variante de estilo(s) de gráfica"
 msgid "Set"
 msgstr "Especificar"
 
-#: src/exec_set.cpp:849
+#: src/exec_set.cpp:858
 msgid "Set additional tick and axis labels shift"
 msgstr "Desplazamiento adicional para etiquetas y escala del eje"
 
-#: src/exec_set.cpp:797
+#: src/exec_set.cpp:805
 msgid "Set ambient light brightness"
 msgstr "Especificar brillo de luz ambiental"
 
-#: src/exec_set.cpp:818
+#: src/exec_set.cpp:826
 msgid "Set arbitrary position of plot in picture"
 msgstr "Especificar posición arbitraria de gráfica en imagen"
 
-#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:338
+#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:329
 msgid "Set arguments"
 msgstr "Argumentos"
 
-#: src/exec_set.cpp:799
+#: src/exec_set.cpp:807
 msgid "Set aspect ration"
 msgstr "Especificar proporcion de apariencia"
 
-#: src/exec_set.cpp:801
+#: src/exec_set.cpp:809
 msgid "Set axis and tick style"
 msgstr "Especificar estilos de eje y escala"
 
-#: src/exec_set.cpp:827
+#: src/exec_set.cpp:835
 msgid "Set axis origin"
 msgstr "Especificar origen de ejes"
 
-#: src/exec_set.cpp:834
+#: src/exec_set.cpp:842
 msgid "Set axis ranges"
 msgstr "Especificar rango de ejes"
 
-#: src/exec_set.cpp:842
+#: src/exec_set.cpp:850
 msgid "Set bit-flags (for advanced users only)"
 msgstr "Especificar bit-flags (para usuarios avanzados)"
 
-#: src/exec_set.cpp:803
+#: src/exec_set.cpp:811
 msgid "Set bounding box for 2d export"
 msgstr "Especificar \"bounding box\" para exportar 2D"
 
-#: src/exec_set.cpp:824
+#: src/exec_set.cpp:832
 msgid "Set brush for given mask id"
 msgstr "Especificar brocha para máscara id dada"
 
-#: src/exec_set.cpp:808
+#: src/exec_set.cpp:816
 msgid "Set color range"
 msgstr "Especificar rango de colores"
 
-#: src/exec_dat.cpp:1703
+#: src/exec_dat.cpp:1766
 msgid "Set column id for data"
 msgstr "Especificar id de columna para datos"
 
@@ -4381,23 +4433,23 @@ msgstr "Activar/desactivar cortado para gráfica particular"
 msgid "Set data sizes manually"
 msgstr "Especificar tamaño de datos manualmente"
 
-#: src/exec_set.cpp:802
+#: src/exec_set.cpp:810
 msgid "Set default bars width"
 msgstr "Especificar ancho de barras"
 
-#: src/exec_set.cpp:832
+#: src/exec_set.cpp:840
 msgid "Set default filename"
 msgstr "Especificar nombre de archivo"
 
-#: src/exec_set.cpp:796
+#: src/exec_set.cpp:804
 msgid "Set default transparency"
 msgstr "Especificar transparencia"
 
-#: src/exec_set.cpp:811
+#: src/exec_set.cpp:819
 msgid "Set diffusive light brightness"
 msgstr "Especificar brillo de luz difusa"
 
-#: src/exec_set.cpp:812
+#: src/exec_set.cpp:820
 msgid "Set draw region for quality&4"
 msgstr "Especificar region de dibujo para calida&4"
 
@@ -4421,75 +4473,75 @@ msgstr "Especificar area de dibujo como celda de barra."
 msgid "Set lighting off/on for particular plot"
 msgstr "Activar/desactivar luz para gráfica particular"
 
-#: src/exec_set.cpp:825
+#: src/exec_set.cpp:833
 msgid "Set number of lines in mesh/fall/vect and so on"
 msgstr "Especificar número de líneas en grilla/cascada/etc."
 
-#: src/exec_set.cpp:819
+#: src/exec_set.cpp:827
 msgid "Set number of marks in the legend"
 msgstr "Especificar número de marcas en leyenda"
 
-#: src/exec_set.cpp:813
+#: src/exec_set.cpp:821
 msgid "Set number of visible faces"
 msgstr "Especificar número de facetas visibles"
 
-#: src/exec_set.cpp:829
+#: src/exec_set.cpp:837
 msgid "Set palette for 1D plots"
 msgstr "Especificar paleta para gráficas 1D"
 
-#: src/exec_set.cpp:831
+#: src/exec_set.cpp:839
 msgid "Set perspective"
 msgstr "Especificar perspectiva"
 
-#: src/exec_set.cpp:840
+#: src/exec_set.cpp:848
 msgid "Set picture size"
 msgstr "Especificar tamaño de imagen"
 
-#: src/exec_set.cpp:833
+#: src/exec_set.cpp:841
 msgid "Set plot quality"
 msgstr "Especificar calidad de gráfica"
 
-#: src/exec_set.cpp:846
+#: src/exec_set.cpp:854
 msgid "Set position of plot as cell of matrix"
 msgstr "Especificar posición de gráfica como celda de matriz"
 
-#: src/exec_set.cpp:826
+#: src/exec_set.cpp:834
 msgid "Set position of plot block in matrix"
 msgstr "Especificar posición de gráfica en matriz"
 
-#: src/exec_set.cpp:807
+#: src/exec_set.cpp:815
 msgid "Set position of plot inside cell of column"
 msgstr "Especificar posición de gráfica en celda de columna"
 
-#: src/exec_set.cpp:817
+#: src/exec_set.cpp:825
 msgid "Set position of plot inside cell of matrix"
 msgstr "Especificar posición de gráfica en celda de matriz"
 
-#: src/exec_set.cpp:845
+#: src/exec_set.cpp:853
 msgid "Set position of plot inside cell of rotated stick"
 msgstr "Especificar posición de gráfica en celda de barra rotada"
 
-#: src/exec_set.cpp:844
+#: src/exec_set.cpp:852
 msgid "Set position of plot inside cell of sheared stick"
 msgstr "Especificar posición de gráfica en celda de barra recortada"
 
-#: src/exec_set.cpp:857
+#: src/exec_set.cpp:866
 msgid "Set range for x-axis"
 msgstr "Especificar rango de eje x"
 
-#: src/exec_set.cpp:859
+#: src/exec_set.cpp:868
 msgid "Set range for y-axis"
 msgstr "Especificar rango de eje y"
 
-#: src/exec_set.cpp:863
+#: src/exec_set.cpp:872
 msgid "Set range for z-axis"
 msgstr "Especificar rango de eje z"
 
-#: src/exec_set.cpp:839
+#: src/exec_set.cpp:847
 msgid "Set scale text in relative subplots too"
 msgstr "Set scale text in relative subplots too"
 
-#: src/exec_set.cpp:841
+#: src/exec_set.cpp:849
 msgid "Set scaling factor for further setsize"
 msgstr "Especificar factor de escala para \"setsize\""
 
@@ -4501,51 +4553,51 @@ msgstr "Especificar argumentos de script"
 msgid "Set size for text, marks and others"
 msgstr "Especificar tamaño de texto, marcas y otros"
 
-#: src/exec_set.cpp:798
+#: src/exec_set.cpp:806
 msgid "Set size of arrows"
 msgstr "Especificar tamaño de flechas"
 
-#: src/exec_set.cpp:823
+#: src/exec_set.cpp:831
 msgid "Set size of markers"
 msgstr "Especificar tamaño de marcadores"
 
-#: src/exec_set.cpp:830
+#: src/exec_set.cpp:838
 msgid "Set size of semi-transparent area around line"
 msgstr "Especificar tamaño de area semitransparente alrededor de línea"
 
-#: src/exec_set.cpp:828
+#: src/exec_set.cpp:836
 msgid "Set tick labels drawing at origin"
 msgstr "Set tick labels drawing at origin"
 
-#: src/exec_set.cpp:848
+#: src/exec_set.cpp:857
 msgid "Set tick length"
 msgstr "Especificar longtud de marcas"
 
-#: src/exec_set.cpp:809
+#: src/exec_set.cpp:817
 msgid "Set ticks for colorbar"
 msgstr "Especificar escala para barra de colores"
 
-#: src/exec_set.cpp:858
+#: src/exec_set.cpp:867
 msgid "Set ticks for x-axis"
 msgstr "Especificar escala para el eje x"
 
-#: src/exec_set.cpp:860
+#: src/exec_set.cpp:869
 msgid "Set ticks for y-axis"
 msgstr "Especificar escala para el eje y"
 
-#: src/exec_set.cpp:864
+#: src/exec_set.cpp:873
 msgid "Set ticks for z-axis"
 msgstr "Especificar escala para el eje z"
 
-#: src/exec_set.cpp:850
+#: src/exec_set.cpp:859
 msgid "Set ticks in time format"
 msgstr "Especificar escala en formato de tiempo"
 
-#: src/exec_set.cpp:852
+#: src/exec_set.cpp:861
 msgid "Set ticks tuning"
 msgstr "Afinar escala"
 
-#: src/exec_set.cpp:838
+#: src/exec_set.cpp:846
 msgid "Set to auto rotate text or not"
 msgstr "Activar/desactivar rotacion de texto"
 
@@ -4553,7 +4605,7 @@ msgstr "Activar/desactivar rotacion de texto"
 msgid "Set to use whole area (style '#')"
 msgstr "Usar toda el area (estilo '#')"
 
-#: src/exec_set.cpp:851
+#: src/exec_set.cpp:860
 msgid "Set type transparency"
 msgstr "Especificar tipo de transparencia"
 
@@ -4585,11 +4637,11 @@ msgstr ""
 msgid "Settings"
 msgstr "Ajustes"
 
-#: mgllab/mgllab.cpp:336
+#: mgllab/mgllab.cpp:327
 msgid "Setup"
 msgstr "Configurar"
 
-#: mgllab/mgllab.cpp:339
+#: mgllab/mgllab.cpp:330
 msgid "Setup animation"
 msgstr "Animación"
 
@@ -4597,19 +4649,19 @@ msgstr "Animación"
 msgid "Setup colors for:"
 msgstr "Config. colores para:"
 
-#: src/exec_set.cpp:815
+#: src/exec_set.cpp:823
 msgid "Setup font"
 msgstr "Config. fuente"
 
-#: src/exec_set.cpp:820
+#: src/exec_set.cpp:828
 msgid "Setup light"
 msgstr "Config. luz"
 
-#: src/exec_prm.cpp:625
+#: src/exec_prm.cpp:629
 msgid "Setup or draw axis"
 msgstr "Config. o graficar eje"
 
-#: src/exec_set.cpp:810
+#: src/exec_set.cpp:818
 msgid "Setup plot points cutting"
 msgstr "Config. cortado de gráfica"
 
@@ -4633,23 +4685,23 @@ msgstr "Sew phase"
 msgid "Sharp colors"
 msgstr "Colores fuertes"
 
-#: src/exec_set.cpp:843
+#: src/exec_set.cpp:851
 msgid "Shear plot"
 msgstr "Recortar gráfica"
 
-#: widgets/fltk.cpp:905
+#: widgets/fltk.cpp:911
 msgid "Shift the picture down"
 msgstr "Mover la imagen abajo"
 
-#: widgets/fltk.cpp:897
+#: widgets/fltk.cpp:903
 msgid "Shift the picture left"
 msgstr "Mover la imagen a la izq."
 
-#: widgets/fltk.cpp:903
+#: widgets/fltk.cpp:909
 msgid "Shift the picture right"
 msgstr "Mover la imagen a la der."
 
-#: widgets/fltk.cpp:895
+#: widgets/fltk.cpp:901
 msgid "Shift the picture up"
 msgstr "Mover la imagen arriba"
 
@@ -4657,7 +4709,7 @@ msgstr "Mover la imagen arriba"
 msgid "Short description of selected command"
 msgstr "Descripción corta del comando seleccionado"
 
-#: udav/info_dlg.cpp:54
+#: udav/info_dlg.cpp:56
 msgid "Short information about the data."
 msgstr "Info. resumida de los datos."
 
@@ -4673,11 +4725,11 @@ msgstr ""
 "Mostrar calculadora que escribe y evalua formulas textuales.\n"
 "Las formulas textuales pueden contener variables también."
 
-#: mgllab/editor.cpp:526 mgllab/editor.cpp:528
+#: mgllab/editor.cpp:530
 msgid "Show calculator window"
 msgstr "Mostrar ventana de calculadora"
 
-#: widgets/fltk.cpp:916
+#: widgets/fltk.cpp:922
 msgid "Show custom dialog for plot setup"
 msgstr "Mostrar dialogo de config. de gráfica"
 
@@ -4742,11 +4794,11 @@ msgstr "Mostrar sugerencias de uso de MGL."
 msgid "Show info"
 msgstr "Mostrar info."
 
-#: mgllab/mgllab.cpp:314
+#: mgllab/mgllab.cpp:305
 msgid "Show lines"
 msgstr "Mostrar líneas"
 
-#: widgets/fltk.cpp:913
+#: widgets/fltk.cpp:919
 msgid "Show next frame in slideshow"
 msgstr "Mostrar sgte. cuadro de la animación"
 
@@ -4754,7 +4806,7 @@ msgstr "Mostrar sgte. cuadro de la animación"
 msgid "Show next slide (Ctrl+.)."
 msgstr "Mostrar sgte. cuadro (Ctrl+.)."
 
-#: widgets/fltk.cpp:908
+#: widgets/fltk.cpp:914
 msgid "Show previous frame in slideshow"
 msgstr "Mostrar cuadro previo de la animación"
 
@@ -4762,6 +4814,15 @@ msgstr "Mostrar cuadro previo de la animación"
 msgid "Show previous slide (Ctrl+,)."
 msgstr "Mostrar cuadro previo (Ctrl+,)."
 
+#: mgllab/editor.cpp:532
+#, fuzzy
+msgid "Show window for primitives"
+msgstr "Mostrar dialogo de propiedades de UDAV."
+
+#: src/random.cpp:354
+msgid "Shuffle data cells (for dir='a') or slices (for dir='xyz')"
+msgstr ""
+
 #: mgllab/table.cpp:779
 msgid "Sin FFT"
 msgstr "Sin FFT"
@@ -4770,7 +4831,7 @@ msgstr "Sin FFT"
 msgid "Sin-Fourier transform along direction(s)"
 msgstr "Transformada Sin-Fourier en dirección(es)"
 
-#: src/exec_dat.cpp:1746
+#: src/exec_dat.cpp:1812
 msgid "Sin-Fourier transform at some direction"
 msgstr "Transformada Sin-Fourier en alguna dirección"
 
@@ -4796,7 +4857,7 @@ msgstr "Tamaño de barra"
 msgid "Sizes"
 msgstr "Tamaños"
 
-#: src/parser.cpp:1482
+#: src/parser.cpp:1491
 msgid "Skip commands and iterate for-loop again"
 msgstr "Saltar comandos e iterar bucle \"for\" nuevamente"
 
@@ -4808,7 +4869,7 @@ msgstr "Animación"
 msgid "Smooth"
 msgstr "Suavizado"
 
-#: src/exec_dat.cpp:1747
+#: src/exec_dat.cpp:1813
 msgid "Smooth data"
 msgstr "Suavizar datos"
 
@@ -4817,35 +4878,35 @@ msgid "Smooth data along direction(s)"
 msgstr "Suavizar datos en dirección(es)"
 
 # Mantener ODE y GO o llevar al español?
-#: src/exec_dat.cpp:1730
+#: src/exec_dat.cpp:1795
 msgid "Solve Hamiltonian ODE (find GO ray or trajectory)"
 msgstr "Resolver ODE (encontrar rayo GO o trayectoria)"
 
-#: src/exec_dat.cpp:1720
+#: src/exec_dat.cpp:1785
 msgid "Solve ODE"
 msgstr "Resolver ODE"
 
-#: src/exec_dat.cpp:1722
+#: src/exec_dat.cpp:1787
 msgid "Solve PDE"
 msgstr "Resolver PDE"
 
-#: src/exec_dat.cpp:1728
+#: src/exec_dat.cpp:1793
 msgid "Solve PDE in accompanied coordinates for 2d case"
 msgstr "Solve PDE in accompanied coordinates for 2d case"
 
-#: src/exec_dat.cpp:1729
+#: src/exec_dat.cpp:1794
 msgid "Solve PDE in accompanied coordinates for 3d case"
 msgstr "Solve PDE in accompanied coordinates for 3d case"
 
-#: src/exec_dat.cpp:1667
+#: src/exec_dat.cpp:1729
 msgid "Solve PDE using advanced method (X-Y only)"
 msgstr "Resolver PDE usando método avanzado (solo X-Y)"
 
-#: src/exec_dat.cpp:1761
+#: src/exec_dat.cpp:1827
 msgid "Solve tridiagonal matrix"
 msgstr "Resolver matriz tridiagonal"
 
-#: src/exec_dat.cpp:1749
+#: src/exec_dat.cpp:1815
 msgid "Sort data by values in column"
 msgstr "Ordenar datos por valores en columna"
 
@@ -4885,7 +4946,7 @@ msgstr ""
 msgid "Squeeze"
 msgstr "Comprimir"
 
-#: src/exec_dat.cpp:1750
+#: src/exec_dat.cpp:1816
 msgid "Squeeze data"
 msgstr "Comprimir datos"
 
@@ -4893,15 +4954,15 @@ msgstr "Comprimir datos"
 msgid "Start"
 msgstr "Inicio"
 
-#: src/parser.cpp:1492
+#: src/parser.cpp:1501
 msgid "Start function definition and stop execution of main script"
 msgstr "Definir función y detener ejecución de script principal"
 
-#: src/parser.cpp:1495
+#: src/parser.cpp:1504
 msgid "Start next for-loop iteration"
 msgstr "Iniciar sgte. iteración de bucle for"
 
-#: src/parser.cpp:1496
+#: src/parser.cpp:1505
 msgid "Start/close commands which should executed only once"
 msgstr "Iniciar/terminar bloque de comandos ejecutables una sola vez"
 
@@ -4913,7 +4974,7 @@ msgstr "Índice de celda inicial"
 msgid "State"
 msgstr "Estado"
 
-#: src/exec_dat.cpp:1685
+#: src/exec_dat.cpp:1747
 msgid "Step for pulse diffraction"
 msgstr "Paso para pulso de difracción"
 
@@ -4921,11 +4982,11 @@ msgstr "Paso para pulso de difracción"
 msgid "Stop"
 msgstr "Deterner"
 
-#: widgets/fltk.cpp:875
+#: widgets/fltk.cpp:881
 msgid "Stop drawing"
 msgstr "Detener graficación"
 
-#: src/parser.cpp:1498
+#: src/parser.cpp:1507
 msgid "Stop execution"
 msgstr "Detener ejecución"
 
@@ -5025,7 +5086,7 @@ msgstr "Subescala"
 msgid "Subticks"
 msgstr "Subescala"
 
-#: src/exec_dat.cpp:1753
+#: src/exec_dat.cpp:1819
 msgid "Subtract data or number"
 msgstr "Restar datos o número"
 
@@ -5051,7 +5112,7 @@ msgstr "Sumar datos en una(s) dirección(es)"
 msgid "Summation of"
 msgstr "Suma de"
 
-#: src/exec_dat.cpp:1755
+#: src/exec_dat.cpp:1821
 msgid "Swap data (useful after Fourier transform)"
 msgstr "Invertir orden de datos (útil luego de la Tranformada de Fourier)"
 
@@ -5063,15 +5124,20 @@ msgstr "Invertir orden de datos en dirección(es)"
 msgid "Swap parts"
 msgstr "Intercambiar partes"
 
-#: src/exec_set.cpp:814
+#: src/exec_set.cpp:856
+#, fuzzy
+msgid "Switch on/off TeX parsing at text output"
+msgstr "Activar/desactivar transparencia en la imagen"
+
+#: src/exec_set.cpp:822
 msgid "Switch on/off fog"
 msgstr "Activar/desactivar niebla"
 
-#: src/exec_set.cpp:816
+#: src/exec_set.cpp:824
 msgid "Switch on/off gray-scale mode"
 msgstr "Activar/desactivar modo B/N"
 
-#: widgets/fltk.cpp:862
+#: widgets/fltk.cpp:868
 msgid "Switch on/off grid drawing"
 msgstr "Activar/desactivar dibujado de grilla"
 
@@ -5088,7 +5154,7 @@ msgstr "Activar/desactivar luz para las gráficas (Alt+L)."
 msgid "Switch on/off lightning for the graphics (Ctrl+L)."
 msgstr "Activar/desactivar luz para las gráficas (Alt+L)."
 
-#: widgets/fltk.cpp:859
+#: widgets/fltk.cpp:865
 msgid "Switch on/off lightning in the picture"
 msgstr "Activar/desactivar luz en la imagen"
 
@@ -5105,11 +5171,11 @@ msgid "Switch on/off mouse zoom of selected region."
 msgstr "Activar/desactivar zoom con el mouse de la región seleccionada."
 
 # Ternario or triple?
-#: src/exec_set.cpp:847
+#: src/exec_set.cpp:855
 msgid "Switch on/off to use ternary axis"
 msgstr "Activar/desactivar uso de ejes ternarios"
 
-#: src/exec_set.cpp:795
+#: src/exec_set.cpp:803
 msgid "Switch on/off transparency"
 msgstr "Activar/desactivar transparencia"
 
@@ -5121,7 +5187,7 @@ msgstr "Activar/desactivar transparencia para gráfica (Alt+T)."
 msgid "Switch on/off transparency for the graphics (Ctrl+T)."
 msgstr "Activar/desactivar transparencia para gráfica (Alt+T)."
 
-#: widgets/fltk.cpp:856
+#: widgets/fltk.cpp:862
 msgid "Switch on/off transparency in the picture"
 msgstr "Activar/desactivar transparencia en la imagen"
 
@@ -5133,7 +5199,7 @@ msgstr "Rango simétrico"
 msgid "Symmetrical?"
 msgstr "¿Simétrico?"
 
-#: src/addon.cpp:121 src/base_cf.cpp:268
+#: src/addon.cpp:121 src/base_cf.cpp:281
 #, c-format
 msgid "TEST: %s\n"
 msgstr "TEST: %s\n"
@@ -5188,7 +5254,7 @@ msgstr ""
 "Solo escriba la expresión (que puede depender de las coordenadas x,y,z, "
 "etc.) y añádala al script."
 
-#: mgllab/editor.cpp:280
+#: mgllab/editor.cpp:284
 msgid ""
 "The current file has not been saved.\n"
 "Would you like to save it now?"
@@ -5204,14 +5270,14 @@ msgstr ""
 "Los diálogos especiales (Editar|Insertar|Nuevo comando) ayudan a seleccionar "
 "un comando, llenar sus argumentos y añadirlo al script."
 
-#: src/crust.cpp:591
+#: src/crust.cpp:590
 msgid ""
 "There are duplicated or indistinguishably adjacent points for triangulation."
 msgstr ""
 "Hay puntos duplicados o indistinguiblemente juntos para la triangulación."
 
 #. mglScrStr
-#: src/base.cpp:251
+#: src/base.cpp:262
 msgid "There is changing temporary data in script"
 msgstr "Algunos datos temporales cambiaron en el script"
 
@@ -5223,7 +5289,7 @@ msgstr "Hay primitivas del usuario."
 msgid "There is no 'fmt' argument for this command"
 msgstr "No hay argumento \"fmt\" para este comando"
 
-#: udav/text_pnl.cpp:137 mgllab/editor.cpp:681
+#: udav/text_pnl.cpp:137 mgllab/editor.cpp:685
 msgid "There is no fitted formula."
 msgstr "No hay fórmula ajustada."
 
@@ -5247,30 +5313,30 @@ msgstr ""
 "existentes en las expresiones."
 
 #. mglScrCmd
-#: src/base.cpp:249
+#: src/base.cpp:260
 msgid "There is too long string(s) in script"
 msgstr "Texto muy largo en el script"
 
 #. mglScrLong
-#: src/base.cpp:250
+#: src/base.cpp:261
 msgid "There is unbalanced ' in script"
 msgstr "Desbalance de ' en el script"
 
 #. mglWarnSpc
-#: src/base.cpp:247
+#: src/base.cpp:258
 msgid "There is wrong argument(s) in script"
 msgstr "Argumento(s) incorrecto(s) en el script"
 
 #. mglScrArg
-#: src/base.cpp:248
+#: src/base.cpp:259
 msgid "There is wrong command(s) in script"
 msgstr "Comando(s) incorrecto(s) en el script"
 
-#: widgets/fltk.cpp:888
+#: widgets/fltk.cpp:894
 msgid "Theta angle (tilt z-axis)"
 msgstr "Ángulo theta (inclinación del eje z)"
 
-#: widgets/fltk.cpp:1191
+#: widgets/fltk.cpp:1206
 msgid "This is for parameter "
 msgstr "Esto es para parámetro "
 
@@ -5331,7 +5397,7 @@ msgstr "Transponer"
 msgid "Transpose data"
 msgstr "Transponer datos"
 
-#: src/exec_dat.cpp:1759
+#: src/exec_dat.cpp:1825
 msgid "Transpose data array"
 msgstr "Transponer arreglo de datos"
 
@@ -5502,7 +5568,7 @@ msgstr "UDAV - Comprimir datos"
 msgid "UDAV - about"
 msgstr "UDAV - Acerca de"
 
-#: udav/anim_dlg.cpp:105
+#: udav/anim_dlg.cpp:104
 msgid "UDAV - animation"
 msgstr "UDAV - Animación"
 
@@ -5546,7 +5612,7 @@ msgid "Underline"
 msgstr "Subrayado"
 
 #. edit menu
-#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:308
+#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:299
 msgid "Undo"
 msgstr "Deshacer"
 
@@ -5554,15 +5620,15 @@ msgstr "Deshacer"
 msgid "Undo editor change (Ctrl+Z)."
 msgstr "Deshacer cambios de editor (Ctrl+Z)."
 
-#: mgllab/mgllab.cpp:137
+#: mgllab/mgllab.cpp:140
 msgid "Untitled"
 msgstr "Sin nombre"
 
-#: mgllab/mgllab.cpp:360 mgllab/mgllab.cpp:364
+#: mgllab/mgllab.cpp:351 mgllab/mgllab.cpp:355
 msgid "Untitled - mgllab"
 msgstr "Sin nombre - mgllab"
 
-#: widgets/fltk.cpp:1108
+#: widgets/fltk.cpp:1120
 msgid "Update"
 msgstr "Actualizar"
 
@@ -5579,7 +5645,7 @@ msgstr "Limite superior para determinar color o alfa"
 msgid "Usage:\tmglconv [parameter(s)] scriptfile\n"
 msgstr "Uso:\tmglconv [parámetro(s)] script\n"
 
-#: mgllab/mgllab.cpp:432
+#: mgllab/mgllab.cpp:423
 #, c-format
 msgid "Usage:\tmgllab [parameter(s)] scriptfile\n"
 msgstr "Uso:\tmgllab [parámetro(s)] script\n"
@@ -5624,12 +5690,17 @@ msgstr ""
 msgid "Use color scheme"
 msgstr "Usar esquema de colores"
 
+#: mgllab/mgllab.cpp:485
+#, fuzzy
+msgid "Use dark color scheme"
+msgstr "Usar esquema de colores"
+
 #: udav/prop_dlg.cpp:175
 msgid "Use dots plot for preview"
 msgstr "Usar gráfica de puntos para vista previa"
 
 # Thread=hilo?
-#: mgllab/mgllab.cpp:492
+#: mgllab/mgllab.cpp:484
 msgid "Use multi-threading for drawing"
 msgstr "Usar múltiples subprocesos para graficar"
 
@@ -5676,7 +5747,7 @@ msgstr "Tamaño vertical"
 msgid "W - lightgray"
 msgstr "W - gris claro"
 
-#: src/exec_dat.cpp:1763
+#: src/exec_dat.cpp:1829
 msgid "Wavelet transform at some direction"
 msgstr "Transformada wavelet en alguna dirección"
 
@@ -5684,7 +5755,7 @@ msgstr "Transformada wavelet en alguna dirección"
 msgid "Whole area"
 msgstr "Área completa"
 
-#: mgllab/mgllab.cpp:495
+#: mgllab/mgllab.cpp:488
 msgid "Widget scheme"
 msgstr "Esquema del widget"
 
@@ -5696,7 +5767,7 @@ msgstr "Ancho"
 msgid "Width of selected cells"
 msgstr "Ancho de las celdas seleccionadas"
 
-#: src/data.cpp:1490
+#: src/data.cpp:1559
 #, c-format
 msgid ""
 "Widths are:\n"
@@ -5717,7 +5788,7 @@ msgstr "Gráfica de cables o grilla"
 msgid "Wire style"
 msgstr "Estilo de alambre"
 
-#: src/exec_set.cpp:856
+#: src/exec_set.cpp:865
 msgid "Write current image to graphical file"
 msgstr "Guardar imagen actual a archivo gráfico"
 
@@ -5961,7 +6032,7 @@ msgstr "Debe especificar dirección(es)"
 msgid "You should put text inside ' ' for argument "
 msgstr "Debe poner el texto entre ' para el argumento "
 
-#: udav/anim_dlg.cpp:106
+#: udav/anim_dlg.cpp:105
 msgid "You should select one of case"
 msgstr "Debe seleccionar uno de los casos"
 
@@ -6001,7 +6072,7 @@ msgstr "Tamaño z"
 msgid "Z-slice from"
 msgstr "Sección z para"
 
-#: src/exec_set.cpp:862
+#: src/exec_set.cpp:871
 msgid "Zoom axis range"
 msgstr "Rango de zoom para eje"
 
@@ -6022,7 +6093,7 @@ msgstr "Magnificar"
 msgid "Zoom in graphics."
 msgstr "Magnificar gráfica."
 
-#: widgets/fltk.cpp:869
+#: widgets/fltk.cpp:875
 msgid "Zoom in selected region of the picture"
 msgstr "Magnificar región seleccionada de la imagen"
 
@@ -6031,7 +6102,7 @@ msgstr "Magnificar región seleccionada de la imagen"
 msgid "Zoom in text"
 msgstr "Magnificar texto"
 
-#: widgets/fltk.cpp:899
+#: widgets/fltk.cpp:905
 msgid "Zoom in the picture"
 msgstr "Magnificar la imagen"
 
@@ -6047,11 +6118,11 @@ msgstr "Reducir gráfica."
 msgid "Zoom out text"
 msgstr "Reducir texto"
 
-#: widgets/fltk.cpp:901
+#: widgets/fltk.cpp:907
 msgid "Zoom out the picture"
 msgstr "Reducir la imagen"
 
-#: src/exec_set.cpp:861
+#: src/exec_set.cpp:870
 msgid "Zoom plot region"
 msgstr "Escalar región de gráfica"
 
@@ -6122,7 +6193,7 @@ msgid "attach light"
 msgstr "vincular luz"
 
 #. mglWarnFmt
-#: src/base.cpp:244
+#: src/base.cpp:255
 msgid "axis ranges are incompatible"
 msgstr "rangos de ejes incompletos"
 
@@ -6157,13 +6228,13 @@ msgstr "c - cian"
 msgid "center"
 msgstr "centro"
 
-#: widgets/fltk.cpp:794
+#: widgets/fltk.cpp:800
 #, c-format
 msgid "click at %g, %g, %g"
 msgstr "clic en %g, %g, %g"
 
 #. mglWarnCnt
-#: src/base.cpp:240
+#: src/base.cpp:251
 msgid "couldn't open file"
 msgstr "no se pudo abrir archivo"
 
@@ -6176,17 +6247,17 @@ msgid "cutting"
 msgstr "cortado"
 
 #. -----------------------------------------------------------------------------
-#: src/base.cpp:231
+#: src/base.cpp:242
 msgid "data dimension(s) is incompatible"
 msgstr "dimensión(es) de datos incompatible(s)"
 
 #. mglWarnDim
-#: src/base.cpp:232
+#: src/base.cpp:243
 msgid "data dimension(s) is too small"
 msgstr "dimensión(es) de datos muy pequeña(s)"
 
 #. mglWarnMem
-#: src/base.cpp:236
+#: src/base.cpp:247
 msgid "data values are zero"
 msgstr "valores nulos"
 
@@ -6218,11 +6289,11 @@ msgid "factor"
 msgstr "factor"
 
 #. mglWarnSize
-#: src/base.cpp:243
+#: src/base.cpp:254
 msgid "format is not supported for that build"
 msgstr "formato no soportado"
 
-#: src/canvas.cpp:33
+#: src/canvas.cpp:31
 msgid "frame"
 msgstr "cuadro"
 
@@ -6248,7 +6319,7 @@ msgstr "escala de grises"
 msgid "h - gray"
 msgstr "h - gris"
 
-#: src/parser.cpp:1067
+#: src/parser.cpp:1076
 #, c-format
 msgid "in line %ld"
 msgstr "en línea %ld"
@@ -6284,7 +6355,7 @@ msgid "left"
 msgstr "izquierda"
 
 #. mglWarnOpen
-#: src/base.cpp:241
+#: src/base.cpp:252
 msgid "light: ID is out of range"
 msgstr "luz: ID fuera de rango"
 
@@ -6342,7 +6413,7 @@ msgstr ""
 "mglconv convierte scripts MGL a archivos de imagen (PNG por defecto).\n"
 "La version actual es 2.%g\n"
 
-#: mgllab/mgllab.cpp:431
+#: mgllab/mgllab.cpp:422
 #, c-format
 msgid ""
 "mgllab draw mgl script interactively.\n"
@@ -6376,7 +6447,7 @@ msgid "min"
 msgstr "min"
 
 #. mglWarnLow
-#: src/base.cpp:233
+#: src/base.cpp:244
 msgid "minimal data value is negative"
 msgstr "valor minimal de datos es negativo"
 
@@ -6390,12 +6461,12 @@ msgid "name"
 msgstr "nombre"
 
 #. mglWarnNeg
-#: src/base.cpp:234
+#: src/base.cpp:245
 msgid "no file or wrong data dimensions"
 msgstr "archivo no existe o las dimensiones de datos son incorrectas"
 
 #. mglWarnZero
-#: src/base.cpp:237
+#: src/base.cpp:248
 msgid "no legend entries"
 msgstr "leyenda vacia"
 
@@ -6417,12 +6488,12 @@ msgid "none or default"
 msgstr "ninguno o por defecto"
 
 #. mglWarnFile
-#: src/base.cpp:235
+#: src/base.cpp:246
 msgid "not enough memory"
 msgstr "no hay suficiente memoria"
 
 #. mglWarnNull
-#: src/base.cpp:246
+#: src/base.cpp:257
 msgid "not enough space for plot"
 msgstr "no hay suficiente espacio para gráfica"
 
@@ -6431,7 +6502,7 @@ msgid "not used"
 msgstr "no usado"
 
 #. mglWarnSlc
-#: src/base.cpp:239
+#: src/base.cpp:250
 msgid "number of contours is zero or negative"
 msgstr "número de curvas de nivel es cero o negativo"
 
@@ -6462,7 +6533,7 @@ msgid "plain"
 msgstr "plano"
 
 #. mglWarnTern
-#: src/base.cpp:245
+#: src/base.cpp:256
 msgid "pointer is NULL"
 msgstr "puntero es NULL"
 
@@ -6517,12 +6588,12 @@ msgid "save slides"
 msgstr "guardar cuadros"
 
 #. mglWarnLId
-#: src/base.cpp:242
+#: src/base.cpp:253
 msgid "size(s) is zero or negative"
 msgstr "tamaño(s) nulo(s) o negativo(s)"
 
 #. mglWarnLeg
-#: src/base.cpp:238
+#: src/base.cpp:249
 msgid "slice value is out of range"
 msgstr "valor de sección fuera de rango"
 
@@ -6568,7 +6639,7 @@ msgstr "escala"
 msgid "to"
 msgstr "hacia"
 
-#: mgllab/mgllab.cpp:579
+#: mgllab/mgllab.cpp:574
 msgid "to script"
 msgstr "al script"
 
@@ -6631,6 +6702,12 @@ msgstr "con paso"
 msgid "y - yellow"
 msgstr "y - amarillo"
 
+#~ msgid "Insert file content?"
+#~ msgstr "¿Insertar contenido de archivo?"
+
+#~ msgid "Insert file name?"
+#~ msgstr "¿Insertar nombre de archivo?"
+
 #~ msgid ""
 #~ "You may quickly draw the data from file. Just use: udav 'filename.dat' in "
 #~ "command line."
index 5b6544858b42ab359ac058f0015c769cfad7060e..87a4e739bd1eb8e68ad83eb5a1d8681e05859ec0 100644 (file)
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: MathGL2 2.4.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2019-07-06 19:59+0300\n"
+"POT-Creation-Date: 2021-12-03 16:47+0300\n"
 "PO-Revision-Date: 2017-04-19 01:17+0300\n"
 "Last-Translator: Alexey Balakin <mathgl.abalakin@gmail.com>\n"
 "Language-Team: Russian\n"
@@ -18,7 +18,7 @@ msgstr ""
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
 "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
 
-#: mgllab/mgllab.cpp:433
+#: mgllab/mgllab.cpp:424
 #, c-format
 msgid ""
 "\t-1 str       set str as argument $1 for script\n"
@@ -104,7 +104,7 @@ msgstr ""
 "(c) Алексей Балакин, 2007\n"
 "http://mathgl.sourceforge.net/"
 
-#: src/parser.cpp:1066
+#: src/parser.cpp:1075
 #, c-format
 msgid ""
 "\n"
@@ -113,7 +113,7 @@ msgstr ""
 "\n"
 "Попытка изменить временные данные в строке %ld"
 
-#: src/parser.cpp:1064
+#: src/parser.cpp:1073
 #, c-format
 msgid ""
 "\n"
@@ -122,7 +122,7 @@ msgstr ""
 "\n"
 "Строковый аргумент слишком длинный в строке %ld"
 
-#: src/parser.cpp:1065
+#: src/parser.cpp:1074
 #, c-format
 msgid ""
 "\n"
@@ -131,7 +131,7 @@ msgstr ""
 "\n"
 "Лишняя кавычка ' в строке %ld"
 
-#: src/parser.cpp:1062
+#: src/parser.cpp:1071
 #, c-format
 msgid ""
 "\n"
@@ -140,7 +140,7 @@ msgstr ""
 "\n"
 "Неправильные аргументы в строке %ld"
 
-#: src/parser.cpp:1063
+#: src/parser.cpp:1072
 #, c-format
 msgid ""
 "\n"
@@ -184,7 +184,7 @@ msgstr " Новый"
 msgid " Save"
 msgstr " Сохранить"
 
-#: mgllab/mgllab.cpp:242
+#: mgllab/mgllab.cpp:233
 msgid " Yes "
 msgstr "Да"
 
@@ -444,43 +444,43 @@ msgstr "'|' штрихи"
 msgid "'~' waves"
 msgstr "'~' волны"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "0 - special plot"
 msgstr "0 - специальные графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "1 - other plot"
 msgstr "1 - прочие графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "10 - dd plot"
 msgstr "10 - двойный графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "11 - vector plot"
 msgstr "11 - векторные графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "12 - axis"
 msgstr "12 - оси координат"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "13 - primitives"
 msgstr "13 - примитивы"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "14 - axis setup"
 msgstr "14 - настройка осей"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "15 - text/legend"
 msgstr "15 - текст/легенда"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "16 - data transform"
 msgstr "16 - преобразования данных"
 
-#: udav/info_dlg.cpp:47
+#: udav/info_dlg.cpp:49
 msgid "1D plot"
 msgstr "1D график"
 
@@ -492,11 +492,11 @@ msgstr "1D графики"
 msgid "1D view"
 msgstr "1D вид"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "2 - setup"
 msgstr "2 - настройки"
 
-#: udav/info_dlg.cpp:47
+#: udav/info_dlg.cpp:49
 msgid "2D plot"
 msgstr "2D график"
 
@@ -508,7 +508,7 @@ msgstr "2D графики"
 msgid "2D view"
 msgstr "2D вид"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "3 - data handle"
 msgstr "3 - изменение данных"
 
@@ -524,27 +524,27 @@ msgstr "3D графики"
 msgid "3D view"
 msgstr "3D вид"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "4 - data create"
 msgstr "4 - создание данных"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "5 - subplot"
 msgstr "5 - картинка в картинке"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "6 - program flow"
 msgstr "6 - команды управления"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "7 - 1d plot"
 msgstr "7 - 1D графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "8 - 2d plot"
 msgstr "8 - 2D графики"
 
-#: src/parser.cpp:51
+#: src/parser.cpp:53
 msgid "9 - 3d plot"
 msgstr "9 - 3D графики"
 
@@ -560,7 +560,7 @@ msgstr ""
 msgid "@<-  Prev"
 msgstr "@<-  Пред."
 
-#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:347
+#: widgets/qt.cpp:1294 udav/udav_wnd.cpp:331 mgllab/mgllab.cpp:338
 msgid "About"
 msgstr "О программе"
 
@@ -590,7 +590,7 @@ msgstr "Добавить кривую"
 msgid "Add curve which properties can be changed later by mouse."
 msgstr "Добавить кривую. Ее свойства можно изменить позже мышью."
 
-#: src/exec_dat.cpp:1666
+#: src/exec_dat.cpp:1728
 msgid "Add data or number"
 msgstr "Прибавить массив или число"
 
@@ -606,7 +606,7 @@ msgstr "Добавить эллипс. Его свойства можно изм
 msgid "Add inplot"
 msgstr "Добавить под-график"
 
-#: src/exec_set.cpp:792
+#: src/exec_set.cpp:800
 msgid "Add legend entry"
 msgstr "Добавить запись легенды"
 
@@ -666,7 +666,7 @@ msgstr "Добавить текст"
 msgid "Add text which properties can be changed later by mouse."
 msgstr "Добавить текст. Его свойства можно изменить позже мышью."
 
-#: src/exec_prm.cpp:658
+#: src/exec_prm.cpp:662
 msgid "Add title for current subplot/inplot"
 msgstr "Добавить заголовок к текущему под-графику"
 
@@ -674,19 +674,19 @@ msgstr "Добавить заголовок к текущему под-граф
 msgid "Add to"
 msgstr "Добавить к"
 
-#: src/exec_set.cpp:793
+#: src/exec_set.cpp:801
 msgid "Add user-defined symbol"
 msgstr "Добавить пользовательский символ"
 
-#: widgets/fltk.cpp:877
+#: widgets/fltk.cpp:883
 msgid "Adjust picture size to fill drawing area"
 msgstr "Подогнать размер картинки под область окна"
 
-#: widgets/fltk.cpp:840 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337
+#: widgets/fltk.cpp:846 widgets/qt.cpp:1156 udav/plot_pnl.cpp:337
 msgid "Adjust size"
 msgstr "Подогнать размер"
 
-#: src/exec_set.cpp:794
+#: src/exec_set.cpp:802
 msgid "Adjust ticks for best view"
 msgstr "Подобрать метки осей для лучшего вида"
 
@@ -787,7 +787,7 @@ msgstr "Соотношение сторон по y и z"
 msgid "Aspect x/z"
 msgstr "Стороны x/z"
 
-#: src/exec_set.cpp:800
+#: src/exec_set.cpp:808
 msgid "Attach light settings to inplot"
 msgstr "Привязать настройки света к под-графику"
 
@@ -811,7 +811,7 @@ msgstr "Выполнить скрипт после загрузки"
 msgid "Automatically save before redrawing (F5)"
 msgstr "Сохранять скрипт перед рисованием (F5)"
 
-#: src/data.cpp:1488
+#: src/data.cpp:1557
 #, c-format
 msgid ""
 "Averages are:\n"
@@ -847,12 +847,12 @@ msgstr "B - темно-синий"
 msgid "Backward"
 msgstr "Назад"
 
-#: src/font.cpp:1021
+#: src/font.cpp:1005
 #, c-format
 msgid "Bad '%ls' at %zu\n"
 msgstr "Неправильный '%ls' при %zu\n"
 
-#: src/parser.cpp:769
+#: src/parser.cpp:778
 #, c-format
 msgid "Bad arguments for %ls: %ld instead of %d\n"
 msgstr "Неправильные аргументы для %ls: %ld вместо %d\n"
@@ -869,7 +869,7 @@ msgstr "Базовые"
 msgid "Begin"
 msgstr "Начало"
 
-#: src/parser.cpp:1483
+#: src/parser.cpp:1492
 msgid "Begin of do-while loop"
 msgstr "Начало цикла do-while"
 
@@ -897,7 +897,7 @@ msgstr "Оба поля в yrange должны быть заполнены"
 msgid "Both fields in zrange must be filled"
 msgstr "Оба поля в zrange должны быть заполнены"
 
-#: src/parser.cpp:1480
+#: src/parser.cpp:1489
 msgid "Break for-loop"
 msgstr "Прервать выполнение цикла for"
 
@@ -932,8 +932,8 @@ msgstr "Вычисления"
 
 #. TODO
 #. connect(hidden,SIGNAL(cursorPositionChanged()),this,SLOT(hiddenClicked()));
-#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:341
-#: mgllab/mgllab.cpp:572
+#: udav/udav_wnd.cpp:194 udav/udav_wnd.cpp:206 mgllab/mgllab.cpp:332
+#: mgllab/mgllab.cpp:567
 msgid "Calculator"
 msgstr "Калькулятор"
 
@@ -942,20 +942,20 @@ msgstr "Калькулятор"
 #: udav/dat_pnl.cpp:510 udav/dat_pnl.cpp:552 udav/dat_pnl.cpp:629
 #: udav/opt_dlg.cpp:78 udav/setup_dlg.cpp:145 udav/files_dlg.cpp:58
 #: udav/style_dlg.cpp:206 udav/data_dlg.cpp:90 udav/subplot_dlg.cpp:219
-#: mgllab/editor.cpp:282 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197
+#: mgllab/editor.cpp:286 mgllab/mathgl.cpp:166 mgllab/mathgl.cpp:197
 #: mgllab/dialogs.cpp:120 mgllab/dialogs.cpp:164 mgllab/dialogs.cpp:410
 #: mgllab/dialogs.cpp:584 mgllab/dialogs.cpp:749 mgllab/dialogs.cpp:1071
-#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:497
+#: mgllab/dialogs.cpp:1318 mgllab/dialogs.cpp:1473 mgllab/mgllab.cpp:490
 #: mgllab/table.cpp:101 mgllab/table.cpp:179 mgllab/table.cpp:353
 #: mgllab/table.cpp:556 mgllab/table.cpp:619 mgllab/table.cpp:675
 msgid "Cancel"
 msgstr "Отмена"
 
-#: src/crust.cpp:589
+#: src/crust.cpp:588
 msgid "Cannot triangulate this set!"
 msgstr "Не могу построить триангуляцию!"
 
-#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:370 mgllab/mgllab.cpp:371
+#: udav/udav_wnd.cpp:226 mgllab/mgllab.cpp:361 mgllab/mgllab.cpp:362
 msgid "Canvas"
 msgstr "График"
 
@@ -976,7 +976,7 @@ msgstr "Изменить размер данных"
 msgid "Change canvas size to fill whole region (F6)."
 msgstr "Подогнать размер рисунка под размер окна (F6)."
 
-#: src/exec_set.cpp:804
+#: src/exec_set.cpp:812
 msgid "Change current directory"
 msgstr "Сменить директорию"
 
@@ -996,7 +996,7 @@ msgstr "Изменить данные и закрыть окно"
 msgid "Change font"
 msgstr "Изменить шрифт"
 
-#: src/exec_set.cpp:855
+#: src/exec_set.cpp:864
 msgid "Change view angles - use 'rotate' for plot rotation"
 msgstr "Изменяет углы обзора, а не поворот как 'rotate'"
 
@@ -1008,17 +1008,17 @@ msgstr "Очистить"
 msgid "Clear all"
 msgstr "Удалить все"
 
-#: src/exec_set.cpp:805
+#: src/exec_set.cpp:813
 msgid "Clear legend entries"
 msgstr "Удалить записи легенды"
 
-#: src/exec_set.cpp:806
+#: src/exec_set.cpp:814
 msgid "Clear picture"
 msgstr "Очистить рисунок"
 
 #. o = new Fl_Button(180, 130, 25, 25);o->image(img_save);     o->tooltip("img_save");
-#: widgets/fltk.cpp:1106 widgets/qt.cpp:1108 udav/find_dlg.cpp:52
-#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:566 mgllab/help.cpp:289
+#: widgets/fltk.cpp:1118 widgets/qt.cpp:1108 udav/find_dlg.cpp:52
+#: udav/hint_dlg.cpp:52 mgllab/editor.cpp:570 mgllab/help.cpp:289
 #: mgllab/help.cpp:349 mgllab/help.cpp:465
 msgid "Close"
 msgstr "Закрыть"
@@ -1066,7 +1066,7 @@ msgstr ""
 msgid "Column expr"
 msgstr ""
 
-#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:320
+#: mgllab/dialogs.cpp:724 mgllab/mgllab.cpp:311
 msgid "Command"
 msgstr "Команда"
 
@@ -1090,27 +1090,27 @@ msgstr "Опции команды"
 msgid "Comments"
 msgstr "Комментарий"
 
-#: src/exec_prm.cpp:646
+#: src/exec_prm.cpp:650
 msgid "Computes the attractor of an IFS"
 msgstr "Вычисляет точки фрактала IFS"
 
-#: src/exec_prm.cpp:647
+#: src/exec_prm.cpp:651
 msgid "Computes the attractor of an IFS for 3d case"
 msgstr "Вычисляет точки фрактала IFS в 3d случае"
 
-#: src/exec_prm.cpp:648
+#: src/exec_prm.cpp:652
 msgid "Computes the attractor of an IFS with parameters from *.ifs file"
 msgstr "Вычисляет точки фрактала IFS с параметрами из файла"
 
-#: src/exec_prm.cpp:642
+#: src/exec_prm.cpp:646
 msgid "Computes the flame fractal"
 msgstr "Вычисляет точки фрактала flame"
 
-#: src/parser.cpp:1499
+#: src/parser.cpp:1508
 msgid "Condition of do-while loop"
 msgstr "Условие do-while цикла"
 
-#: src/parser.cpp:1489 src/parser.cpp:1493
+#: src/parser.cpp:1498 src/parser.cpp:1502
 msgid "Conditional operator"
 msgstr "Условный оператор"
 
@@ -1126,11 +1126,11 @@ msgstr "Копировать координаты последнего нажа
 msgid "Copy data"
 msgstr "Копировать данные"
 
-#: src/exec_dat.cpp:1674
+#: src/exec_dat.cpp:1736
 msgid "Copy data from another variable"
 msgstr "Копировать данные из другой переменной"
 
-#: widgets/fltk.cpp:837
+#: widgets/fltk.cpp:843
 msgid "Copy graphics"
 msgstr "Копировать рисунок"
 
@@ -1138,7 +1138,7 @@ msgstr "Копировать рисунок"
 msgid "Copy graphics to clipboard (Ctrl+Shift+G)."
 msgstr "Копировать рисунок в буфер обмена (Ctrl+Shift+G)."
 
-#: widgets/fltk.cpp:881
+#: widgets/fltk.cpp:887
 msgid "Copy image to clipboard"
 msgstr "Копировать рисунок в буфер обмена"
 
@@ -1154,11 +1154,11 @@ msgstr "Копировать диапазон чисел в буфер обме
 msgid "Copy selected text or data to clipboard (Ctrl+C)."
 msgstr "Копировать выделенный текст или данные в буфер обмена (Ctrl+C)."
 
-#: mgllab/editor.cpp:512
+#: mgllab/editor.cpp:516
 msgid "Copy selection to clipboard"
 msgstr "Копировать выделение в буфер обмена"
 
-#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:310
+#: udav/text_pnl.cpp:533 mgllab/mgllab.cpp:301
 msgid "Copy text"
 msgstr "Копировать текст"
 
@@ -1170,7 +1170,7 @@ msgstr "Косинус-Фурье"
 msgid "Cos-Fourier transform along direction(s)"
 msgstr "Косинус-Фурье преобразование вдоль направления(й)"
 
-#: src/exec_dat.cpp:1676
+#: src/exec_dat.cpp:1738
 msgid "Cos-Fourier transform at some direction"
 msgstr "Косинус-Фурье преобразование вдоль направления"
 
@@ -1207,7 +1207,7 @@ msgstr "Создание данных и I/O"
 msgid "Create data and IO"
 msgstr "Создание данных и ввод-вывод"
 
-#: src/exec_dat.cpp:1702
+#: src/exec_dat.cpp:1765
 msgid "Create histogram (distribution) of data values"
 msgstr "Создать гистограмму (распределение) значений данных"
 
@@ -1215,11 +1215,11 @@ msgstr "Создать гистограмму (распределение) зн
 msgid "Create new"
 msgstr "Создать новый"
 
-#: src/exec_dat.cpp:1762
+#: src/exec_dat.cpp:1828
 msgid "Create new 1D data and fill it in range"
 msgstr "Создать новые 1d данные и заполнить их в диапазоне"
 
-#: src/exec_dat.cpp:1717
+#: src/exec_dat.cpp:1782
 msgid "Create new data"
 msgstr "Создать новый массив данных"
 
@@ -1235,7 +1235,7 @@ msgstr "Создать новый массив данных, заполненн
 msgid "Create new empty script window (Ctrl+N)."
 msgstr "Создать новое окно скрипта (Ctrl+N)."
 
-#: src/parser.cpp:1494
+#: src/parser.cpp:1503
 msgid "Creates new variable from list of numbers or data"
 msgstr "Создать новый массив из списка значений или данных"
 
@@ -1251,7 +1251,7 @@ msgstr "Обрезать края массива данных"
 msgid "Crop data"
 msgstr "Обрезать данные"
 
-#: src/exec_dat.cpp:1677
+#: src/exec_dat.cpp:1739
 msgid "Crop edge of data"
 msgstr "Обрезать края массива данных"
 
@@ -1264,7 +1264,7 @@ msgstr ""
 msgid "CumSum"
 msgstr ""
 
-#: src/exec_dat.cpp:1678
+#: src/exec_dat.cpp:1740
 msgid "Cumulative summation along direction(s)"
 msgstr "Накопительное суммирование данных по направлению"
 
@@ -1280,7 +1280,7 @@ msgstr "Текущий шрифт"
 msgid "Cut selected text to clipboard (Ctrl+X)."
 msgstr "Вырезать выбранный текст в буфер обмена (Ctrl+X)."
 
-#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:309
+#: udav/text_pnl.cpp:528 mgllab/mgllab.cpp:300
 msgid "Cut text"
 msgstr "Вырезать текст"
 
@@ -1332,11 +1332,12 @@ msgstr "Информация и просмотр данных."
 msgid "Data name"
 msgstr "Имя данных"
 
-#: udav/info_dlg.cpp:42
+#. mgl->autoResize = true;     // TODO: something strange here !!!
+#: udav/info_dlg.cpp:43
 msgid "Data preview"
 msgstr "Просмотр данных"
 
-#: udav/info_dlg.cpp:43
+#: udav/info_dlg.cpp:44
 msgid "Data preview for current slice."
 msgstr "Просмотр текущего среза данных."
 
@@ -1356,19 +1357,19 @@ msgstr "Уменьшить угол θ на 10 градусов."
 msgid "Decrease font size"
 msgstr "Уменьшить размер шрифта"
 
-#: src/parser.cpp:1485
+#: src/parser.cpp:1494
 msgid "Define constant or parameter"
 msgstr "Определит постоянную или параметр"
 
-#: src/parser.cpp:1484
+#: src/parser.cpp:1493
 msgid "Define parameter as character"
 msgstr "Определить параметр как символ"
 
-#: src/parser.cpp:1486
+#: src/parser.cpp:1495
 msgid "Define parameter as numerical value"
 msgstr "Определить параметр как значение выражения"
 
-#: src/parser.cpp:1479
+#: src/parser.cpp:1488
 msgid "Define parameter from user input"
 msgstr "Определить параметр по вводу пользователя"
 
@@ -1388,7 +1389,7 @@ msgstr "Удалить @b все@. массивы данных."
 msgid "Delete ALL data arrays"
 msgstr "Удалить ВСЕ массивы данных"
 
-#: src/exec_dat.cpp:1681
+#: src/exec_dat.cpp:1743
 msgid "Delete data or slice of data"
 msgstr "Удалить данные или их срез"
 
@@ -1412,7 +1413,7 @@ msgstr "Удалить выбранный график"
 msgid "Description"
 msgstr "Описание"
 
-#: src/exec_dat.cpp:1682
+#: src/exec_dat.cpp:1744
 msgid "Detect curves for maximums of data array"
 msgstr "Найти кривые по максимумам массива данных"
 
@@ -1428,11 +1429,11 @@ msgstr "Дифференцировать данные по направлени
 msgid "Diffuse"
 msgstr "Расс.свет"
 
-#: src/exec_dat.cpp:1686
+#: src/exec_dat.cpp:1748
 msgid "Dilate data larger val"
 msgstr "Расширить данные большие val"
 
-#: src/exec_dat.cpp:1671
+#: src/exec_dat.cpp:1733
 msgid "Direct multiplication of arrays"
 msgstr "Прямое произведение массивов"
 
@@ -1453,7 +1454,7 @@ msgstr "Расстояние между ячейками"
 msgid "Divide by"
 msgstr "Разделить на"
 
-#: src/exec_dat.cpp:1687
+#: src/exec_dat.cpp:1749
 msgid "Divide by data or number"
 msgstr "Разделить данные поэлементно на массив или число"
 
@@ -1461,11 +1462,11 @@ msgstr "Разделить данные поэлементно на массив
 msgid "Do"
 msgstr "OK"
 
-#: src/exec_dat.cpp:1751
+#: src/exec_dat.cpp:1817
 msgid "Do STFA transform"
 msgstr "Выполнить преобразование STFA"
 
-#: src/exec_dat.cpp:1757 src/exec_dat.cpp:1758
+#: src/exec_dat.cpp:1823 src/exec_dat.cpp:1824
 msgid "Do integral transform of data"
 msgstr "Выполнить интегральное преобразование данных"
 
@@ -1482,7 +1483,7 @@ msgstr "Вы хотите удалить все данные?"
 msgid "Do you want to save the changes to the document?"
 msgstr "Вы хотите сохранить изменения в документе?"
 
-#: mgllab/editor.cpp:282
+#: mgllab/editor.cpp:286
 msgid "Don't Save"
 msgstr "Не сохранять"
 
@@ -1490,439 +1491,449 @@ msgstr "Не сохранять"
 msgid "Double diff."
 msgstr "Вторая производная"
 
-#: src/exec_gr.cpp:1141
+#: src/exec_gr.cpp:1213
 msgid "Draw Bifurcation diagram"
 msgstr "Нарисовать бифуркационную диаграмму"
 
-#: src/exec_gr.cpp:1177
+#: src/exec_gr.cpp:1250
 msgid "Draw Iris plots"
 msgstr "Нарисовать график Iris"
 
-#: src/exec_gr.cpp:1179
+#: src/exec_gr.cpp:1252
 msgid "Draw Lamerey diagram"
 msgstr "Нарисовать диаграмму Ламерея"
 
-#: src/exec_gr.cpp:1183
+#: src/exec_gr.cpp:1257
 msgid "Draw Open-High-Low-Close (OHLC) diagram"
 msgstr "Нарисовать диаграмму OHLC (Open-High-Low-Close)"
 
-#: src/exec_gr.cpp:1186
+#: src/exec_gr.cpp:1260
 msgid "Draw Poincare map"
 msgstr "Нарисовать диаграмму Пуанкаре"
 
-#: src/exec_gr.cpp:1192
+#: src/exec_gr.cpp:1266
 msgid "Draw STFA diagram"
 msgstr "Нарисовать диаграмму STFA"
 
-#: src/exec_gr.cpp:1204
+#: src/exec_gr.cpp:1278
 msgid "Draw TeX mark at point position"
 msgstr "Нарисовать ТеХ символы в положении точек"
 
-#: src/exec_prm.cpp:624
+#: src/exec_prm.cpp:628
 msgid "Draw angle arc"
 msgstr "Нарисовать дугу"
 
-#: src/exec_gr.cpp:1134
+#: src/exec_gr.cpp:1206
 msgid "Draw area plot for 1D data"
 msgstr "Закрасить область между кривой и осью"
 
-#: src/exec_gr.cpp:1137
+#: src/exec_gr.cpp:1209
 msgid "Draw bars for 1D data"
 msgstr "Нарисовать график из вертикальных полос"
 
-#: src/exec_gr.cpp:1139
+#: src/exec_gr.cpp:1211
 msgid "Draw belts"
 msgstr "Нарисовать поверхность ленточками"
 
-#: src/exec_gr.cpp:1140
+#: src/exec_gr.cpp:1212
 msgid "Draw belts colored by other data"
 msgstr "Нарисовать поверхность ленточками с заданным цветом"
 
-#: src/exec_gr.cpp:1202
+#: src/exec_gr.cpp:1276
 msgid "Draw binormales for 1D data"
 msgstr "Нарисовать нормаль и бинормаль для кривой"
 
-#: src/exec_prm.cpp:651
+#: src/exec_prm.cpp:655
 msgid "Draw bitmap (logo) along axis range"
 msgstr "Нарисовать растр (логотип) в области осей координат"
 
-#: src/exec_prm.cpp:628
+#: src/exec_prm.cpp:632
 msgid "Draw bounding box"
 msgstr "Нарисовать ограничивающий параллелепипед"
 
-#: src/exec_gr.cpp:1143
+#: src/exec_gr.cpp:1215
 msgid "Draw boxes"
 msgstr "Нарисовать поверхность ящиками"
 
-#: src/exec_gr.cpp:1142
+#: src/exec_gr.cpp:1214
 msgid "Draw boxplot for 2D data"
 msgstr "Нарисовать box-and-whisker диаграмму"
 
-#: src/exec_gr.cpp:1144
+#: src/exec_gr.cpp:1216
 msgid "Draw candlestick chart"
 msgstr "Нарисовать свечной график"
 
-#: src/exec_gr.cpp:1145
+#: src/exec_gr.cpp:1217
 msgid "Draw chart"
 msgstr "Нарисовать линейчатую (круговую) диаграмму"
 
-#: src/exec_prm.cpp:629
+#: src/exec_prm.cpp:633
 msgid "Draw circle"
 msgstr "Нарисовать окружность (круг)"
 
-#: src/exec_gr.cpp:1146
+#: src/exec_gr.cpp:1218
 msgid "Draw cloud"
 msgstr "Нарисовать облако для 3D данных"
 
-#: src/exec_prm.cpp:631
+#: src/exec_prm.cpp:635
 msgid "Draw colorbar"
 msgstr "Нарисовать цветовую шкалу"
 
-#: src/exec_prm.cpp:632
+#: src/exec_prm.cpp:636
 msgid "Draw cone"
 msgstr "Нарисовать конус"
 
-#: src/exec_gr.cpp:1147
+#: src/exec_gr.cpp:1219
 msgid "Draw cones for 1D data"
 msgstr "Нарисовать конусы для 1D данных"
 
-#: src/exec_gr.cpp:1148
+#: src/exec_gr.cpp:1220
 msgid "Draw contour lines"
 msgstr "Нарисовать линии уровня"
 
-#: src/exec_gr.cpp:1158
+#: src/exec_gr.cpp:1230
 msgid "Draw contour lines at x-slice (or x-plane)"
 msgstr "Нарисовать линии уровня на x-срезе"
 
-#: src/exec_gr.cpp:1159
+#: src/exec_gr.cpp:1231
 msgid "Draw contour lines at y-slice (or y-plane)"
 msgstr "Нарисовать линии уровня на y-срезе"
 
-#: src/exec_gr.cpp:1160
+#: src/exec_gr.cpp:1232
 msgid "Draw contour lines at z-slice (or z-plane)"
 msgstr "Нарисовать линии уровня на z-срезе"
 
-#: src/exec_gr.cpp:1149
+#: src/exec_gr.cpp:1221
 msgid "Draw contour lines for 3D data"
 msgstr "Нарисовать линии уровня на срезах 3D данных"
 
-#: src/exec_gr.cpp:1209
+#: src/exec_gr.cpp:1283
 msgid "Draw contour lines for surface of triangles"
 msgstr "Нарисовать линии уровня для поверхности из треугольников"
 
-#: src/exec_gr.cpp:1156
+#: src/exec_gr.cpp:1228
 msgid "Draw contour lines on parametric surface"
 msgstr "Нарисовать линии уровня на параметрической поверхности"
 
-#: src/exec_gr.cpp:1157
+#: src/exec_gr.cpp:1229
 msgid "Draw contour tubes"
 msgstr "Нарисовать цилиндры по линиям уровней"
 
-#: src/exec_gr.cpp:1210
+#: src/exec_gr.cpp:1284
 msgid "Draw contour tubes for surface of triangles"
 msgstr "Нарисовать цилиндры по линиям уровней для поверхности из треугольников"
 
-#: src/exec_prm.cpp:633
+#: src/exec_prm.cpp:637
 msgid "Draw curve"
 msgstr "Нарисовать кривую"
 
-#: src/exec_gr.cpp:1212
+#: src/exec_gr.cpp:1286
 msgid "Draw curve by tube"
 msgstr "Нарисовать трубу около кривой"
 
-#: src/exec_gr.cpp:1162
+#: src/exec_gr.cpp:1234
+#, fuzzy
+msgid "Draw curves of cross-section of isosurfaces a,b for 3D data"
+msgstr "Нарисовать поверхность постоянного уровня"
+
+#: src/exec_gr.cpp:1235
 msgid "Draw density plot"
 msgstr "Нарисовать график плотности"
 
-#: src/exec_gr.cpp:1163
+#: src/exec_gr.cpp:1236
 msgid "Draw density plot at slices of 3D data"
 msgstr "Нарисовать график плотности на срезе 3D данных"
 
-#: src/exec_gr.cpp:1164
+#: src/exec_gr.cpp:1237
 msgid "Draw density plot at x-slice (or x-plane)"
 msgstr "Нарисовать график плотности на x-срезе"
 
-#: src/exec_gr.cpp:1165
+#: src/exec_gr.cpp:1238
 msgid "Draw density plot at y-slice (or y-plane)"
 msgstr "Нарисовать график плотности на y-срезе"
 
-#: src/exec_gr.cpp:1166
+#: src/exec_gr.cpp:1239
 msgid "Draw density plot at z-slice (or z-plane)"
 msgstr "Нарисовать график плотности на z-срезе"
 
-#: src/exec_gr.cpp:1167
+#: src/exec_gr.cpp:1240
 msgid "Draw dew plot"
 msgstr "Нарисовать векторное поле каплями"
 
-#: src/exec_gr.cpp:1168
+#: src/exec_gr.cpp:1241
 msgid "Draw dots for arbitrary data points"
 msgstr "Нарисовать набор точек"
 
-#: src/exec_prm.cpp:634
+#: src/exec_prm.cpp:638
 msgid "Draw drop"
 msgstr "Нарисовать каплю"
 
-#: src/exec_prm.cpp:635
+#: src/exec_prm.cpp:639
 msgid "Draw ellipse"
 msgstr "Нарисовать эллипс"
 
-#: src/exec_prm.cpp:636
+#: src/exec_prm.cpp:640
 msgid "Draw error box"
 msgstr "Нарисовать размер ошибки"
 
-#: src/exec_gr.cpp:1169
+#: src/exec_gr.cpp:1242
 msgid "Draw error boxes"
 msgstr "Нарисовать размеры ошибок для 1D данных"
 
-#: src/exec_prm.cpp:637
+#: src/exec_prm.cpp:641
 msgid "Draw face (quadrangle)"
 msgstr "Нарисовать грань (четырехугольник)"
 
-#: src/exec_prm.cpp:638
+#: src/exec_prm.cpp:642
 msgid "Draw face perpendicular to x-axis"
 msgstr "Нарисовать грань поперек оси x"
 
-#: src/exec_prm.cpp:639
+#: src/exec_prm.cpp:643
 msgid "Draw face perpendicular to y-axis"
 msgstr "Нарисовать грань поперек оси y"
 
-#: src/exec_prm.cpp:640
+#: src/exec_prm.cpp:644
 msgid "Draw face perpendicular to z-axis"
 msgstr "Нарисовать грань поперек оси z"
 
-#: src/exec_gr.cpp:1189
+#: src/exec_gr.cpp:1263
 msgid "Draw filled region (ribbon) between 2 curves"
 msgstr "Закрасить область между двумя кривыми"
 
-#: src/exec_gr.cpp:1184
+#: src/exec_gr.cpp:1258
 msgid "Draw flow pipes for vector field"
 msgstr "Нарисовать трубки тока для векторного поля"
 
-#: src/exec_gr.cpp:1171
+#: src/exec_gr.cpp:1244
 msgid "Draw flow threads for vector field"
 msgstr "Нарисовать линии тока для векторного поля"
 
-#: src/exec_gr.cpp:1173
+#: src/exec_gr.cpp:1246
 msgid "Draw flow threads from plain for vector field"
 msgstr "Нарисовать линии тока для векторного поля, начинающиеся с плоскости"
 
-#: src/exec_gr.cpp:1174
+#: src/exec_gr.cpp:1247
 msgid "Draw gradient lines for scalar field"
 msgstr "Нарисовать линии градиента для скалярного поля"
 
-#: src/exec_prm.cpp:645
+#: src/exec_prm.cpp:649
 msgid "Draw grid"
 msgstr "Нарисовать сетку осей координат"
 
-#: src/exec_gr.cpp:1176
+#: src/exec_gr.cpp:1249
 msgid "Draw grid at slices of 3D data"
 msgstr "Нарисовать сетку на срезе 3D данных"
 
-#: src/exec_gr.cpp:1175
+#: src/exec_gr.cpp:1248
 msgid "Draw grid for data array(s)"
 msgstr "Нарисовать сетку для массива"
 
-#: src/exec_gr.cpp:1136
+#: src/exec_gr.cpp:1208
 msgid "Draw horizontal bars for 1D data"
 msgstr "Нарисовать график из горизонтальных полос"
 
-#: src/exec_gr.cpp:1205
+#: src/exec_gr.cpp:1279
 msgid "Draw horizontal tiles"
 msgstr "Нарисовать поверхность горизонтальными плитками"
 
-#: src/exec_gr.cpp:1206
+#: src/exec_gr.cpp:1280
 msgid "Draw horizontal tiles with variable size"
 msgstr "Нарисовать поверхность плитками переменного размера"
 
-#: src/exec_gr.cpp:1194
+#: src/exec_gr.cpp:1268
 msgid "Draw isosurface for 3D data"
 msgstr "Нарисовать поверхность постоянного уровня"
 
-#: src/exec_gr.cpp:1197
+#: src/exec_gr.cpp:1271
 msgid "Draw isosurface for 3D data colored and transpared by other data"
 msgstr "Нарисовать поверхность уровня с заданными цветом и прозрачностью"
 
-#: src/exec_gr.cpp:1196
+#: src/exec_gr.cpp:1270
 msgid "Draw isosurface for 3D data colored by other data"
 msgstr "Нарисовать поверхность уровня с заданным цветом"
 
-#: src/exec_gr.cpp:1195
+#: src/exec_gr.cpp:1269
 msgid "Draw isosurface for 3D data transpared by other data"
 msgstr "Нарисовать поверхность уровня с заданной прозрачностью"
 
-#: src/exec_gr.cpp:1178
+#: src/exec_gr.cpp:1251
 msgid "Draw label at arbitrary position"
 msgstr "Вывести надписи для 1D данных"
 
-#: src/exec_prm.cpp:630
+#: src/exec_prm.cpp:634
 msgid "Draw label for colorbar"
 msgstr "Вывести подпись colorbar"
 
-#: src/exec_prm.cpp:659
+#: src/exec_prm.cpp:663
 msgid "Draw label for t-axis"
 msgstr "Вывести подпись оси t"
 
-#: src/exec_prm.cpp:660
+#: src/exec_prm.cpp:664
 msgid "Draw label for x-axis"
 msgstr "Вывести подпись оси x"
 
-#: src/exec_prm.cpp:661
+#: src/exec_prm.cpp:665
 msgid "Draw label for y-axis"
 msgstr "Вывести подпись оси y"
 
-#: src/exec_prm.cpp:662
+#: src/exec_prm.cpp:666
 msgid "Draw label for z-axis"
 msgstr "Вывести подпись оси z"
 
-#: src/exec_prm.cpp:649
+#: src/exec_prm.cpp:653
 msgid "Draw legend"
 msgstr "Нарисовать легенду графика"
 
-#: src/exec_prm.cpp:650
+#: src/exec_prm.cpp:654
 msgid "Draw line"
 msgstr "Нарисовать прямую линию"
 
-#: src/exec_gr.cpp:1180
+#: src/exec_gr.cpp:1253
+#, fuzzy
+msgid "Draw lines with arrows for 1D data"
+msgstr "Нарисовать график из вертикальных полос"
+
+#: src/exec_gr.cpp:1254
 msgid "Draw mapping plot"
 msgstr "Нарисовать отображение матрицы"
 
-#: src/exec_gr.cpp:1181
+#: src/exec_gr.cpp:1255
 msgid "Draw mark plot for 1D data"
 msgstr "Нарисовать маркеры переменного размера"
 
-#: src/exec_gr.cpp:1182
+#: src/exec_gr.cpp:1256
 msgid "Draw mesh surface"
 msgstr "Нарисовать сетчатую поверхность"
 
-#: src/exec_prm.cpp:627
+#: src/exec_prm.cpp:631
 msgid "Draw point (ball)"
 msgstr "Нарисовать точку"
 
-#: src/exec_prm.cpp:652
+#: src/exec_prm.cpp:656
 msgid "Draw polygon"
 msgstr "Нарисовать полигон"
 
-#: src/exec_gr.cpp:1138
+#: src/exec_gr.cpp:1210
 msgid "Draw quasi-optical beam"
 msgstr "Нарисовать квазиоптический пучок"
 
-#: src/exec_gr.cpp:1188
+#: src/exec_gr.cpp:1262
 msgid "Draw radar chart"
 msgstr "Нарисовать круговой график"
 
-#: src/exec_gr.cpp:1161
+#: src/exec_gr.cpp:1233
 msgid "Draw reconstructed surface for arbitrary data points"
 msgstr "Нарисовать поверхность по произвольным точкам"
 
-#: src/exec_prm.cpp:653
+#: src/exec_prm.cpp:657
 msgid "Draw rectangle"
 msgstr "Нарисовать прямоугольник"
 
-#: src/exec_prm.cpp:654
+#: src/exec_prm.cpp:658
 msgid "Draw rhombus"
 msgstr "Нарисовать ромб"
 
-#: src/exec_gr.cpp:1153
+#: src/exec_gr.cpp:1225
 msgid "Draw solid contour lines at x-slice (or x-plane)"
 msgstr "Закрасить линии уровня на x-срезе"
 
-#: src/exec_gr.cpp:1154
+#: src/exec_gr.cpp:1226
 msgid "Draw solid contour lines at y-slice (or y-plane)"
 msgstr "Закрасить линии уровня на y-срезе"
 
-#: src/exec_gr.cpp:1155
+#: src/exec_gr.cpp:1227
 msgid "Draw solid contour lines at z-slice (or z-plane)"
 msgstr "Закрасить линии уровня на z-срезе"
 
-#: src/exec_gr.cpp:1152
+#: src/exec_gr.cpp:1224
 msgid "Draw solid contour lines for 3D data"
 msgstr "Закрасить линии уровня на 3D данных"
 
-#: src/exec_gr.cpp:1151
+#: src/exec_gr.cpp:1223
 msgid "Draw solid contours"
 msgstr "Закрасить линии уровня"
 
-#: src/exec_gr.cpp:1150
+#: src/exec_gr.cpp:1222
 msgid "Draw solid contours with manual colors"
 msgstr "Закрасить линии уровня заданными цветами"
 
-#: src/exec_gr.cpp:1193
+#: src/exec_gr.cpp:1267
 msgid "Draw solid surface"
 msgstr "Нарисовать поверхность"
 
-#: src/exec_gr.cpp:1200
+#: src/exec_gr.cpp:1274
 msgid "Draw solid surface colored and transpared by other data"
 msgstr "Нарисовать поверхность с заданными цветом и прозрачностью"
 
-#: src/exec_gr.cpp:1199
+#: src/exec_gr.cpp:1273
 msgid "Draw solid surface colored by other data"
 msgstr "Нарисовать поверхность с заданным цветом"
 
-#: src/exec_gr.cpp:1198
+#: src/exec_gr.cpp:1272
 msgid "Draw solid surface transpared by other data"
 msgstr "Нарисовать поверхность с заданной прозрачностью"
 
-#: src/exec_prm.cpp:655
+#: src/exec_prm.cpp:659
 msgid "Draw sphere"
 msgstr "Нарисовать сферу"
 
-#: src/exec_gr.cpp:1190
+#: src/exec_gr.cpp:1264
 msgid "Draw stem plot for 1D data"
 msgstr "Нарисовать линии от 1D данных до оси"
 
-#: src/exec_gr.cpp:1191
+#: src/exec_gr.cpp:1265
 msgid "Draw step plot for 1D data"
 msgstr "Нарисовать ступеньки"
 
-#: src/exec_gr.cpp:1207
+#: src/exec_gr.cpp:1281
 msgid "Draw surface of curve rotation"
 msgstr "Нарисовать поверхность вращения"
 
-#: src/exec_gr.cpp:1187
+#: src/exec_gr.cpp:1261
 msgid "Draw surface of quadrangles"
 msgstr "Нарисовать поверхность из четырехугольников"
 
-#: src/exec_gr.cpp:1211
+#: src/exec_gr.cpp:1285
 msgid "Draw surface of triangles"
 msgstr "Нарисовать поверхность из треугольников"
 
-#: src/exec_gr.cpp:1135
+#: src/exec_gr.cpp:1207
 msgid "Draw surfaces of contour lines rotation"
 msgstr "Нарисовать поверхность вращения линий уровня"
 
-#: src/exec_gr.cpp:1201
+#: src/exec_gr.cpp:1275
 msgid "Draw table with data values"
 msgstr "Нарисовать таблицу значений данных"
 
-#: src/exec_gr.cpp:1203
+#: src/exec_gr.cpp:1277
 msgid "Draw tension plot for 1D data"
 msgstr "Нарисовать кривую с заданным цветом"
 
-#: src/exec_prm.cpp:657
+#: src/exec_prm.cpp:661
 msgid "Draw text at some position or along curve"
 msgstr "Вывести текст в точке или вдоль кривой"
 
-#: src/exec_prm.cpp:656
+#: src/exec_prm.cpp:660
 msgid "Draw user-defined symbol at given position and direction"
 msgstr "Нарисовать символ в заданных точке и направлении"
 
-#: src/exec_gr.cpp:1185
+#: src/exec_gr.cpp:1259
 msgid "Draw usual plot for 1D data"
 msgstr "Нарисовать кривую для 1D данных"
 
-#: src/exec_gr.cpp:1213
+#: src/exec_gr.cpp:1287
 msgid "Draw vector field"
 msgstr "Нарисовать векторное поле"
 
-#: src/exec_gr.cpp:1214
+#: src/exec_gr.cpp:1288
 msgid "Draw vector field at slices of 3D data"
 msgstr "Нарисовать векторное поле на срезах 3D данных"
 
-#: src/exec_gr.cpp:1208
+#: src/exec_gr.cpp:1282
 msgid "Draw vectors along a curve"
 msgstr "Нарисовать вектора вдоль кривой"
 
-#: src/exec_gr.cpp:1170
+#: src/exec_gr.cpp:1243
 msgid "Draw waterfalls"
 msgstr "Нарисовать поверхность набором линий (водопад)"
 
@@ -1943,7 +1954,7 @@ msgstr "E - темно-салатовый"
 msgid "Edges"
 msgstr "Края"
 
-#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:307
+#: udav/text_pnl.cpp:84 mgllab/mgllab.cpp:298
 msgid "Edit"
 msgstr "Правка"
 
@@ -1955,13 +1966,13 @@ msgstr "Редактировать выбранный массив данных"
 msgid "Elliptic"
 msgstr "Эллиптические"
 
-#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:489
+#: udav/prop_dlg.cpp:171 mgllab/mgllab.cpp:481
 msgid "Enable keywords completion"
 msgstr "Разрешить дополнение команд"
 
 #. pure = new QCheckBox(_("Disable face drawing (faster) for mouse rotation/shift/zoom."), this);
 #. pure->setChecked(mglAutoPure);      v->addWidget(pure);     pure->setEnabled(false);
-#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:491
+#: udav/prop_dlg.cpp:169 mgllab/mgllab.cpp:483
 msgid "Enable mouse wheel for zooming"
 msgstr "Колесо мыши приближает график"
 
@@ -2062,11 +2073,11 @@ msgstr "Введите значение аргумента %s"
 msgid "Envelop"
 msgstr "Огибающая"
 
-#: src/exec_dat.cpp:1690
+#: src/exec_dat.cpp:1752
 msgid "Erode data larger val"
 msgstr "Сузить данные большие val"
 
-#: mgllab/editor.cpp:348
+#: mgllab/editor.cpp:352
 #, c-format
 msgid ""
 "Error reading from file '%s':\n"
@@ -2080,7 +2091,7 @@ msgstr ""
 msgid "Error to call external viewer\n"
 msgstr "Ошибка вызова внешнего просмотра\n"
 
-#: mgllab/editor.cpp:359
+#: mgllab/editor.cpp:363
 #, c-format
 msgid ""
 "Error writing to file '%s':\n"
@@ -2089,17 +2100,17 @@ msgstr ""
 "Ошибка записи в файл '%s':\n"
 "%s."
 
-#: src/exec_dat.cpp:1691
+#: src/exec_dat.cpp:1753
 msgid ""
 "Evaluate (interpolate) values of array Dat at points i=idat,j=jdat,k=kdat"
 msgstr "Интерполирует значения в точках i=idat,j=jdat,k=kdat"
 
 #. {"defpal",_("Define parameter as palette color"),"defpal $N val", 0, 6},
-#: src/parser.cpp:1488
+#: src/parser.cpp:1497
 msgid "Execute if condition is false"
 msgstr "Выполнить если условие ложно"
 
-#: mgllab/mgllab.cpp:487
+#: mgllab/mgllab.cpp:479
 msgid "Execute script after loading"
 msgstr "Выполнить скрипт после загрузки"
 
@@ -2107,7 +2118,7 @@ msgstr "Выполнить скрипт после загрузки"
 msgid "Execute script and redraw graphics (F5)."
 msgstr "Выполнить скрипт и обновить рисунок (F5)."
 
-#: src/parser.cpp:1481
+#: src/parser.cpp:1490
 msgid "Execute script in external file"
 msgstr "Выполнить скрипт из внешнего файла"
 
@@ -2115,7 +2126,7 @@ msgstr "Выполнить скрипт из внешнего файла"
 msgid "Existing data arrays"
 msgstr "Массивы данных"
 
-#: mgllab/mgllab.cpp:305
+#: mgllab/mgllab.cpp:296
 msgid "Exit"
 msgstr "Выход"
 
@@ -2131,7 +2142,7 @@ msgstr "Exp-интегралы"
 msgid "Export Data?"
 msgstr "Экспорт данных?"
 
-#: widgets/fltk.cpp:815
+#: widgets/fltk.cpp:821
 msgid "Export as ..."
 msgstr "Экспорт как ..."
 
@@ -2143,7 +2154,7 @@ msgstr "Экспорт как 2D ..."
 msgid "Export as 3D ..."
 msgstr "Экспорт как 3D ..."
 
-#: src/exec_dat.cpp:1692 mgllab/table.cpp:846
+#: src/exec_dat.cpp:1754 mgllab/table.cpp:846
 msgid "Export data to PNG file"
 msgstr "Экспорт данных в PNG файл"
 
@@ -2156,7 +2167,7 @@ msgstr "Экспорт в GIF"
 msgid "Export to PNG"
 msgstr "Экспорт в PNG"
 
-#: src/exec_dat.cpp:1693
+#: src/exec_dat.cpp:1755
 msgid "Extend data array"
 msgstr "Расширить массив данных"
 
@@ -2164,11 +2175,11 @@ msgstr "Расширить массив данных"
 msgid "Extract data"
 msgstr "Выделить данные"
 
-#: src/exec_dat.cpp:1752
+#: src/exec_dat.cpp:1818
 msgid "Extract sub-array"
 msgstr "Выделить под-массив"
 
-#: src/exec_dat.cpp:1744
+#: src/exec_dat.cpp:1810
 msgid "Extract sub-array between values"
 msgstr "Выделить под-массив в диапазоне между значениями"
 
@@ -2178,7 +2189,7 @@ msgstr "Фактор"
 
 #. file menu
 #: widgets/qt.cpp:1083 udav/udav_wnd.cpp:281 udav/dat_pnl.cpp:681
-#: mgllab/mgllab.cpp:292 mgllab/table.cpp:750
+#: mgllab/mgllab.cpp:283 mgllab/table.cpp:750
 msgid "File"
 msgstr "Файл"
 
@@ -2186,7 +2197,7 @@ msgstr "Файл"
 msgid "File %1 saved"
 msgstr "Файл %1 сохранен."
 
-#: mgllab/mgllab.cpp:242
+#: mgllab/mgllab.cpp:233
 msgid "File exist. Overwrite it?"
 msgstr "Файл существует. Переписать?"
 
@@ -2194,7 +2205,7 @@ msgstr "Файл существует. Переписать?"
 msgid "File name"
 msgstr "Имя файла"
 
-#: mgllab/mgllab.cpp:318
+#: mgllab/mgllab.cpp:309
 msgid "File path"
 msgstr "Путь к файлу"
 
@@ -2202,7 +2213,7 @@ msgstr "Путь к файлу"
 msgid "File to export"
 msgstr "Экспорт в файл"
 
-#: mgllab/editor.cpp:267 mgllab/mgllab.cpp:412
+#: mgllab/editor.cpp:271 mgllab/mgllab.cpp:403
 msgid "File/Recent files"
 msgstr "Файл/Последние файлы"
 
@@ -2214,19 +2225,19 @@ msgstr "Заполнить"
 msgid "Fill data by formula"
 msgstr "Заполнить по формуле"
 
-#: src/exec_dat.cpp:1700
+#: src/exec_dat.cpp:1763
 msgid "Fill data by global spline of Vdat"
 msgstr "Заполнить данные по глобальному сплайну Vdat"
 
-#: src/exec_dat.cpp:1736
+#: src/exec_dat.cpp:1802
 msgid "Fill data by interpolation of Vdat"
 msgstr "Заполнить данные интерполяцией Vdat"
 
-#: src/exec_dat.cpp:1679
+#: src/exec_dat.cpp:1741
 msgid "Fill data by triangulated values"
 msgstr "Заполнить данные триангуляцией"
 
-#: src/exec_dat.cpp:1695
+#: src/exec_dat.cpp:1757
 msgid "Fill data linearly in range [v1, v2]"
 msgstr "Заполнить данные линейно в диапазоне [v1, v2]"
 
@@ -2234,19 +2245,57 @@ msgstr "Заполнить данные линейно в диапазоне [v1
 msgid "Fill in range"
 msgstr "Заполнить в диапазоне"
 
-#: src/exec_dat.cpp:1696
+#: src/exec_dat.cpp:1758
 msgid "Fill x-,k-samples for transforms"
 msgstr "Заполнить как x-,k-координаты для трансформации"
 
-#: udav/find_dlg.cpp:48 mgllab/editor.cpp:560
+#: src/random.cpp:350
+msgid "Fills by fractional brownian motion"
+msgstr "Заполнить броуновским движением"
+
+#: src/random.cpp:356
+msgid "Fills by random integers uniformly chosen in [lo, hi)"
+msgstr "Заполнить случайными целыми числами в интервале [lo, hi)"
+
+#: src/random.cpp:348
+msgid ""
+"Fills by random numbers according to Bernoulli distribution with probability "
+"p"
+msgstr "Заполнить случайными числами с распределением Бернулли"
+
+#: src/random.cpp:353
+msgid "Fills by random numbers according to Gaussian distribution"
+msgstr "Заполнить случайными числами с гауссовым распределением"
+
+#: src/random.cpp:349
+msgid ""
+"Fills by random numbers according to binomial distribution in n coin flips "
+"with probability p"
+msgstr "Заполнить случайными числами с биномиальным распределением"
+
+#: src/random.cpp:351
+msgid "Fills by random numbers according to discrete distribution"
+msgstr "Заполнить случайными числами с дискретным распределением"
+
+#: src/random.cpp:352
+msgid ""
+"Fills by random numbers according to exponential distribution with "
+"probability p"
+msgstr "Заполнить случайными числами с экспоненциальным распределением"
+
+#: src/random.cpp:355
+msgid "Fills by random numbers uniformly chosen in [lo,hi)"
+msgstr "Заполнить случайными числами в интервале [lo, hi)"
+
+#: udav/find_dlg.cpp:48 mgllab/editor.cpp:564
 msgid "Find"
 msgstr "Найти"
 
-#: src/exec_dat.cpp:1675
+#: src/exec_dat.cpp:1737
 msgid "Find correlation between data arrays"
 msgstr "Найти корреляцию между данными"
 
-#: src/exec_dat.cpp:1689
+#: src/exec_dat.cpp:1751
 msgid "Find envelop for the data"
 msgstr "Найти огибающую данных"
 
@@ -2254,55 +2303,65 @@ msgstr "Найти огибающую данных"
 msgid "Find envelope along direction(s)"
 msgstr "Найти огибающую в направлении"
 
+#: src/exec_dat.cpp:1759
+#, fuzzy
+msgid "Find first indexes of values larger val over direction"
+msgstr "Найти минимум по направлению"
+
 #: udav/dat_pnl.cpp:804
 msgid "Find histogram of data."
 msgstr "Найти гистограмму данных"
 
-#: src/exec_dat.cpp:1711
+#: src/exec_dat.cpp:1773
+#, fuzzy
+msgid "Find last indexes of values larger val over direction"
+msgstr "Найти максимум по направлению"
+
+#: src/exec_dat.cpp:1776
 msgid "Find maximal value over direction"
 msgstr "Найти максимум по направлению"
 
-#: src/exec_dat.cpp:1712
+#: src/exec_dat.cpp:1777
 msgid "Find minimal value over direction"
 msgstr "Найти минимум по направлению"
 
-#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:316
+#: udav/text_pnl.cpp:551 mgllab/mgllab.cpp:307
 msgid "Find next"
 msgstr "Найти следующее"
 
-#: mgllab/editor.cpp:516
+#: mgllab/editor.cpp:520
 msgid "Find or replace text"
 msgstr "Найти или заменить"
 
-#: src/exec_dat.cpp:1748
+#: src/exec_dat.cpp:1814
 msgid "Find root Dat[i,j,k]=val (inverse evaluate)"
 msgstr "Найти корень Dat[i,j,k]=val (обратно evaluate)"
 
-#: src/exec_dat.cpp:1740
+#: src/exec_dat.cpp:1806
 msgid "Find roots using data as initial values"
 msgstr "Найти корни используя данные как начальные условия"
 
-#: src/exec_dat.cpp:1754
+#: src/exec_dat.cpp:1820
 msgid "Find summation over direction"
 msgstr "Найти сумму по направлению"
 
-#: src/exec_dat.cpp:1760
+#: src/exec_dat.cpp:1826
 msgid "Find triangles of randomly placed points"
 msgstr "Триангулировать произвольно расположенные точки"
 
-#: udav/find_dlg.cpp:36 mgllab/editor.cpp:559
+#: udav/find_dlg.cpp:36 mgllab/editor.cpp:563
 msgid "Find what:"
 msgstr "Найти что:"
 
-#: udav/text_pnl.cpp:546 mgllab/editor.cpp:558
+#: udav/text_pnl.cpp:546 mgllab/editor.cpp:562
 msgid "Find/Replace"
 msgstr "Найти/Заменить"
 
-#: mgllab/mgllab.cpp:315
+#: mgllab/mgllab.cpp:306
 msgid "Find|Replace"
 msgstr "Найти|Заменить"
 
-#: src/parser.cpp:1490
+#: src/parser.cpp:1499
 msgid "Finish if/else block"
 msgstr "Окончание блока if/else"
 
@@ -2314,11 +2373,11 @@ msgstr "Первая ячейка"
 msgid "First slice"
 msgstr "Первый срез"
 
-#: src/exec_dat.cpp:1697 src/exec_dat.cpp:1698
+#: src/exec_dat.cpp:1760 src/exec_dat.cpp:1761
 msgid "Fit data to formula"
 msgstr "Подогнать данные по формуле"
 
-#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:322
+#: udav/text_pnl.cpp:567 mgllab/mgllab.cpp:313
 msgid "Fitted formula"
 msgstr "Подобранная формула"
 
@@ -2334,11 +2393,11 @@ msgstr "Туман"
 msgid "Fog dist."
 msgstr "глубина"
 
-#: mgllab/mgllab.cpp:548
+#: mgllab/mgllab.cpp:543
 msgid "Folder for help files"
 msgstr "Папка для файлов справки"
 
-#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:319
+#: udav/text_pnl.cpp:587 mgllab/mgllab.cpp:310
 msgid "Folder path"
 msgstr "Путь к папке"
 
@@ -2346,7 +2405,7 @@ msgstr "Путь к папке"
 msgid "Font"
 msgstr "Шрифт"
 
-#: mgllab/mgllab.cpp:539
+#: mgllab/mgllab.cpp:534
 msgid "Font file name"
 msgstr "Имя файла шрифта"
 
@@ -2354,11 +2413,11 @@ msgstr "Имя файла шрифта"
 msgid "Font files (*.vfm)"
 msgstr "Файлы шрифтов (*.vfm)"
 
-#: mgllab/mgllab.cpp:478
+#: mgllab/mgllab.cpp:470
 msgid "Font kind"
 msgstr "Шрифт"
 
-#: mgllab/mgllab.cpp:480
+#: mgllab/mgllab.cpp:472
 msgid "Font size"
 msgstr "Размер"
 
@@ -2370,7 +2429,7 @@ msgstr "Шрифт"
 msgid "FontSize"
 msgstr "Размер"
 
-#: src/parser.cpp:1491
+#: src/parser.cpp:1500
 msgid "For loop"
 msgstr "Цикл for"
 
@@ -2387,7 +2446,7 @@ msgstr "Кадр %1 из %2"
 msgid "From"
 msgstr "от"
 
-#: mgllab/mgllab.cpp:607
+#: mgllab/mgllab.cpp:602
 msgid "Function"
 msgstr "Функция"
 
@@ -2405,44 +2464,46 @@ msgstr "GIF поддержка отключена. Включите ее и пе
 msgid "General setup"
 msgstr "Общие настройки"
 
-#: src/exec_dat.cpp:1708
+#: src/exec_dat.cpp:1771
 msgid "Get Jacobian"
 msgstr "Вычислить якобиан"
 
-#: src/exec_dat.cpp:1673
+#: src/exec_dat.cpp:1735
 msgid "Get contour lines for dat[i,j]=val, separated by NAN"
 msgstr "Найти координаты линий уровня dat[i,j]=val, разделенных NAN"
 
-#: src/exec_dat.cpp:1670
+#: src/exec_dat.cpp:1732
 msgid "Get data column filled by formula on column ids"
 msgstr "Вычислить данные по формуле из имен колонок"
 
-#: src/exec_dat.cpp:1743
+#: src/exec_dat.cpp:1809
 msgid "Get formated data from file"
 msgstr "Загрузить форматированные данные из файла"
 
-#: src/exec_dat.cpp:1672
+#: src/exec_dat.cpp:1734
 msgid ""
 "Get indexes or resort data for found connected surfaces dependent on j,k"
-msgstr "Найти индексы или пересортировать данные для поиска связанных поверхностей, зависящих от j,k"
+msgstr ""
+"Найти индексы или пересортировать данные для поиска связанных поверхностей, "
+"зависящих от j,k"
 
-#: src/exec_dat.cpp:1715
+#: src/exec_dat.cpp:1780
 msgid "Get momentum along direction"
 msgstr "Вычислить момент по направлению"
 
-#: src/exec_dat.cpp:1694
+#: src/exec_dat.cpp:1756
 msgid "Get positions of local maximums and minimums"
 msgstr "Найти положение локальных максимумов и минимумов"
 
-#: src/exec_dat.cpp:1725
+#: src/exec_dat.cpp:1790
 msgid "Get pulse properties"
 msgstr "Найти параметры импульса"
 
-#: src/exec_dat.cpp:1756
+#: src/exec_dat.cpp:1822
 msgid "Get trace of array"
 msgstr "Найти след матрицы"
 
-#: src/base_cf.cpp:85
+#: src/base_cf.cpp:86
 #, c-format
 msgid "Global message - %s\n"
 msgstr "Общее сообщение - %s\n"
@@ -2472,7 +2533,7 @@ msgid "Go to the specified slice for 3D data."
 msgstr "Перейти к указанному срезу 3D данных"
 
 #: widgets/qt.cpp:1112 widgets/qt.cpp:1114 udav/plot_pnl.cpp:66
-#: mgllab/mgllab.cpp:334
+#: mgllab/mgllab.cpp:325
 msgid "Graphics"
 msgstr "Графика"
 
@@ -2480,157 +2541,148 @@ msgstr "Графика"
 msgid "Graphics setup"
 msgstr "Настройка графика"
 
-#: widgets/fltk.cpp:964
+#: widgets/fltk.cpp:970
 msgid "Graphics/Adjust size"
 msgstr "Графика/Подогнать размер"
 
-#. /< Parameter for handling animation
-#. /< Callback function for next frame
-#. /< Callback function for prev frame
-#. /< Callback function for delay
-#. /< Callback function for reloading
-#. / Toggle transparency (alpha) button
-#: widgets/fltk.cpp:958 include/mgl2/Fl_MathGL.h:164
+#. -----------------------------------------------------------------------------
+#: widgets/fltk.cpp:964 widgets/fltk.cpp:1094
 msgid "Graphics/Alpha"
 msgstr "Графика/Прозрачность"
 
-#: widgets/fltk.cpp:993
+#: widgets/fltk.cpp:999
 msgid "Graphics/Animation/Next frame"
 msgstr "Графика/Анимация/Следующий"
 
-#: widgets/fltk.cpp:994
+#: widgets/fltk.cpp:1000
 msgid "Graphics/Animation/Prev frame"
 msgstr "Графика/Анимация/Предыдущий"
 
-#: mgllab/mgllab.cpp:386
+#: mgllab/mgllab.cpp:377
 msgid "Graphics/Animation/Setup animation"
 msgstr "Графика/Анимация/Настройка"
 
-#. / Toggle slideshow button
-#: widgets/fltk.cpp:992 include/mgl2/Fl_MathGL.h:168
+#: widgets/fltk.cpp:998 widgets/fltk.cpp:1096
 msgid "Graphics/Animation/Slideshow"
 msgstr "Графика/Анимация/Запустить"
 
-#: widgets/fltk.cpp:968
+#: widgets/fltk.cpp:974
 msgid "Graphics/Copy click coor."
 msgstr "Графика/Копировать коор."
 
-#: widgets/fltk.cpp:967
+#: widgets/fltk.cpp:973
 msgid "Graphics/Copy graphics"
 msgstr "Графика/Копировать рисунок"
 
-#: widgets/fltk.cpp:981
+#: widgets/fltk.cpp:987
 msgid "Graphics/Export/as BMP"
 msgstr "Графика/Экспорт/как BMP"
 
-#: widgets/fltk.cpp:979
+#: widgets/fltk.cpp:985
 msgid "Graphics/Export/as GIF"
 msgstr "Графика/Экспорт/как GIF"
 
-#: widgets/fltk.cpp:976
+#: widgets/fltk.cpp:982
 msgid "Graphics/Export/as JPEG"
 msgstr "Графика/Экспорт/как JPEG"
 
-#: widgets/fltk.cpp:987
+#: widgets/fltk.cpp:993
 msgid "Graphics/Export/as OBJ"
 msgstr "Графика/Экспорт/как OBJ"
 
-#: widgets/fltk.cpp:988
+#: widgets/fltk.cpp:994
 msgid "Graphics/Export/as OFF"
 msgstr "Графика/Экспорт/как OFF"
 
-#: widgets/fltk.cpp:972
+#: widgets/fltk.cpp:978
 msgid "Graphics/Export/as PNG"
 msgstr "Графика/Экспорт/как PNG"
 
-#: widgets/fltk.cpp:986
+#: widgets/fltk.cpp:992
 msgid "Graphics/Export/as PRC"
 msgstr "Графика/Экспорт/как PRC"
 
-#: widgets/fltk.cpp:989
+#: widgets/fltk.cpp:995
 msgid "Graphics/Export/as STL"
 msgstr "Графика/Экспорт/как STL"
 
-#: widgets/fltk.cpp:982
+#: widgets/fltk.cpp:988
 msgid "Graphics/Export/as SVG"
 msgstr "Графика/Экспорт/как SVG"
 
-#: widgets/fltk.cpp:985
+#: widgets/fltk.cpp:991
 msgid "Graphics/Export/as TeX"
 msgstr "Графика/Экспорт/как TeX"
 
-#: widgets/fltk.cpp:990
+#: widgets/fltk.cpp:996
 msgid "Graphics/Export/as XYZ"
 msgstr "Графика/Экспорт/как XYZ"
 
-#: widgets/fltk.cpp:984
+#: widgets/fltk.cpp:990
 msgid "Graphics/Export/as bitmap EPS"
 msgstr "Графика/Экспорт/как растровый EPS"
 
-#: widgets/fltk.cpp:973
+#: widgets/fltk.cpp:979
 msgid "Graphics/Export/as solid PNG"
 msgstr "Графика/Экспорт/как PNG с заливкой"
 
-#: widgets/fltk.cpp:983
+#: widgets/fltk.cpp:989
 msgid "Graphics/Export/as vector EPS"
 msgstr "Графика/Экспорт/как EPS"
 
-#. / Toggle grid drawing button
-#: widgets/fltk.cpp:960 include/mgl2/Fl_MathGL.h:170
+#: widgets/fltk.cpp:966 widgets/fltk.cpp:1097
 msgid "Graphics/Grid"
 msgstr "Графика/Сетка"
 
-#. / Toggle lighting button
-#: widgets/fltk.cpp:959 include/mgl2/Fl_MathGL.h:166
+#: widgets/fltk.cpp:965 widgets/fltk.cpp:1095
 msgid "Graphics/Light"
 msgstr "Графика/Освещение"
 
-#. / Toggle pause calculation button
-#: widgets/fltk.cpp:969 include/mgl2/Fl_MathGL.h:182 mgllab/mgllab.cpp:387
+#: widgets/fltk.cpp:975 widgets/fltk.cpp:1098 mgllab/mgllab.cpp:378
 msgid "Graphics/Pause calc"
 msgstr "Графика/Пауза расчета"
 
-#: mgllab/mgllab.cpp:385
+#: mgllab/mgllab.cpp:376
 msgid "Graphics/Primitive"
 msgstr "Графика/Примитивы"
 
-#: widgets/fltk.cpp:963
+#: widgets/fltk.cpp:969
 msgid "Graphics/Redraw"
 msgstr "Графика/Перерисовать"
 
-#: widgets/fltk.cpp:965
+#: widgets/fltk.cpp:971
 msgid "Graphics/Reload data"
 msgstr "Графика/Перезагрузить"
 
-#: widgets/fltk.cpp:962
+#: widgets/fltk.cpp:968
 msgid "Graphics/Restore"
 msgstr "Графика/Восстановить"
 
-#: widgets/fltk.cpp:966
+#: widgets/fltk.cpp:972
 msgid "Graphics/Stop"
 msgstr "Графика/Стоп"
 
-#: widgets/fltk.cpp:1000
+#: widgets/fltk.cpp:1006
 msgid "Graphics/Transform/Move down"
 msgstr "Графика/Сдвиг/Вниз"
 
-#: widgets/fltk.cpp:996
+#: widgets/fltk.cpp:1002
 msgid "Graphics/Transform/Move left"
 msgstr "Графика/Сдвиг/Влево"
 
-#: widgets/fltk.cpp:1001
+#: widgets/fltk.cpp:1007
 msgid "Graphics/Transform/Move right"
 msgstr "Графика/Сдвиг/Вправо"
 
-#: widgets/fltk.cpp:997
+#: widgets/fltk.cpp:1003
 msgid "Graphics/Transform/Move up"
 msgstr "Графика/Сдвиг/Вверх"
 
-#: widgets/fltk.cpp:998
+#: widgets/fltk.cpp:1004
 msgid "Graphics/Transform/Zoom in"
 msgstr "Графика/Сдвиг/Приблизить"
 
-#: widgets/fltk.cpp:999
+#: widgets/fltk.cpp:1005
 msgid "Graphics/Transform/Zoom out"
 msgstr "Графика/Сдвиг/Отдалить"
 
@@ -2647,12 +2699,13 @@ msgstr "Группы команд MGL"
 msgid "H - darkgray"
 msgstr "H - темно-серый"
 
-#: src/data_io.cpp:1092
+#: src/data_io.cpp:1204
 msgid "HDF4 support was disabled. Please, enable it and rebuild MathGL."
 msgstr "HDF4 поддержка отключена. Включите ее и пересоберите MathGL."
 
-#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1191
-#: src/data_io.cpp:1193 src/data_io.cpp:1195 src/data_io.cpp:1197
+#: src/complex_io.cpp:924 src/complex_io.cpp:926 src/data_io.cpp:1359
+#: src/data_io.cpp:1361 src/data_io.cpp:1363 src/data_io.cpp:1365
+#: src/data_io.cpp:1367 src/data_io.cpp:1369 src/data_io.cpp:1371
 msgid "HDF5 support was disabled. Please, enable it and rebuild MathGL."
 msgstr "HDF5 поддержка отключена. Включите ее и пересоберите MathGL."
 
@@ -2664,7 +2717,7 @@ msgstr "Ханкель"
 msgid "Hankel transform along direction(s)"
 msgstr "Преобразование Ханкеля по направлению(ям)"
 
-#: src/exec_dat.cpp:1701
+#: src/exec_dat.cpp:1764
 msgid "Hankel transform at some direction"
 msgstr "Преобразование Ханкеля по направлению"
 
@@ -2673,8 +2726,8 @@ msgid "Height of selected cells"
 msgstr "Высота выбранных ячеек"
 
 #: widgets/qt.cpp:1293 udav/help_pnl.cpp:57 udav/udav_wnd.cpp:231
-#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:344 mgllab/mgllab.cpp:345
-#: mgllab/mgllab.cpp:373
+#: udav/udav_wnd.cpp:323 mgllab/mgllab.cpp:335 mgllab/mgllab.cpp:336
+#: mgllab/mgllab.cpp:364
 msgid "Help"
 msgstr "Справка"
 
@@ -2686,7 +2739,7 @@ msgstr ""
 "Здесь можно задать опции команды, \n"
 "которые используются для доп.настройки графика."
 
-#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:313
+#: udav/udav_wnd.cpp:186 mgllab/mgllab.cpp:304
 msgid "Hidden plots"
 msgstr "Скрытые графики"
 
@@ -2698,11 +2751,11 @@ msgstr "Скрыть выделенное"
 msgid "Hide selected plots."
 msgstr "Скрыть выделенные графики"
 
-#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:490
+#: udav/prop_dlg.cpp:173 mgllab/mgllab.cpp:482
 msgid "Highlight current object(s)"
 msgstr "Выделить текущие графики"
 
-#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:346
+#: udav/udav_wnd.cpp:328 mgllab/mgllab.cpp:337
 msgid "Hints"
 msgstr "Подсказки"
 
@@ -2722,7 +2775,7 @@ msgstr "Гиперболические"
 msgid "ID"
 msgstr ""
 
-#: mgllab/mgllab.cpp:348
+#: mgllab/mgllab.cpp:339
 msgid "Icon list"
 msgstr "Список иконок"
 
@@ -2734,11 +2787,11 @@ msgstr "Номер среза в z-направлении"
 msgid "Image size"
 msgstr "Размер рисунка"
 
-#: src/exec_dat.cpp:1724
+#: src/exec_dat.cpp:1789
 msgid "Immediately display the progress of calculation"
 msgstr "Показать прогресс вычислений сразу"
 
-#: src/exec_dat.cpp:1723
+#: src/exec_dat.cpp:1788
 msgid "Immediately print the message"
 msgstr "Напечатать это сообщение сразу же"
 
@@ -2746,7 +2799,7 @@ msgstr "Напечатать это сообщение сразу же"
 msgid "Import Data?"
 msgstr "Импортировать данные?"
 
-#: src/exec_dat.cpp:1704 mgllab/table.cpp:842
+#: src/exec_dat.cpp:1767 mgllab/table.cpp:842
 msgid "Import data from PNG file"
 msgstr "Импортировать данные из PNG файла"
 
@@ -2758,7 +2811,7 @@ msgstr "Импортировать из PNG"
 msgid "In range"
 msgstr "В диапазоне"
 
-#: src/exec_dat.cpp:1699
+#: src/exec_dat.cpp:1762
 msgid "In-place Fourier transform"
 msgstr "Фурье преобразование по месту"
 
@@ -2786,20 +2839,20 @@ msgstr "Увеличить размер шрифта"
 msgid "Info"
 msgstr "Инфо"
 
-#: udav/info_dlg.cpp:55 mgllab/help.cpp:335
+#: udav/info_dlg.cpp:57 mgllab/help.cpp:335
 msgid "Information"
 msgstr "Информация"
 
-#: mgllab/mgllab.cpp:321
+#: mgllab/mgllab.cpp:312
 msgid "Inplot"
 msgstr "Под-график"
 
 #. insert menu
-#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:317
+#: udav/text_pnl.cpp:557 mgllab/mgllab.cpp:308
 msgid "Insert"
 msgstr "Вставить"
 
-#: mgllab/editor.cpp:519
+#: mgllab/editor.cpp:523
 msgid "Insert MGL command"
 msgstr "Вставить команду MGL"
 
@@ -2807,19 +2860,11 @@ msgstr "Вставить команду MGL"
 msgid "Insert as 'list'"
 msgstr "Вставить как 'list'"
 
-#: mgllab/editor.cpp:487
-msgid "Insert file content?"
-msgstr "Вставить содержимое файла?"
-
-#: mgllab/mgllab.cpp:158
-msgid "Insert file name?"
-msgstr "Вставить имя файла?"
-
-#: mgllab/editor.cpp:521
+#: mgllab/editor.cpp:525
 msgid "Insert filename"
 msgstr "Вставить имя файла"
 
-#: mgllab/editor.cpp:523
+#: mgllab/editor.cpp:527
 msgid "Insert inplot command"
 msgstr "Вставить под-график"
 
@@ -2827,7 +2872,7 @@ msgstr "Вставить под-график"
 msgid "Insert last fitted formula with found coefficients."
 msgstr "Вставить последнюю подогнанную формулу с найденными коэффициентами"
 
-#: src/exec_dat.cpp:1706
+#: src/exec_dat.cpp:1769
 msgid "Insert slice of data"
 msgstr "Вставить срез данных"
 
@@ -2839,7 +2884,7 @@ msgstr "Вставить в скрипт как команду 'list'"
 msgid "Integrate"
 msgstr "Интегрировать"
 
-#: src/exec_dat.cpp:1707 udav/dat_pnl.cpp:615
+#: src/exec_dat.cpp:1770 udav/dat_pnl.cpp:615
 msgid "Integrate data along direction(s)"
 msgstr "Интегрировать данные по направлению"
 
@@ -2863,7 +2908,7 @@ msgstr "JPEG поддержка отключена. Включите ее и п
 msgid "Jacobi"
 msgstr "Якоби"
 
-#: src/exec_dat.cpp:1709
+#: src/exec_dat.cpp:1772
 msgid "Join data arrays"
 msgstr "Объединить массивы данных"
 
@@ -2875,6 +2920,10 @@ msgstr "Оставьте пустым для добавления в начал
 msgid "Keep only each n-th element of the data array."
 msgstr "Сохранить каждый n-ый элемент массива данных"
 
+#: src/exec_dat.cpp:1774
+msgid "Keep phase/amplitude along line"
+msgstr "Сохраняет фазу/амплитуду вдоль линии"
+
 #: mgllab/mathgl.cpp:200
 msgid "Keep slides in memory (faster animation but require more memory)"
 msgstr "Хранить кадры в памяти (быстрее анимация, но требуется больше памяти)"
@@ -2901,7 +2950,7 @@ msgstr ""
 " * Прочие -- числа (например, zval);\n"
 " * В скобках [] -- опциональные аргументы."
 
-#: udav/info_dlg.cpp:50
+#: udav/info_dlg.cpp:52
 msgid "Kind of plots: lines for 1D, density for 2D."
 msgstr "Тип графика: кривые для 1D, график плотности для 2D."
 
@@ -2922,7 +2971,7 @@ msgstr "Надпись"
 msgid "Language for UDAV"
 msgstr "Язык для UDAV"
 
-#: mgllab/mgllab.cpp:493
+#: mgllab/mgllab.cpp:486
 msgid "Language for mgllab"
 msgstr "Язык для mgllab"
 
@@ -2963,7 +3012,7 @@ msgstr "Положение источника света должно быть 
 msgid "Light settings"
 msgstr "Настройки освещения"
 
-#: src/exec_dat.cpp:1710
+#: src/exec_dat.cpp:1775
 msgid "Limit data to be inside [-v,v]"
 msgstr "Ограничить данные диапазоном [-v,v]"
 
@@ -2991,7 +3040,7 @@ msgstr "Список доступных данных."
 msgid "Load Data?"
 msgstr "Загрузить данные?"
 
-#: src/exec_set.cpp:821
+#: src/exec_set.cpp:829
 msgid "Load commands from external DLL"
 msgstr "Загрузить команды из внешней DLL"
 
@@ -3011,7 +3060,7 @@ msgstr ""
 "Загрузить данные. Данные будут удалены только\n"
 "при выходе из программы без запроса на сохранение (Ctrl+Shift+O)."
 
-#: src/exec_set.cpp:822
+#: src/exec_set.cpp:830
 msgid "Load fontfaces"
 msgstr "Загрузить шрифт"
 
@@ -3019,7 +3068,7 @@ msgstr "Загрузить шрифт"
 msgid "Load from file"
 msgstr "Загрузить из файла"
 
-#: src/exec_prm.cpp:626
+#: src/exec_prm.cpp:630
 msgid "Load image for background"
 msgstr "Загрузить фоновое изображение"
 
@@ -3048,7 +3097,7 @@ msgstr "Нижняя граница для цвета или прозрачно
 msgid "M - purple"
 msgstr "M - пурпурный"
 
-#: src/parser.cpp:1074
+#: src/parser.cpp:1083
 msgid "MGL Parser"
 msgstr "MGL парсер"
 
@@ -3056,11 +3105,11 @@ msgstr "MGL парсер"
 msgid "MGL commands for selected group"
 msgstr "Команда MGL для выбранной группы"
 
-#: mgllab/mgllab.cpp:229
+#: mgllab/mgllab.cpp:220
 msgid "MGL files \t*.mgl"
 msgstr "MGL файлы \t*.mgl"
 
-#: mgllab/mgllab.cpp:182
+#: mgllab/mgllab.cpp:173
 msgid ""
 "MGL files \t*.mgl\n"
 "DAT files \t*.{dat,csv}"
@@ -3128,7 +3177,7 @@ msgstr "Штриховка вручную"
 msgid "Manual mask"
 msgstr "Маска вручную"
 
-#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:323
+#: udav/text_pnl.cpp:591 mgllab/mgllab.cpp:314
 msgid "Manual primitives"
 msgstr "Примитивы вручную"
 
@@ -3156,7 +3205,7 @@ msgstr "Угол поворота маски"
 msgid "Mask size"
 msgstr "Размер маски"
 
-#: udav/find_dlg.cpp:42 mgllab/editor.cpp:563
+#: udav/find_dlg.cpp:42 mgllab/editor.cpp:567
 msgid "Match case"
 msgstr "Учитывать регистр"
 
@@ -3164,7 +3213,7 @@ msgstr "Учитывать регистр"
 msgid "MathGL - about"
 msgstr "MathGL - о программе"
 
-#: src/base.cpp:265
+#: src/base.cpp:276
 #, c-format
 msgid "MathGL message - %s\n"
 msgstr "Сообщение MathGL - %s\n"
@@ -3205,7 +3254,7 @@ msgstr "Максимум Y для обрезания или координат"
 msgid "Maximal value of Z for cutting or for coordinate filling"
 msgstr "Максимум Z для обрезания или координат"
 
-#: src/data.cpp:1480
+#: src/data.cpp:1549
 #, c-format
 msgid "Maximum is %g\t at x = %ld\ty = %ld\tz = %ld\n"
 msgstr "Максимум %g\t при x = %ld\ty = %ld\tz = %ld\n"
@@ -3214,7 +3263,7 @@ msgstr "Максимум %g\t при x = %ld\ty = %ld\tz = %ld\n"
 msgid "Maximum of"
 msgstr "Максимум от"
 
-#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:375
+#: udav/mem_pnl.cpp:68 udav/mem_pnl.cpp:73 mgllab/mgllab.cpp:366
 msgid "Memory"
 msgstr "Память"
 
@@ -3226,7 +3275,7 @@ msgstr "Число линий"
 msgid "MeshNum"
 msgstr "Число линий"
 
-#: mgllab/mgllab.cpp:342
+#: mgllab/mgllab.cpp:333
 msgid "Messages"
 msgstr "Сообщения"
 
@@ -3262,7 +3311,7 @@ msgstr "Минимум Y для обрезания или координат"
 msgid "Minimal value of Z for cutting or for coordinate filling"
 msgstr "Минимум Z для обрезания или координат"
 
-#: src/data.cpp:1483
+#: src/data.cpp:1552
 #, c-format
 msgid "Minimum is %g\t at x = %ld\ty = %ld\tz = %ld\n"
 msgstr "Минимум %g\t при x = %ld\ty = %ld\tz = %ld\n"
@@ -3280,11 +3329,11 @@ msgstr "Отразить"
 msgid "Mirror data along direction(s)"
 msgstr "Отразить данные по направлению"
 
-#: src/exec_dat.cpp:1713
+#: src/exec_dat.cpp:1778
 msgid "Mirror data at some direction"
 msgstr "Отразить данные по направлению"
 
-#: src/exec_dat.cpp:1714
+#: src/exec_dat.cpp:1779
 msgid "Modify data values by formula"
 msgstr "Изменить данные по формуле"
 
@@ -3356,7 +3405,7 @@ msgstr "Сдвиг вверх"
 msgid "Multiply by"
 msgstr "Умножить на"
 
-#: src/exec_dat.cpp:1716
+#: src/exec_dat.cpp:1781
 msgid "Multiply by data or number"
 msgstr "Умножить на массив данных или число"
 
@@ -3407,7 +3456,7 @@ msgstr "Новый под-график"
 msgid "New order of dimensions"
 msgstr "Новый порядок размерностей"
 
-#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:293
+#: udav/udav_wnd.cpp:282 mgllab/mgllab.cpp:284
 msgid "New script"
 msgstr "Новый скрипт"
 
@@ -3439,7 +3488,7 @@ msgstr "Следующий срез"
 msgid "Next slide"
 msgstr "Следующий кадр"
 
-#: mgllab/help.cpp:135 mgllab/mgllab.cpp:242
+#: mgllab/help.cpp:135 mgllab/mgllab.cpp:233
 msgid "No"
 msgstr "Нет"
 
@@ -3462,7 +3511,7 @@ msgstr "Не введено направление/формула"
 msgid "No filename."
 msgstr "Отсутствует имя файла."
 
-#: mgllab/editor.cpp:585 mgllab/editor.cpp:607 mgllab/editor.cpp:632
+#: mgllab/editor.cpp:589 mgllab/editor.cpp:611 mgllab/editor.cpp:636
 #, c-format
 msgid "No occurrences of '%s' found!"
 msgstr "Вхождения '%s' не найдены!"
@@ -3479,7 +3528,7 @@ msgstr "Вхождения не найдены"
 msgid "No text rotation"
 msgstr "Не вращать текст"
 
-#: widgets/fltk.cpp:838
+#: widgets/fltk.cpp:844
 msgid "Normal view"
 msgstr "Обычный вид"
 
@@ -3487,11 +3536,11 @@ msgstr "Обычный вид"
 msgid "Normalize"
 msgstr "Нормировать"
 
-#: src/exec_dat.cpp:1718
+#: src/exec_dat.cpp:1783
 msgid "Normalize data"
 msgstr "Нормировать данные"
 
-#: src/exec_dat.cpp:1719
+#: src/exec_dat.cpp:1784
 msgid "Normalize data slice by slice"
 msgstr "Нормировать данные по срезам"
 
@@ -3519,11 +3568,11 @@ msgstr "Численный параметр"
 msgid "Numeric value"
 msgstr "Численное значение"
 
-#: src/exec_dat.cpp:1683
+#: src/exec_dat.cpp:1745
 msgid "Numerically differentiate data"
 msgstr "Численно дифференцировать данные"
 
-#: src/exec_dat.cpp:1684
+#: src/exec_dat.cpp:1746
 msgid "Numerically double differentiate data"
 msgstr "Численно дифференцировать данные дважды"
 
@@ -3550,7 +3599,7 @@ msgstr "OBJ"
 #: udav/data_dlg.cpp:92 udav/subplot_dlg.cpp:221 mgllab/mathgl.cpp:198
 #: mgllab/dialogs.cpp:121 mgllab/dialogs.cpp:165 mgllab/dialogs.cpp:411
 #: mgllab/dialogs.cpp:585 mgllab/dialogs.cpp:750 mgllab/dialogs.cpp:1072
-#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:498
+#: mgllab/dialogs.cpp:1319 mgllab/dialogs.cpp:1474 mgllab/mgllab.cpp:491
 #: mgllab/table.cpp:621
 msgid "OK"
 msgstr "OK"
@@ -3559,11 +3608,11 @@ msgstr "OK"
 msgid "Only current slice will be inserted"
 msgstr "Только текущий срез будет вставлен"
 
-#: mgllab/mgllab.cpp:181
+#: mgllab/mgllab.cpp:172
 msgid "Open File?"
 msgstr "Открыть файл?"
 
-#: src/exec_dat.cpp:1721
+#: src/exec_dat.cpp:1786
 msgid "Open all data arrays from HDF file"
 msgstr "Загрузить все данные из HDF файла"
 
@@ -3583,7 +3632,7 @@ msgstr "Открыть диалог создания новых данных."
 msgid "Open file"
 msgstr "Открыть файл"
 
-#: mgllab/mgllab.cpp:294
+#: mgllab/mgllab.cpp:285
 msgid "Open file ..."
 msgstr "Открыть файл ..."
 
@@ -3591,7 +3640,7 @@ msgstr "Открыть файл ..."
 msgid "Open printer dialog and print graphics (Ctrl+P)"
 msgstr "Открыть диалог и напечатать график (CTRl+P)"
 
-#: mgllab/editor.cpp:507
+#: mgllab/editor.cpp:511
 msgid "Open script or data file"
 msgstr "Загрузить скрипт или файл данных"
 
@@ -3612,7 +3661,7 @@ msgid "Operations"
 msgstr "Операции"
 
 #: udav/prop_dlg.cpp:91 udav/newcmd_dlg.cpp:72 mgllab/dialogs.cpp:746
-#: mgllab/mgllab.cpp:325
+#: mgllab/mgllab.cpp:316
 msgid "Options"
 msgstr "Опции"
 
@@ -3653,7 +3702,7 @@ msgstr ""
 msgid "PNG Files \t*.png"
 msgstr "PNG файлы \t*.png"
 
-#: src/canvas_cf.cpp:495 src/canvas_cf.cpp:497 src/data_png.cpp:118
+#: src/canvas_cf.cpp:546 src/canvas_cf.cpp:548 src/data_png.cpp:118
 #: src/export.cpp:75 src/export.cpp:109
 msgid "PNG support was disabled. Please, enable it and rebuild MathGL."
 msgstr "PNG поддержка отключена. Включите ее и пересоберите MathGL."
@@ -3678,11 +3727,11 @@ msgstr "Вставить данные"
 msgid "Paste range of numbers from clipboard (Ctrl+Shift+P)."
 msgstr "Вставить диапазон значений из буфера обмена (Ctrl+Shift+P)."
 
-#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:311
+#: udav/text_pnl.cpp:538 mgllab/mgllab.cpp:302
 msgid "Paste text"
 msgstr "Вставить текст"
 
-#: mgllab/editor.cpp:514
+#: mgllab/editor.cpp:518
 msgid "Paste text from clipboard"
 msgstr "Вставить текст из буфера обмена"
 
@@ -3690,11 +3739,11 @@ msgstr "Вставить текст из буфера обмена"
 msgid "Paste text or data from clipboard (Ctrl+V)."
 msgstr "Вставить текст из буфера обмена (Ctrl+V)."
 
-#: mgllab/mgllab.cpp:484
+#: mgllab/mgllab.cpp:476
 msgid "Path for MathGL font (without extension)"
 msgstr "Путь к шрифтам MathGL (без расширения)"
 
-#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:481
+#: udav/prop_dlg.cpp:110 mgllab/mgllab.cpp:473
 msgid "Path for help files"
 msgstr "Путь к файлам справки"
 
@@ -3707,15 +3756,15 @@ msgid "Pause calculation"
 msgstr "Пауза вычислений"
 
 #. Wnd->connect(a, SIGNAL(triggered()), QMGL, SLOT(setPause()));
-#: widgets/fltk.cpp:921 widgets/qt.cpp:1287
+#: widgets/fltk.cpp:927 widgets/qt.cpp:1287
 msgid "Pause on/off external calculations"
 msgstr "Пауза вкл/выкл для внешних вычислений"
 
-#: src/exec_dat.cpp:1738
+#: src/exec_dat.cpp:1804
 msgid "Perform Runge-Kutta step"
 msgstr "Выполнить шаг Рунге-Кутта"
 
-#: widgets/fltk.cpp:890
+#: widgets/fltk.cpp:896
 msgid "Phi angle (rotate in x*y plane)"
 msgstr "Угол Phi (вращать в плоскости x*y)"
 
@@ -3727,7 +3776,7 @@ msgstr "Поместить редактор сверху"
 msgid "Plot ID"
 msgstr "ID графика"
 
-#: src/exec_prm.cpp:643
+#: src/exec_prm.cpp:647
 msgid "Plot curve by formula"
 msgstr "Построить кривую по формуле"
 
@@ -3748,15 +3797,15 @@ msgstr ""
 "Нарисовать данные в новом окне.\n"
 "Вы можете выбрать тип графика, его стиль и т.д."
 
-#: mgllab/mgllab.cpp:340
+#: mgllab/mgllab.cpp:331
 msgid "Plot setup"
 msgstr "Настройки графика"
 
-#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:324
+#: udav/text_pnl.cpp:571 mgllab/dialogs.cpp:312 mgllab/mgllab.cpp:315
 msgid "Plot style"
 msgstr "Стиль графика"
 
-#: src/exec_prm.cpp:644
+#: src/exec_prm.cpp:648
 msgid "Plot surface by formula"
 msgstr "Построить поверхность по формуле"
 
@@ -3776,11 +3825,11 @@ msgstr "Предыдущий срез"
 msgid "Prev slide"
 msgstr "Предыдущий кадр"
 
-#: udav/info_dlg.cpp:51
+#: udav/info_dlg.cpp:53
 msgid "Preview"
 msgstr "Просмотр"
 
-#: mgllab/mgllab.cpp:581
+#: mgllab/mgllab.cpp:576
 msgid "Previous expressions"
 msgstr "Предыдущее выражение"
 
@@ -3792,15 +3841,15 @@ msgstr "Примитивы"
 msgid "Primitives ..."
 msgstr "Примитивы ..."
 
-#: src/exec_set.cpp:854
+#: src/exec_set.cpp:863
 msgid "Print MathGL version or check if it is valid"
 msgstr "Вывести версию MathGL или проверить, что она подходит"
 
-#: src/exec_dat.cpp:1688
+#: src/exec_dat.cpp:1750
 msgid "Print content of the data"
 msgstr "Вывести содержимое массива данных"
 
-#: src/exec_dat.cpp:1727
+#: src/exec_dat.cpp:1792
 msgid "Print fitted formula"
 msgstr "Вывести подобранную формулу"
 
@@ -3808,15 +3857,15 @@ msgstr "Вывести подобранную формулу"
 msgid "Print graphics"
 msgstr "Напечатать график"
 
-#: src/exec_dat.cpp:1680
+#: src/exec_dat.cpp:1742
 msgid "Print list of data names in HDF file"
 msgstr "Вывести список имен переменных в HDF файле"
 
-#: src/exec_dat.cpp:1705
+#: src/exec_dat.cpp:1768
 msgid "Print message or information about the data"
 msgstr "Вывести сообщение или информацию о данных"
 
-#: mgllab/mgllab.cpp:297
+#: mgllab/mgllab.cpp:288
 msgid "Print plot"
 msgstr "Напечатать график"
 
@@ -3824,7 +3873,7 @@ msgstr "Напечатать график"
 msgid "Print script"
 msgstr "Напечатать скрипт"
 
-#: src/exec_prm.cpp:641
+#: src/exec_prm.cpp:645
 msgid "Print string from file"
 msgstr "Вывести строку в файл"
 
@@ -3844,11 +3893,11 @@ msgstr "Печатаю ..."
 msgid "Program flow"
 msgstr "Команды управления"
 
-#: src/exec_dat.cpp:1669
+#: src/exec_dat.cpp:1731
 msgid "Project periodical data in [v1,v2]"
 msgstr "Проецирует периодические данные в [v1,v2]"
 
-#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:337 mgllab/mgllab.cpp:476
+#: udav/udav_wnd.cpp:312 mgllab/mgllab.cpp:328 mgllab/mgllab.cpp:468
 msgid "Properties"
 msgstr "Свойства"
 
@@ -3860,7 +3909,7 @@ msgstr "Свойства выбранного массива данных"
 msgid "Pulse prop."
 msgstr "Свойства импульса"
 
-#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:615
+#: udav/calc_dlg.cpp:127 mgllab/mgllab.cpp:610
 msgid "Put function"
 msgstr "Поместить"
 
@@ -3876,7 +3925,7 @@ msgstr "Поместить в этот массив данных"
 msgid "Put to script"
 msgstr "В скрипт"
 
-#: src/exec_dat.cpp:1726
+#: src/exec_dat.cpp:1791
 msgid "Put value (numeric or array) to given data element"
 msgstr "Поместить число или массив в заданный элемент данных"
 
@@ -3894,35 +3943,40 @@ msgstr "Выход"
 msgid "R - maroon"
 msgstr "R - темно-красный"
 
-#: src/exec_set.cpp:835
+#: src/exec_set.cpp:843
 msgid "Rasterize plot and save to background"
 msgstr "Растеризовать график и установить вместо фона"
 
-#: src/exec_dat.cpp:1732
+#: src/exec_dat.cpp:1797
 msgid "Read and join data from several files"
 msgstr "Загрузить и объединить данные из нескольких файлов"
 
-#: src/exec_dat.cpp:1731
+#: src/exec_dat.cpp:1798
+#, fuzzy
+msgid "Read data from binary file of specified type"
+msgstr "Загрузить данные из файла с размерами из первой строки"
+
+#: src/exec_dat.cpp:1796
 msgid "Read data from file"
 msgstr "Загрузить данные из файла"
 
-#: src/exec_dat.cpp:1734
+#: src/exec_dat.cpp:1800
 msgid "Read data from file with sizes specified in first row"
 msgstr "Загрузить данные из файла с размерами из первой строки"
 
-#: src/exec_dat.cpp:1733
+#: src/exec_dat.cpp:1799
 msgid "Read data with name 'id' from HDF file"
 msgstr "Загрузить данные с именем 'id' из HDF файла"
 
-#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:382
+#: udav/udav_wnd.cpp:268 mgllab/mgllab.cpp:373
 msgid "Ready"
 msgstr "Готов"
 
-#: src/exec_dat.cpp:1735
+#: src/exec_dat.cpp:1801
 msgid "Rearrange data dimensions"
 msgstr "Упорядочить размерности массива данных"
 
-#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:298
+#: udav/udav_wnd.cpp:301 mgllab/mgllab.cpp:289
 msgid "Recent files"
 msgstr "Последние файлы"
 
@@ -3946,7 +4000,7 @@ msgstr "Перерисовать"
 msgid "Redraw picture for $0 equal to"
 msgstr "Перерисовать для $0 равного"
 
-#: widgets/fltk.cpp:839
+#: widgets/fltk.cpp:845
 msgid "Redraw plot"
 msgstr "Перерисовать график"
 
@@ -3954,7 +4008,7 @@ msgstr "Перерисовать график"
 msgid "Refresh"
 msgstr "Обновить"
 
-#: widgets/fltk.cpp:873
+#: widgets/fltk.cpp:879
 msgid "Refresh the picture"
 msgstr "Обновить рисунок"
 
@@ -3966,31 +4020,31 @@ msgstr "Положение i-го цвета"
 msgid "Reload"
 msgstr "Перезагрузить"
 
-#: widgets/fltk.cpp:841
+#: widgets/fltk.cpp:847
 msgid "Reload data"
 msgstr "Перезагрузить"
 
-#: widgets/fltk.cpp:879
+#: widgets/fltk.cpp:885
 msgid "Reload data and refresh the picture"
 msgstr "Перезагрузить данные и обновить рисунок"
 
-#: src/exec_dat.cpp:1668
+#: src/exec_dat.cpp:1730
 msgid "Remove duplicate rows"
 msgstr "Удалить одинаковые строки"
 
-#: src/exec_dat.cpp:1745
+#: src/exec_dat.cpp:1811
 msgid "Remove jump into the data, like phase jumps"
 msgstr "Убрать скачки данных, например скачки фазы"
 
-#: udav/find_dlg.cpp:50 mgllab/editor.cpp:562
+#: udav/find_dlg.cpp:50 mgllab/editor.cpp:566
 msgid "Replace"
 msgstr "Заменить"
 
-#: mgllab/editor.cpp:565
+#: mgllab/editor.cpp:569
 msgid "Replace all"
 msgstr "Заменить все"
 
-#: udav/find_dlg.cpp:39 mgllab/editor.cpp:561
+#: udav/find_dlg.cpp:39 mgllab/editor.cpp:565
 msgid "Replace by:"
 msgstr "Заменить на:"
 
@@ -3998,7 +4052,7 @@ msgstr "Заменить на:"
 msgid "Replace expression by its numerical value."
 msgstr "Заменить выражение на его числовое значение."
 
-#: mgllab/editor.cpp:631
+#: mgllab/editor.cpp:635
 #, c-format
 msgid "Replaced %ld occurrences."
 msgstr "Заменено %ld вхождений."
@@ -4032,7 +4086,7 @@ msgstr "Оставить место для подписей справа (сти
 msgid "Reserve space for labels at top side (style '^')"
 msgstr "Оставить место для подписей сверху (стиль '^')"
 
-#: src/exec_set.cpp:836
+#: src/exec_set.cpp:844
 msgid "Reset settings and clear picture"
 msgstr "Сбросить настройки и обновить рисунок"
 
@@ -4044,7 +4098,7 @@ msgstr "Изменить размер"
 msgid "Resize (interpolate) the data to specified sizes (Ctrl+Shift+R)."
 msgstr "Изменить размер (интерполоировать) данных (Ctrl+Shift+R)."
 
-#: src/exec_dat.cpp:1737
+#: src/exec_dat.cpp:1803
 msgid "Resize data array"
 msgstr "Изменить размер массива данных"
 
@@ -4056,7 +4110,7 @@ msgstr "Изменить размер массива данных со сгла
 msgid "Restore"
 msgstr "Восстановить"
 
-#: widgets/fltk.cpp:870
+#: widgets/fltk.cpp:876
 msgid "Restore default graphics rotation, zoom and perspective"
 msgstr "Восстановить вращение, приближение и перспективу графика"
 
@@ -4085,7 +4139,7 @@ msgstr "Результат (будет иметь размеры "
 msgid "Resulting string"
 msgstr "Итоговая строка"
 
-#: src/parser.cpp:1497
+#: src/parser.cpp:1506
 msgid "Return from function"
 msgstr "Возврат из функции"
 
@@ -4101,7 +4155,7 @@ msgstr "Правый верхний угол"
 msgid "Roll"
 msgstr "Сдвинуть"
 
-#: src/exec_dat.cpp:1739
+#: src/exec_dat.cpp:1805
 msgid "Roll data along direction(s)"
 msgstr "Сдвинуть данные по направлению"
 
@@ -4126,11 +4180,11 @@ msgstr "Вращать влево"
 msgid "Rotate on"
 msgstr "Поворот"
 
-#: widgets/fltk.cpp:866
+#: widgets/fltk.cpp:872
 msgid "Rotate picture by holding left mouse button"
 msgstr "Вращать рисунок при удержании кнопок мыши"
 
-#: src/exec_set.cpp:837
+#: src/exec_set.cpp:845
 msgid "Rotate plot"
 msgstr "Вращать график"
 
@@ -4158,7 +4212,7 @@ msgstr ""
 "Запустить анимацию (CTRl+F5). Если ее параметры\n"
 "не заданы, то будет показан диалог настройки."
 
-#: widgets/fltk.cpp:912
+#: widgets/fltk.cpp:918
 msgid "Run/Stop slideshow (graphics animation)"
 msgstr "Запустить/остановить анимацию"
 
@@ -4178,7 +4232,7 @@ msgstr ""
 msgid "Saturation"
 msgstr "Насыщенность"
 
-#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:282
+#: udav/setup_dlg.cpp:143 mgllab/editor.cpp:286
 msgid "Save"
 msgstr "Сохранить"
 
@@ -4186,7 +4240,7 @@ msgstr "Сохранить"
 msgid "Save Data?"
 msgstr "Сохранить данные?"
 
-#: widgets/fltk.cpp:595 mgllab/mgllab.cpp:229
+#: widgets/fltk.cpp:601 mgllab/mgllab.cpp:220
 msgid "Save File As?"
 msgstr "Сохранить файл?"
 
@@ -4194,7 +4248,7 @@ msgstr "Сохранить файл?"
 msgid "Save JPEG frames"
 msgstr "Сохранить кадры в JPEG"
 
-#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:296
+#: udav/udav_wnd.cpp:290 mgllab/mgllab.cpp:287
 msgid "Save as ..."
 msgstr "Сохранить как ..."
 
@@ -4202,7 +4256,7 @@ msgstr "Сохранить как ..."
 msgid "Save data"
 msgstr "Сохранить данные"
 
-#: src/exec_dat.cpp:1742
+#: src/exec_dat.cpp:1808
 msgid "Save data to HDF5 file"
 msgstr "Сохранить данные в HDF5 файл"
 
@@ -4210,15 +4264,15 @@ msgstr "Сохранить данные в HDF5 файл"
 msgid "Save data to a file (Ctrl+Shift+S)."
 msgstr "Сохранить данные в файл (Ctrl+Shift+S)."
 
-#: src/exec_dat.cpp:1741 mgllab/table.cpp:844
+#: src/exec_dat.cpp:1807 mgllab/table.cpp:844
 msgid "Save data to file"
 msgstr "Сохранить данные в файл"
 
-#: mgllab/mgllab.cpp:295
+#: mgllab/mgllab.cpp:286
 msgid "Save file"
 msgstr "Сохранить файл"
 
-#: mgllab/mgllab.cpp:488
+#: mgllab/mgllab.cpp:480
 msgid "Save file before redrawing"
 msgstr "Сохранить файл перед рисованием"
 
@@ -4230,7 +4284,7 @@ msgstr "Сохранить скрипт"
 msgid "Save script to a file (Ctrl+S)"
 msgstr "Сохранить скрипт в файл (Ctrl+S)"
 
-#: mgllab/editor.cpp:509
+#: mgllab/editor.cpp:513
 msgid "Save script to file"
 msgstr "Сохранить скрипт в файл"
 
@@ -4254,11 +4308,11 @@ msgstr "Масштаб и вращение"
 msgid "Script"
 msgstr "Скрипт"
 
-#: udav/find_dlg.cpp:43 mgllab/editor.cpp:564
+#: udav/find_dlg.cpp:43 mgllab/editor.cpp:568
 msgid "Search backward"
 msgstr "Искать назад"
 
-#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:312
+#: udav/text_pnl.cpp:543 mgllab/mgllab.cpp:303
 msgid "Select all"
 msgstr "Выделить все"
 
@@ -4278,7 +4332,7 @@ msgstr "Выбрать данные"
 msgid "Select direction"
 msgstr "Выбрать направление"
 
-#: mgllab/editor.cpp:654
+#: mgllab/editor.cpp:658
 msgid "Select file name"
 msgstr "Выбрать имя файла"
 
@@ -4286,7 +4340,7 @@ msgstr "Выбрать имя файла"
 msgid "Select first the proper kind of arguments"
 msgstr "Сначала выберите вариант аргументов"
 
-#: mgllab/editor.cpp:667
+#: mgllab/editor.cpp:671
 msgid "Select folder name"
 msgstr "Выбрать путь к папке"
 
@@ -4294,7 +4348,7 @@ msgstr "Выбрать путь к папке"
 msgid "Select kind of plot"
 msgstr "Выбрать тип графика"
 
-#: src/exec_set.cpp:853
+#: src/exec_set.cpp:862
 msgid "Select variant of plot style(s)"
 msgstr "Выбрать вариант стиля графика"
 
@@ -4302,55 +4356,55 @@ msgstr "Выбрать вариант стиля графика"
 msgid "Set"
 msgstr "Задать"
 
-#: src/exec_set.cpp:849
+#: src/exec_set.cpp:858
 msgid "Set additional tick and axis labels shift"
 msgstr "Задает дополнительный сдвиш меток осей"
 
-#: src/exec_set.cpp:797
+#: src/exec_set.cpp:805
 msgid "Set ambient light brightness"
 msgstr "Задает яркость фонового освещения"
 
-#: src/exec_set.cpp:818
+#: src/exec_set.cpp:826
 msgid "Set arbitrary position of plot in picture"
 msgstr "Задать произвольную область рисования внутри рисунка"
 
-#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:338
+#: udav/udav_wnd.cpp:315 mgllab/mgllab.cpp:329
 msgid "Set arguments"
 msgstr "Задать аргументы"
 
-#: src/exec_set.cpp:799
+#: src/exec_set.cpp:807
 msgid "Set aspect ration"
 msgstr "Задать соотношение сторон"
 
-#: src/exec_set.cpp:801
+#: src/exec_set.cpp:809
 msgid "Set axis and tick style"
 msgstr "Задать стиль осей и меток"
 
-#: src/exec_set.cpp:827
+#: src/exec_set.cpp:835
 msgid "Set axis origin"
 msgstr "Задать начало координат"
 
-#: src/exec_set.cpp:834
+#: src/exec_set.cpp:842
 msgid "Set axis ranges"
 msgstr "Задать диапазон осей"
 
-#: src/exec_set.cpp:842
+#: src/exec_set.cpp:850
 msgid "Set bit-flags (for advanced users only)"
 msgstr "Задает битовый флаг (для опытных пользователей)"
 
-#: src/exec_set.cpp:803
+#: src/exec_set.cpp:811
 msgid "Set bounding box for 2d export"
 msgstr "Задать границы для 2d экспорта"
 
-#: src/exec_set.cpp:824
+#: src/exec_set.cpp:832
 msgid "Set brush for given mask id"
 msgstr "Задать кисть для маски с выбранным id"
 
-#: src/exec_set.cpp:808
+#: src/exec_set.cpp:816
 msgid "Set color range"
 msgstr "Задать диапазон цвета"
 
-#: src/exec_dat.cpp:1703
+#: src/exec_dat.cpp:1766
 msgid "Set column id for data"
 msgstr "Задать id колонок данных"
 
@@ -4362,23 +4416,23 @@ msgstr "Вкл/выкл обрезание для конкретного гра
 msgid "Set data sizes manually"
 msgstr "Задать размеры данных вручную"
 
-#: src/exec_set.cpp:802
+#: src/exec_set.cpp:810
 msgid "Set default bars width"
 msgstr "Задать размер полос по умолчанию"
 
-#: src/exec_set.cpp:832
+#: src/exec_set.cpp:840
 msgid "Set default filename"
 msgstr "Задать имя файла по умолчанию"
 
-#: src/exec_set.cpp:796
+#: src/exec_set.cpp:804
 msgid "Set default transparency"
 msgstr "Задать прозрачность по умолчанию"
 
-#: src/exec_set.cpp:811
+#: src/exec_set.cpp:819
 msgid "Set diffusive light brightness"
 msgstr "Задать яркость рассеянного света"
 
-#: src/exec_set.cpp:812
+#: src/exec_set.cpp:820
 msgid "Set draw region for quality&4"
 msgstr "Задать область рисования при quality&4"
 
@@ -4402,75 +4456,75 @@ msgstr "Задать область рисования как ячейку бр
 msgid "Set lighting off/on for particular plot"
 msgstr "Вкл/выкл освещение отдельного графика"
 
-#: src/exec_set.cpp:825
+#: src/exec_set.cpp:833
 msgid "Set number of lines in mesh/fall/vect and so on"
 msgstr "Задать примерное число линий в mesh/fall/vect ..."
 
-#: src/exec_set.cpp:819
+#: src/exec_set.cpp:827
 msgid "Set number of marks in the legend"
 msgstr "Задать число маркеров в легенде"
 
-#: src/exec_set.cpp:813
+#: src/exec_set.cpp:821
 msgid "Set number of visible faces"
 msgstr "Задать число видимых граней"
 
-#: src/exec_set.cpp:829
+#: src/exec_set.cpp:837
 msgid "Set palette for 1D plots"
 msgstr "Задать палитру для 1D графиков"
 
-#: src/exec_set.cpp:831
+#: src/exec_set.cpp:839
 msgid "Set perspective"
 msgstr "Задать перспективу"
 
-#: src/exec_set.cpp:840
+#: src/exec_set.cpp:848
 msgid "Set picture size"
 msgstr "Задать размер рисунка"
 
-#: src/exec_set.cpp:833
+#: src/exec_set.cpp:841
 msgid "Set plot quality"
 msgstr "Задать качество рисования картинки"
 
-#: src/exec_set.cpp:846
+#: src/exec_set.cpp:854
 msgid "Set position of plot as cell of matrix"
 msgstr "Задать область рисования как ячейку матрицы"
 
-#: src/exec_set.cpp:826
+#: src/exec_set.cpp:834
 msgid "Set position of plot block in matrix"
 msgstr "Задать область рисования как блок в матрице"
 
-#: src/exec_set.cpp:807
+#: src/exec_set.cpp:815
 msgid "Set position of plot inside cell of column"
 msgstr "Задать область рисования как ячейку колонки"
 
-#: src/exec_set.cpp:817
+#: src/exec_set.cpp:825
 msgid "Set position of plot inside cell of matrix"
 msgstr "Задать область рисования внутри ячейки колонки"
 
-#: src/exec_set.cpp:845
+#: src/exec_set.cpp:853
 msgid "Set position of plot inside cell of rotated stick"
 msgstr "Задать область рисования как ячейку повернутого бруска"
 
-#: src/exec_set.cpp:844
+#: src/exec_set.cpp:852
 msgid "Set position of plot inside cell of sheared stick"
 msgstr "Задать область рисования как ячейку наклоненной колонки"
 
-#: src/exec_set.cpp:857
+#: src/exec_set.cpp:866
 msgid "Set range for x-axis"
 msgstr "Задать диапазон по x"
 
-#: src/exec_set.cpp:859
+#: src/exec_set.cpp:868
 msgid "Set range for y-axis"
 msgstr "Задать диапазон по y"
 
-#: src/exec_set.cpp:863
+#: src/exec_set.cpp:872
 msgid "Set range for z-axis"
 msgstr "Задать диапазон по z"
 
-#: src/exec_set.cpp:839
+#: src/exec_set.cpp:847
 msgid "Set scale text in relative subplots too"
 msgstr "Задает масштабирование текста в отн.подграфиках"
 
-#: src/exec_set.cpp:841
+#: src/exec_set.cpp:849
 msgid "Set scaling factor for further setsize"
 msgstr "Задать множитель для всех 'setsize'"
 
@@ -4482,51 +4536,51 @@ msgstr "Задать аргументы скрипта"
 msgid "Set size for text, marks and others"
 msgstr "Задать размер текста, маркеров и пр."
 
-#: src/exec_set.cpp:798
+#: src/exec_set.cpp:806
 msgid "Set size of arrows"
 msgstr "Задать размер стрелок"
 
-#: src/exec_set.cpp:823
+#: src/exec_set.cpp:831
 msgid "Set size of markers"
 msgstr "Задать размер маркеров"
 
-#: src/exec_set.cpp:830
+#: src/exec_set.cpp:838
 msgid "Set size of semi-transparent area around line"
 msgstr "Задать размер полупрозрачной области около линии"
 
-#: src/exec_set.cpp:828
+#: src/exec_set.cpp:836
 msgid "Set tick labels drawing at origin"
 msgstr "Разрешить вывод меток осей в начале координат"
 
-#: src/exec_set.cpp:848
+#: src/exec_set.cpp:857
 msgid "Set tick length"
 msgstr "Задать длину меток осей"
 
-#: src/exec_set.cpp:809
+#: src/exec_set.cpp:817
 msgid "Set ticks for colorbar"
 msgstr "Задать метки для цветовой шкалы"
 
-#: src/exec_set.cpp:858
+#: src/exec_set.cpp:867
 msgid "Set ticks for x-axis"
 msgstr "Задать метки для оси x"
 
-#: src/exec_set.cpp:860
+#: src/exec_set.cpp:869
 msgid "Set ticks for y-axis"
 msgstr "Задать метки для оси y"
 
-#: src/exec_set.cpp:864
+#: src/exec_set.cpp:873
 msgid "Set ticks for z-axis"
 msgstr "Задать метки для оси z"
 
-#: src/exec_set.cpp:850
+#: src/exec_set.cpp:859
 msgid "Set ticks in time format"
 msgstr "Задать метки в формате времени"
 
-#: src/exec_set.cpp:852
+#: src/exec_set.cpp:861
 msgid "Set ticks tuning"
 msgstr "Включить оптимизацию меток осей"
 
-#: src/exec_set.cpp:838
+#: src/exec_set.cpp:846
 msgid "Set to auto rotate text or not"
 msgstr "Разрешить поворот текста"
 
@@ -4534,7 +4588,7 @@ msgstr "Разрешить поворот текста"
 msgid "Set to use whole area (style '#')"
 msgstr "Задать использование всей области (стиль '#')"
 
-#: src/exec_set.cpp:851
+#: src/exec_set.cpp:860
 msgid "Set type transparency"
 msgstr "Задать тип прозрачности"
 
@@ -4566,11 +4620,11 @@ msgstr ""
 msgid "Settings"
 msgstr "Настройки"
 
-#: mgllab/mgllab.cpp:336
+#: mgllab/mgllab.cpp:327
 msgid "Setup"
 msgstr "Настройки"
 
-#: mgllab/mgllab.cpp:339
+#: mgllab/mgllab.cpp:330
 msgid "Setup animation"
 msgstr "Настроить анимацию"
 
@@ -4578,19 +4632,19 @@ msgstr "Настроить анимацию"
 msgid "Setup colors for:"
 msgstr "Настроить цвета:"
 
-#: src/exec_set.cpp:815
+#: src/exec_set.cpp:823
 msgid "Setup font"
 msgstr "Настроить шрифт"
 
-#: src/exec_set.cpp:820
+#: src/exec_set.cpp:828
 msgid "Setup light"
 msgstr "Настроить освещение"
 
-#: src/exec_prm.cpp:625
+#: src/exec_prm.cpp:629
 msgid "Setup or draw axis"
 msgstr "Настроить или нарисовать оси"
 
-#: src/exec_set.cpp:810
+#: src/exec_set.cpp:818
 msgid "Setup plot points cutting"
 msgstr "Настроить обрезание точек графика"
 
@@ -4614,23 +4668,23 @@ msgstr "Сшить фазу"
 msgid "Sharp colors"
 msgstr "Контрастные"
 
-#: src/exec_set.cpp:843
+#: src/exec_set.cpp:851
 msgid "Shear plot"
 msgstr "Наклон графика"
 
-#: widgets/fltk.cpp:905
+#: widgets/fltk.cpp:911
 msgid "Shift the picture down"
 msgstr "Сдвинуть рисунок вниз"
 
-#: widgets/fltk.cpp:897
+#: widgets/fltk.cpp:903
 msgid "Shift the picture left"
 msgstr "Сдвинуть рисунок слево"
 
-#: widgets/fltk.cpp:903
+#: widgets/fltk.cpp:909
 msgid "Shift the picture right"
 msgstr "Сдвинуть рисунок вправо"
 
-#: widgets/fltk.cpp:895
+#: widgets/fltk.cpp:901
 msgid "Shift the picture up"
 msgstr "Сдвинуть рисунок вверх"
 
@@ -4638,7 +4692,7 @@ msgstr "Сдвинуть рисунок вверх"
 msgid "Short description of selected command"
 msgstr "Краткое описание выбранной команды"
 
-#: udav/info_dlg.cpp:54
+#: udav/info_dlg.cpp:56
 msgid "Short information about the data."
 msgstr "Краткая информация о данных"
 
@@ -4654,11 +4708,11 @@ msgstr ""
 "Показать калькулятор, который вычисляет текстовые формулы,\n"
 "которые могут содержать и переменные из скрипта."
 
-#: mgllab/editor.cpp:526 mgllab/editor.cpp:528
+#: mgllab/editor.cpp:530
 msgid "Show calculator window"
 msgstr "Показать окно калькулятора"
 
-#: widgets/fltk.cpp:916
+#: widgets/fltk.cpp:922
 msgid "Show custom dialog for plot setup"
 msgstr "Показать диалог настроек графика"
 
@@ -4720,11 +4774,11 @@ msgstr "Показать подсказки по использованию MGL.
 msgid "Show info"
 msgstr "Показать информацию"
 
-#: mgllab/mgllab.cpp:314
+#: mgllab/mgllab.cpp:305
 msgid "Show lines"
 msgstr "Показать строки"
 
-#: widgets/fltk.cpp:913
+#: widgets/fltk.cpp:919
 msgid "Show next frame in slideshow"
 msgstr "Показать следующий кадр"
 
@@ -4732,7 +4786,7 @@ msgstr "Показать следующий кадр"
 msgid "Show next slide (Ctrl+.)."
 msgstr "Показать следующий кадр (Ctrl+.)."
 
-#: widgets/fltk.cpp:908
+#: widgets/fltk.cpp:914
 msgid "Show previous frame in slideshow"
 msgstr "Показать предыдущий кадр"
 
@@ -4740,6 +4794,15 @@ msgstr "Показать предыдущий кадр"
 msgid "Show previous slide (Ctrl+,)."
 msgstr "Показать предыдущий кадр (Ctrl+,)."
 
+#: mgllab/editor.cpp:532
+#, fuzzy
+msgid "Show window for primitives"
+msgstr "Показать диалог настроек UDAV"
+
+#: src/random.cpp:354
+msgid "Shuffle data cells (for dir='a') or slices (for dir='xyz')"
+msgstr "Перемешать ячейки (для dir='a') или срезы (для dir='xyz') данных"
+
 #: mgllab/table.cpp:779
 msgid "Sin FFT"
 msgstr "Синус-Фурье"
@@ -4748,7 +4811,7 @@ msgstr "Синус-Фурье"
 msgid "Sin-Fourier transform along direction(s)"
 msgstr "Синус-Фурье преобразование вдоль направления"
 
-#: src/exec_dat.cpp:1746
+#: src/exec_dat.cpp:1812
 msgid "Sin-Fourier transform at some direction"
 msgstr "Синус-Фурье преобразование вдоль направления"
 
@@ -4774,7 +4837,7 @@ msgstr "Размер бруска"
 msgid "Sizes"
 msgstr "Размеры"
 
-#: src/parser.cpp:1482
+#: src/parser.cpp:1491
 msgid "Skip commands and iterate for-loop again"
 msgstr "Пропустить команды до конца цикла for"
 
@@ -4786,7 +4849,7 @@ msgstr "Анимация"
 msgid "Smooth"
 msgstr "Сгладить"
 
-#: src/exec_dat.cpp:1747
+#: src/exec_dat.cpp:1813
 msgid "Smooth data"
 msgstr "Сгладить массив данных"
 
@@ -4794,35 +4857,35 @@ msgstr "Сгладить массив данных"
 msgid "Smooth data along direction(s)"
 msgstr "Сгладить массив данных по направлению"
 
-#: src/exec_dat.cpp:1730
+#: src/exec_dat.cpp:1795
 msgid "Solve Hamiltonian ODE (find GO ray or trajectory)"
 msgstr "Решить гамильтонову ОДУ (найти ГО луч/траекторию)"
 
-#: src/exec_dat.cpp:1720
+#: src/exec_dat.cpp:1785
 msgid "Solve ODE"
 msgstr "Решить систему обыкновенных диф. уравнений"
 
-#: src/exec_dat.cpp:1722
+#: src/exec_dat.cpp:1787
 msgid "Solve PDE"
 msgstr "Решить уравнение в частных производных"
 
-#: src/exec_dat.cpp:1728
+#: src/exec_dat.cpp:1793
 msgid "Solve PDE in accompanied coordinates for 2d case"
 msgstr "Решить PDE в сопровождающей системе координат (2d)"
 
-#: src/exec_dat.cpp:1729
+#: src/exec_dat.cpp:1794
 msgid "Solve PDE in accompanied coordinates for 3d case"
 msgstr "Решить PDE в сопровождающей системе координат (3d)"
 
-#: src/exec_dat.cpp:1667
+#: src/exec_dat.cpp:1729
 msgid "Solve PDE using advanced method (X-Y only)"
 msgstr "Решить PDE (сложные уравнения, 2d случай)"
 
-#: src/exec_dat.cpp:1761
+#: src/exec_dat.cpp:1827
 msgid "Solve tridiagonal matrix"
 msgstr "Решить трехдиагональную систему"
 
-#: src/exec_dat.cpp:1749
+#: src/exec_dat.cpp:1815
 msgid "Sort data by values in column"
 msgstr "Сортировать данные по значениям в колонке"
 
@@ -4862,7 +4925,7 @@ msgstr ""
 msgid "Squeeze"
 msgstr "Сжать"
 
-#: src/exec_dat.cpp:1750
+#: src/exec_dat.cpp:1816
 msgid "Squeeze data"
 msgstr "Сжать данные"
 
@@ -4870,15 +4933,15 @@ msgstr "Сжать данные"
 msgid "Start"
 msgstr "Старт"
 
-#: src/parser.cpp:1492
+#: src/parser.cpp:1501
 msgid "Start function definition and stop execution of main script"
 msgstr "Начало определения функции и остановка выполнения основного скрипта"
 
-#: src/parser.cpp:1495
+#: src/parser.cpp:1504
 msgid "Start next for-loop iteration"
 msgstr "Начать новую итерацию цикла for"
 
-#: src/parser.cpp:1496
+#: src/parser.cpp:1505
 msgid "Start/close commands which should executed only once"
 msgstr "Начало/конец блока команд, которые будут выполняться единожды"
 
@@ -4890,7 +4953,7 @@ msgstr "Индекс начальной ячейки"
 msgid "State"
 msgstr "Состояние"
 
-#: src/exec_dat.cpp:1685
+#: src/exec_dat.cpp:1747
 msgid "Step for pulse diffraction"
 msgstr "Шаг для расчета дифракции импульса"
 
@@ -4898,11 +4961,11 @@ msgstr "Шаг для расчета дифракции импульса"
 msgid "Stop"
 msgstr "Стоп"
 
-#: widgets/fltk.cpp:875
+#: widgets/fltk.cpp:881
 msgid "Stop drawing"
 msgstr "Остановить рисование"
 
-#: src/parser.cpp:1498
+#: src/parser.cpp:1507
 msgid "Stop execution"
 msgstr "Остановить выполнение скрипта"
 
@@ -5002,7 +5065,7 @@ msgstr "Подметки"
 msgid "Subticks"
 msgstr "Подметки"
 
-#: src/exec_dat.cpp:1753
+#: src/exec_dat.cpp:1819
 msgid "Subtract data or number"
 msgstr "Вычесть данные или число"
 
@@ -5027,7 +5090,7 @@ msgstr "Суммировать вдоль направления"
 msgid "Summation of"
 msgstr "Сумма от"
 
-#: src/exec_dat.cpp:1755
+#: src/exec_dat.cpp:1821
 msgid "Swap data (useful after Fourier transform)"
 msgstr "Поменять местами левую и правую части данных"
 
@@ -5039,15 +5102,20 @@ msgstr "Поменять местами данные по направлению
 msgid "Swap parts"
 msgstr "Поменять местами"
 
-#: src/exec_set.cpp:814
+#: src/exec_set.cpp:856
+#, fuzzy
+msgid "Switch on/off TeX parsing at text output"
+msgstr "Вкл/выкл прозрачность рисунка"
+
+#: src/exec_set.cpp:822
 msgid "Switch on/off fog"
 msgstr "Вкл/выкл туман"
 
-#: src/exec_set.cpp:816
+#: src/exec_set.cpp:824
 msgid "Switch on/off gray-scale mode"
 msgstr "Вкл/выкл режим оттенков серого"
 
-#: widgets/fltk.cpp:862
+#: widgets/fltk.cpp:868
 msgid "Switch on/off grid drawing"
 msgstr "Вкл/выкл рисование сетки"
 
@@ -5063,7 +5131,7 @@ msgstr "Вкл/выкл освещение графика (Alt+L)."
 msgid "Switch on/off lightning for the graphics (Ctrl+L)."
 msgstr "Вкл/выкл освещение графика (Ctrl+L)."
 
-#: widgets/fltk.cpp:859
+#: widgets/fltk.cpp:865
 msgid "Switch on/off lightning in the picture"
 msgstr "Вкл/выкл освещение графика"
 
@@ -5079,11 +5147,11 @@ msgstr ""
 msgid "Switch on/off mouse zoom of selected region."
 msgstr "Вкл/выкл приближение мышью выбранной области."
 
-#: src/exec_set.cpp:847
+#: src/exec_set.cpp:855
 msgid "Switch on/off to use ternary axis"
 msgstr "Указать тип тернарных координат или проекций"
 
-#: src/exec_set.cpp:795
+#: src/exec_set.cpp:803
 msgid "Switch on/off transparency"
 msgstr "Вкл/выкл прозрачность"
 
@@ -5095,7 +5163,7 @@ msgstr "Вкл/выкл прозрачность рисунка (Alt+T)."
 msgid "Switch on/off transparency for the graphics (Ctrl+T)."
 msgstr "Вкл/выкл прозрачность рисунка (Ctrl+T)."
 
-#: widgets/fltk.cpp:856
+#: widgets/fltk.cpp:862
 msgid "Switch on/off transparency in the picture"
 msgstr "Вкл/выкл прозрачность рисунка"
 
@@ -5107,7 +5175,7 @@ msgstr "Симметричный диапазон"
 msgid "Symmetrical?"
 msgstr "Симметрично?"
 
-#: src/addon.cpp:121 src/base_cf.cpp:268
+#: src/addon.cpp:121 src/base_cf.cpp:281
 #, c-format
 msgid "TEST: %s\n"
 msgstr "ТЕСТ: %s\n"
@@ -5162,7 +5230,7 @@ msgstr ""
 "калькуляторе выражение (которое может зависеть от координат x,y,z и др.) и "
 "вставьте его в скрипт."
 
-#: mgllab/editor.cpp:280
+#: mgllab/editor.cpp:284
 msgid ""
 "The current file has not been saved.\n"
 "Would you like to save it now?"
@@ -5176,13 +5244,13 @@ msgstr ""
 "Специальный диалог (Правка|Вставить|Новая команда) поможет Вам выбрать "
 "команду, заполнить ее аргументы и вставить в скрипт."
 
-#: src/crust.cpp:591
+#: src/crust.cpp:590
 msgid ""
 "There are duplicated or indistinguishably adjacent points for triangulation."
 msgstr "Повторяющиеся или близкие точки при триангуляции"
 
 #. mglScrStr
-#: src/base.cpp:251
+#: src/base.cpp:262
 msgid "There is changing temporary data in script"
 msgstr "Попытка изменить временные данные в скрипте"
 
@@ -5194,7 +5262,7 @@ msgstr "Есть примитивы, заданные вручную"
 msgid "There is no 'fmt' argument for this command"
 msgstr "Отсутствует 'fmt' аргумент для этой команды"
 
-#: udav/text_pnl.cpp:137 mgllab/editor.cpp:681
+#: udav/text_pnl.cpp:137 mgllab/editor.cpp:685
 msgid "There is no fitted formula."
 msgstr "Нет подобранной формулы."
 
@@ -5218,30 +5286,30 @@ msgstr ""
 "переменные из скрипта."
 
 #. mglScrCmd
-#: src/base.cpp:249
+#: src/base.cpp:260
 msgid "There is too long string(s) in script"
 msgstr "Слишком длинная строка в скрипте"
 
 #. mglScrLong
-#: src/base.cpp:250
+#: src/base.cpp:261
 msgid "There is unbalanced ' in script"
 msgstr "Лишняя кавычка ' в скрипте"
 
 #. mglWarnSpc
-#: src/base.cpp:247
+#: src/base.cpp:258
 msgid "There is wrong argument(s) in script"
 msgstr "Неправильные аргументы команды в скрипте"
 
 #. mglScrArg
-#: src/base.cpp:248
+#: src/base.cpp:259
 msgid "There is wrong command(s) in script"
 msgstr "В скрипте неправильная команд(ы)"
 
-#: widgets/fltk.cpp:888
+#: widgets/fltk.cpp:894
 msgid "Theta angle (tilt z-axis)"
 msgstr "Угол Theta (наклон оси z)"
 
-#: widgets/fltk.cpp:1191
+#: widgets/fltk.cpp:1206
 msgid "This is for parameter "
 msgstr "Это для параметра "
 
@@ -5302,7 +5370,7 @@ msgstr "Транспонировать"
 msgid "Transpose data"
 msgstr "Транспонировать данные"
 
-#: src/exec_dat.cpp:1759
+#: src/exec_dat.cpp:1825
 msgid "Transpose data array"
 msgstr "Транспонировать данные"
 
@@ -5473,7 +5541,7 @@ msgstr "UDAV - сжать данные"
 msgid "UDAV - about"
 msgstr "UDAV - о программе"
 
-#: udav/anim_dlg.cpp:105
+#: udav/anim_dlg.cpp:104
 msgid "UDAV - animation"
 msgstr "UDAV - анимация"
 
@@ -5516,7 +5584,7 @@ msgid "Underline"
 msgstr "Подчеркивание"
 
 #. edit menu
-#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:308
+#: udav/text_pnl.cpp:516 mgllab/mgllab.cpp:299
 msgid "Undo"
 msgstr "Отмена"
 
@@ -5524,15 +5592,15 @@ msgstr "Отмена"
 msgid "Undo editor change (Ctrl+Z)."
 msgstr "Отменить изменения в редакторе (Ctrl+Z)."
 
-#: mgllab/mgllab.cpp:137
+#: mgllab/mgllab.cpp:140
 msgid "Untitled"
 msgstr "без имени"
 
-#: mgllab/mgllab.cpp:360 mgllab/mgllab.cpp:364
+#: mgllab/mgllab.cpp:351 mgllab/mgllab.cpp:355
 msgid "Untitled - mgllab"
 msgstr "без имени - mgllab"
 
-#: widgets/fltk.cpp:1108
+#: widgets/fltk.cpp:1120
 msgid "Update"
 msgstr "Обновить"
 
@@ -5549,7 +5617,7 @@ msgstr "Верхняя граница для цвета или прозрачн
 msgid "Usage:\tmglconv [parameter(s)] scriptfile\n"
 msgstr "Использование:\tmglconv [параметр(ы)] имя_скрипта\n"
 
-#: mgllab/mgllab.cpp:432
+#: mgllab/mgllab.cpp:423
 #, c-format
 msgid "Usage:\tmgllab [parameter(s)] scriptfile\n"
 msgstr "Использование:\tmgllab [параметр(ы)] имя_скрипта\n"
@@ -5594,11 +5662,16 @@ msgstr ""
 msgid "Use color scheme"
 msgstr "Использовать цветовую схему"
 
+#: mgllab/mgllab.cpp:485
+#, fuzzy
+msgid "Use dark color scheme"
+msgstr "Использовать цветовую схему"
+
 #: udav/prop_dlg.cpp:175
 msgid "Use dots plot for preview"
 msgstr "Использовать точки для просмотра"
 
-#: mgllab/mgllab.cpp:492
+#: mgllab/mgllab.cpp:484
 msgid "Use multi-threading for drawing"
 msgstr "Рисование в отдельном потоке"
 
@@ -5645,7 +5718,7 @@ msgstr "Вертикальный размер"
 msgid "W - lightgray"
 msgstr "W - светло-серый"
 
-#: src/exec_dat.cpp:1763
+#: src/exec_dat.cpp:1829
 msgid "Wavelet transform at some direction"
 msgstr "Wavelet преобразование вдоль направления"
 
@@ -5653,7 +5726,7 @@ msgstr "Wavelet преобразование вдоль направления"
 msgid "Whole area"
 msgstr "Вся область"
 
-#: mgllab/mgllab.cpp:495
+#: mgllab/mgllab.cpp:488
 msgid "Widget scheme"
 msgstr "Вид виджетов"
 
@@ -5665,7 +5738,7 @@ msgstr "Ширина"
 msgid "Width of selected cells"
 msgstr "Ширины выбранных ячеек"
 
-#: src/data.cpp:1490
+#: src/data.cpp:1559
 #, c-format
 msgid ""
 "Widths are:\n"
@@ -5684,7 +5757,7 @@ msgstr "Сетчатый график"
 msgid "Wire style"
 msgstr "Контур"
 
-#: src/exec_set.cpp:856
+#: src/exec_set.cpp:865
 msgid "Write current image to graphical file"
 msgstr "Сохранить текущий рисунок в файл"
 
@@ -5774,6 +5847,11 @@ msgid ""
 "string using `+` (for example, `'abc'+3` will give 'abf'), or use it all "
 "together."
 msgstr ""
+"Вы можете объединять строки и числа с помощью `,` без пробелов (например, "
+"`'max (u) =',u.max,' a.u.' 'или`'u = ',!(1+i2)` для комплексных чисел). "
+"Также вы можете получить n-й символ строки с помощью `[]` (например, "
+"`'abc'[1]` даст 'b') или добавить значение к последнему символу строки с "
+"помощью `+` (например, `'abc'+3` даст 'abf') или использовать все вместе."
 
 #: src/window.cpp:411
 msgid ""
@@ -5921,7 +5999,7 @@ msgstr "Необходимо указать направление"
 msgid "You should put text inside ' ' for argument "
 msgstr "Необходимо ввести текст в ' ' для аргумента"
 
-#: udav/anim_dlg.cpp:106
+#: udav/anim_dlg.cpp:105
 msgid "You should select one of case"
 msgstr "Необходимо выбрать один из вариантов"
 
@@ -5961,7 +6039,7 @@ msgstr "Размер по Z"
 msgid "Z-slice from"
 msgstr "Z срез от"
 
-#: src/exec_set.cpp:862
+#: src/exec_set.cpp:871
 msgid "Zoom axis range"
 msgstr "Увеличить диапазон осей координат"
 
@@ -5981,7 +6059,7 @@ msgstr "Приблизить"
 msgid "Zoom in graphics."
 msgstr "Приблизить рисунок"
 
-#: widgets/fltk.cpp:869
+#: widgets/fltk.cpp:875
 msgid "Zoom in selected region of the picture"
 msgstr "Приблизить выбранную область рисунка"
 
@@ -5990,7 +6068,7 @@ msgstr "Приблизить выбранную область рисунка"
 msgid "Zoom in text"
 msgstr "Увеличить текст"
 
-#: widgets/fltk.cpp:899
+#: widgets/fltk.cpp:905
 msgid "Zoom in the picture"
 msgstr "Приблизить рисунок"
 
@@ -6006,11 +6084,11 @@ msgstr "Отдалить рисунок"
 msgid "Zoom out text"
 msgstr "Уменьшить текст"
 
-#: widgets/fltk.cpp:901
+#: widgets/fltk.cpp:907
 msgid "Zoom out the picture"
 msgstr "Отдалить рисунок"
 
-#: src/exec_set.cpp:861
+#: src/exec_set.cpp:870
 msgid "Zoom plot region"
 msgstr "Приблизить область рисунка"
 
@@ -6080,7 +6158,7 @@ msgid "attach light"
 msgstr "прикрепить свет"
 
 #. mglWarnFmt
-#: src/base.cpp:244
+#: src/base.cpp:255
 msgid "axis ranges are incompatible"
 msgstr "размеры осей неправильные"
 
@@ -6115,13 +6193,13 @@ msgstr "c - голубой"
 msgid "center"
 msgstr "центр"
 
-#: widgets/fltk.cpp:794
+#: widgets/fltk.cpp:800
 #, c-format
 msgid "click at %g, %g, %g"
 msgstr "клик в %g, %g, %g"
 
 #. mglWarnCnt
-#: src/base.cpp:240
+#: src/base.cpp:251
 msgid "couldn't open file"
 msgstr "не могу открыть файл"
 
@@ -6134,17 +6212,17 @@ msgid "cutting"
 msgstr "обрезание"
 
 #. -----------------------------------------------------------------------------
-#: src/base.cpp:231
+#: src/base.cpp:242
 msgid "data dimension(s) is incompatible"
 msgstr "размеры данных несовместимы"
 
 #. mglWarnDim
-#: src/base.cpp:232
+#: src/base.cpp:243
 msgid "data dimension(s) is too small"
 msgstr "размеры данных слишком малы"
 
 #. mglWarnMem
-#: src/base.cpp:236
+#: src/base.cpp:247
 msgid "data values are zero"
 msgstr "значение данных равно нулю"
 
@@ -6176,11 +6254,11 @@ msgid "factor"
 msgstr "множитель"
 
 #. mglWarnSize
-#: src/base.cpp:243
+#: src/base.cpp:254
 msgid "format is not supported for that build"
 msgstr "формат не поддерживается для этой сборки"
 
-#: src/canvas.cpp:33
+#: src/canvas.cpp:31
 msgid "frame"
 msgstr "кадр"
 
@@ -6206,7 +6284,7 @@ msgstr "черно-белый"
 msgid "h - gray"
 msgstr "h - серый"
 
-#: src/parser.cpp:1067
+#: src/parser.cpp:1076
 #, c-format
 msgid "in line %ld"
 msgstr "в строке %ld"
@@ -6242,7 +6320,7 @@ msgid "left"
 msgstr "слева"
 
 #. mglWarnOpen
-#: src/base.cpp:241
+#: src/base.cpp:252
 msgid "light: ID is out of range"
 msgstr "light: ID вне диапазона"
 
@@ -6299,7 +6377,7 @@ msgstr ""
 "mglconv конвертирует mgl скрипт в рисунок (по умолчанию PNG).\n"
 "Текущая версия 2.%g\n"
 
-#: mgllab/mgllab.cpp:431
+#: mgllab/mgllab.cpp:422
 #, c-format
 msgid ""
 "mgllab draw mgl script interactively.\n"
@@ -6333,7 +6411,7 @@ msgid "min"
 msgstr "min"
 
 #. mglWarnLow
-#: src/base.cpp:233
+#: src/base.cpp:244
 msgid "minimal data value is negative"
 msgstr "минимальное значение отрицательно"
 
@@ -6347,12 +6425,12 @@ msgid "name"
 msgstr "имя"
 
 #. mglWarnNeg
-#: src/base.cpp:234
+#: src/base.cpp:245
 msgid "no file or wrong data dimensions"
 msgstr "нет файла или неверные размеры"
 
 #. mglWarnZero
-#: src/base.cpp:237
+#: src/base.cpp:248
 msgid "no legend entries"
 msgstr "нет записей легенды"
 
@@ -6374,12 +6452,12 @@ msgid "none or default"
 msgstr "нет или по умолчанию"
 
 #. mglWarnFile
-#: src/base.cpp:235
+#: src/base.cpp:246
 msgid "not enough memory"
 msgstr "не хватает памяти"
 
 #. mglWarnNull
-#: src/base.cpp:246
+#: src/base.cpp:257
 msgid "not enough space for plot"
 msgstr "не достаточно места для графика"
 
@@ -6388,7 +6466,7 @@ msgid "not used"
 msgstr "не используется"
 
 #. mglWarnSlc
-#: src/base.cpp:239
+#: src/base.cpp:250
 msgid "number of contours is zero or negative"
 msgstr "число контуров меньше или равно нуля"
 
@@ -6418,7 +6496,7 @@ msgid "plain"
 msgstr "карта"
 
 #. mglWarnTern
-#: src/base.cpp:245
+#: src/base.cpp:256
 msgid "pointer is NULL"
 msgstr "указатель равен NULL"
 
@@ -6471,12 +6549,12 @@ msgid "save slides"
 msgstr "сохранить кадры"
 
 #. mglWarnLId
-#: src/base.cpp:242
+#: src/base.cpp:253
 msgid "size(s) is zero or negative"
 msgstr "размер(ы) меньше или равны нулю"
 
 #. mglWarnLeg
-#: src/base.cpp:238
+#: src/base.cpp:249
 msgid "slice value is out of range"
 msgstr "срез вне диапазона"
 
@@ -6521,7 +6599,7 @@ msgstr "метки"
 msgid "to"
 msgstr "до"
 
-#: mgllab/mgllab.cpp:579
+#: mgllab/mgllab.cpp:574
 msgid "to script"
 msgstr "в скрипт"
 
@@ -6584,6 +6662,12 @@ msgstr "с шагом"
 msgid "y - yellow"
 msgstr "y - желтый"
 
+#~ msgid "Insert file content?"
+#~ msgstr "Вставить содержимое файла?"
+
+#~ msgid "Insert file name?"
+#~ msgstr "Вставить имя файла?"
+
 #~ msgid ""
 #~ "You may quickly draw the data from file. Just use: udav 'filename.dat' in "
 #~ "command line."
index 8f39ee5a9a02dd4872ad571dddf7c1efb9d866bf..3170d53794ffb48dd84604deb1a653619e4dba8f 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * modify it under the terms of the GNU Lesser General Public License 
  * as published by the Free Software Foundation
  *
  * This program is distributed in the hope that it will be useful,
@@ -179,8 +179,8 @@ public:
 void dirsel_dlg_cb(Fl_Widget *, void *v)
 {      dirsel_dlg.ext=NULL;    dirsel_dlg.e=(ScriptWindow *)v; dirsel_dlg.show();      }
 //-----------------------------------------------------------------------------
-void dirsel_in_cb(Fl_Widget *, void *v)
-{      dirsel_dlg.ext=(Fl_Input*)v;    dirsel_dlg.e=NULL;      dirsel_dlg.show();      }
+// void dirsel_in_cb(Fl_Widget *, void *v)
+// {   dirsel_dlg.ext=(Fl_Input*)v;    dirsel_dlg.e=NULL;      dirsel_dlg.show();      }
 //-----------------------------------------------------------------------------
 //const char *arr = "_AKVITSDOX";
 Fl_Menu_Item arrows[] = {
@@ -544,8 +544,8 @@ void cb_style_sch(Fl_Widget *, void *)      {       style_dlg.set_scheme(); }
 void style_dlg_cb(Fl_Widget *, void *v)
 {      style_dlg.ext=NULL;     style_dlg.e=(ScriptWindow *)v;  style_dlg.show();       }
 //-----------------------------------------------------------------------------
-void style_in_cb(Fl_Widget *, void *v)
-{      style_dlg.ext=(Fl_Input*)v;     style_dlg.e=NULL;       style_dlg.show();       }
+//void style_in_cb(Fl_Widget *, void *v)
+//{    style_dlg.ext=(Fl_Input*)v;     style_dlg.e=NULL;       style_dlg.show();       }
 //-----------------------------------------------------------------------------
 void cb_datsel_upd(Fl_Widget *, void *);
 void cb_datsel_act(Fl_Widget *, void *);
@@ -671,8 +671,8 @@ void cb_datsel_act(Fl_Widget *, void *)     {       datsel_dlg.activate();  }
 void datsel_dlg_cb(Fl_Widget *, void *v)
 {      datsel_dlg.ext=NULL;    datsel_dlg.e=(ScriptWindow *)v; datsel_dlg.show();      }
 //-----------------------------------------------------------------------------
-void datsel_in_cb(Fl_Widget *, void *v)
-{      datsel_dlg.ext=(Fl_Input*)v;    datsel_dlg.e=NULL;      datsel_dlg.show();      }
+// void datsel_in_cb(Fl_Widget *, void *v)
+// {   datsel_dlg.ext=(Fl_Input*)v;    datsel_dlg.e=NULL;      datsel_dlg.show();      }
 //-----------------------------------------------------------------------------
 std::string with_arg(std::string ss, std::vector<std::string> prev)
 {
@@ -900,8 +900,8 @@ public:
                }
                hide();
        }
-       void set_cmd(const char *line)  // TODO
-       {}
+//     void set_cmd(const char *line)  // TODO
+//     {}
 } newcmd_dlg;
 //-----------------------------------------------------------------------------
 void cb_cmd_type(Fl_Widget*, void*)    {       newcmd_dlg.type_sel();  }
index 9e4a510dc78c3125505d941778a7127d36747cfa..ec1cc970fd6593097b44f2298e325355e08169bb 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -41,20 +41,24 @@ Fl_Text_Display::Style_Table_Entry styletable[10] = {       // Style table
                { FL_DARK_CYAN, FL_COURIER,             14, 0 },                // F - Flow command\r
                { FL_DARK_MAGENTA,      FL_COURIER,     14, 0 },                // G - New-data command\r
                { FL_DARK_RED,  FL_COURIER,             14, 0 },                // H - Option\r
-               { FL_DARK_GREEN,FL_COURIER,             14, 0 },                // I - Inactive command\r
+               { FL_GRAY,              FL_COURIER,             14, 0 },                // I - Inactive command\r
                { FL_MAGENTA,   FL_COURIER,             14, 0 }                 // J - Error line ???\r
        };\r
 int font_kind; ///< Editor font kind\r
 int font_size; ///< Editor font size\r
 //-----------------------------------------------------------------------------\r
-void set_style(int kind, int size)\r
+void set_style(int kind, int size, int fdark)\r
 {\r
+       Fl_Color c1[10]={FL_BLACK,FL_DARK_GREEN,FL_BLUE,FL_RED,FL_DARK_BLUE,FL_DARK_CYAN,FL_DARK_MAGENTA,FL_DARK_RED,FL_GRAY,FL_MAGENTA};\r
+       Fl_Color c2[10]={FL_WHITE,FL_GREEN,FL_CYAN,FL_YELLOW,FL_BLUE,FL_CYAN,FL_MAGENTA,FL_RED,FL_GRAY,FL_MAGENTA};\r
        if(kind<0 || kind>2)    kind = 1;\r
        if(size<1)      size = 14;\r
        for(int i=0;i<10;i++)   // set font for styles\r
        {       styletable[i].size = size;      styletable[i].font = 4*kind;    }\r
        styletable[1].font = 4*kind+2;\r
        font_kind = kind;       font_size = size;\r
+       if(fdark)       for(int i=0;i<10;i++)   styletable[i].color = c2[i];\r
+       else            for(int i=0;i<10;i++)   styletable[i].color = c1[i];\r
 }\r
 //-----------------------------------------------------------------------------\r
 bool MGL_FUNC_PURE is_sfx(const char *s)       // suffix\r
@@ -482,12 +486,12 @@ void changed_cb(int pos, int nInserted, int nDeleted, int nRestyled, const char
        if (loading) w->editor->show_insert_position();\r
 }\r
 //-----------------------------------------------------------------------------\r
-void insert_cb(Fl_Widget*, void *v)\r
-{\r
-       const char *newfile = mgl_file_chooser(_("Insert file content?"));\r
-       ScriptWindow *w = (ScriptWindow *)v;\r
-       if (newfile != NULL) load_file(newfile, w->editor->insert_position(),w);\r
-}\r
+// void insert_cb(Fl_Widget*, void *v)\r
+// {\r
+//     const char *newfile = mgl_file_chooser(_("Insert file content?"));\r
+//     ScriptWindow *w = (ScriptWindow *)v;\r
+//     if (newfile != NULL) load_file(newfile, w->editor->insert_position(),w);\r
+// }\r
 //-----------------------------------------------------------------------------\r
 void paste_cb(Fl_Widget*, void* v)\r
 {\r
@@ -525,7 +529,7 @@ Fl_Widget *add_editor(ScriptWindow *w, int txtW, int wndH)
        o = new Fl_Button(210, 1, 25, 25);      o->image(img_calc);     o->callback(calc_dlg_cb,w);\r
        o->tooltip(_("Show calculator window"));\r
        o = new Fl_Button(240, 1, 25, 25);      o->image(img_curve);o->callback(prim_dlg_cb,w);\r
-       o->tooltip(_("Show calculator window"));\r
+       o->tooltip(_("Show window for primitives"));\r
        g->end();       g->resizable(0);\r
 \r
        w->editor = new Fl_Text_Editor(0, 28, txtW, wndH-85);\r
index cc82b24aeb77751d78691e74f591edf4cd145b19..a186210345ed32fec62201dc0368ada16d91a842 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * modify it under the terms of the GNU Lesser General Public License 
  * as published by the Free Software Foundation
  *
  * This program is distributed in the hope that it will be useful,
index 966117649d022c74bfa8af7b3c2558e38b1b567f..de5a9e0f3b35457e60d06cb2076e7795c3bc8e80 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -127,8 +127,8 @@ void mem_dlg_cb3(Fl_Widget *, void *v)
 void mem_dlg_cb4(Fl_Widget *, void *v)\r
 {      ((ScriptWindow*)v)->mem_pressed(4);     }\r
 //-----------------------------------------------------------------------------\r
-void mem_update_cb(Fl_Widget *, void *v)\r
-{      ((ScriptWindow*)v)->mem_init(); }\r
+// void mem_update_cb(Fl_Widget *, void *v)\r
+// {   ((ScriptWindow*)v)->mem_init(); }\r
 //-----------------------------------------------------------------------------\r
 void delete_all_cb(Fl_Widget *, void *v)\r
 {\r
index ef3e9995fe6afe8894491e8dad6832b8bdb62960..d6cc3b3dc995958333451443ed06a403e7f29b1f 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -115,13 +115,13 @@ void Fl_MGL::update()
        }\r
 }\r
 //-----------------------------------------------------------------------------\r
-void add_suffix(char *fname, const char *ext)\r
-{\r
-       long n=strlen(fname);\r
-       if(n>4 && fname[n-4]=='.')\r
-       {       fname[n-3]=ext[0];      fname[n-2]=ext[1];      fname[n-1]=ext[2];      }\r
-       else    {       strcat(fname,".");      strcat(fname,ext);      }\r
-}\r
+// void add_suffix(char *fname, const char *ext)\r
+// {\r
+//     long n=strlen(fname);\r
+//     if(n>4 && fname[n-4]=='.')\r
+//     {       fname[n-3]=ext[0];      fname[n-2]=ext[1];      fname[n-1]=ext[2];      }\r
+//     else    {       strcat(fname,".");      strcat(fname,ext);      }\r
+// }\r
 //-----------------------------------------------------------------------------\r
 class ArgsDlg : public GeneralDlg\r
 {\r
index 8323cd881368012899744950fbb92b5ba9650c23..c8d5801be96abc4c2cbb75603e00e448740b7ea8 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -46,6 +46,7 @@ std::string helpname;
 std::string fontname;\r
 int lang;\r
 int scheme;\r
+int dark;\r
 std::string lastfiles[5];\r
 Fl_Preferences pref(Fl_Preferences::USER,"abalakin","mgllab");\r
 //-----------------------------------------------------------------------------\r
@@ -91,6 +92,7 @@ void save_pref()
        pref.set("wnd_width", wndW);\r
        pref.set("wnd_height",wndH);\r
        pref.set("txt_width", txtW);\r
+       pref.set("dark",dark);\r
 }\r
 //-----------------------------------------------------------------------------\r
 void load_pref(ScriptWindow *w)\r
@@ -108,7 +110,8 @@ void load_pref(ScriptWindow *w)
        pref.get("complete_word",complete_word,1);\r
        pref.get("font_kind",font_kind,1);\r
        pref.get("font_size",font_size,14);\r
-       set_style(font_kind, font_size);\r
+       pref.get("dark", dark,0);\r
+       set_style(font_kind, font_size,dark);\r
        pref.get("font_name",s,"");\r
        if(s)   {       fontname=s;     free(s);        }\r
 \r
@@ -152,18 +155,6 @@ void set_title(Fl_Window* w)
 //-----------------------------------------------------------------------------\r
 void close_dlg_cb(Fl_Widget *, void *v)        {       ((Fl_Window *)v)->hide();       }\r
 //-----------------------------------------------------------------------------\r
-void fname_cb(Fl_Widget*, void *v)\r
-{\r
-       ScriptWindow* e = (ScriptWindow*)v;\r
-       const char *file = mgl_file_chooser(_("Insert file name?"));\r
-       if(file)\r
-       {\r
-               char *str = new char[strlen(file)+4];\r
-               snprintf(str,strlen(file)+4," '%s'",file);\r
-               e->editor->insert(str);\r
-               delete []str;\r
-       }\r
-}\r
 //-----------------------------------------------------------------------------\r
 void new_cb(Fl_Widget*, void*)\r
 {\r
@@ -249,10 +240,10 @@ void saveas_cb(Fl_Widget*, void *v)
 }\r
 //-----------------------------------------------------------------------------\r
 ScriptWindow *new_view();\r
-void view_cb(Fl_Widget*, void*)\r
-{      Fl_Window* w = new_view();      w->show();      }\r
+//void view_cb(Fl_Widget*, void*)\r
+//{    Fl_Window* w = new_view();      w->show();      }\r
 //-----------------------------------------------------------------------------\r
-void hint_cb(Fl_Widget*, void*)        {}\r
+// void hint_cb(Fl_Widget*, void*)     {}\r
 void lastfile1_cb(Fl_Widget*, void *v)\r
 {      if (!check_save()) return;\r
        load_file(lastfiles[0].c_str(),-1,(ScriptWindow*)v);    }\r
@@ -467,13 +458,14 @@ class PropDlg : public GeneralDlg
        Fl_Check_Button *highlight_w;\r
        Fl_Check_Button *mouse_zoom_w;\r
        Fl_Check_Button *use_thr_w;\r
+       Fl_Check_Button *dark_w;\r
        Fl_Choice *lang_w;\r
        Fl_Choice *scheme_w;\r
 public:\r
        PropDlg() : GeneralDlg()\r
        {\r
                Fl_Button *o;\r
-               w = new Fl_Double_Window(340, 390, _("Properties"));\r
+               w = new Fl_Double_Window(340, 415, _("Properties"));\r
                w->align(Fl_Align(FL_ALIGN_CLIP|FL_ALIGN_INSIDE));\r
                fkind = new Fl_Choice(75, 10, 90, 25, _("Font kind"));\r
                fkind->add("Helvetica");        fkind->add("Courier");  fkind->add("Times");\r
@@ -490,12 +482,13 @@ public:
                highlight_w = new Fl_Check_Button(5, 220, 330, 25, _("Highlight current object(s)"));\r
                mouse_zoom_w = new Fl_Check_Button(5, 245, 330, 25, _("Enable mouse wheel for zooming"));\r
                use_thr_w = new Fl_Check_Button(5, 270, 330, 25, _("Use multi-threading for drawing"));\r
-               lang_w = new Fl_Choice(160, 300, 175, 25, _("Language for mgllab"));\r
+               dark_w = new Fl_Check_Button(5, 295, 330, 25, _("Use dark color scheme"));\r
+               lang_w = new Fl_Choice(160, 325, 175, 25, _("Language for mgllab"));\r
                for(long i=0;i<NUM_LOCALE;i++)  lang_w->add(loc[i]);\r
-               scheme_w = new Fl_Choice(160, 330, 175, 25, _("Widget scheme"));\r
+               scheme_w = new Fl_Choice(160, 355, 175, 25, _("Widget scheme"));\r
                scheme_w->add("base");  scheme_w->add("gtk+");  scheme_w->add("plastic");       scheme_w->add("gleam");\r
-               o = new Fl_Button(85, 360, 75, 25, _("Cancel"));        o->callback(cb_dlg_cancel,this);\r
-               o = new Fl_Return_Button(180, 360, 75, 25, _("OK"));    o->callback(cb_dlg_ok,this);\r
+               o = new Fl_Button(85, 385, 75, 25, _("Cancel"));        o->callback(cb_dlg_cancel,this);\r
+               o = new Fl_Return_Button(180, 385, 75, 25, _("OK"));    o->callback(cb_dlg_ok,this);\r
                w->set_modal(); w->end();\r
        }\r
        void init()\r
@@ -512,10 +505,10 @@ public:
                use_thr_w->value(use_thr);\r
                lang_w->value(lang);\r
                scheme_w->value(scheme);\r
+               dark_w->value(dark);\r
        }\r
        void cb_ok()\r
        {\r
-               set_style(fkind->value(),fsize->value());\r
                auto_exec = auto_exec_w->value();\r
                exec_save = exec_save_w->value();\r
                highlight = highlight_w->value();\r
@@ -524,6 +517,8 @@ public:
                use_thr = use_thr_w->value();\r
                docdir = help_path->value();\r
                fontname = font_path->value();\r
+               dark = dark_w->value();\r
+               set_style(fkind->value(),fsize->value(),dark);\r
                if(e->graph->get_graph())\r
                        mgl_load_font(e->graph->get_graph(),fontname.c_str(),NULL);\r
                set_scheme_lang(scheme_w->value(),lang_w->value());     // NOTE: must be after setting docdir\r
index f6f28862bfac27e7c8005ebcd7caf2136defa289..67cdf93055307de39c5d7d623e4003173d6300c3 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -68,9 +68,10 @@ extern int scheme;           ///< FLTK scheme
 extern int font_kind;  ///< Editor font kind\r
 extern int font_size;  ///< Editor font size\r
 extern int complete_word;      ///< enable word completion\r
+extern int dark;               ///< use dark color scheme\r
 //-----------------------------------------------------------------------------\r
 void set_scheme_lang(int s, int l);            ///< Set FLTK scheme and locale\r
-void set_style(int fkind, int fsize);  ///< Change the style of highlight\r
+void set_style(int fkind, int fsize, int fdark);       ///< Change the style of highlight\r
 void style_init();             ///< Initialize the style buffer\r
 void save_pref();              ///< Apply and save preferences\r
 void load_pref();              ///< Load preferences\r
index 56a99a9bd073357f7637a6fd9d3a490bdac7da67..1cdcb9d27ec8dc145b71721411970ffcec436bb9 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007 Alexey Balakin <balakin@appl.sci-nnov.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
index 65400c2b957e8355dc1f57d704bf96f1dafee5b0..2ed717173502d1e7b8dfc81f2524994381ed1e64 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>\r
  *\r
  * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU Library General Public License\r
+ * modify it under the terms of the GNU Lesser General Public License \r
  * as published by the Free Software Foundation\r
  *\r
  * This program is distributed in the hope that it will be useful,\r
@@ -382,7 +382,7 @@ public:
                        case 0: *out = c->Sum(r);       break;\r
                        case 1: *out = c->Max(r);       break;\r
                        case 2: *out = c->Min(r);       break;\r
-                       case 3: out = mgl_data_pulse(c,*r);     break;\r
+                       case 3: *out = mglData(true,mgl_data_pulse(c,*r));      break;\r
                }\r
                hide();\r
        }\r
@@ -559,8 +559,8 @@ public:
                o->tooltip(_("Change data values and close this window"));\r
                w->set_modal(); w->end();\r
        }\r
-       double min()    {       return wmin->value();   }\r
-       double max()    {       return wmax->value();   }\r
+       double vmin()   {       return wmin->value();   }\r
+       double vmax()   {       return wmax->value();   }\r
        int sym()               {       return wsym->value();   }\r
        bool ok()               {       return !result.empty(); }\r
        void cb_ok()\r
@@ -581,8 +581,8 @@ void fill_cb(Fl_Widget*, void*v)
                HMDT d = dynamic_cast<HMDT>(e->var);\r
                HADT c = dynamic_cast<HADT>(e->var);\r
                char ch = nrm_dlg.result[0];\r
-               if(d)   {       d->Fill(nrm_dlg.min(),nrm_dlg.max(),ch);        e->refresh();   }\r
-               if(c)   {       c->Fill(nrm_dlg.min(),nrm_dlg.max(),ch);        e->refresh();   }\r
+               if(d)   {       d->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),ch);      e->refresh();   }\r
+               if(c)   {       c->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),ch);      e->refresh();   }\r
        }\r
 }\r
 //-----------------------------------------------------------------------------\r
@@ -594,8 +594,8 @@ void normal_cb(Fl_Widget*, void*v)
        {\r
                HMDT d = dynamic_cast<HMDT>(e->var);\r
                HADT c = dynamic_cast<HADT>(e->var);\r
-               if(d)   {       d->Norm(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym());     e->refresh();   }\r
-               if(c)   {       c->Fill(nrm_dlg.min(),nrm_dlg.max(),nrm_dlg.sym());     e->refresh();   }\r
+               if(d)   {       d->Norm(nrm_dlg.vmin(),nrm_dlg.vmax(),nrm_dlg.sym());   e->refresh();   }\r
+               if(c)   {       c->Fill(nrm_dlg.vmin(),nrm_dlg.vmax(),nrm_dlg.sym());   e->refresh();   }\r
        }\r
 }\r
 //-----------------------------------------------------------------------------\r
index 28f80a10666a598a27f5fa38089158f1a3a53ee6..3416cf102901061ed5b7b0233f0d54137faf33c4 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arc_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 457c0aacb72caca084b8ebc63b9b05b76a98629e..f841dd41b4fba5a6881b3e502126c689fbc72bd3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 834f703628352540a82bbf3512ab9ddeac6a2bb9..fa5ae6e0b678254281bf2273647990f949a2e229 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a8c617e227b36d98fcc45b5401f3915d61136050..3bc2959e16d3dee26b1ecd58327f0d83ff3df5d9 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " ..             ",
index 840d32577cb2066459fe7418730d5692647c0f70..339201b542dbfa6b83299c4cf0b654c5d1d31457 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_k_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " ..             ",
index 305238be0ac1ae7f4257343a3239de55d3fb44c7..52f3587bc5fd0660fdd037172e806be36faae1df 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_n_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 6f4b5835ade1338714ac0ea6da4368d4b1c4db23..807fb0c2f00126349aa2dee521b3fd71687fb27e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index ddeeb7f4df3c438f24b3a359b0d75006aef4b49f..7bc281347171033f10d9ad01e77ddd8b8ab9fa8e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 71ff9dc1544db6a1f57dcc13a77b33dfa9eda4e4..f6c1f91cd75c0f92d5a89f1be49be979fce76335 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 038a3e5d8fba7a07607b5972e8742bbf47e48298..c5eb9c4490088898e94ba2ade0a98f818512eaf3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * arrow_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 65014f12f6e852043c1286bc9d06855af9f419bf..9be05e5e406e6b37b5282b8f8829b8d1d8301a82 100644 (file)
@@ -2,7 +2,7 @@
 static const char * axis_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 " ..             ",
 "  .             ",
index d09869f44cd9ef6751128c26032e9f548c68dedc..775288f585a04b95503672e32000985112bdb08e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * axis_sh_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #FF0000",
 "                ",
 "  .             ",
index 8545b8f1c71e0bbb100ff085965c0e9dfc576492..575390598f624dc9c49ebbd7de678d66610a9681 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index fe133deeb68a494e6bdf5bb6224ef039169dd054..00c426239d22e5e0c8c7cf7c88a6c3e680c28f96 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 54e91ad564828be3f03cdf9633eb3677771f60e3..e4104b3a6f329f8fe78880ea22bbb081cf56d415 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "             .. ",
index be962b170dc5ee847cc51242362392c3761b3be7..820c9a8e601e2ef34c38969c7b322c8b5c7c864e 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_k_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "             .. ",
index 7d2b54c3eb8cde01554edbddbcc9632d028bfac7..c5c54d68761be3efc8e9c970cf1d8bf91f5e7da8 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_n_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a0ea26486d8365e77302f09d792341d3acc56f0f..86601cebed5f61203c3b7ab75952b7ad85cfbf04 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index f19c4d8c25e854bd0e0bb7aa97d827a465b5dad1..08af6b55df326444721cb3630e37f1079050fd47 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 06e23d5b04a6e4234f87556d674de4fc9e65c44c..30456941851779ae08150eb272206dc0328eccba 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index b31d4d236eb09f9059b80a34fa2ca44beeba3ec9..3b54b24f9f643f87f4d315bade7b496952258513 100644 (file)
@@ -2,7 +2,7 @@
 const char * barrow_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 23260d1a9ed42c7283823cbf0e8bb7788dbafb64..a60f05481c60c2601c4c8de252848dd8e7036667 100644 (file)
@@ -1,22 +1,23 @@
 /* XPM */
 static const char * box_xpm[] = {
-"16 16 3 1",
+"16 16 4 1",
 "      c None",
 ".     c #000000",
 "+     c #666666",
+"=     c #ffffff",
 "                ",
 "      ......... ",
-"     .+      .. ",
-"    . +     . . ",
-"   .  +    .  . ",
-"  .   +   .   . ",
-" .........    . ",
-" .    +  .    . ",
-" .    +  .    . ",
-" .    +++.++++. ",
-" .   +   .   .  ",
-" .  +    .  .   ",
-" . +     . .    ",
-" .+      ..     ",
+"     .+======.. ",
+"    .=+=====.=. ",
+"   .==+====.==. ",
+"  .===+===.===. ",
+" .........====. ",
+" .====+==.====. ",
+" .====+==.====. ",
+" .====+++.++++. ",
+" .===+===.===.  ",
+" .==+====.==.   ",
+" .=+=====.=.    ",
+" .+======..     ",
 " .........      ",
 "                "};
index e18a730f760b3d0498f978060edd4996a6ebc78b..474cf189b355780baae8f526f1d2eb2b04c4b29a 100644 (file)
@@ -2,7 +2,7 @@
 static const char * crop_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "     .          ",
 "                ",
index 88e37e35f481afb3000f3baa68f8f27e054b8b30..eb613c88c20c0d1ae13e58fd0e5a5700d21a5ef0 100644 (file)
@@ -2,7 +2,7 @@
 static const char * curve_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "               .",
 "               .",
 "              . ",
index 6892ce6855a0f4ec23169ab8fccb5d2b9e346d41..f2e4e7205b106cfabd5e9763bbf8e89f955cae9e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 13eaf63c9cab614b5854d18a4e772350f0881d55..97db0c5ff1019ec885aadcc55057f5d1cf7e37e2 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_e_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 2ad1f1c400ed7986c257d1b7eaf09f7ed2ae9383..f012469bd250a2054eeefa70a7d0f2f57ef2bde5 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_i_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 70a9cc4c08e9aed009cbadf246aef49642247bde..c5ffeb375c993a49c98bd4a32811d2a177c59942 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_j_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 4346c08fe05e49a37ba307a167c697717678794e..f735a733d287dad713162ccff847bd6ea98e3759 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_l_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 7cd2b39d4dcd9311735618ee494f3595d044f90d..83a3794658b5729d54b66d8ca626e68a98280add 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_m_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 4edb6c5cb9b63bcd3acf950aaa3125fd95ddff11..92d9a116420362b01bc2abdfda46edbe21fb5afa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * dash_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index a191ea2678652612e2b59bc735d21182e0f927e9..14158c68b717b4418831c0f722f8427f6c7a086d 100644 (file)
@@ -1,21 +1,22 @@
 /* XPM */
 static const char * delete_xpm[] = {
-"16 16 2 1",
+"16 16 3 1",
 "      c none",
 ".     c #000000",
+"=     c #afafaf",
 "                ",
 "                ",
 "                ",
-"  ...      ...  ",
-"   ...    ...   ",
-"    ...  ...    ",
-"     ......     ",
-"      ....      ",
-"      ....      ",
-"     ......     ",
-"    ...  ...    ",
-"   ...    ...   ",
-"  ...      ...  ",
+"   ..      ..   ",
+"   .=.    .=.   ",
+"    .=.  .=.    ",
+"     .=..=.     ",
+"      .==.      ",
+"      .==.      ",
+"     .=..=.     ",
+"    .=.  .=.    ",
+"   .=.    .=.   ",
+"   ..      ..   ",
 "                ",
 "                ",
 "                "};
index b90448a3ce612cd6d20167a5a9fbf9adc38af42d..7083646140912819aa1716e3d814db3cb8bfbcef 100644 (file)
@@ -2,7 +2,7 @@
 static const char * diff_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "   ..           ",
index 7a2d7ebf66bc7c18b9f646f0571a62309b704201..283abc7c8eaf533eda61c6cf415c7e4673473672 100644 (file)
@@ -2,8 +2,8 @@
 static const char * diff2_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f7f",
+"+     c #7FaFaF",
 "                ",
 "                ",
 "                ",
index 02cbeb682c9f7b6429390286aa744a465095a8d0..b53a1440a6df2ef4cc3c55bf36c5eb824c0432db 100644 (file)
@@ -1,7 +1,7 @@
 /* XPM */
 static const char *edit_find_xpm[] = {
 /* columns rows colors chars-per-pixel */
-"16 16 64 1 ",
+"16 16 65 1 ",
 "  c black",
 ". c #010101",
 "X c #040404",
@@ -66,21 +66,22 @@ static const char *edit_find_xpm[] = {
 "S c #817E7D",
 "D c #AB917A",
 "F c None",
+"E c #afafaf",
 /* pixels */
 "FFFFFFFFFFFFFFFF",
-"FFFFFFFFFFFFFFFF",
-"FFFFF  FF  FFFFF",
-"FFFF2z4FF4z2FFFF",
-"FFF 88&&&&68 FFF",
-"FF;b8s&zh&d8b;FF",
-"F tdzed# dezdt F",
-"F&zSn46;;62nSz&F",
+"FFFFFEEFFEEFFFFF",
+"FFFFE  EE  EFFFF",
+"FFFE2z4EE4z2EFFF",
+"FFE 88&&&&68 EFF",
+"FE;b8s&zh&d8b;EF",
+"E tdzed# dezdt E",
+"E&zSn46;;62nSz&E",
 " hqupv:64:vp10g ",
 "OwiCVk;  &kBZiqX",
-" ,yiNl+FF#lNmu, ",
-" 3jADp FF aDAj3 ",
-"F #rO FFFF Or# F",
-"FFFFFFFFFFFFFFFF",
+" ,yiNl+EE#lNmu, ",
+" 3jADp EE aDAj3 ",
+"E #rO EFFE Or# E",
+"FEEEEEFFFFEEEEEF",
 "FFFFFFFFFFFFFFFF",
 "FFFFFFFFFFFFFFFF"
 };
index e62cfe73e4cbc280204a252cf6432fed8fb58478..dd7336940a6102f22983b869e5f49bf7c90454ba 100644 (file)
@@ -2,7 +2,7 @@
 static const char * func_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index ddccb223f9a1fda67834027ad317bdfb29381331..4bd93d2ca8e574aa62827f118575b035e5bf9215 100644 (file)
@@ -1,9 +1,8 @@
 /* XPM */
 static const char * integr_xpm[] = {
-"16 16 3 1",
+"16 16 2 1",
 "      c None",
-".     c #000000",
-"+     c #808080",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
@@ -16,7 +15,7 @@ static const char * integr_xpm[] = {
 "    . .  .  .   ",
 "    . .  .  .   ",
 "    .  ... . .  ",
-"   .     +      ",
+"   .            ",
 "                ",
 "                ",
 "                "};
index aff1af3fc3d86c9c6b3cc43ba8cbdd0b248a8b12..fc5d2f942747bf0ca05db3e4956f08e2ef2bf42e 100644 (file)
@@ -2,7 +2,7 @@
 static const char * line_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "               .",
 "              . ",
 "             .  ",
index b372f5a213244db6e75f04656916e5cc94792ee9..002fcf6278c744ee32a28483cd77fdf63add7b72 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark__xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 29f34cbdea8e0b0caad6ab44c600a2926d86b741..04c5ac6cd8926473e1add99f6558d3b1b7876e05 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "    .       .   ",
 "     .     .    ",
index f743a3148082f73dcdd1631a22174ec848180faa..e2b24cde78a20542a0c3ec7d8a325158cfd6d4c9 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_cf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 678d75ea6e659f0452e646d4629dbb51cb2f3ddb..e3be02536000947fc6d1390cd530a743575fd9ad 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      .  .      ",
 "     .    .     ",
index 582d4203a31a19cb8821f79a76a429ac4597b394..a6e73edf5f7a11d3ba3ad35eec9bb3d778739d81 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_df_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      ....      ",
 "     ......     ",
index 9edd3e0b07547e501e7e91af4bf61b74534f20a1..f3aa86992f0052601b3f41f375e7712ee159850c 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_l_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "          ..    ",
 "        .. .    ",
 "       .   .    ",
index 2585eb47d436698f39e0baa42634198d72b1f009..9c8b3fa9d3461840a1b4f15af1c9a4bab3bda493 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_lf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "          ..    ",
 "        ....    ",
 "       .....    ",
index 3154cdc4acd71cd8c58a1c45c96b1bc4d30444a0..bc9874afeac28bbdd1b96caaf5e8b2a0d260f13b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_o_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..      ..   ",
 "  .          .  ",
index 3eeaf389f00006a999bc4aaf4b166fe0f6072ac3..a3fa73985cc8dc07e6d930e7d6d8f8a73438f1b4 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_of_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "     ......     ",
 "   ..........   ",
 "  ............  ",
index 3f40cfbc99f6b73d88454f03f7a019f62d6a7e73..c48b2f1af288576739134f5694408c29c6d957aa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_p_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "        .       ",
 "        .       ",
 "        .       ",
index ea9cdac83c92b80b6b1e48fc2e2652e9310d8a6d..1b85e50e0392f5a96b1edb118b78af9d218881fd 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_pf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 ".       .      .",
 ".       .      .",
index 845901453a0ca5185ff90d59f9b14d4c7d520655..3c8c49b92cb7f2497d9d93c821aaf47b34a77b81 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_r_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "    ..          ",
 "    . ..        ",
 "    .   .       ",
index cedcd01e21153674a0149ceb9a505d6b0bfa067a..844e2cd0fcf9ccf81fa658506fdd411d43fdfb47 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_rf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "    ..          ",
 "    ....        ",
 "    .....       ",
index 1a4c0128ec2fea86c9869f91519f0547f63c585e..c4fab4fddccf9403aaa804b40ab4c46ffbfb0582 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 ".              .",
 ".              .",
index 5a89f1de39d6fbe6e7fd82d420efd02f758a8ab0..b132874754c7d0810529a415b782aa1a05535daa 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_sf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 "................",
 "................",
index 1e6b398f34edd7d81dd4b3bd9137a2473dfa10d5..514853985be19172df9c429c93d9399b87d6312d 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_t_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      .  .      ",
 "     .    .     ",
index 48f61c16932d2425caf5e7de9632ffe78e794af9..964c45ace394c8a8f8f44cb9166dd6061ebd8f80 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_tf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "       ..       ",
 "      ....      ",
 "     ......     ",
index 9f03771688a617e0bafc661654bdc4232bd5c2cd..9c09de0043e2d76c18cdc10cf56ce685051d2f97 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_v_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 39d7e996d8d93bfbb709d99a3e1c0292468e9732..e2f523513d56ec22531fa040f5a294c798d2259b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_vf_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "                ",
index 8d7ee78c5421a1bdbb2e890044fc2469f1df8735..ad17eb9cec884bfc7113c5c7296a92867108fb54 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_x_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 ".              .",
 " .            . ",
 "  .          .  ",
index b5135fdcd14859a177b4b600c41307f4886dbe98..958cb393383908176aa8442d241e3423bddf8148 100644 (file)
@@ -2,7 +2,7 @@
 static const char * mark_y_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 "   .         .  ",
index 6949dd9bc2fcce72352fb9a5142776ad7cfcc179..4893723ddc6c1c33821d7a3a63261adfe1bf08d0 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_a_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "##............##",
 "##............##",
 "..##........##..",
index dc7f66dce57b36858fd6ac807455ffa8d19bb650..6c96ab9526d0f7a6c75ad62bcacddb042040eba3 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_d_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "........##......",
index d3eee468f4aa5197f5728618939ab3c121f9f9f2..99e8d034a60a7c587f2d5f2462a5026585e8ae9a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_D_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "........##......",
index 2e6b5280cd2542d7c6f275c99fbd4eb9ee71efa2..f729a1d5b8f1935bf4fb0a0c186138c45b1d6b00 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_e_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index a24c1ca0fa180c262516216976b138a0c4ecbf26..ee9cff63054d1e6438200b11f04c802cb4d1914a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_i_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index fcc072f8b2751ab2be543235a2205248d817c4fa..7e8eadcf1436c298719cf62706c2c7687493be83 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_j_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index a062db64efc707ebc4aa60afb205888ccdbb02dc..17335f48c87fe962aa3c218195ef6cdb5e78a75b 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_l_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "..........####..",
index e717d969c1c78e3a5b1233aaef24956e444f2892..de4f3080e7ab0af420d5899b83666ca027cafa78 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_m_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 3664bc4869f9a808fdac4020cfa54c03674e2ea0..f9b9fa362780e97c1c0c939930c19ce7f7a330a5 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_o_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index fbecff88283f8689485a4e9c5c5f36e5895b4d6e..211df44347d1daefca19b25ab54980685305be44 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_O_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index d29f774845137b665c84a6726f4bc06ef8733609..a49e02760bdfab62e43da5f9c898d8370fd92008 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_p_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "........##......",
 "........##......",
 "........##......",
index 47f2aa54d3c59216d25cc76b86606cda516fab8b..245913728c1b55c7e624311dd03bbc1cd53f9b35 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_r_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "..####..........",
index a5e1e826f5cd81efddd1d53d514ab8c91413768b..b83be52cda12d120ed34f0cde27c08bd5432542a 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_s_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 652db363020b21ece8692cd7276758c584c37f93..2ff6574000b6c1cb9785ea5cb2cea7fbeee8c8f0 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_S_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index d153fc833271e3aaf5783ee3dc796de673c3b14c..5052969a06d9a3a627a4b78f1da9d163ff1a042b 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_t_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index 61996fca06667c047541a4dc5b0a7c65a9d17ef1..6873046b63e76276715a5e59c2552ec66d5e19ed 100644 (file)
@@ -2,7 +2,7 @@
 static const char *mask_u_xpm[]={
 "16 16 2 1",
 ". c None",
-"# c #000000",
+"# c #007f00",
 "................",
 "................",
 "................",
index e81575fd7d390649bcae537492fedc7893b93faa..3ca0ca5447853b6d835033329351b6a543e351c0 100644 (file)
@@ -2,7 +2,7 @@
 static const char * none_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "................",
 "..            ..",
 ". .          . .",
index ca6a51d9643f9241769376be473054dad82425dc..c4939d0747c8b7210d25eb212ef1332c79b127f8 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "   .            ",
 "   .            ",
index afa1a80b9079a566fbb68f43af0e570962cee94b..ddf42bcb632fe7a2e8e6e322ac10b7a08dd4a627 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_a_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index 2b89d5ed72a874481a778f6f318a742f8b72000e..ff8bd60e01cdf5b8c39d0b529791fa43b671a792 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_d_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index f6f7b8a62038930ef583e34745df7e6390529c02..0a3f03cfe257e380e47a5fef12ef707533ba2199 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_dir_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "   .            ",
 "  .   .         ",
 "  .   .         ",
index f2f8db1056c3a597e186f82de138c1cba156ac94..5eb90f18995c653e237bf16a9471c3267aa7b7e3 100644 (file)
@@ -2,8 +2,8 @@
 static const char * oper_m_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f7f",
+"+     c #7FAFAF",
 "                ",
 "                ",
 "                ",
index c22a9ba0783bbd1c616be68cd68833d509df8f3b..be3e1699f4ce7f5bc73ec164fa8b9a47d290f074 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_of_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #FF0000",
 "   .        ++  ",
 "  .   .     ++  ",
index 6bda134b6920a0d32fd317caf750b2b797ce1cba..a83db2af9059b1f2175c4178b317811f5b3bf37b 100644 (file)
@@ -2,7 +2,7 @@
 static const char * oper_s_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index d7dd6d6b2804acac9fa0c9ff1b7a7fc83e07b28e..3ef30d8187e2f5bceadb07269e222380342da810 100644 (file)
@@ -2,8 +2,8 @@
 static const char * option_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F0000",
+".     c #7f0000",
+"+     c #FF0000",
 "                ",
 "                ",
 "                ",
index e09d88b03b8c27c15916b293653d84f1824ddd85..e2421eb61064de116779ed02af37e665e37f5cce 100644 (file)
@@ -2,7 +2,7 @@
 static const char * pause_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #777777",
+".     c #afafaf",
 "q     c #000000",
 "                ",
 "                ",
index acc1eeaa2459f2984754f06e44a92a330ea78be6..70bb211a1963ab4dd5981ee349d35303ec36ae10 100644 (file)
@@ -2,7 +2,7 @@
 static const char * plot_xpm[] = {
 "16 16 4 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "+     c #0000FF",
 "@     c #FF0000",
 "                ",
index ecbdb8f5fab628937e241f9ad9df165ea952a1b5..6941429dca573495352728aebf6ac62924d5b7c3 100644 (file)
@@ -2,7 +2,7 @@
 static const char *polygon_xpm[]={
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "       ..       ",
 "      .  .      ",
index 3a1d846ae0aa47dfc15c149d8c6c88605f97c613..be90e125000232734889c46c9c0e4788945e5925 100644 (file)
@@ -2,7 +2,7 @@
 static const char * size_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "                ",
 " .............. ",
index fa68e6a0c23e9270caedff33d5fdc2bcf6608608..25aeb58de1ddad73a8524b30648775737fae37da 100644 (file)
@@ -2,8 +2,8 @@
 static const char * squize_xpm[] = {
 "16 16 3 1",
 "      c None",
-".     c #000000",
-"+     c #7F7F7F",
+".     c #007f00",
+"+     c #7FFF7F",
 "                ",
 "                ",
 "     ......     ",
index 56317c0ebb4960041d093ee6c78bbdf35e2e9f69..137dcb221f02753e74278438eebecb960dd33ab3 100644 (file)
@@ -2,7 +2,7 @@
 static const char * text_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f00",
 "                ",
 "  ............  ",
 "  ............  ",
index 5ee1dd64fa849b65a1172ee86fa0b4a9056f8014..c7f53d2cb404a91edc3ec12056602ad5c7375ffd 100644 (file)
@@ -2,7 +2,7 @@
 static const char *update_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #00007F",
+".     c #007ffF",
 "                ",
 "                ",
 "      ....      ",
index b67d50b41e3b5f26126beb253dfd8028614f3227..6996fa5df1526e3f29afd18529c3d5b203d6bf59 100644 (file)
@@ -2,7 +2,7 @@
 static const char * wire_xpm[] = {
 "16 16 2 1",
 "      c None",
-".     c #000000",
+".     c #007f7f",
 "                ",
 "                ",
 "                ",
index 79ac30a20ea70e442b48e5c9daa66db77f369a01..141a53d9f25df5eab3b94a4547cd742594874c34 100644 (file)
@@ -8,6 +8,19 @@ set(MathGL2_HAVE_QT4 "@enable-qt4@")
 set(MathGL2_HAVE_WX "@enable-wx@")
 set(MathGL2_HAVE_FLTK "@enable-fltk@")
 set(MathGL2_HAVE_GLUT "@enable-glut@")
+set(MathGL2_HAVE_PTHREAD "@CMAKE_USE_PTHREADS_INIT@")
+set(MathGL2_HAVE_OPENMP "@OPENMP_FOUND@")
+
+include(CMakeFindDependencyMacro)
+# Adding dependency for Threads imported target
+if (MathGL2_HAVE_PTHREAD STRGREATER "")
+  find_dependency(Threads)
+endif()
+
+# Adding dependency for OpenMP imported target
+if (MathGL2_HAVE_OPENMP STRGREATER "")
+  find_dependency(OpenMP)
+endif()
 
 # Compute paths
 get_filename_component(MathGL2_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
index ae6b0bdf36331fdb77a3ca1016488be899708a4d..d44125c6eeb3b068a6f365235a84cd118646afa6 100644 (file)
@@ -5,7 +5,7 @@ set(mgl_src
        export_2d.cpp export_3d.cpp eval.cpp evalp.cpp export.cpp
        fit.cpp font.cpp obj.cpp other.cpp parser.cpp pde.cpp pixel.cpp pixel_gen.cpp
        plot.cpp prim.cpp surf.cpp vect.cpp volume.cpp evalc.cpp
-       s_hull/s_hull_pro.cpp window.cpp fractal.cpp
+       s_hull/s_hull_pro.cpp window.cpp fractal.cpp random.cpp
        exec_dat.cpp exec_gr.cpp exec_set.cpp exec_prm.cpp c2mdual.c
 )
 
index 8783dcd09214f15fa29ad2a40f49e8e11ba08f12..04bcbf9a2d51c7bd940786c1310bd7fa1971a822 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -135,11 +135,11 @@ void MGL_EXPORT mgl_info(const char *str, ...)
        fclose(fp);
 }
 //-----------------------------------------------------------------------------
-MGL_EXPORT FILE *mgl_next_data(const char *fname,int p)
+MGL_EXPORT FILE *mgl_next_data(const char *fname,long p)
 {
        char *s;
-       int len;
-       static int pos=0;
+       long len;
+       static long pos=0;
        static char path[256];
 
        if(p>0) pos = p;
@@ -184,24 +184,29 @@ void MGL_EXPORT mgl_difr_grid_old(dual *a,int n,int step,dual q,int Border,dual
                {
                        default:
                        case 0:         // zero at border
+                       case 'z':
                                b[0] = 0;       b[n-1] = 0;             break;
                        case 1:         // constant at border
                                b[0] = b[1];    b[n-1] = b[n-2];        break;
                        case 2:         // linear at border
+                       case 'l':
                                b[0] = mreal(2)*b[1]-b[2];
                                b[n-1] = mreal(2)*b[n-2]-b[n-3];
                                break;
                        case 3:         // square at border
+                       case 's':
                                b[0] = b[3]+mreal(3)*(b[1]-b[2]);
                                b[n-1] = b[n-4]+mreal(3)*(b[n-2]-b[n-3]);
                                break;
                        case -1:                // exponent at border
                        case 4:
+                       case 'e':
                                b[0] = norm(b[2])<norm(b[1]) ? b[1] : b[1]*b[1]/b[2];
                                b[n-1] = norm(b[n-3])<norm(b[n-2]) ? b[n-2] : b[n-2]*b[n-2]/b[n-3];
                                break;
                        case -2:                // gaussian at border
                        case 5:
+                       case 'g':
                                b[0] = norm(b[2])<norm(b[1]) ? b[3] : pow(b[1]/b[2],3)*b[3];
                                b[n-1] = norm(b[n-3])<norm(b[n-2]) ? b[n-4] : pow(b[n-2]/b[n-3],3)*b[n-4];
                                break;
@@ -228,7 +233,7 @@ void MGL_EXPORT mgl_difr_axial_old(dual *a,int n,int step,dual q,int Border,dual
                        mreal dd = i+di;
                        dd = 1./(sqrt(dd*dd+1.)+dd);    // corrections for "axiality"
                        mreal gg = 1+dd*dd;
-                       d[i] = a[i*step] + adt*( b[i-1]*((gg-dd)/k) - b[i]*(2*gg/k) + b[i+1]*((gg+dd)/k) );
+                       d[i] = a[i*step] + adt*( b[i-1]*((gg-2*dd)/k) - b[i]*(2*gg/k) + b[i+1]*((gg+2*dd)/k) );
                }
                memcpy(b,d,n*sizeof(dual));
                switch(Border)
index 4ad83981e4999a016709db0cbf8cc44a1d356f15..d8adac5378d8e2abc1ffe4e0931d907611bad62e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -278,7 +278,7 @@ void mglCanvas::SetTickTime(char dir, mreal d, const char *t)
        }
 }
 //-----------------------------------------------------------------------------
-void mglCanvas::AdjustTicks(const char *dir, bool force, std::string stl)
+void mglCanvas::AdjustTicks(const char *dir, bool force, const std::string &stl)
 {
        if(force)       SetTuneTicks(3);
        UpdateAxis();
@@ -483,7 +483,6 @@ void mglCanvas::Axis(const char *dir, const char *stl, const char *opt)
 
        mreal angl = SaveState(opt);
        AdjustTicks(dir,mglchr(stl,'a'),Tstl);
-       LoadState();
 
        ax.pos = strchr(dir,'X') ? 'T':'t';
        ay.pos = strchr(dir,'Y') ? 'T':'t';
@@ -505,6 +504,7 @@ void mglCanvas::Axis(const char *dir, const char *stl, const char *opt)
        else if(strchr(dir,'Y') || strchr(dir,'y'))
        {       ay.inv = inv;   DrawAxis(ay, text, arr, stl, angl);     }
        set(ret, MGL_ENABLE_RTEXT);
+       LoadState();
 }
 //-----------------------------------------------------------------------------
 void mglCanvas::DrawAxis(mglAxis &aa, int text, char arr,const char *stl,mreal angl)
@@ -1056,6 +1056,7 @@ void mglCanvas::Colorbar(HCDT v, const char *sch, mreal x, mreal y, mreal w, mre
 void mglCanvas::colorbar(HCDT vv, const mreal *c, int where, mreal x, mreal y, mreal w, mreal h, bool text)
 {
        static int cgid=1;      StartGroup("Colorbar",cgid++);
+
        long n=vv->GetNx();
        mreal s3=B.pf,ss=1/s3;          // NOTE: colorbar was wider ss=0.9;
        mglPoint p1,p2;
index 2c7c916ca76bd4e78bdf2a04b2d321d969610a14..631a79f95e8444136cc269b4d2a7d8d49f4901c6 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
 #include "mgl2/font.h"\r
 #include "mgl2/base.h"\r
 #include "mgl2/eval.h"\r
+\r
+#if MGL_HAVE_FREETYPE\r
+#include <ft2build.h>\r
+#include FT_FREETYPE_H\r
+#include FT_OUTLINE_H\r
+#include FT_BBOX_H\r
+#endif\r
+\r
 #if MGL_HAVE_OMP\r
 #include <omp.h>\r
 #endif\r
@@ -121,7 +129,9 @@ void MGL_EXPORT mgl_strlwr(char *str)
 //-----------------------------------------------------------------------------\r
 mglBase::mglBase()\r
 {\r
+       mgl_init();\r
        Flag=0; saved=false;    PrmInd=NULL;\r
+       limit_pm1 = false;\r
 #if MGL_HAVE_PTHREAD\r
        pthread_mutex_init(&mutexPnt,0);\r
        pthread_mutex_init(&mutexTxt,0);\r
@@ -187,6 +197,7 @@ mglBase::~mglBase()
 #endif\r
 }\r
 //-----------------------------------------------------------------------------\r
+void mglBase::SetFontHscale(mreal val) {       fnt->HeightScale(val);  }\r
 void mglBase::RestoreFont()    {       fnt->Restore(); }\r
 void mglBase::LoadFont(const char *name, const char *path)\r
 {      if(name && *name)       fnt->Load(name,path);   else    fnt->Restore(); }\r
@@ -269,6 +280,117 @@ void mglBase::SetWarn(int code, const char *who)
 //-----------------------------------------------------------------------------\r
 //             Add glyph to the buffer\r
 //-----------------------------------------------------------------------------\r
+#if MGL_HAVE_FREETYPE\r
+MGL_NO_EXPORT int mgl_glf_moveto(const FT_Vector *to, void *user)\r
+{\r
+       std::vector<double> *a = (std::vector<double> *)user;\r
+       if(a->size()>1) {       a->push_back(NAN);      a->push_back(NAN);      }\r
+       a->push_back(to->x);    a->push_back(to->y);\r
+       return 0;\r
+}\r
+MGL_NO_EXPORT int mgl_glf_lineto(const FT_Vector *to, void *user)\r
+{\r
+       std::vector<double> *a = (std::vector<double> *)user;\r
+       if(a->size()<2) {       a->push_back(0);        a->push_back(0);        }\r
+       a->push_back(to->x);    a->push_back(to->y);\r
+       return 0;\r
+}\r
+MGL_NO_EXPORT int mgl_glf_parabto(const FT_Vector *ctrl, const FT_Vector *to, void *user)\r
+{\r
+       std::vector<double> *a = (std::vector<double> *)user;\r
+       int x0=0,y0=0, x1=ctrl->x,y1=ctrl->y, x2=to->x,y2=to->y;\r
+       size_t n=a->size();\r
+       if(n<2) {       a->push_back(0);        a->push_back(0);        }\r
+       else    {       x0 = (*a)[n-2]; y0 = (*a)[n-1]; }\r
+       for(int i=1;i<=10;i++)\r
+       {\r
+               double t = 0.1*i;\r
+               a->push_back(x0*(1-t)*(1-t)+2*(1-t)*t*x1+t*t*x2);\r
+               a->push_back(y0*(1-t)*(1-t)+2*(1-t)*t*y1+t*t*y2);\r
+       }\r
+       return 0;\r
+}\r
+MGL_NO_EXPORT int mgl_glf_cubeto(const FT_Vector *ctrl1, const FT_Vector *ctrl2, const FT_Vector *to, void *user)\r
+{\r
+       std::vector<double> *a = (std::vector<double> *)user;\r
+       int x0=0,y0=0, x1=ctrl1->x,y1=ctrl1->y, x2=ctrl2->x,y2=ctrl2->y, x3=to->x,y3=to->y;\r
+       size_t n=a->size();\r
+       if(n<2) {       a->push_back(0);        a->push_back(0);        }\r
+       else    {       x0 = (*a)[n-2]; y0 = (*a)[n-1]; }\r
+       for(int i=1;i<=30;i++)\r
+       {\r
+               double t = 0.1*i;\r
+               a->push_back(x0*(1-t)*(1-t)*(1-t) + 3*(1-t)*t*(x1*(1-t)+t*x2) + t*t*t*x3);\r
+               a->push_back(y0*(1-t)*(1-t)*(1-t) + 3*(1-t)*t*(y1*(1-t)+t*y2) + t*t*t*y3);\r
+       }\r
+       return 0;\r
+}\r
+#endif\r
+void mglGlyph::Load(wchar_t id, const char *fname)\r
+{\r
+#if MGL_HAVE_FREETYPE\r
+       FT_Library m_ftLibrary;\r
+       if(FT_Init_FreeType(&m_ftLibrary))\r
+               mgl_set_global_warn("Couldn't initialize the FreeType library.");\r
+       else\r
+       {\r
+               FT_Face m_face;\r
+               // For simplicity, always use the first face index.\r
+               if(FT_New_Face(m_ftLibrary, fname, 0, &m_face))\r
+                       mgl_set_global_warn("Couldn't load the font file.");\r
+               else\r
+               {\r
+                       // For simplicity, use the charmap FreeType provides by default;\r
+                       // in most cases this means Unicode.\r
+                       FT_UInt index = FT_Get_Char_Index(m_face, id);\r
+                       if(FT_Load_Glyph(m_face, index, FT_LOAD_NO_SCALE|FT_LOAD_NO_BITMAP))\r
+                               mgl_set_global_warn("Couldn't load the glyph.");\r
+                       else\r
+                       {\r
+                               FT_GlyphSlot slot = m_face->glyph;\r
+                               FT_Outline &outline = slot->outline;\r
+\r
+                               if(slot->format!=FT_GLYPH_FORMAT_OUTLINE || outline.n_contours <= 0 || outline.n_points <= 0 ||FT_Outline_Check(&outline))\r
+                                       mgl_set_global_warn("Outline doesn't exist.");\r
+                               else\r
+                               {\r
+                                       const FT_Fixed multiplier = 32768L;\r
+                                       FT_Matrix matrix;\r
+                                       matrix.xx = matrix.yy = multiplier;\r
+                                       matrix.xy = matrix.yx = 0;\r
+                                       FT_Outline_Transform(&outline, &matrix);\r
+                                       \r
+                                       FT_Outline_Funcs callbacks;\r
+                                       callbacks.move_to = mgl_glf_moveto;\r
+                                       callbacks.line_to = mgl_glf_lineto;\r
+                                       callbacks.conic_to = mgl_glf_parabto;\r
+                                       callbacks.cubic_to = mgl_glf_cubeto;\r
+                                       callbacks.shift = 0;\r
+                                       callbacks.delta = 0;\r
+                                       std::vector<double> xy_coor;\r
+                                       if(FT_Outline_Decompose(&outline, &callbacks, &xy_coor))\r
+                                               mgl_set_global_warn("Couldn't extract the outline.");\r
+                                       nt = -id;       // TODO optimize and copy points. Q: actual width? Q: cmp with known.\r
+                                       FT_BBox boundingBox;\r
+                                       FT_Outline_Get_BBox(&outline, &boundingBox);\r
+                                       FT_Pos xMin = boundingBox.xMin;\r
+                                       FT_Pos yMin = boundingBox.yMin;\r
+                                       FT_Pos xMax = boundingBox.xMax;\r
+                                       FT_Pos yMax = boundingBox.yMax;\r
+/*                                     m_xMin = xMin;\r
+                                       m_yMin = yMin;\r
+                                       m_width = xMax - xMin;\r
+                                       m_height = yMax - yMin;*/\r
+\r
+                               }\r
+                       }\r
+                       FT_Done_Face(m_face);\r
+               }\r
+       }\r
+       FT_Done_FreeType(m_ftLibrary);\r
+#endif\r
+}\r
+//-----------------------------------------------------------------------------\r
 void mglGlyph::Create(long Nt, long Nl)\r
 {\r
 //     if(Nt<0 || Nl<0)        return;\r
@@ -374,7 +496,7 @@ static void mgl_coor_box(HMGL gr, mglPoint &p)
        mgl_put_inbox(gr->Min.y, gr->Max.y, p.y);\r
        mgl_put_inbox(gr->Min.z, gr->Max.z, p.z);\r
 }\r
-long mglBase::AddPnt(const mglMatrix *mat, mglPoint p, mreal c, mglPoint n, mreal a, int scl)\r
+long mglBase::AddPnt(const mglMatrix *mat, const mglPoint &p, mreal c, const mglPoint &n, mreal a, int scl)\r
 {\r
        mglPnt q;\r
        if(!AddPntQ(q,mat,p,c,n,a,scl)) return -1;\r
@@ -455,7 +577,7 @@ bool mglBase::CopyNtoC(mglPnt &q, long from, mreal c)
        return mgl_isnum(q.x);\r
 }\r
 //-----------------------------------------------------------------------------\r
-long mglBase::CopyProj(long from, mglPoint p, mglPoint n, short sub)\r
+long mglBase::CopyProj(long from, const mglPoint &p, const mglPoint &n, short sub)\r
 {\r
        mglPnt q;\r
        if(!CopyProj(q,from,p,n,sub))   return -1;\r
@@ -464,7 +586,7 @@ long mglBase::CopyProj(long from, mglPoint p, mglPoint n, short sub)
        {k=Pnt.size();  MGL_PUSH(Pnt,q,mutexPnt);}      return k;\r
 }\r
 //-----------------------------------------------------------------------------\r
-bool mglBase::CopyProj(mglPnt &q, long from, mglPoint p, mglPoint n, short sub)\r
+bool mglBase::CopyProj(mglPnt &q, long from, const mglPoint &p, const mglPoint &n, short sub)\r
 {\r
        if(from<0)      return false;\r
        q=Pnt[from];    q.sub = sub;\r
@@ -659,6 +781,12 @@ bool mglBase::ScalePoint(const mglMatrix *, mglPoint &p, mglPoint &n, bool use_n
        if(fabs(x)>MGL_FEPSILON || fabs(y)>MGL_FEPSILON || fabs(z)>MGL_FEPSILON)        res = false;\r
 \r
        if(!res && use_nan)     x = NAN;        // extra sign that point shouldn't be plotted\r
+       else if(limit_pm1)\r
+       {\r
+               x = x>1?1:(x<-1?-1:x);\r
+               y = y>1?1:(y<-1?-1:y);\r
+               z = z>1?1:(z<-1?-1:z);\r
+       }\r
        return res;\r
 }\r
 //-----------------------------------------------------------------------------\r
@@ -693,7 +821,7 @@ void mglBase::SetOrigin(mreal x0, mreal y0, mreal z0, mreal c0)
        }\r
 }\r
 //-----------------------------------------------------------------------------\r
-void mglBase::SetRanges(mglPoint m1, mglPoint m2)\r
+void mglBase::SetRanges(const mglPoint &m1, const mglPoint &m2)\r
 {\r
        if(mgl_isrange(m1.x, m2.x))     {       Min.x=m1.x;     Max.x=m2.x;     }\r
        if(mgl_isrange(m1.y, m2.y))     {       Min.y=m1.y;     Max.y=m2.y;     }\r
@@ -1431,7 +1559,7 @@ mreal mglBase::SaveState(const char *opt)
                s=q;    q=strchr(s,';');\r
                if(q)   {       *q=0;   q++;    }\r
                mgl_strtrim(s);         char *a=s;\r
-               long n=mglFindArg(s);   if(n>0) {       s[n]=0;         s=s+n+1;        }\r
+               long n=mglFindArg(s);   if(n>0) {       s[n]=0; s=s+n+1;        }\r
                mgl_strtrim(a);         char *b=s;\r
                n=mglFindArg(s);        if(n>0) {       s[n]=0;         s=s+n+1;        }\r
                mgl_strtrim(b);\r
@@ -1447,7 +1575,7 @@ mreal mglBase::SaveState(const char *opt)
                        if(a[0]=='x')           {       Min.x=ff;       Max.x=ss;       }\r
                        else if(a[0]=='y')      {       Min.y=ff;       Max.y=ss;       }\r
                        else if(a[0]=='z')      {       Min.z=ff;       Max.z=ss;       }\r
-//                     else if(a[0]=='c')      {       Min.c=ff;       Max.c=ss;       }       // Bad idea since there is formula for coloring\r
+// NOTE!       else if(a[0]=='c')      {       Min.c=ff;       Max.c=ss;       }       // Bad idea since there is formula for coloring\r
                }\r
                else if(!strcmp(a,"cut"))               SetCut(ff!=0);\r
                else if(!strcmp(a,"meshnum"))   SetMeshNum(ff);\r
index 2e69a0269c66188ede860a158c7e2390a22ef756..0abb3abc5d4e7239d649e4849ed9d830722fe60e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -77,17 +77,23 @@ int MGL_EXPORT_PURE mgl_get_warn(HMGL gr)   {       return gr->GetWarn();   }
 void MGL_EXPORT mgl_set_warn(HMGL gr, int code, const char *txt)\r
 {      gr->SetWarn(code,txt);  }\r
 extern bool mglPrintWarn;\r
+extern MGL_EXPORT std::string *mglGlobalMess;  ///< Buffer for receiving global messages\r
 void MGL_EXPORT mgl_set_global_warn(const char *txt)\r
 {\r
        if(txt && *txt)\r
        {\r
-               mglGlobalMess += txt;   mglGlobalMess += '\n';\r
+               *mglGlobalMess += txt;  *mglGlobalMess += '\n';\r
                if(mglPrintWarn)        fprintf(stderr,_("Global message - %s\n"),txt);\r
        }\r
 }\r
 void MGL_EXPORT mgl_set_global_warn_(const char *txt, int l)\r
 {      char *s=new char[l+1];  memcpy(s,txt,l);        s[l]=0; mgl_set_global_warn(s); delete []s;     }\r
-MGL_EXPORT_PURE const char *mgl_get_global_warn()      {       return mglGlobalMess.c_str();   }\r
+void MGL_EXPORT mgl_clear_global_warn()\r
+{      *mglGlobalMess = "";    }\r
+void MGL_EXPORT mgl_clear_global_warn_()\r
+{      mgl_clear_global_warn();        }\r
+MGL_EXPORT_PURE const char *mgl_get_global_warn()\r
+{      return mglGlobalMess->empty()?"":mglGlobalMess->c_str();        }\r
 int MGL_EXPORT mgl_get_global_warn_(char *out, int len)\r
 {\r
        const char *res = mgl_get_global_warn();\r
@@ -206,6 +212,7 @@ void MGL_EXPORT mgl_set_scale_text(HMGL gr, int enable)             {       gr->set(!enable, MGL_
 void MGL_EXPORT mgl_set_mark_size(HMGL gr, double size)                {       gr->SetMarkSize(size);  }\r
 void MGL_EXPORT mgl_set_arrow_size(HMGL gr, double size)       {       gr->SetArrowSize(size); }\r
 void MGL_EXPORT mgl_set_font_size(HMGL gr, double size)                {       gr->SetFontSize(size);  }\r
+void MGL_EXPORT mgl_set_font_hscale(HMGL gr, double scale)     {       gr->SetFontHscale(scale);       }\r
 void MGL_EXPORT mgl_set_font_def(HMGL gr, const char *fnt)     {       gr->SetFontDef(fnt);    }\r
 void MGL_EXPORT mgl_load_font(HMGL gr, const char *name, const char *path)\r
 {      gr->LoadFont(name,path);        }\r
@@ -219,6 +226,7 @@ void MGL_EXPORT mgl_set_scale_text_(uintptr_t *gr, int *enable)     {       mgl_set_scale_
 void MGL_EXPORT mgl_set_mark_size_(uintptr_t *gr, mreal *size)         {       _GR_->SetMarkSize(*size);       }\r
 void MGL_EXPORT mgl_set_arrow_size_(uintptr_t *gr, mreal *size)        {       _GR_->SetArrowSize(*size);      }\r
 void MGL_EXPORT mgl_set_font_size_(uintptr_t *gr, mreal *size)         {       _GR_->SetFontSize(*size);       }\r
+void MGL_EXPORT mgl_set_font_hscale_(uintptr_t *gr, double *scale)     {       _GR_->SetFontHscale(*scale);    }\r
 void MGL_EXPORT mgl_set_font_def_(uintptr_t *gr, const char *name, int l)\r
 {      char *s=new char[l+1];          memcpy(s,name,l);       s[l]=0;\r
        _GR_->SetFontDef(s);    delete []s;     }\r
@@ -232,13 +240,13 @@ void MGL_EXPORT mgl_restore_font_(uintptr_t *gr)  {       _GR_->RestoreFont();    }
 void MGL_EXPORT mgl_define_symbol_(uintptr_t *gr, char *id, uintptr_t *x, uintptr_t *y, int)\r
 {      _GR_->DefineGlyph(_DA_(x),_DA_(y),id?*id:0);    }\r
 //-----------------------------------------------------------------------------\r
-extern mglFont mglDefFont;\r
+extern mglFont *mglDefFont;\r
 void MGL_EXPORT mgl_def_font(const char *name, const char *path)\r
-{      mglDefFont.Load(name,path);     }\r
+{      mglDefFont->Load(name,path);    }\r
 void MGL_EXPORT mgl_def_font_(const char *name, const char *path,int l,int n)\r
 {      char *s=new char[l+1];          memcpy(s,name,l);       s[l]=0;\r
        char *d=new char[n+1];          memcpy(d,path,n);       d[n]=0;\r
-       mglDefFont.Load(name,path);     delete []s;             delete []d;     }\r
+       mglDefFont->Load(name,path);    delete []s;             delete []d;     }\r
 //-----------------------------------------------------------------------------\r
 int MGL_EXPORT mgl_check_version(const char *ver)\r
 {      double v=0;     int r = sscanf(ver,"2.%lg",&v);\r
@@ -247,6 +255,11 @@ int MGL_EXPORT mgl_check_version_(const char *ver, int l)
 {      char *s=new char[l+1];          memcpy(s,ver,l);        s[l]=0;\r
        int r=mgl_check_version(s);     delete []s;     return r;       }\r
 //-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_set_tex_parse(HMGL gr, int val)\r
+{      gr->GetFont()->parse=val;       }\r
+void MGL_EXPORT mgl_set_tex_parse_(uintptr_t *gr, int *val)\r
+{      _GR_->GetFont()->parse=*val;    }\r
+//-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_start_group(HMGL gr, const char *s)        {       gr->StartAutoGroup(s);  }\r
 void MGL_EXPORT mgl_end_group(HMGL gr) {       gr->EndGroup(); }\r
 void MGL_EXPORT mgl_start_group_(uintptr_t *gr, const char *name,int l)\r
index 3c5abbec3c18af2c317fd2ed424605e2438c448d..bc13bd07cbb5c35e3c76513bbcb6478fafaf888e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -21,8 +21,6 @@
 #include "mgl2/font.h"\r
 #include "mgl2/canvas.h"\r
 //-----------------------------------------------------------------------------\r
-MGL_EXPORT std::string mglGlobalMess;  ///< Buffer for receiving global messages\r
-//-----------------------------------------------------------------------------\r
 mglCanvas::mglCanvas(int w, int h) : mglBase()\r
 {\r
        clr(MGL_DISABLE_SCALE);\r
@@ -228,12 +226,12 @@ GifFileType *gif;*/
        ax.Clear();     ay.Clear();     az.Clear();     ac.Clear();\r
        mgl_clear_fft();                DefMaskAn=0;    ResetMask();\r
        SetTickRotate(true);    SetTickSkip(true);\r
-       SetWarn(mglWarnNone,"");        mglGlobalMess = "";\r
+       SetWarn(mglWarnNone,"");        mgl_clear_global_warn();\r
        ObjId = -1;     HighId = INT_MIN;\r
        SetFunc(0,0);   CutOff(0);      Ternary(0);\r
        Stop=false;     event_cb = NULL;        event_par=NULL;\r
        SetRanges(mglPoint(-1,-1,-1,-1), mglPoint(1,1,1,1));\r
-       SetOrigin(NAN,NAN,NAN,NAN);\r
+       SetOrigin(NAN,NAN,NAN,NAN);     set(0, MGL_NO_ORIGIN);\r
        SetBarWidth(0.7);       SetMarkSize(1); SetArrowSize(1);\r
        SetAlphaDef(0.5);               FontDef[0]=0;\r
        SetTranspType(0);               SetMeshNum(0);  // NOTE: default MeshNum=0\r
@@ -965,7 +963,7 @@ void mglCanvas::Legend(const std::vector<mglText> &leg, mreal x, mreal y, const
        strcpy(ff,fmt?fmt:"");  strcat(ff,":L");        Push();\r
        if((pA=strchr(ff,'A')))\r
        {       *pA = ' ';      InPlot(0,1,0,1,false);  iw=B1.b[0];     ih=B1.b[4];     }\r
-       else if(mglchr(font,'A'))\r
+       else if(strchr(font,'A'))\r
        {       InPlot(0,1,0,1,false);  iw=B1.b[0];     ih=B1.b[4];     }\r
        else    {       iw=B1.b[0]/B1.pf;       ih=B1.b[4]/B1.pf;       }\r
        // find sizes\r
@@ -986,7 +984,7 @@ void mglCanvas::Legend(const std::vector<mglText> &leg, mreal x, mreal y, const
                nrow = 1+(n-1)/j;\r
                ncol = (n+nrow-1)/nrow;\r
        }\r
-       if(mglchr(font,'^'))    // use "external" positioning\r
+       if(strchr(font,'^'))    // use "external" positioning\r
        {\r
                x = x>=0.5 ? x*iw : x*iw-w*ncol-2*dx;\r
                y = y>=0.5 ? y*ih : y*ih-h*nrow-2*dy;\r
@@ -1001,6 +999,7 @@ void mglCanvas::Legend(const std::vector<mglText> &leg, mreal x, mreal y, const
        mglPoint p,q(NAN,NAN,NAN);\r
 \r
        mreal cc = AddTexture(font);\r
+       SetMask("");\r
        mreal c1,c2;    //=AddTexture(char(k1?k1:'w')), c2=AddTexture(char(k2?k2:'k'));\r
        if(cc<2 || Txt[long(cc+0.5)].n==0)\r
        {       c1 = AddTexture('w');   cc = c2 = AddTexture('k');      }\r
@@ -1189,7 +1188,7 @@ void mglCanvas::StartAutoGroup (const char *lbl)
 //-----------------------------------------------------------------------------\r
 void mglCanvas::EndGroup()\r
 {\r
-       LoadState();\r
+       LoadState();    SetMask("");\r
        if(Quality&MGL_DRAW_LMEM)\r
        {\r
                Pnt.clear();    Prm.clear();    Ptx.clear();    ClearPrmInd();\r
index ad29c5546605e042301da42ae0a8e498de9bcac1..e93f74beec143652bebeb7219614888e653c157a 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
 #include "mgl2/canvas_cf.h"\r
 #include "mgl2/eval.h"\r
 #include "mgl2/evalc.h"\r
+#include "mgl2/font.h"\r
 //-----------------------------------------------------------------------------\r
 #undef _GR_\r
 #define _GR_   ((mglCanvas *)(*gr))\r
 //-----------------------------------------------------------------------------\r
+MGL_EXPORT std::string *mglGlobalMess; ///< Buffer for receiving global messages\r
+MGL_EXPORT mglCanvas *mglDefaultGr=NULL;       ///< Default HMGL object\r
+extern mglFont *mglDefFont;\r
+#if MGL_HAVE_PTHREAD\r
+pthread_mutex_t mutexRnd;\r
+#endif\r
+//-----------------------------------------------------------------------------\r
+float MGL_EXPORT mgl_cos[360];\r
+void MGL_EXPORT MGL_FUNC_INIT mgl_init()       // TODO try to add ld option: "-init mgl_init"\r
+{\r
+       static bool ini=true;\r
+       if(ini)\r
+       {\r
+               ini = false;\r
+               mglGlobalMess = new std::string;\r
+               mgl_textdomain(NULL,"");\r
+#if MGL_HAVE_PTHREAD\r
+               pthread_mutex_init(&mutexRnd,0);\r
+#endif\r
+#ifndef WIN32  // win32 don't initialized threads before main()\r
+#pragma omp parallel for\r
+#endif\r
+               for(long i=0;i<360;i++) mgl_cos[i] = cos(i*M_PI/180.);\r
+               if(!mglDefFont)         mglDefFont = new mglFont(MGL_DEF_FONT_NAME);\r
+               if(!mglDefaultGr)       mglDefaultGr = new mglCanvas(600,400);\r
+       }\r
+}\r
+void MGL_EXPORT MGL_FUNC_FINI mgl_fini()       // TODO try to add ld option: "-fini mgl_fini"\r
+{\r
+       if(mglDefaultGr)        {       delete mglDefaultGr;mglDefaultGr=NULL;  }\r
+       if(mglDefFont)          {       delete mglDefFont;      mglDefFont=NULL;        }\r
+}\r
+//-----------------------------------------------------------------------------\r
 MGL_EXPORT const unsigned char *mgl_get_rgb(HMGL gr)\r
 {      mglCanvas *g = dynamic_cast<mglCanvas *>(gr);   return g?g->GetBits():0;        }\r
 MGL_EXPORT const unsigned char *mgl_get_rgba(HMGL gr)\r
@@ -111,6 +145,10 @@ void MGL_EXPORT mgl_clf_str(HMGL gr, const char *col)
 {      mglCanvas *g = dynamic_cast<mglCanvas *>(gr);   if(g)   g->Clf(col);    }\r
 void MGL_EXPORT mgl_load_background(HMGL gr, const char *fn, double alpha)\r
 {      mglCanvas *g = dynamic_cast<mglCanvas *>(gr);   if(g)   g->LoadBackground(fn,alpha);    }\r
+void MGL_EXPORT mgl_load_background_ext(HMGL gr, const char *fn, const char *how, double alpha)\r
+{      mglCanvas *g = dynamic_cast<mglCanvas *>(gr);   if(g)   g->LoadBackground(fn,how,alpha);        }\r
+void MGL_EXPORT mgl_fill_background(HMGL gr, double r, double g, double b)\r
+{      mglCanvas *gg = dynamic_cast<mglCanvas *>(gr);  if(gg)  gg->FillBackground(mglColor(r,g,b));    }\r
 //-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_subplot_d(HMGL gr, int nx,int ny,int m,const char *style,double dx,double dy)\r
 {\r
@@ -226,6 +264,12 @@ void MGL_EXPORT mgl_clf_str_(uintptr_t *gr, const char *col, int l)
 void MGL_EXPORT mgl_load_background_(uintptr_t *gr, const char *fn, mreal *a, int l)\r
 {      char *s=new char[l+1];  memcpy(s,fn,l); s[l]=0;\r
        mgl_load_background(_GR_,s,*a); delete []s;     }\r
+void MGL_EXPORT mgl_load_background_ext_(uintptr_t *gr, const char *fn, const char *how, mreal *a, int l,int m)\r
+{      char *s=new char[l+1];  memcpy(s,fn,l);         s[l]=0;\r
+       char *h=new char[m+1];  memcpy(h,how,l);        h[m]=0;\r
+       mgl_load_background_ext(_GR_,s,h,*a);   delete []s;     delete []h;     }\r
+void MGL_EXPORT mgl_fill_background_(uintptr_t *gr, double *r, double *g, double *b)\r
+{      mgl_fill_background(_GR_,*r,*g,*b);     }\r
 //-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_subplot_d_(uintptr_t *gr, int *nx,int *ny,int *m,const char *st, mreal *dx, mreal *dy,int l)\r
 {      char *s=new char[l+1];  memcpy(s,st,l); s[l]=0;\r
@@ -290,6 +334,12 @@ double mgl_size_scl = 1;
 HMGL MGL_EXPORT mgl_create_graph(int width, int height)\r
 {      return new mglCanvas(width,height);     }\r
 void MGL_EXPORT mgl_delete_graph(HMGL gr)      {       if(gr)  delete gr;      }\r
+HMGL MGL_EXPORT mgl_default_graph()\r
+{\r
+       if(!mglDefaultGr)\r
+               mglDefaultGr = new mglCanvas(600,400);\r
+       return mglDefaultGr;\r
+}\r
 void MGL_EXPORT mgl_set_size_scl(double scl){  if(scl>0)       mgl_size_scl = scl;     }\r
 void MGL_EXPORT mgl_set_size(HMGL gr, int width, int height)\r
 {\r
@@ -384,6 +434,7 @@ void MGL_EXPORT mgl_set_legend_marks(HMGL gr, int num)
 uintptr_t MGL_EXPORT mgl_create_graph_(int *width, int *height)\r
 {      return uintptr_t(new mglCanvas(*width,*height));        }\r
 void MGL_EXPORT mgl_delete_graph_(uintptr_t *gr)       {       delete _GR_;    }\r
+uintptr_t MGL_EXPORT mgl_default_graph_()      {       return uintptr_t(&mglDefaultGr);        }\r
 void MGL_EXPORT mgl_set_size_scl_(double *scl) {       mgl_set_size_scl(*scl); }\r
 void MGL_EXPORT mgl_set_size_(uintptr_t *gr, int *width, int *height)\r
 {      mgl_set_size(_GR_,*width,*height);      }\r
@@ -451,13 +502,13 @@ void MGL_EXPORT mgl_label_(uintptr_t *gr, const char *dir, const char *text, mre
        char *o=new char[m+1];  memcpy(o,opt,m);        o[m]=0;\r
        _GR_->Label(*dir, s, *pos, o);  delete []s;     delete []o;     }\r
 //-----------------------------------------------------------------------------\r
-void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch,int l)\r
+void MGL_EXPORT mgl_colorbar_(uintptr_t *gr, const char *sch, int l)\r
 {      char *s=new char[l+1];  memcpy(s,sch,l);        s[l]=0;\r
        _GR_->Colorbar(s);      delete []s;     }\r
 void MGL_EXPORT mgl_colorbar_ext_(uintptr_t *gr, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int l)\r
 {      char *s=new char[l+1];  memcpy(s,sch,l);        s[l]=0;\r
        _GR_->Colorbar(s,*x,*y,*w,*h);  delete []s;     }\r
-void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch,int l)\r
+void MGL_EXPORT mgl_colorbar_val_(uintptr_t *gr, uintptr_t *dat, const char *sch, int l)\r
 {      char *s=new char[l+1];  memcpy(s,sch,l);        s[l]=0;\r
        _GR_->Colorbar(_DA_(dat), s);   delete []s;     }\r
 void MGL_EXPORT mgl_colorbar_val_ext_(uintptr_t *gr, uintptr_t *dat, const char *sch, mreal *x, mreal *y, mreal *w, mreal *h, int l)\r
index 4957a3f8e935a922694022118c5c59065583ca42..f2684d272c00326f878ed836e84a551e05025076 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -1114,20 +1114,20 @@ void MGL_EXPORT mgl_datac_diffr(HADT d, const char *how, mreal q)
                p[0]=nz;        p[1]=nx*ny;     p[2]=0;\r
                mglStartThreadC(mgl_difr,0,nx*ny,d->a,&qq,0,p);\r
        }\r
-       if(mglchr(how,'y') && ny>1 && !axial)\r
+       if(mglchr(how,'y') && ny>1)\r
        {\r
                p[0]=ny;        p[1]=nx;        p[2]=0;\r
                mglStartThreadC(mgl_difr,0,nx*nz,d->a,&qq,0,p);\r
        }\r
-       if(mglchr(how,'x') && nx>1 && !axial)\r
+       if(axial && nx>1)\r
        {\r
-               p[0]=nx;        p[1]=1; p[2]=0;\r
+               p[0]=nx;        p[1]=1; p[2]=1;\r
                mglStartThreadC(mgl_difr,0,ny*nz,d->a,&qq,0,p);\r
        }\r
-       if(axial && nx>1)\r
+       else if(mglchr(how,'x') && nx>1)\r
        {\r
-               p[0]=nx;        p[1]=1; p[2]=1;\r
-               mglStartThreadC(mgl_difr,0,ny*nz,0,&qq,0,p);\r
+               p[0]=nx;        p[1]=1; p[2]=0;\r
+               mglStartThreadC(mgl_difr,0,ny*nz,d->a,&qq,0,p);\r
        }\r
 }\r
 //-----------------------------------------------------------------------------\r
index 718f7ee8a61bb5afa48d3731dda019ac6ccc6cf2..084048f4a299c5dee29cca445124645bddf4ffd6 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -23,7 +23,6 @@
 #include "mgl2/thread.h"\r
 #include "interp.hpp"\r
 void MGL_NO_EXPORT mgl_txt_funcC(const mreal *x, mreal *dx, void *par);\r
-HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 HADT MGL_EXPORT mgl_datac_trace(HCDT d)\r
 {\r
@@ -123,14 +122,14 @@ HADT MGL_EXPORT mgl_datac_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz)
 #pragma omp parallel for\r
                        for(long i0=0;i0<n*m*l;i0++)\r
                        {\r
-                               long x=long(0.5+xx->vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0));\r
+                               long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0)));\r
                                r->a[i0] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?dd->a[x+nx*(y+ny*z)]:NAN;\r
                        }\r
                else\r
 #pragma omp parallel for\r
                        for(long i0=0;i0<n*m*l;i0++)\r
                        {\r
-                               long x=long(0.5+xx->vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0));\r
+                               long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0)));\r
                                r->a[i0] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?d->v(x,y,z):NAN;\r
                        }\r
        }\r
@@ -145,14 +144,14 @@ HADT MGL_EXPORT mgl_datac_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz)
 #pragma omp parallel for collapse(3)\r
                        for(long k=0;k<l;k++)   for(long j=0;j<m;j++)   for(long i=0;i<n;i++)\r
                        {\r
-                               long x=long(0.5+xx->v(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k));\r
+                               long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k)));\r
                                r->a[i+n*(j+m*k)] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?dd->a[x+nx*(y+ny*z)]:NAN;\r
                        }\r
                else\r
 #pragma omp parallel for collapse(3)\r
                        for(long k=0;k<l;k++)   for(long j=0;j<m;j++)   for(long i=0;i<n;i++)\r
                        {\r
-                               long x=long(0.5+xx->v(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k));\r
+                               long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k)));\r
                                r->a[i+n*(j+m*k)] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?d->v(x,y,z):NAN;\r
                        }\r
                if(m==1)        {       r->ny=r->nz;    r->nz=1;        }// "squeeze" dimensions\r
@@ -723,3 +722,54 @@ uintptr_t MGL_EXPORT mgl_find_roots_txt_c_(const char *func, const char *vars, u
        uintptr_t r = uintptr_t(mgl_find_roots_txt_c(s,v,_DA_(ini)));\r
        delete []s;     delete []v;     return r;       }\r
 //-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_datac_keep(HADT dat, const char *how, long i, long j)\r
+{\r
+       const long nx = dat->GetNx(), ny = dat->GetNy(), nz = dat->GetNz();\r
+       const bool phase = !mglchr(how, 'a');\r
+       if(mglchr(how,'z'))\r
+       {\r
+               long ix = i, iy = j;\r
+               if(ix<0 || ix>=nx)      ix = 0;\r
+               if(iy<0 || iy>=ny)      iy = 0;\r
+               const long i0 = ix+nx*iy, nn = nx*ny;\r
+               const dual v0 = dat->a[i0];\r
+               for(long k=0;k<nz;k++)\r
+               {\r
+                       dual v = dat->a[i0+nn*k], f = v0/v;\r
+                       if(phase) f /= abs(f);\r
+                       for(long ii=0;ii<nn;ii++)       dat->a[ii+nn*k] *= f;\r
+               }\r
+       }\r
+       else if(mglchr(how,'x'))\r
+       {\r
+               long iy = i, iz = j;\r
+               if(iz<0 || iz>=nz)      iz = 0;\r
+               if(iy<0 || iy>=ny)      iy = 0;\r
+               const long i0 = nx*(iy+ny*iz), nn = ny*nz;\r
+               const dual v0 = dat->a[i0];\r
+               for(long k=0;k<nx;k++)\r
+               {\r
+                       dual v = dat->a[i0+k], f = v0/v;\r
+                       if(phase) f /= abs(f);\r
+                       for(long ii=0;ii<nn;ii++)       dat->a[k+nx*ii] *= f;\r
+               }\r
+       }\r
+       else    // default is "y"\r
+       {\r
+               long ix = i, iz = j;\r
+               if(ix<0 || ix>=nx)      ix = 0;\r
+               if(iz<0 || iz>=nz)      iz = 0;\r
+               const long i0 = ix+nx*ny*iz;\r
+               const dual v0 = dat->a[i0];\r
+               for(long k=0;k<ny;k++)\r
+               {\r
+                       dual v = dat->a[i0+nx*k], f = v0/v;\r
+                       if(phase) f /= abs(f);\r
+                       for(long ii=0;ii<nz;ii++)       for(long jj=0;jj<nx;jj++)       dat->a[jj+nx*(k+ny*ii)] *= f;\r
+               }\r
+       }\r
+}\r
+void MGL_EXPORT mgl_datac_keep_(uintptr_t *d, const char *how, long *i, long *j, int l)\r
+{      char *s=new char[l+1];  memcpy(s,how,l);        s[l]=0;\r
+       mgl_datac_keep(_DC_, s, *i, *j);        delete []s;     }\r
+//-----------------------------------------------------------------------------\r
index 8cdf0e1514e77425a6ae099004e2abd20cbf4397..4096eaca1abec52d3a4f2bda4104f3bf7adccba3 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -34,7 +34,6 @@
 \r
 inline bool isn(char ch)       {return ch=='\n';}\r
 MGL_NO_EXPORT char *mgl_read_gz(gzFile fp);\r
-HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 HADT MGL_EXPORT mgl_create_datac()     {       return new mglDataC;    }\r
 HADT MGL_EXPORT mgl_create_datac_size(long nx, long ny, long nz){      return new mglDataC(nx,ny,nz);  }\r
@@ -42,14 +41,14 @@ HADT MGL_EXPORT mgl_create_datac_file(const char *fname)            {       return new mglDataC(
 void MGL_EXPORT mgl_delete_datac(HADT d)       {       if(d)   delete d;       }\r
 //-----------------------------------------------------------------------------\r
 uintptr_t MGL_EXPORT mgl_create_datac_()\r
-{      return uintptr_t(new mglDataC());       }\r
+{      return uintptr_t(mgl_create_datac());   }\r
 uintptr_t MGL_EXPORT mgl_create_datac_size_(int *nx, int *ny, int *nz)\r
-{      return uintptr_t(new mglDataC(*nx,*ny,*nz));    }\r
+{      return uintptr_t(mgl_create_datac_size(*nx,*ny,*nz));   }\r
 uintptr_t MGL_EXPORT mgl_create_datac_file_(const char *fname,int l)\r
 {      char *s=new char[l+1];  memcpy(s,fname,l);      s[l]=0;\r
-       uintptr_t r = uintptr_t(new mglDataC(s));       delete []s;     return r;       }\r
+       uintptr_t r = uintptr_t(mgl_create_datac_file(s));      delete []s;     return r;       }\r
 void MGL_EXPORT mgl_delete_datac_(uintptr_t *d)\r
-{      if(_DC_)        delete _DC_;    }\r
+{      mgl_delete_datac(_DC_); }\r
 //-----------------------------------------------------------------------------\r
 cmdual MGL_EXPORT mgl_atoc(const char *s, int adv)\r
 {\r
@@ -882,8 +881,9 @@ int MGL_EXPORT mgl_datac_read_hdf(HADT d,const char *fname,const char *data)
        hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);\r
        if(hf<0)        return 0;\r
        hd = H5Dopen(hf,data);\r
-       if(hd<0)        return 0;\r
+       if(hd<0)        {       H5Fclose(hf);   return 0;       }\r
        hs = H5Dget_space(hd);\r
+       if(hs<0)        {       H5Dclose(hd);   H5Fclose(hf);   return 0;       }\r
        rank = H5Sget_simple_extent_ndims(hs);\r
        if(rank>0 && rank<=4)\r
        {\r
index 8afef5ad940eb34c1469d1ecf504291ac3c515f2..f35ef26c2f0b2fbcefc2732bc7879eb113a408e0 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -33,6 +33,7 @@
 #include "mgl2/eval.h"\r
 #include "mgl2/font.h"\r
 #include "mgl2/base.h"\r
+#include "cont.hpp"\r
 //-----------------------------------------------------------------------------\r
 //\r
 //     Text printing along a curve\r
@@ -195,10 +196,176 @@ char *o=new char[lo+1];  memcpy(o,opt,lo);       o[lo]=0;
 mgl_text_y(_GR_, _DA_(y),s,f,o);       delete []o;     delete []s;     delete []f;     }\r
 //-----------------------------------------------------------------------------\r
 //\r
-//     Cont series\r
+//     DCont series\r
 //\r
 //-----------------------------------------------------------------------------\r
-#include "cont.hpp"\r
+bool mglSegment::set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z)\r
+{\r
+       bool res=(v1>=0 && v1<=MGL_FEPSILON && u1>=0 && u1<=MGL_FEPSILON && v2>=0 && v2<=MGL_FEPSILON && u2>=0 && u2<=MGL_FEPSILON);\r
+       if(v1==v2 && u1==u2)    res=false;      // NOTE: shouldn't be here never\r
+       if(res)\r
+       {\r
+               p1.Set(mgl_data_linear(x,i+u1,j+v1,k), mgl_data_linear(y,i+u1,j+v1,k), mgl_data_linear(z,i+u1,j+v1,k));\r
+               p2.Set(mgl_data_linear(x,i+u2,j+v2,k), mgl_data_linear(y,i+u2,j+v2,k), mgl_data_linear(z,i+u2,j+v2,k));\r
+       }\r
+       return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
+void mglSegment::set(const mglPoint &q1, const mglPoint &q2,HCDT x, HCDT y, HCDT z, bool nboth)\r
+{\r
+       if(nboth)\r
+       {\r
+               p1.Set(mgl_data_linear(x,q1.x,0,0), mgl_data_linear(y,q1.y,0,0), mgl_data_linear(z,q1.z,0,0));\r
+               p2.Set(mgl_data_linear(x,q2.x,0,0), mgl_data_linear(y,q2.y,0,0), mgl_data_linear(z,q2.z,0,0));\r
+       }\r
+       else\r
+       {\r
+               p1.Set(mgl_data_linear(x,q1.x,q1.y,q1.z), mgl_data_linear(y,q1.x,q1.y,q1.z), mgl_data_linear(z,q1.x,q1.y,q1.z));\r
+               p2.Set(mgl_data_linear(x,q2.x,q2.y,q2.z), mgl_data_linear(y,q2.x,q2.y,q2.z), mgl_data_linear(z,q2.x,q2.y,q2.z));\r
+       }\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_NO_EXPORT mgl_dcont_add_pnt(mglPoint p1, mglPoint p2, HCDT b, mreal val, std::vector<mglPoint> &pp)\r
+{\r
+       mreal b1=b->Linear(p1.x,p1.y,p1.z), b2=b->Linear(p2.x,p2.y,p2.z);\r
+       mreal d = (val-b1)/(b2-b1);\r
+       if(d>=0 && d<=1)        pp.push_back(p2*d+p1*(1-d));\r
+}\r
+//-----------------------------------------------------------------------------\r
+std::vector<mglSegment> MGL_EXPORT mgl_get_dlines(mreal val, HCDT a, HCDT b, HCDT x, HCDT y, HCDT z)\r
+{\r
+       long nx=a->GetNx(), ny=a->GetNy(), nz=a->GetNz(), nn=nx*ny;\r
+       bool nboth = mgl_isnboth(x,y,z,a);\r
+       std::vector<mglSegment> lines;\r
+       for(long k=0;k<nz-1;k++)        for(long j=0;j<ny-1;j++)        for(long i=0;i<nx-1;i++)\r
+       {\r
+               std::vector<mglPoint> pp;\r
+               long i0 = i+nx*(j+ny*k);\r
+               mreal v1=a->vthr(i0), v2=a->vthr(i0+1), v3=a->vthr(i0+nx), v4=a->vthr(i0+1+nx);\r
+               mreal v5=a->vthr(i0+nn), v6=a->vthr(i0+1+nn), v7=a->vthr(i0+nx+nn), v8=a->vthr(i0+1+nx+nn);\r
+               // first find isosurface for a\r
+               mreal d1,d2,d3,d4,d5,d6,d7,d8,dA,dB,dC,dD;\r
+               d1=(val-v1)/(v2-v1);    d1=(d1>=0&&d1<=1)?d1:NAN;\r
+               d2=(val-v2)/(v4-v2);    d2=(d2>=0&&d2<=1)?d2:NAN;\r
+               d3=(val-v3)/(v4-v3);    d3=(d3>=0&&d3<=1)?d3:NAN;\r
+               d4=(val-v1)/(v3-v1);    d4=(d4>=0&&d4<=1)?d4:NAN;\r
+               mglPoint p1(i+d1,j,k), p2(i+1,j+d2,k), p3(i+d3,j+1,k), p4(i,j+d4,k);\r
+               d5=(val-v5)/(v6-v5);    d5=(d5>=0&&d5<=1)?d5:NAN;\r
+               d6=(val-v6)/(v8-v6);    d6=(d6>=0&&d6<=1)?d6:NAN;\r
+               d7=(val-v7)/(v8-v7);    d7=(d7>=0&&d7<=1)?d7:NAN;\r
+               d8=(val-v5)/(v7-v5);    d8=(d8>=0&&d8<=1)?d8:NAN;\r
+               mglPoint p5(i+d5,j,k+1), p6(i+1,j+d6,k+1), p7(i+d7,j+1,k+1), p8(i,j+d8,k+1);\r
+               dA=(val-v1)/(v5-v1);    dA=(dA>=0&&dA<=1)?dA:NAN;\r
+               dB=(val-v2)/(v6-v2);    dB=(dB>=0&&dB<=1)?dB:NAN;\r
+               dC=(val-v3)/(v7-v3);    dC=(dC>=0&&dC<=1)?dC:NAN;\r
+               dD=(val-v4)/(v8-v4);    dD=(dD>=0&&dD<=1)?dD:NAN;\r
+               mglPoint pA(i,j,k+dA),  pB(i+1,j,k+dB), pC(i,j+1,k+dC), pD(i+1,j+1,k+dD);\r
+               // next find its cross-section with isosurface of b at faces\r
+               mgl_dcont_add_pnt(p1,p2,b,val,pp);      mgl_dcont_add_pnt(p1,p4,b,val,pp);\r
+               mgl_dcont_add_pnt(p1,p3,b,val,pp);      mgl_dcont_add_pnt(p1,p5,b,val,pp);\r
+               mgl_dcont_add_pnt(p1,pA,b,val,pp);      mgl_dcont_add_pnt(p1,pB,b,val,pp);\r
+               mgl_dcont_add_pnt(p2,p4,b,val,pp);      mgl_dcont_add_pnt(p2,p3,b,val,pp);\r
+               mgl_dcont_add_pnt(p2,p6,b,val,pp);      mgl_dcont_add_pnt(p2,pD,b,val,pp);\r
+               mgl_dcont_add_pnt(p2,pB,b,val,pp);      mgl_dcont_add_pnt(p4,p3,b,val,pp);\r
+               mgl_dcont_add_pnt(p4,p8,b,val,pp);      mgl_dcont_add_pnt(p4,pA,b,val,pp);\r
+               mgl_dcont_add_pnt(p4,pC,b,val,pp);      mgl_dcont_add_pnt(p5,p6,b,val,pp);\r
+               mgl_dcont_add_pnt(p5,p8,b,val,pp);      mgl_dcont_add_pnt(p5,p7,b,val,pp);\r
+               mgl_dcont_add_pnt(p5,pA,b,val,pp);      mgl_dcont_add_pnt(p5,pB,b,val,pp);\r
+               mgl_dcont_add_pnt(p6,p8,b,val,pp);      mgl_dcont_add_pnt(p6,p7,b,val,pp);\r
+               mgl_dcont_add_pnt(p6,pD,b,val,pp);      mgl_dcont_add_pnt(p6,pB,b,val,pp);\r
+               mgl_dcont_add_pnt(p3,p7,b,val,pp);      mgl_dcont_add_pnt(p8,p7,b,val,pp);\r
+               mgl_dcont_add_pnt(p7,pD,b,val,pp);      mgl_dcont_add_pnt(p7,pC,b,val,pp);\r
+               mgl_dcont_add_pnt(p8,pA,b,val,pp);      mgl_dcont_add_pnt(pA,pB,b,val,pp);\r
+               mgl_dcont_add_pnt(pA,pC,b,val,pp);      mgl_dcont_add_pnt(p3,pC,b,val,pp);\r
+               mgl_dcont_add_pnt(p8,pC,b,val,pp);      mgl_dcont_add_pnt(pD,pC,b,val,pp);\r
+               mgl_dcont_add_pnt(pD,pB,b,val,pp);      mgl_dcont_add_pnt(p3,pD,b,val,pp);\r
+               // now connect points\r
+               if(pp.size()<2) continue;\r
+               else if(pp.size()==2)\r
+               {       mglSegment line;        line.set(pp[0],pp[1],x,y,z,nboth);      lines.push_back(line);  }\r
+               else\r
+               {\r
+                       mglSegment line;\r
+                       size_t n = pp.size();   // TODO sort by closest in future\r
+                       for(size_t ii=0;ii<n-1;ii++)\r
+                       {       line.set(pp[ii],pp[ii+1],x,y,z,nboth);  lines.push_back(line);  }\r
+               }\r
+       }\r
+       return lines;\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_dcont_gen(HMGL gr, double val, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt)\r
+{\r
+       if(mgl_check_dim3(gr,!mgl_isnboth(x,y,z,a),x,y,z,a,b,"DCont"))  return;\r
+       gr->SaveState(opt);\r
+       static int cgid=1;      gr->StartGroup("DContGen",cgid++);\r
+\r
+       int text=0;\r
+       if(mglchr(sch,'t'))     text=1;\r
+       if(mglchr(sch,'T'))     text=2;\r
+       gr->SetPenPal(sch);\r
+       mgl_draw_curvs(gr,val,gr->CDef,text,mgl_get_curvs(gr,mgl_get_dlines(val,a,b,x,y,z)));\r
+       gr->EndGroup();\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_dcont_xyz(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, HCDT b, const char *sch, const char *opt)\r
+{\r
+       if(mgl_check_dim3(gr,!mgl_isnboth(x,y,z,a),x,y,z,a,b,"DCont"))  return;\r
+\r
+       mreal r = gr->SaveState(opt);\r
+       static int cgid=1;      gr->StartGroup("DCont",cgid++);\r
+\r
+       int text=0;\r
+       if(mglchr(sch,'t'))     text=1;\r
+       if(mglchr(sch,'T'))     text=2;\r
+       long s=gr->AddTexture(sch);\r
+       gr->SetPenPal(sch);\r
+\r
+       long Num = mgl_isnan(r)?7:long(r+0.5);\r
+       if(!v && Num<1) {       gr->SetWarn(mglWarnCnt,"Cont"); return; }\r
+       mglData vv(Num);\r
+       for(long i=0;i<Num;i++) vv.a[i] = gr->Min.c + (gr->Max.c-gr->Min.c)*mreal(i+1)/(Num+1);\r
+       if(!v) v = &vv;\r
+\r
+#pragma omp parallel for\r
+       for(long i=0;i<v->GetNx();i++)\r
+       {\r
+               mreal val = v->v(i);\r
+               mgl_draw_curvs(gr,val,gr->GetC(s,val),text, mgl_get_curvs(gr, mgl_get_dlines(val,a,b,x,y,z)));\r
+       }\r
+       gr->EndGroup();\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_dcont(HMGL gr, HCDT v, HCDT a, HCDT b, const char *sch, const char *opt)\r
+{\r
+       long n = a->GetNx(), m = a->GetNy(), l = a->GetNz();\r
+       if(m<2 || n<2 || l<2 || n*m*l!=b->GetNN())      {       gr->SetWarn(mglWarnLow,"DCont");        return; }\r
+       mreal r = gr->SaveState(opt);\r
+       mglDataV x(n,m,l), y(n,m,l), z(n,m,l);\r
+       x.Fill(gr->Min.x,gr->Max.x,'x');\r
+       y.Fill(gr->Min.y,gr->Max.y,'y');\r
+       z.Fill(gr->Min.z,gr->Max.z,'z');\r
+       long Num = mgl_isnan(r)?7:long(r+0.5);\r
+       if(!v && Num<1) {       gr->SetWarn(mglWarnCnt,"Cont"); return; }\r
+       mglData vv(Num);\r
+       for(long i=0;i<Num;i++) vv.a[i] = gr->Min.c + (gr->Max.c-gr->Min.c)*mreal(i+1)/(Num+1);\r
+       mgl_dcont_xyz(gr,v?v:&vv,&x,&y,&z,a,b,sch,0);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_dcont_xyz_(uintptr_t *gr, uintptr_t *v, uintptr_t *x, uintptr_t *y, uintptr_t *z, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,sch,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_dcont_xyz(_GR_, _DA_(v), _DA_(x), _DA_(y), _DA_(z), _DA_(a), _DA_(b), s, o);\r
+       delete []o;     delete []s;     }\r
+void MGL_EXPORT mgl_dcont_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, uintptr_t *b, const char *sch, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,sch,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_dcont(_GR_, _DA_(v), _DA_(a), _DA_(b), s, o);\r
+       delete []o;     delete []s;     }\r
+//-----------------------------------------------------------------------------\r
+//\r
+//     Cont series\r
+//\r
 //-----------------------------------------------------------------------------\r
 std::vector<mglSegment> MGL_EXPORT mgl_get_lines(mreal val, HCDT a, HCDT x, HCDT y, HCDT z, long ak)\r
 {\r
@@ -327,7 +494,7 @@ std::vector<mglSegment> MGL_EXPORT mgl_get_curvs(const mglPoint &Min, const mglP
        delete []used;  delete []xsl;   delete []ysl;\r
        return curvs;\r
 }\r
-std::vector<mglSegment> MGL_EXPORT mgl_get_curvs(HMGL gr, std::vector<mglSegment> lines)\r
+std::vector<mglSegment> MGL_EXPORT mgl_get_curvs(HMGL gr, const std::vector<mglSegment> &lines)\r
 {      return mgl_get_curvs(gr->Min, gr->Max, lines);  }\r
 //-----------------------------------------------------------------------------\r
 void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const std::vector<mglSegment> &curvs)\r
@@ -365,7 +532,7 @@ void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const s
                mreal x0 = (del*ii1)/0xffff, y0 = (del*ii2)/0xffff;\r
                for(long k=0;k<pc;k++)  // print label several times if possible\r
                {\r
-                       if(nn[k]<0)     continue;\r
+                       if(nn[k]<0 || ff[k]<0)  continue;\r
                        const mglPoint t = gr->GetPntP(ff[k]);\r
                        mreal tx = t.x+x0, ty = t.y+y0;         // quasi-random shift\r
                        long i = long(tx/del);  tx -= i*del;\r
@@ -384,7 +551,7 @@ void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const s
        delete []nn;    delete []ff;\r
 }\r
 //-----------------------------------------------------------------------------\r
-HMDT mgl_data_conts(mreal val, HCDT dat)\r
+HMDT MGL_EXPORT mgl_data_conts(mreal val, HCDT dat)\r
 {\r
        mglPoint Min(0,0,0), Max(1,1,1);\r
        mglDataV x(dat->GetNx(),dat->GetNy(),dat->GetNz(),0,1,'x');\r
@@ -414,7 +581,7 @@ HMDT mgl_data_conts(mreal val, HCDT dat)
 }\r
 //-----------------------------------------------------------------------------\r
 // NOTE! All data MUST have the same size! Only first slice is used!\r
-void MGL_EXPORT mgl_cont_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak)\r
+void MGL_EXPORT mgl_cont_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak)\r
 {\r
        long n=a->GetNx(), m=a->GetNy();\r
        if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m)\r
@@ -433,7 +600,7 @@ void MGL_EXPORT mgl_cont_gen(HMGL gr, double val, HCDT a, HCDT x, HCDT y, HCDT z
        if(mglchr(sch,'t'))     text=1;\r
        if(mglchr(sch,'T'))     text=2;\r
        gr->SetPenPal(sch);\r
-       mgl_cont_gen(gr,val,a,x,y,z,gr->CDef,text,0);\r
+       mgl_cont_genI(gr,val,a,x,y,z,gr->CDef,text,0);\r
        gr->EndGroup();\r
 }\r
 //-----------------------------------------------------------------------------\r
@@ -471,7 +638,7 @@ void MGL_EXPORT mgl_cont_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const c
                if(z->GetNz()>1)\r
                        z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1);\r
                mglDataV zz(n, m);      zz.Fill(z0,z0);\r
-               mgl_cont_gen(gr,v0,z,x,y,&zz,gr->GetC(s,v0),text,j);\r
+               mgl_cont_genI(gr,v0,z,x,y,&zz,gr->GetC(s,v0),text,j);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -640,7 +807,7 @@ void static mgl_add_edges(HMGL gr, HCDT a, HCDT x, HCDT y, HCDT z, long i1, long
        if(f2<=v2 && f2>=v1)    u2 = mgl_add_pnt(gr,1,x,y,z,i1,j1,i2,j2,c,true);\r
 }\r
 //-----------------------------------------------------------------------------\r
-void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak)\r
+void MGL_EXPORT mgl_contf_genI(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak)\r
 {\r
        long n=a->GetNx(), m=a->GetNy();\r
        if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m)\r
@@ -783,14 +950,14 @@ void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT
        delete []kk;\r
 }\r
 //-----------------------------------------------------------------------------\r
-void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt)\r
+void MGL_EXPORT mgl_contf_gen(HMGL gr, double v1, double v2, HCDT a, HCDT x, HCDT y, HCDT z, const char *sch, const char *opt)\r
 {\r
        if(mgl_check_dim2(gr,x,y,z,a,"ContFGen"))       return;\r
        gr->SaveState(opt);\r
        static int cgid=1;      gr->StartGroup("ContFGen",cgid++);\r
 \r
        gr->SetPenPal(sch);\r
-       mgl_contf_gen(gr,v1,v2,a,x,y,z,gr->CDef,0);\r
+       mgl_contf_genI(gr,v1,v2,a,x,y,z,gr->CDef,0);\r
        gr->EndGroup();\r
 }\r
 //-----------------------------------------------------------------------------\r
@@ -823,7 +990,7 @@ void MGL_EXPORT mgl_contf_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const
                if(z->GetNz()>1)\r
                        z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1);\r
                mglDataV zz(n, m);      zz.Fill(z0,z0);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,gr->GetC(s,v0),j);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),z,x,y,&zz,gr->GetC(s,v0),j);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -914,9 +1081,9 @@ void MGL_EXPORT mgl_contp_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT a, c
        {\r
                if(gr->NeedStop())      continue;\r
                if(fill)\r
-                       mgl_contf_gen(gr,v->v(i),v->v(i+1),a,x,y,z,gr->GetC(s,v->v(i)),j);\r
+                       mgl_contf_genI(gr,v->v(i),v->v(i+1),a,x,y,z,gr->GetC(s,v->v(i)),j);\r
                else\r
-                       mgl_cont_gen(gr,v->v(i),a,x,y,z,gr->GetC(s,v->v(i)),text,j);\r
+                       mgl_cont_genI(gr,v->v(i),a,x,y,z,gr->GetC(s,v->v(i)),text,j);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -988,7 +1155,7 @@ void MGL_EXPORT mgl_contd_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const
                if(z->GetNz()>1)\r
                        z0 = gr->Min.z+(gr->Max.z-gr->Min.z)*mreal(j)/(z->GetNz()-1);\r
                mglDataV zz(n, m);      zz.Fill(z0,z0);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),z,x,y,&zz,s+(i%nc)*dc,j);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),z,x,y,&zz,s+(i%nc)*dc,j);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -1046,7 +1213,7 @@ void MGL_EXPORT mgl_contd_(uintptr_t *gr, uintptr_t *a, const char *sch, const c
 //\r
 //-----------------------------------------------------------------------------\r
 // NOTE! All data MUST have the same size! Only first slice is used!\r
-void MGL_EXPORT mgl_contv_gen(HMGL gr, mreal val, mreal dval, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak)\r
+void MGL_EXPORT mgl_contv_genI(HMGL gr, mreal val, mreal dval, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak)\r
 {\r
        long n=a->GetNx(), m=a->GetNy();\r
        if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m || z->GetNx()*z->GetNy()!=n*m)\r
@@ -1100,7 +1267,7 @@ void MGL_EXPORT mgl_contv_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const
                if(i>0) dv = v->v(i-1)-v->v(i);\r
                else if(i<v->GetNx()-1) dv = v->v(i)-v->v(i+1);\r
                if(fixed)       dv=-dv;\r
-               mgl_contv_gen(gr,v0,dv,z,x,y,&zz,gr->GetC(s,v0),j);\r
+               mgl_contv_genI(gr,v0,dv,z,x,y,&zz,gr->GetC(s,v0),j);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -1272,7 +1439,7 @@ void MGL_EXPORT mgl_cont3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT
        for(long i=0;i<v->GetNx();i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_cont_gen(gr,v0,&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),text,0);\r
+               mgl_cont_genI(gr,v0,&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),text,0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -1437,7 +1604,7 @@ void MGL_EXPORT mgl_contf3_xyz_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, HCDT
        for(long i=0;i<v->GetNx()-1;i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),0);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),&s.a,&s.x,&s.y,&s.z,gr->GetC(ss,v0),0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -1551,7 +1718,7 @@ void static mgl_axial_plot(mglBase *gr,long pc, mglPoint *ff, long *nn,char dir,
 }\r
 //-----------------------------------------------------------------------------\r
 // NOTE! All data MUST have the same size! Only first slice is used!\r
-void MGL_EXPORT mgl_axial_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, mreal c, char dir,long ak,int wire)\r
+void MGL_EXPORT mgl_axial_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, mreal c, char dir,long ak,int wire)\r
 {\r
        long n=a->GetNx(), m=a->GetNy();\r
        if(n<2 || m<2 || x->GetNx()*x->GetNy()!=n*m || y->GetNx()*y->GetNy()!=n*m)\r
@@ -1669,7 +1836,7 @@ void MGL_EXPORT mgl_axial_xy_val(HMGL gr, HCDT v, HCDT x, HCDT y, HCDT z, const
        {\r
                if(gr->NeedStop())      continue;\r
                mreal v0 = v->v(i);\r
-               mgl_axial_gen(gr,v0,z,x,y,gr->GetC(s,v0),dir,j,wire);\r
+               mgl_axial_genI(gr,v0,z,x,y,gr->GetC(s,v0),dir,j,wire);\r
        }\r
        gr->EndGroup();\r
 }\r
index 65629885ef4dd6f43c6433702c2b6e05b11efe33..2f05433bf29a10fb4d45400c91545a0b20bb0440 100644 (file)
@@ -1,9 +1,9 @@
 /***************************************************************************
- * cont.cpp is part of Math Graphic Library
+ * cont.hpp is part of Math Graphic Library
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -22,21 +22,12 @@ struct mglSegment
 {
        mglPoint p1,p2; // edges
        std::list<mglPoint> pp;
-       bool set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z)
-       {
-               bool res=(v1>=0 && v1<=MGL_FEPSILON && u1>=0 && u1<=MGL_FEPSILON && v2>=0 && v2<=MGL_FEPSILON && u2>=0 && u2<=MGL_FEPSILON);
-               if(v1==v2 && u1==u2)    res=false;      // NOTE: shouldn't be here never
-               if(res)
-               {
-                       p1.Set(mgl_data_linear(x,i+u1,j+v1,k), mgl_data_linear(y,i+u1,j+v1,k), mgl_data_linear(z,i+u1,j+v1,k));
-                       p2.Set(mgl_data_linear(x,i+u2,j+v2,k), mgl_data_linear(y,i+u2,j+v2,k), mgl_data_linear(z,i+u2,j+v2,k));
-               }
-               return res;
-       }
+       bool set(mreal u1,mreal v1,mreal u2,mreal v2,long i,long j,long k,HCDT x, HCDT y, HCDT z);
+       void set(const mglPoint &p1, const mglPoint &p2,HCDT x, HCDT y, HCDT z, bool nboth);
        void before(const mglPoint &p)  {       p1 = p; pp.push_front(p);       }
        void after(const mglPoint &p)   {       p2 = p; pp.push_back(p);        }
 };
 //-----------------------------------------------------------------------------
-std::vector<mglSegment> MGL_EXPORT mgl_get_curvs(HMGL gr, std::vector<mglSegment> lines);
+std::vector<mglSegment> MGL_EXPORT mgl_get_curvs(HMGL gr, const std::vector<mglSegment> &lines);
 void MGL_NO_EXPORT mgl_draw_curvs(HMGL gr, mreal val, mreal c, int text, const std::vector<mglSegment> &curvs);
 //-----------------------------------------------------------------------------
index c3ba949399a976aa49fa4394e449dd0d4dfc7c1d..21c3888ec755bde87c9cea25af76634d7c44802e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
  ***************************************************************************/\r
 #include <float.h>\r
-#include <math.h>\r
 #include <list>\r
 #include <limits>\r
 #include "mgl2/other.h"\r
@@ -530,7 +529,6 @@ HMDT MGL_EXPORT mgl_triangulation_2d(HCDT x, HCDT y)
        if(y->GetNN()!=n)       return nums;\r
        // use s-hull here\r
        std::vector<Shx> pts;\r
-       Shx pt;\r
 \r
        double x1=mglInf, x2=-mglInf, y1=mglInf, y2=-mglInf;\r
        for(long i=0;i<n;i++)\r
@@ -545,6 +543,7 @@ HMDT MGL_EXPORT mgl_triangulation_2d(HCDT x, HCDT y)
        if(dx==0 || dy==0)      return nums;\r
        for(long i=0;i<n;i++)   // Filter NaNs and Infs\r
        {\r
+               Shx pt;\r
                pt.r = (x->vthr(i)-x1)/dx;      pt.c = (y->vthr(i)-y1)/dy;\r
                if(mgl_isbad(pt.r) || mgl_isbad(pt.c))  continue;\r
                pt.id = i;    pts.push_back(pt);\r
index 5a22869fc324458bdfe6115ba43d1b569f361a6b..afefa18fc9327697f7c5f3461efae8ea887a46e7 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -25,6 +25,8 @@
 #include "interp.hpp"\r
 \r
 MGL_EXPORT int mglNumThr=0;\r
+MGL_EXPORT std::vector<mglDataA*> mglDataList;\r
+\r
 //-----------------------------------------------------------------------------\r
 #if MGL_HAVE_PTHREAD\r
 #ifdef WIN32\r
@@ -162,25 +164,37 @@ static void *mgl_smth_x(void *par)
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
-                       if(mgl_isnum(a[i]))     // bypass NAN values\r
-                       {\r
-                               long j = i%nx, nk = 2*kind+1;\r
-                               for(long k=-kind;k<=kind;k++)\r
-                                       if(j+k>=0 && j+k<nx && mgl_isnum(a[i+k])) b[i] += a[i+k];       else nk--;\r
-                               b[i] /= nk;\r
-                       }       else    b[i] = a[i];\r
-       else if(kind==-1)\r
+               {\r
+                       long j = i%nx;\r
+                       double s0=0,s1=0,s2=0,sf=0,sxf=0;\r
+                       for(long k=-kind;k<=kind;k++)\r
+                               if(j+k>=0 && j+k<nx && mgl_isnum(a[i+k]))\r
+                               {\r
+                                       s0+=1;  s1+=k;  s2+=k*k;\r
+                                       sf+=a[i+k];     sxf+=a[i+k]*k;\r
+                               }\r
+                       double d = s0*s2-s1*s1;\r
+                       b[i] = d?(s2*sf - s1*sxf)/d:a[i];\r
+               }\r
+       else if(kind<-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
                {\r
                        long j = i%nx;\r
-                       if(j>1 && j<nx-2)       b[i] = (12*a[i-2] - 3*a[i-1] + 17*a[i] - 3*a[i+1] + 12*a[i+2])/35.;\r
-                       else if(j==1 || j==nx-2)        b[i] = (a[i-1] + a[i] + a[i+1])/3.;\r
-                       else    b[i] = a[i];\r
+                       double s0=0,s1=0,s2=0,s3=0,s4=0,sf=0,sxf=0,sxxf=0;\r
+                       for(long k=kind;k<=-kind;k++)\r
+                               if(j+k>=0 && j+k<nx && mgl_isnum(a[i+k]))\r
+                               {\r
+                                       long k2 = k*k, i0 = i+k;\r
+                                       s0+=1;  s1+=k;  s2+=k2; s3+=k2*k;       s4+=k2*k2;\r
+                                       sf+=a[i0];      sxf+=a[i0]*k;   sxxf+=a[i0]*k2;\r
+                               }\r
+                       double d = (s0*s4-s2*s2)*s2 + (s2*s3-s4*s1)*s1 + (s1*s2-s0*s3)*s3;\r
+                       b[i] = d?( (s1*s3-s2*s2)*sxxf + (s2*s3-s1*s4)*sxf + (s2*s4-s3*s3)*sf )/d:a[i];\r
                }\r
-       else if(kind==-2)\r
+       else if(kind==0)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -190,7 +204,7 @@ static void *mgl_smth_x(void *par)
                        mreal v = (j>0 && j<nx-1) ? (a[i-1]+a[i+1])/2 : NAN;\r
                        b[i] = v<a[i]?v:a[i];\r
                }\r
-       else if(kind==-3)\r
+       else if(kind==-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -222,25 +236,37 @@ static void *mgl_smth_y(void *par)
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
-                       if(mgl_isnum(a[i]))     // bypass NAN values\r
-                       {\r
-                               long j = (i/nx)%ny, nk = 2*kind+1;\r
-                               for(long k=-kind;k<=kind;k++)\r
-                                       if(j+k>=0 && j+k<ny && mgl_isnum(a[i+k*nx])) b[i] += a[i+k*nx]; else nk--;\r
-                               b[i] /= nk;\r
-                       }       else    b[i] = a[i];\r
-       else if(kind==-1)\r
+               {\r
+                       long j = (i/nx)%ny;\r
+                       double s0=0,s1=0,s2=0,sf=0,sxf=0;\r
+                       for(long k=-kind;k<=kind;k++)\r
+                               if(j+k>=0 && j+k<ny && mgl_isnum(a[i+k*nx]))\r
+                               {\r
+                                       s0+=1;  s1+=k;  s2+=k*k;\r
+                                       sf+=a[i+k*nx];  sxf+=a[i+k*nx]*k;\r
+                               }\r
+                       double d = s0*s2-s1*s1;\r
+                       b[i] = d?(s2*sf - s1*sxf)/d:a[i];\r
+               }\r
+       else if(kind<-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
                {\r
                        long j = (i/nx)%ny;\r
-                       if(j>1 && j<ny-2)       b[i] = (12*a[i-2*nx] - 3*a[i-nx] + 17*a[i] - 3*a[i+nx] + 12*a[i+2*nx])/35.;\r
-                       else if(j==1 || j==ny-2)        b[i] = (a[i-nx] + a[i] + a[i+nx])/3.;\r
-                       else    b[i] = a[i];\r
+                       double s0=0,s1=0,s2=0,s3=0,s4=0,sf=0,sxf=0,sxxf=0;\r
+                       for(long k=kind;k<=-kind;k++)\r
+                               if(j+k>=0 && j+k<ny && mgl_isnum(a[i+k*nx]))\r
+                               {\r
+                                       long k2 = k*k, i0 = i+k*nx;\r
+                                       s0+=1;  s1+=k;  s2+=k2; s3+=k2*k;       s4+=k2*k2;\r
+                                       sf+=a[i0];      sxf+=a[i0]*k;   sxxf+=a[i0]*k2;\r
+                               }\r
+                       double d = (s0*s4-s2*s2)*s2 + (s2*s3-s4*s1)*s1 + (s1*s2-s0*s3)*s3;\r
+                       b[i] = d?( (s1*s3-s2*s2)*sxxf + (s2*s3-s1*s4)*sxf + (s2*s4-s3*s3)*sf )/d:a[i];\r
                }\r
-       else if(kind==-2)\r
+       else if(kind==0)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -250,7 +276,7 @@ static void *mgl_smth_y(void *par)
                        mreal v = (j>0 && j<ny-1) ? (a[i-nx]+a[i+nx])/2 : NAN;\r
                        b[i] = v<a[i]?v:a[i];\r
                }\r
-       else if(kind==-3)\r
+       else if(kind==-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -282,25 +308,37 @@ static void *mgl_smth_z(void *par)
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
-                       if(mgl_isnum(a[i]))     // bypass NAN values\r
-                       {\r
-                               long j = i/nn, nk = 2*kind+1;\r
-                               for(long k=-kind;k<=kind;k++)\r
-                                       if(j+k>=0 && j+k<nz && mgl_isnum(a[i+k*nn])) b[i] += a[i+k*nn]; else nk--;\r
-                               b[i] /= nk;\r
-                       }       else    b[i] = a[i];\r
-       else if(kind==-1)\r
+               {\r
+                       long j = i/nn;\r
+                       double s0=0,s1=0,s2=0,sf=0,sxf=0;\r
+                       for(long k=-kind;k<=kind;k++)\r
+                               if(j+k>=0 && j+k<nz && mgl_isnum(a[i+k*nn]))\r
+                               {\r
+                                       s0+=1;  s1+=k;  s2+=k*k;\r
+                                       sf+=a[i+k*nn];  sxf+=a[i+k*nn]*k;\r
+                               }\r
+                       double d = s0*s2-s1*s1;\r
+                       b[i] = d?(s2*sf - s1*sxf)/d:a[i];\r
+               }\r
+       else if(kind<-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
                for(long i=t->id;i<t->n;i+=mglNumThr)\r
                {\r
                        long j = i/nn;\r
-                       if(j>1 && j<nz-2)       b[i] = (12*a[i-2*nn] - 3*a[i-nn] + 17*a[i] - 3*a[i+nn] + 12*a[i+2*nn])/35.;\r
-                       else if(j==1 || j==nz-2)        b[i] = (a[i-nn] + a[i] + a[i+nn])/3.;\r
-                       else    b[i] = a[i];\r
+                       double s0=0,s1=0,s2=0,s3=0,s4=0,sf=0,sxf=0,sxxf=0;\r
+                       for(long k=kind;k<=-kind;k++)\r
+                               if(j+k>=0 && j+k<nz && mgl_isnum(a[i+k*nn]))\r
+                               {\r
+                                       long k2 = k*k, i0 = i+k*nn;\r
+                                       s0+=1;  s1+=k;  s2+=k2; s3+=k2*k;       s4+=k2*k2;\r
+                                       sf+=a[i0];      sxf+=a[i0]*k;   sxxf+=a[i0]*k2;\r
+                               }\r
+                       double d = (s0*s4-s2*s2)*s2 + (s2*s3-s4*s1)*s1 + (s1*s2-s0*s3)*s3;\r
+                       b[i] = d?( (s1*s3-s2*s2)*sxxf + (s2*s3-s1*s4)*sxf + (s2*s4-s3*s3)*sf )/d:a[i];\r
                }\r
-       else if(kind==-2)\r
+       else if(kind==0)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -310,7 +348,7 @@ static void *mgl_smth_z(void *par)
                        mreal v = (j>0 && j<nz-1) ? (a[i-nn]+a[i+nn])/2 : NAN;\r
                        b[i] = v<a[i]?v:a[i];\r
                }\r
-       else if(kind==-3)\r
+       else if(kind==-1)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
@@ -333,7 +371,7 @@ static void *mgl_smth_z(void *par)
 }\r
 void MGL_EXPORT mgl_data_smooth(HMDT d, const char *dirs, mreal delta)\r
 {\r
-       long Type = -1;\r
+       long Type = -2;\r
        if(mglchr(dirs,'0'))    return;\r
        bool xdir=mglchr(dirs,'x'), ydir=mglchr(dirs,'y'), zdir=mglchr(dirs,'z');\r
        if(!xdir && !ydir && !zdir)     xdir=ydir=zdir=true;\r
@@ -349,14 +387,25 @@ void MGL_EXPORT mgl_data_smooth(HMDT d, const char *dirs, mreal delta)
                if(mglchr(dirs,'8'))    Type = 8;\r
                if(mglchr(dirs,'9'))    Type = 9;\r
        }\r
+       else if(mglchr(dirs,'p'))\r
+       {\r
+               if(mglchr(dirs,'2'))    Type = -2;\r
+               if(mglchr(dirs,'3'))    Type = -3;\r
+               if(mglchr(dirs,'4'))    Type = -4;\r
+               if(mglchr(dirs,'5'))    Type = -5;\r
+               if(mglchr(dirs,'6'))    Type = -6;\r
+               if(mglchr(dirs,'7'))    Type = -7;\r
+               if(mglchr(dirs,'8'))    Type = -8;\r
+               if(mglchr(dirs,'9'))    Type = -9;\r
+       }\r
        else\r
        {\r
                if(mglchr(dirs,'1'))    return;\r
                if(mglchr(dirs,'3'))    Type = 1;\r
                if(mglchr(dirs,'5'))    Type = 2;\r
        }\r
-       if(mglchr(dirs,'_'))    Type = -2;\r
-       if(mglchr(dirs,'^'))    Type = -3;\r
+       if(mglchr(dirs,'_'))    Type = 0;\r
+       if(mglchr(dirs,'^'))    Type = -1;\r
        long nx=d->nx,ny=d->ny,nz=d->nz;\r
 //     if(Type == SMOOTH_NONE) return;\r
        long p[3]={nx,ny,Type};\r
@@ -1337,52 +1386,72 @@ int MGL_EXPORT mgl_data_find_any_(uintptr_t *d, const char *cond, int l)
 mreal MGL_EXPORT mgl_data_momentum_val(HCDT dd, char dir, mreal *x, mreal *w, mreal *s, mreal *k)\r
 {\r
        long nx=dd->GetNx(),ny=dd->GetNy(),nz=dd->GetNz();\r
-       mreal i0=0,i1=0,i2=0,i3=0,i4=0;\r
+       mreal i0=0,i1=0,i2=0,i3=0,i4=0,is;\r
        switch(dir)\r
        {\r
        case 'x':\r
-#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4)\r
+#pragma omp parallel for reduction(+:i0,i1)\r
                for(long i=0;i<nx*ny*nz;i++)\r
                {\r
-                       mreal d = mreal(i%nx), t = d*d, v = dd->vthr(i);\r
-                       i0+= v; i1+= v*d;       i2+= v*t;\r
-                       i3+= v*d*t;             i4+= v*t*t;\r
+                       mreal d = mreal(i%nx), v = dd->vthr(i);\r
+                       i0+= v; i1+= v*d;\r
+               }\r
+               is = i1/i0;\r
+#pragma omp parallel for reduction(+:i2,i3,i4)\r
+               for(long i=0;i<nx*ny*nz;i++)\r
+               {\r
+                       mreal d = mreal(i%nx)-is, t = d*d, v = dd->vthr(i);\r
+                       i2+= v*t;       i3+= v*d*t;     i4+= v*t*t;\r
                }\r
                break;\r
        case 'y':\r
-#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4)\r
+#pragma omp parallel for reduction(+:i0,i1)\r
+               for(long i=0;i<nx*ny*nz;i++)\r
+               {\r
+                       mreal d = mreal((i/nx)%ny), v = dd->vthr(i);\r
+                       i0+= v; i1+= v*d;\r
+               }\r
+               is = i1/i0;\r
+#pragma omp parallel for reduction(+:i2,i3,i4)\r
                for(long i=0;i<nx*ny*nz;i++)\r
                {\r
-                       mreal d = mreal((i/nx)%ny), t = d*d, v = dd->vthr(i);\r
-                       i0+= v; i1+= v*d;       i2+= v*t;\r
-                       i3+= v*d*t;             i4+= v*t*t;\r
+                       mreal d = mreal((i/nx)%ny)-is, t = d*d, v = dd->vthr(i);\r
+                       i2+= v*t;       i3+= v*d*t;             i4+= v*t*t;\r
                }\r
                break;\r
        case 'z':\r
-#pragma omp parallel for reduction(+:i0,i1,i2,i3,i4)\r
+#pragma omp parallel for reduction(+:i0,i1)\r
+               for(long i=0;i<nx*ny*nz;i++)\r
+               {\r
+                       mreal d = mreal(i/(nx*ny)), v = dd->vthr(i);\r
+                       i0+= v; i1+= v*d;\r
+               }\r
+               is = i1/i0;\r
+#pragma omp parallel for reduction(+:i2,i3,i4)\r
                for(long i=0;i<nx*ny*nz;i++)\r
                {\r
-                       mreal d = mreal(i/(nx*ny)), t = d*d, v = dd->vthr(i);\r
-                       i0+= v; i1+= v*d;       i2+= v*t;\r
-                       i3+= v*d*t;             i4+= v*t*t;\r
+                       mreal d = mreal(i/(nx*ny))-is, t = d*d, v = dd->vthr(i);\r
+                       i2+= v*t;       i3+= v*d*t;     i4+= v*t*t;\r
                }\r
                break;\r
        default:        // "self-dispersion"\r
                i0 = nx*ny*nz;\r
-#pragma omp parallel for reduction(+:i1,i2,i3,i4)\r
+#pragma omp parallel for reduction(+:i1)\r
+               for(long i=0;i<nx*ny*nz;i++)    i1 += dd->vthr(i);\r
+               is = i1/i0;\r
+#pragma omp parallel for reduction(+:i2,i3,i4)\r
                for(long i=0;i<nx*ny*nz;i++)\r
                {\r
-                       mreal v = dd->vthr(i), t = v*v;\r
-                       i1+= v;                 i2+= t;\r
-                       i3+= v*t;               i4+= t*t;\r
+                       mreal v = dd->vthr(i)-is, t = v*v;\r
+                       i2+= t; i3+= v*t;       i4+= t*t;\r
                }\r
        }\r
        if(i0==0)       return 0;\r
-       mreal d=i1/i0;\r
-       if(x)   *x=d;\r
-       if(w)   *w=i2>d*d*i0 ? sqrt(i2/i0-d*d) : 0;\r
-       if(s)   *s=i3/i0;\r
-       if(k)   *k=i4/(i0*3);\r
+       mreal w2=i2/i0, ww = sqrt(w2);\r
+       if(x)   *x=is;\r
+       if(w)   *w=ww;\r
+       if(s)   *s=i3/i0/ww/w2;\r
+       if(k)   *k=i4/(i0*3)/w2/w2;\r
        return i0;\r
 }\r
 mreal MGL_EXPORT mgl_data_momentum_val_(uintptr_t *d, char *dir, mreal *m, mreal *w, mreal *s, mreal *k,int)\r
index e2ecfb93469945ad8d928fd989ca61f212740639..57165a2800f49ff6557ca77ddb69c9c6fcfc6f57 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -25,7 +25,6 @@
 #include "mgl2/thread.h"\r
 #include "interp.hpp"\r
 void MGL_NO_EXPORT mgl_txt_func(const mreal *x, mreal *dx, void *par);\r
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 HMDT MGL_EXPORT mgl_data_trace(HCDT d)\r
 {\r
@@ -110,7 +109,7 @@ HMDT MGL_EXPORT mgl_data_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz)
 #pragma omp parallel for\r
                for(long i0=0;i0<n*m*l;i0++)\r
                {\r
-                       long x=long(0.5+xx->vthr(i0)), y=long(0.5+yy->vthr(i0)), z=long(0.5+zz->vthr(i0));\r
+                       long x=long(floor(0.5+xx->vthr(i0))), y=long(floor(0.5+yy->vthr(i0))), z=long(floor(0.5+zz->vthr(i0)));\r
                        r->a[i0] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?d->v(x,y,z):NAN;\r
                }\r
        }\r
@@ -124,7 +123,7 @@ HMDT MGL_EXPORT mgl_data_subdata_ext(HCDT d, HCDT xx, HCDT yy, HCDT zz)
 #pragma omp parallel for collapse(3)\r
                for(long k=0;k<l;k++)   for(long j=0;j<m;j++)   for(long i=0;i<n;i++)\r
                {\r
-                       long x=long(0.5+xx->v(i)), y=long(0.5+yy->v(j)), z=long(0.5+zz->v(k));\r
+                       long x=long(floor(0.5+xx->v(i))), y=long(floor(0.5+yy->v(j))), z=long(floor(0.5+zz->v(k)));\r
                        r->a[i+n*(j+m*k)] = (x>=0 && x<nx && y>=0 && y<ny && z>=0 && z<nz)?d->v(x,y,z):NAN;\r
                }\r
                if(m==1)        {       r->ny=r->nz;    r->nz=1;        }// "squeeze" dimensions\r
@@ -388,6 +387,94 @@ uintptr_t MGL_EXPORT mgl_data_max_dir_(uintptr_t *d, const char *dir,int l)
 {      char *s=new char[l+1];  memcpy(s,dir,l);        s[l]=0;\r
        uintptr_t r=uintptr_t(mgl_data_max_dir(_DT_,s));        delete []s;     return r;       }\r
 //-----------------------------------------------------------------------------\r
+HMDT MGL_EXPORT mgl_data_first_dir(HCDT dat, const char *dir, double val)\r
+{\r
+       if(!dir || *dir==0)     return 0;\r
+       const long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(), nn=nx*ny;\r
+       mglData *r=NULL;\r
+       if(mglchr(dir,'z') && nz>1)\r
+       {\r
+               r = new mglData(nx,ny);\r
+#pragma omp parallel for\r
+               for(long j=0;j<nn;j++)\r
+               {\r
+                       long i;\r
+                       for(i=0;i<nz;i++)       if(dat->vthr(j+nn*i)>val)       break;\r
+                       r->a[j] = i/mreal(nz-1);\r
+               }\r
+       }\r
+       else if(mglchr(dir,'y') && ny>1)\r
+       {\r
+               r = new mglData(nx,nz);\r
+#pragma omp parallel for\r
+               for(long j=0;j<nx*nz;j++)\r
+               {\r
+                       long i, i0 = (j%nx)+nn*(j/nx);\r
+                       for(i=0;i<ny;i++)       if(dat->vthr(i0+nx*i)>val)      break;\r
+                       r->a[j] = i/mreal(ny-1);\r
+               }\r
+       }\r
+       else if(mglchr(dir,'x') && nx>1)\r
+       {\r
+               r = new mglData(ny,nz);\r
+#pragma omp parallel for\r
+               for(long j=0;j<ny*nz;j++)\r
+               {\r
+                       long i, i0 = j*nx;\r
+                       for(i=0;i<nx;i++)       if(dat->vthr(i0+i)>val) break;\r
+                       r->a[j] = i/mreal(nx-1);\r
+               }\r
+       }\r
+       return r;\r
+}\r
+uintptr_t MGL_EXPORT mgl_data_first_dir_(uintptr_t *d, const char *dir, double *val,int l)\r
+{      char *s=new char[l+1];  memcpy(s,dir,l);        s[l]=0;\r
+       uintptr_t r=uintptr_t(mgl_data_first_dir(_DT_,s,*val)); delete []s;     return r;       }\r
+//-----------------------------------------------------------------------------\r
+HMDT MGL_EXPORT mgl_data_last_dir(HCDT dat, const char *dir, double val)\r
+{\r
+       if(!dir || *dir==0)     return 0;\r
+       const long nx=dat->GetNx(),ny=dat->GetNy(),nz=dat->GetNz(), nn=nx*ny;\r
+       mglData *r=NULL;\r
+       if(mglchr(dir,'z') && nz>1)\r
+       {\r
+               r = new mglData(nx,ny);\r
+#pragma omp parallel for\r
+               for(long j=0;j<nn;j++)\r
+               {\r
+                       long i;\r
+                       for(i=nz-1;i>=0;i++)    if(dat->vthr(j+nn*i)>val)       break;\r
+                       r->a[j] = i/mreal(nz-1);\r
+               }\r
+       }\r
+       else if(mglchr(dir,'y') && ny>1)\r
+       {\r
+               r = new mglData(nx,nz);\r
+#pragma omp parallel for\r
+               for(long j=0;j<nx*nz;j++)\r
+               {\r
+                       long i, i0 = (j%nx)+nn*(j/nx);\r
+                       for(i=ny-1;i>=0;i++)    if(dat->vthr(i0+nx*i)>val)      break;\r
+                       r->a[j] = i/mreal(ny-1);\r
+               }\r
+       }\r
+       else if(mglchr(dir,'x') && nx>1)\r
+       {\r
+               r = new mglData(ny,nz);\r
+#pragma omp parallel for\r
+               for(long j=0;j<ny*nz;j++)\r
+               {\r
+                       long i, i0 = j*nx;\r
+                       for(i=nx-1;i>=0;i++)    if(dat->vthr(i0+i)>val) break;\r
+                       r->a[j] = i/mreal(nx-1);\r
+               }\r
+       }\r
+       return r;\r
+}\r
+uintptr_t MGL_EXPORT mgl_data_last_dir_(uintptr_t *d, const char *dir, double *val,int l)\r
+{      char *s=new char[l+1];  memcpy(s,dir,l);        s[l]=0;\r
+       uintptr_t r=uintptr_t(mgl_data_last_dir(_DT_,s,*val));  delete []s;     return r;       }\r
+//-----------------------------------------------------------------------------\r
 static void *mgl_min_z(void *par)\r
 {\r
        mglThreadD *t=(mglThreadD *)par;\r
@@ -779,37 +866,100 @@ static void *mgl_hist_2(void *par)
 {\r
        mglThreadD *t=(mglThreadD *)par;\r
        long nn=t->n, n = t->p[0];\r
-       long ns=t->p[1], nx=t->p[2], ny=t->p[3];\r
+       long nsub=t->p[1], nx=t->p[2], ny=t->p[3], ns=labs(nsub)+1;\r
        mreal *b=new mreal[n], d=1./ns;\r
        memset(b,0,n*sizeof(mreal));\r
        HCDT a = (HCDT)(t->b), c = (HCDT)(t->c);\r
        const mreal *v=(const mreal *)t->v;\r
-       bool sp = n>0;\r
+       const long nsx=ns*nx, nsy=ns*ny, nxy=nsx*nsy;\r
+       if(nsub<0)      // spline\r
+       {\r
+               if(c)\r
+               {\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp parallel for\r
 #endif\r
-       for(long i=t->id;i<nn;i+=mglNumThr)\r
+                       for(long i=t->id;i<nn;i+=mglNumThr)\r
+                       {\r
+                               mreal x = d*(i%nsx), y = d*((i/nsx)%nsy), z = d*(i/nxy);\r
+                               mreal f = a->value(x,y,z), w = c->value(x,y,z);\r
+                               if(mgl_isnan(f) || mgl_isnan(w))        continue;\r
+                               long k = long(n*(f-v[0])/(v[1]-v[0]));\r
+                               if(k>=0 && k<n)\r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp critical(hist)\r
+#endif\r
+                                       b[k] += w * d*d*d;\r
+                       }\r
+               }\r
+               else\r
+               {       \r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp parallel for\r
+#endif\r
+                       for(long i=t->id;i<nn;i+=mglNumThr)\r
+                       {\r
+                               mreal x = d*(i%nsx), y = d*((i/nsx)%nsy), z = d*(i/nxy);\r
+                               mreal f = a->value(x,y,z);\r
+                               if(mgl_isnan(f))        continue;\r
+                               long k = long(n*(f-v[0])/(v[1]-v[0]));\r
+                               if(k>=0 && k<n)\r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp critical(hist)\r
+#endif\r
+                                       b[k] += d*d*d;\r
+                       }\r
+               }\r
+       }\r
+       else\r
        {\r
-               mreal x = d*(i%(nx*ns)), y = d*((i/(nx*ns))%(ny*ns)), z = d*(i/(nx*ny*ns*ns));\r
-               mreal f = sp ? a->value(x,y,z) : a->linear(x,y,z), w=1;\r
-               if(c)   w = sp ? c->value(x,y,z) : c->linear(x,y,z);\r
-               if(mgl_isnan(f) || mgl_isnan(w))        continue;\r
-               long k = long(n*(f-v[0])/(v[1]-v[0]));\r
-               if(k>=0 && k<n)\r
+               if(c)\r
+               {\r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp parallel for\r
+#endif\r
+                       for(long i=t->id;i<nn;i+=mglNumThr)\r
+                       {\r
+                               mreal x = d*(i%nsx), y = d*((i/nsx)%nsy), z = d*(i/nxy);\r
+                               mreal f = a->linear(x,y,z), w = c->linear(x,y,z);\r
+                               if(mgl_isnan(f) || mgl_isnan(w))        continue;\r
+                               long k = long(n*(f-v[0])/(v[1]-v[0]));\r
+                               if(k>=0 && k<n)\r
 #if !MGL_HAVE_PTHREAD\r
 #pragma omp critical(hist)\r
 #endif\r
-                       b[k] += w * d*d*d;\r
+                                       b[k] += w * d*d*d;\r
+                       }\r
+               }\r
+               else\r
+               {       \r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp parallel for\r
+#endif\r
+                       for(long i=t->id;i<nn;i+=mglNumThr)\r
+                       {\r
+                               mreal x = d*(i%nsx), y = d*((i/nsx)%nsy), z = d*(i/nxy);\r
+                               mreal f = a->linear(x,y,z);\r
+                               if(mgl_isnan(f))        continue;\r
+                               long k = long(n*(f-v[0])/(v[1]-v[0]));\r
+                               if(k>=0 && k<n)\r
+#if !MGL_HAVE_PTHREAD\r
+#pragma omp critical(hist)\r
+#endif\r
+                                       b[k] += d*d*d;\r
+                       }\r
+               }\r
        }\r
        t->a = b;       return 0;\r
 }\r
+//-----------------------------------------------------------------------------\r
 HMDT MGL_EXPORT mgl_data_hist(HCDT dat, long n, mreal v1, mreal v2, long nsub)\r
 {\r
        if(n<2 || v1==v2)       return 0;\r
        mglData *b=new mglData(n);\r
        mreal v[2]={v1,v2};\r
        long nx=dat->GetNx(), ny=dat->GetNy(), nz=dat->GetNz();\r
-       long ns=labs(nsub)+1, p[5]={n,ns,nx,ny,nz};\r
+       long ns=labs(nsub)+1, p[5]={n,nsub,nx,ny,nz};\r
        if(nsub==0)     mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,(const mreal *)dat,0,p,v);\r
        else    mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,(const mreal *)dat,0,p,v);\r
        return b;\r
@@ -822,7 +972,7 @@ HMDT MGL_EXPORT mgl_data_hist_w(HCDT dat, HCDT weight, long n, mreal v1, mreal v
        mreal v[2]={v1,v2};\r
 \r
        long nx=dat->GetNx(), ny=dat->GetNy(), nz=dat->GetNz();\r
-       long ns=labs(nsub)+1, p[5]={n,ns,nx,ny,nz};\r
+       long ns=labs(nsub)+1, p[5]={n,nsub,nx,ny,nz};\r
        if(nsub==0)     mglStartThread(mgl_hist_1,mgl_hist_p, nx*ny*nz, b->a,(const mreal *)dat,(const mreal *)weight,p,v);\r
        else    mglStartThread(mgl_hist_2,mgl_hist_p, nx*ny*nz*ns*ns*ns, b->a,(const mreal *)dat,(const mreal *)weight,p,v);\r
        return b;\r
@@ -878,7 +1028,7 @@ int static mgl_root(const gsl_vector *x, void *params, gsl_vector *f)
                if(mgl_isbad(p->f[i]))  ok=false;       }\r
        return ok?GSL_SUCCESS:GSL_FAILURE;\r
 }\r
-bool MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par)\r
+int MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par)\r
 {\r
        for(size_t i=0;i<n;i++) if(mgl_isbad(x0[i]))    return false;\r
        mglRoots pp;\r
@@ -905,7 +1055,7 @@ bool MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f,
        return status==GSL_SUCCESS;\r
 }\r
 #else\r
-bool MGL_EXPORT mgl_find_roots(size_t , void (*)(const mreal *, mreal *, void *), mreal *, void *)\r
+int MGL_EXPORT mgl_find_roots(size_t n, void (*func)(const mreal *x, mreal *f, void *par), mreal *x0, void *par)\r
 {      return false;   }\r
 #endif // MGL_HAVE_GSL\r
 //-----------------------------------------------------------------------------\r
@@ -1304,3 +1454,54 @@ void MGL_EXPORT mgl_data_connect_r(HMDT a, HMDT b)
 void MGL_EXPORT mgl_data_connect_r_(uintptr_t *a, uintptr_t *b)\r
 {      mgl_data_connect_r(_DM_(a),_DM_(b));    }\r
 //-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_data_keep(HMDT dat, const char *how, long i, long j)\r
+{\r
+       const long nx = dat->GetNx(), ny = dat->GetNy(), nz = dat->GetNz();\r
+       const bool ampl = mglchr(how, 'a');\r
+       if(mglchr(how,'z'))\r
+       {\r
+               long ix = i, iy = j;\r
+               if(ix<0 || ix>=nx)      ix = 0;\r
+               if(iy<0 || iy>=ny)      iy = 0;\r
+               const long i0 = ix+nx*iy, nn = nx*ny;\r
+               const mreal v0 = dat->a[i0];\r
+               for(long k=0;k<nz;k++)\r
+               {\r
+                       mreal v = dat->a[i0+nn*k];\r
+                       mreal f = ampl? v0/v : (v*v0>0?1:-1);\r
+                       for(long ii=0;ii<nn;ii++)       dat->a[ii+nn*k] *= f;\r
+               }\r
+       }\r
+       else if(mglchr(how,'x'))\r
+       {\r
+               long iy = i, iz = j;\r
+               if(iz<0 || iz>=nz)      iz = 0;\r
+               if(iy<0 || iy>=ny)      iy = 0;\r
+               const long i0 = nx*(iy+ny*iz), nn = ny*nz;\r
+               const mreal v0 = dat->a[i0];\r
+               for(long k=0;k<nx;k++)\r
+               {\r
+                       mreal v = dat->a[i0+k];\r
+                       mreal f = ampl? v0/v : (v*v0>0?1:-1);\r
+                       for(long ii=0;ii<nn;ii++)       dat->a[k+nx*ii] *= f;\r
+               }\r
+       }\r
+       else    // default is "y"\r
+       {\r
+               long ix = i, iz = j;\r
+               if(ix<0 || ix>=nx)      ix = 0;\r
+               if(iz<0 || iz>=nz)      iz = 0;\r
+               const long i0 = ix+nx*ny*iz;\r
+               const mreal v0 = dat->a[i0];\r
+               for(long k=0;k<ny;k++)\r
+               {\r
+                       mreal v = dat->a[i0+nx*k];\r
+                       mreal f = ampl? v0/v : (v*v0>0?1:-1);\r
+                       for(long ii=0;ii<nz;ii++)       for(long jj=0;jj<nx;jj++)       dat->a[jj+nx*(k+ny*ii)] *= f;\r
+               }\r
+       }\r
+}\r
+void MGL_EXPORT mgl_data_keep_(uintptr_t *d, const char *how, long *i, long *j, int l)\r
+{      char *s=new char[l+1];  memcpy(s,how,l);        s[l]=0;\r
+       mgl_data_keep(_DT_, s, *i, *j); delete []s;     }\r
+//-----------------------------------------------------------------------------\r
index 066335f82735417a67297841296884e7652ce09e..310b7358ba6533b24b71e81b067cb81b1ca24080 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -28,9 +28,6 @@
 #include "mgl2/thread.h"
 #include "mgl2/base.h"
 //-----------------------------------------------------------------------------
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head);
-HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head);
-//-----------------------------------------------------------------------------
 void MGL_EXPORT mgl_data_refill_gr(HMGL gr, HMDT dat, HCDT xdat, HCDT ydat, HCDT zdat, HCDT vdat, long sl, const char *opt)
 {
        if(!vdat)       return;
@@ -81,8 +78,6 @@ void MGL_EXPORT mgl_datac_refill_gr_(uintptr_t *gr, uintptr_t *d, uintptr_t *xda
 //-----------------------------------------------------------------------------
 void MGL_EXPORT mgl_data_fill_eq(HMGL gr, HMDT d, const char *eq, HCDT vdat, HCDT wdat, const char *opt)
 {
-       if(vdat && vdat->GetNN()!=d->GetNN())   return; // incompatible dimensions
-       if(wdat && wdat->GetNN()!=d->GetNN())   return;
        gr->SaveState(opt);
        std::wstring s = d->Name();     d->Name(L"u");
        mglDataV x(d->nx,d->ny,d->nz, gr->Min.x,gr->Max.x,'x'); x.Name(L"x");
@@ -106,8 +101,6 @@ void MGL_EXPORT mgl_data_fill_eq_(uintptr_t *gr, uintptr_t *d, const char *eq, u
 //-----------------------------------------------------------------------------
 void MGL_EXPORT mgl_datac_fill_eq(HMGL gr, HADT d, const char *eq, HCDT vdat, HCDT wdat, const char *opt)
 {
-       if(vdat && vdat->GetNN()!=d->GetNN())   return; // incompatible dimensions
-       if(wdat && wdat->GetNN()!=d->GetNN())   return;
        gr->SaveState(opt);
        std::wstring s = d->Name();     d->Name(L"u");
        mglDataV x(d->nx,d->ny,d->nz, gr->Min.x,gr->Max.x,'x'); x.Name(L"x");
index a4f776281e59ddd0a12f0dbd63d9e99e37f8ca66..c2464f1a2a4e0f8516f54a4dcdf94997d9d71270 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -40,7 +40,6 @@
 #endif\r
 \r
 inline bool isn(char ch)       {return ch=='\n';}\r
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 HMDT MGL_EXPORT mgl_create_data()      {       return new mglData;     }\r
 HMDT MGL_EXPORT mgl_create_data_size(long nx, long ny, long nz){       return new mglData(nx,ny,nz);   }\r
@@ -48,14 +47,14 @@ HMDT MGL_EXPORT mgl_create_data_file(const char *fname)             {       return new mglData(fn
 void MGL_EXPORT mgl_delete_data(HMDT d)        {       if(d)   delete d;       }\r
 //-----------------------------------------------------------------------------\r
 uintptr_t MGL_EXPORT mgl_create_data_()\r
-{      return uintptr_t(new mglData());        }\r
+{      return uintptr_t(mgl_create_data());    }\r
 uintptr_t MGL_EXPORT mgl_create_data_size_(int *nx, int *ny, int *nz)\r
-{      return uintptr_t(new mglData(*nx,*ny,*nz));     }\r
+{      return uintptr_t(mgl_create_data_size(*nx,*ny,*nz));    }\r
 uintptr_t MGL_EXPORT mgl_create_data_file_(const char *fname,int l)\r
 {      char *s=new char[l+1];  memcpy(s,fname,l);      s[l]=0;\r
-       uintptr_t r = uintptr_t(new mglData(s));        delete []s;     return r;       }\r
+       uintptr_t r = uintptr_t(mgl_create_data_file(s));       delete []s;     return r;       }\r
 void MGL_EXPORT mgl_delete_data_(uintptr_t *d)\r
-{      if(_DT_)        delete _DT_;    }\r
+{      mgl_delete_data(_DT_);  }\r
 //-----------------------------------------------------------------------------\r
 void mglFromStr(HMDT d,char *buf,long NX,long NY,long NZ)\r
 {\r
@@ -309,6 +308,33 @@ std::string MGL_EXPORT mgl_str_arg(const std::string &str, char ch, int n1, int
        return res;\r
 }\r
 //-----------------------------------------------------------------------------\r
+/// Get section separated by symbol ch. This is analog of QString::section().\r
+std::vector<std::wstring> MGL_EXPORT mgl_wcs_args(const std::wstring &str, wchar_t ch)\r
+{\r
+       std::vector<size_t> pos;        pos.push_back(0);\r
+       for(size_t p=0; p != std::string::npos;)\r
+       {       p=str.find(ch,p+1);     pos.push_back(p?p+1:0); }\r
+       std::vector<std::wstring> res;\r
+       for(size_t i=0;i<pos.size()-1;i++)\r
+               res.push_back(str.substr(pos[i],pos[i+1]-pos[i]-1));\r
+       return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
+/// Get section separated by symbol ch. This is analog of QString::section().\r
+std::wstring MGL_EXPORT mgl_wcs_arg(const std::wstring &str, wchar_t ch, int n1, int n2)\r
+{\r
+       std::vector<size_t> pos;        pos.push_back(0);\r
+       for(size_t p=0; p != std::string::npos;)\r
+       {       p=str.find(ch,p+1);     pos.push_back(p?p+1:0); }\r
+       std::wstring res;\r
+       if(n2<0)        n2=n1;\r
+       if(n1<0 || n1>=long(pos.size())-1 || n2<n1)     return res;\r
+       if(n2>=long(pos.size()))        n2=pos.size()-1;\r
+       res = str.substr(pos[n1],pos[n2+1]-pos[n1]-1);\r
+       if(res.size()==1 && res[0]==ch) res.clear();\r
+       return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
 /// Get string from number.\r
 std::string MGL_EXPORT mgl_str_num(double val)\r
 {      char buf[32];   snprintf(buf,32,"%g",val);      return std::string(buf);        }\r
@@ -374,6 +400,92 @@ MGL_NO_EXPORT char *mgl_read_gz(gzFile fp)
        return buf;\r
 }\r
 //-----------------------------------------------------------------------------\r
+int MGL_EXPORT mgl_data_read_bin(HMDT dat, const char *fname, int kind)\r
+{\r
+       FILE *fp = fopen(fname,"rb");\r
+       if(!fp) return 0;\r
+       fseek(fp,0,SEEK_END);\r
+       long len=ftell(fp), n=0;        // file length, and number of elements\r
+       fseek(fp,0,SEEK_SET);\r
+       switch(kind)\r
+       {\r
+               case 0: // double type\r
+                       n = len/sizeof(double);\r
+                       if(n>0)\r
+                       {\r
+                               double *a = new double[n];\r
+                               n = fread(a,sizeof(double),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 1: // float type\r
+                       n = len/sizeof(float);\r
+                       if(n>0)\r
+                       {\r
+                               float *a = new float[n];\r
+                               n = fread(a,sizeof(float),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 2: // long double type\r
+                       n = len/sizeof(long double);\r
+                       if(n>0)\r
+                       {\r
+                               long double *a = new long double[n];\r
+                               n = fread(a,sizeof(long double),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 3: // long int type\r
+                       n = len/sizeof(long);\r
+                       if(n>0)\r
+                       {\r
+                               long *a = new long[n];\r
+                               n = fread(a,sizeof(long),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 4: // int type\r
+                       n = len/sizeof(int);\r
+                       if(n>0)\r
+                       {\r
+                               int *a = new int[n];\r
+                               n = fread(a,sizeof(int),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 5: // short int type\r
+                       n = len/sizeof(short);\r
+                       if(n>0)\r
+                       {\r
+                               short *a = new short[n];\r
+                               n = fread(a,sizeof(short),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+               case 6: // char type\r
+                       n = len/sizeof(char);\r
+                       if(n>0)\r
+                       {\r
+                               char *a = new char[n];\r
+                               n = fread(a,sizeof(char),n,fp);\r
+                               dat->Create(n);\r
+                               for(long i=0;i<n;i++)   dat->a[i]=a[i];\r
+                       }\r
+                       break;\r
+       }\r
+       return 1;\r
+}\r
+int MGL_EXPORT mgl_data_read_bin_(uintptr_t *d, const char *fname,int *kind,int l)\r
+{      char *s=new char[l+1];          memcpy(s,fname,l);      s[l]=0;\r
+       int r = mgl_data_read_bin(_DT_, s, *kind);      delete []s;             return r;       }\r
+//-----------------------------------------------------------------------------\r
 int MGL_EXPORT mgl_data_read(HMDT d, const char *fname)\r
 {\r
        long l=1,m=1,k=1,i;\r
@@ -1010,7 +1122,7 @@ static void *mgl_modify(void *par)
 void MGL_EXPORT mgl_data_modify(HMDT d, const char *eq,long dim)\r
 {\r
        long nx=d->nx, ny=d->ny, nz=d->nz, par[3]={nx,ny,nz};\r
-       if(dim<=0)      mgl_data_modify_vw(d,eq,0,0);   // fastes variant for whole array\r
+       if(dim<=0)      mgl_data_modify_vw(d,eq,0,0);   // fastest variant for whole array\r
        else if(nz>1)   // 3D array\r
        {\r
                mglFormula f(eq);\r
@@ -1093,6 +1205,61 @@ int MGL_EXPORT mgl_data_read_hdf4(HMDT ,const char *,const char *)
 #endif\r
 //-----------------------------------------------------------------------------\r
 #if MGL_HAVE_HDF5\r
+void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite)\r
+{\r
+       hid_t hf,hd,hs;\r
+       hsize_t dims[4]={1,2};\r
+       long rank = 2, res;\r
+       H5Eset_auto(0,0);\r
+       res=H5Fis_hdf5(fname);\r
+       if(res>0 && !rewrite)   hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);\r
+       else    hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);\r
+       if(hf<0)        return;\r
+       hs = H5Screate_simple(rank, dims, 0);\r
+#if MGL_USE_DOUBLE\r
+       hid_t mem_type_id = H5T_NATIVE_DOUBLE;\r
+#else\r
+       hid_t mem_type_id = H5T_NATIVE_FLOAT;\r
+#endif\r
+       hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT);\r
+       H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val);\r
+       H5Dclose(hd);   H5Sclose(hs);   H5Fclose(hf);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite)\r
+{\r
+       hid_t hf,hd,hs;\r
+       hsize_t dims[3]={1,1,1};\r
+       long rank = 1, res;\r
+       H5Eset_auto(0,0);\r
+       res=H5Fis_hdf5(fname);\r
+       if(res>0 && !rewrite)   hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);\r
+       else    hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);\r
+       if(hf<0)        return;\r
+       hs = H5Screate_simple(rank, dims, 0);\r
+       hid_t mem_type_id = H5T_NATIVE_DOUBLE;\r
+       hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT);\r
+       H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val);\r
+       H5Dclose(hd);   H5Sclose(hs);   H5Fclose(hf);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite)\r
+{\r
+       hid_t hf,hd,hs;\r
+       hsize_t dims[3]={1,1,1};\r
+       long rank = 1, res;\r
+       H5Eset_auto(0,0);\r
+       res=H5Fis_hdf5(fname);\r
+       if(res>0 && !rewrite)   hf = H5Fopen(fname, H5F_ACC_RDWR, H5P_DEFAULT);\r
+       else    hf = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);\r
+       if(hf<0)        return;\r
+       hs = H5Screate_simple(rank, dims, 0);\r
+       hid_t mem_type_id = H5T_NATIVE_LONG;\r
+       hd = H5Dcreate(hf, data, mem_type_id, hs, H5P_DEFAULT);\r
+       H5Dwrite(hd, mem_type_id, hs, hs, H5P_DEFAULT, &val);\r
+       H5Dclose(hd);   H5Sclose(hs);   H5Fclose(hf);\r
+}\r
+//-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_data_save_hdf(HCDT dat,const char *fname,const char *data,int rewrite)\r
 {\r
        const mglData *d = dynamic_cast<const mglData *>(dat);  // NOTE: slow for non-mglData\r
@@ -1127,8 +1294,9 @@ int MGL_EXPORT mgl_data_read_hdf(HMDT d,const char *fname,const char *data)
        hf = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT);\r
        if(hf<0)        return 0;\r
        hd = H5Dopen(hf,data);\r
-       if(hd<0)        return 0;\r
+       if(hd<0)        {       H5Fclose(hf);   return 0;       }\r
        hs = H5Dget_space(hd);\r
+       if(hs<0)        {       H5Dclose(hd);   H5Fclose(hf);   return 0;       }\r
        rank = H5Sget_simple_extent_ndims(hs);\r
        if(rank>0 && rank<=3)\r
        {\r
@@ -1195,6 +1363,12 @@ long MGL_EXPORT mgl_datas_hdf(const char *, char *, long )
 {      mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL."));     return 0;}\r
 int MGL_EXPORT mgl_data_read_hdf(HMDT ,const char *,const char *)\r
 {      mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL."));     return 0;}\r
+void MGL_EXPORT mgl_dual_save_hdf(mdual val,const char *fname,const char *data,int rewrite)\r
+{      mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL."));     }\r
+void MGL_EXPORT mgl_real_save_hdf(double val,const char *fname,const char *data,int rewrite)\r
+{      mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL."));     }\r
+void MGL_EXPORT mgl_int_save_hdf(long val,const char *fname,const char *data,int rewrite)\r
+{      mgl_set_global_warn(_("HDF5 support was disabled. Please, enable it and rebuild MathGL."));     }\r
 #endif\r
 //-----------------------------------------------------------------------------\r
 int MGL_EXPORT mgl_data_read_hdf_(uintptr_t *d, const char *fname, const char *data,int l,int n)\r
@@ -1208,6 +1382,14 @@ void MGL_EXPORT mgl_data_save_hdf_(uintptr_t *d, const char *fname, const char *
 long MGL_EXPORT mgl_datas_hdf_(const char *fname, char *buf, int l, int size)\r
 {      char *s=new char[l+1];          memcpy(s,fname,l);      s[l]=0;\r
        int r = mgl_datas_hdf(s,buf,size);      delete []s;     return r;       }\r
+void MGL_EXPORT mgl_real_save_hdf_(double *val,const char *fname,const char *data,int *rewrite,int l,int n)\r
+{      char *s=new char[l+1];          memcpy(s,fname,l);      s[l]=0;\r
+       char *t=new char[n+1];          memcpy(t,data,n);       t[n]=0;\r
+       mgl_real_save_hdf(*val,s,t,*rewrite);   delete []s;     delete []t;     }\r
+void MGL_EXPORT mgl_int_save_hdf_(long *val,const char *fname,const char *data,int *rewrite,int l,int n)\r
+{      char *s=new char[l+1];          memcpy(s,fname,l);      s[l]=0;\r
+       char *t=new char[n+1];          memcpy(t,data,n);       t[n]=0;\r
+       mgl_int_save_hdf(*val,s,t,*rewrite);    delete []s;     delete []t;     }\r
 //-----------------------------------------------------------------------------\r
 bool MGL_EXPORT mgl_add_file(long &kx,long &ky, long &kz, mreal *&b, mglData *d,bool as_slice)\r
 {\r
index b72ada0a39ddb99a7eeb2d85a5aea708fd00b920..20d10c5677f81f4929b01302107053e5be75f3f7 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -217,24 +217,26 @@ printf("\n");
 #else\r
        long num=0;\r
        unsigned char *c = mgl_create_scheme(scheme,num);\r
-       if(num<2)       return;\r
-       d->Create(w,h,1);\r
-#pragma omp parallel for collapse(2)\r
-       for(long i=0;i<h;i++)   for(long j=0;j<w;j++)\r
+       if(num>=2)\r
        {\r
-               unsigned pos=0,mval=256*256;\r
-               const unsigned char *c2=g+4*w*(d->ny-i-1)+4*j;\r
-               for(long k=0;k<num;k++)\r
+               d->Create(w,h,1);\r
+#pragma omp parallel for collapse(2)\r
+               for(long i=0;i<h;i++)   for(long j=0;j<w;j++)\r
                {\r
-                       const unsigned char *c1=c+3*k;\r
-                       int v0=int(c1[0])-c2[0];\r
-                       int v1=int(c1[1])-c2[1];\r
-                       int v2=int(c1[2])-c2[2];\r
-                       unsigned val = v0*v0+v1*v1+v2*v2;\r
-                       if(val==0)              {       pos=k;  break;  }\r
-                       if(val<mval)    {       pos=k;  mval=val;       }\r
+                       unsigned pos=0,mval=256*256;\r
+                       const unsigned char *c2=g+4*w*(d->ny-i-1)+4*j;\r
+                       for(long k=0;k<num;k++)\r
+                       {\r
+                               const unsigned char *c1=c+3*k;\r
+                               int v0=int(c1[0])-c2[0];\r
+                               int v1=int(c1[1])-c2[1];\r
+                               int v2=int(c1[2])-c2[2];\r
+                               unsigned val = v0*v0+v1*v1+v2*v2;\r
+                               if(val==0)              {       pos=k;  break;  }\r
+                               if(val<mval)    {       pos=k;  mval=val;       }\r
+                       }\r
+                       d->a[j+d->nx*i] = v1 + pos*(v2-v1)/(num-1);\r
                }\r
-               d->a[j+d->nx*i] = v1 + pos*(v2-v1)/(num-1);\r
        }\r
        delete []c;     delete []g;\r
 #endif\r
index 7f87793a6ed12cffa5118b07334383c23b687fe1..157bed9cde8fded26fd3f2370d808cb399908d13 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -132,7 +132,7 @@ EQ_CL               // Clausen function
 //-----------------------------------------------------------------------------\r
 int mglFormula::Error=0;\r
 bool MGL_LOCAL_PURE mglCheck(char *str,int n);\r
-int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst);\r
+long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst);\r
 //-----------------------------------------------------------------------------\r
 #if MGL_HAVE_GSL\r
 MGL_NO_EXPORT gsl_rng *mgl_rng=0;      // NOTE: should be deleted by gsl_rng_free() but I don't know where :(\r
@@ -253,7 +253,7 @@ mglFormula::mglFormula(const char *string)
                delete []str;   return;\r
        }\r
        n=mglFindInText(str,"+-");                              // normal priority -- additions\r
-       if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2]))))\r
+       if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2]))))\r
        {\r
                if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB;\r
                str[n]=0;\r
@@ -532,6 +532,7 @@ double MGL_LOCAL_CONST mgl_acosh(double x)  {       return x>1 ? log(x+sqrt(x*x-1.)) :
 double MGL_LOCAL_CONST mgl_atanh(double x)     {       return fabs(x)<1 ? log((1.+x)/(1.-x))/2 : NAN;  }\r
 double MGL_LOCAL_CONST mgl_fmin(double a,double b)     {       return a > b ? b : a;   }\r
 double MGL_LOCAL_CONST mgl_fmax(double a,double b)     {       return a > b ? a : b;   }\r
+double MGL_LOCAL_CONST mgl_fmod(double a, double m)    {       return (a>=0)?fmod(a,m):fmod(a,m)+m;    }\r
 //-----------------------------------------------------------------------------\r
 typedef double (*func_1)(double);\r
 typedef double (*func_2)(double, double);\r
@@ -543,7 +544,7 @@ static const mreal z2[EQ_SIN-EQ_LT] = {3,3,3,3,0,3,3,0,0,0,0,0,NAN,3,3,3,3
        ,0,0,0,0,0,0,0,0,0\r
 #endif\r
 };\r
-static const func_2 f2[EQ_SIN-EQ_LT] = {clt,cgt,ceq,cor,cand,add,sub,mul,del,ipw,pow,fmod,llg,arg,hypot,mgl_fmax,mgl_fmin\r
+static const func_2 f2[EQ_SIN-EQ_LT] = {clt,cgt,ceq,cor,cand,add,sub,mul,del,ipw,pow,mgl_fmod,llg,arg,hypot,mgl_fmax,mgl_fmin\r
 #if MGL_HAVE_GSL\r
        ,gsl_sf_bessel_Jnu,gsl_sf_bessel_Ynu,\r
        gsl_sf_bessel_Inu,gsl_sf_bessel_Knu,\r
@@ -760,7 +761,7 @@ bool MGL_LOCAL_PURE mglCheck(char *str,int n)
 }\r
 //-----------------------------------------------------------------------------\r
 // Try to find one of symbols lst in the string str\r
-int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst)\r
+long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst)\r
 {\r
        long l=0,r=0,len=strlen(str);\r
        for(long i=len-1;i>=0;i--)\r
index bedf91fd684b75389acafeaee080051f2a4ec1f8..9e527f155e5b7caaebc8cd8b671851449893a90d 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -71,7 +71,7 @@ EQ_LAST               // id of last entry
 //-----------------------------------------------------------------------------\r
 int mglFormulaC::Error=0;\r
 bool MGL_LOCAL_PURE mglCheck(char *str,int n);\r
-int MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst);\r
+long MGL_LOCAL_PURE mglFindInText(const char *str, const char *lst);\r
 //-----------------------------------------------------------------------------\r
 mglFormulaC::~mglFormulaC()\r
 {\r
@@ -81,13 +81,12 @@ mglFormulaC::~mglFormulaC()
 }\r
 //-----------------------------------------------------------------------------\r
 // Formula constructor (automatically parse and "compile" formula)\r
-mglFormulaC::mglFormulaC(const char *string)\r
+mglFormulaC::mglFormulaC(const char *string):Res(0)\r
 {\r
        dat = tmp = NULL;\r
        dx1=dy1=dz1=0;  dx2=dy2=dz2=1;\r
-       Error=0;\r
+       Error=Kod=0;\r
        Left=Right=0;\r
-       Res=0; Kod=0;\r
        if(!string)     {       Kod = EQ_NUM;   Res = 0;        return; }\r
        char *str = new char[strlen(string)+1];\r
        strcpy(str,string);\r
@@ -129,7 +128,7 @@ mglFormulaC::mglFormulaC(const char *string)
                delete []str;   return;\r
        }\r
        n=mglFindInText(str,"+-");                              // normal priority -- additions\r
-       if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2]))))\r
+       if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2]))))\r
        {\r
                if(str[n]=='+') Kod=EQ_ADD; else Kod=EQ_SUB;\r
                str[n]=0;\r
index 83ec390506b5c66bfc752a96bf4be7c68dcb903f..8154d9cd6c2f3695d9fa536bfd83a0991672c26e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 #endif
 //-----------------------------------------------------------------------------
 std::wstring mgl_trim_ws(const std::wstring &str);
-HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
-HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
+HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &string, mglParser *arg, const std::vector<mglDataA*> &head);
+HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &string, mglParser *arg, const std::vector<mglDataA*> &head);
+HMDT MGL_NO_EXPORT mglFormulaCalcA(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns);
+HADT MGL_NO_EXPORT mglFormulaCalcAC(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns);
 //-----------------------------------------------------------------------------
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head)
+HMDT MGL_EXPORT mgl_formula_calc(const char *str, long n, ...)
 {
+       if(n<1) return NULL;
+       std::vector<mglDataA*> head;
+       va_list vl;     va_start(vl,n);
+       for(long i=0;i<n;i++)   head.push_back(va_arg(vl,mglDataA*));
+       va_end(vl);
+       return mglFormulaCalc(str, head);
+}
+//-----------------------------------------------------------------------------
+HADT MGL_EXPORT mgl_formula_calc_c(const char *str, long n, ...)
+{
+       if(n<1) return NULL;
+       std::vector<mglDataA*> head;
+       va_list vl;     va_start(vl,n);
+       for(long i=0;i<n;i++)   head.push_back(va_arg(vl,mglDataA*));
+       va_end(vl);
+       return mglFormulaCalcC(str, head);
+}
+//-----------------------------------------------------------------------------
+HMDT MGL_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head)
+{
+       if(!str || *str==0)     return NULL;
        std::wstring s;
        for(long i=0;str[i];i++)        s.push_back(str[i]);
        return mglFormulaCalc(s,0,head);
 }
 //-----------------------------------------------------------------------------
-HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head)
+HADT MGL_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head)
 {
+       if(!str || *str==0)     return NULL;
        std::wstring s;
        for(long i=0;str[i];i++)        s.push_back(str[i]);
        return mglFormulaCalcC(s,0,head);
 }
 //-----------------------------------------------------------------------------
-HMDT mglApplyFunc(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double))
+HMDT MGL_NO_EXPORT mglApplyFunc(const std::wstring &str, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double), const std::vector<std::wstring> &fns)
 {
-       HMDT d = mglFormulaCalc(str, arg, head);
+       HMDT d = mglFormulaCalcA(str, arg, head, fns);
        long n = d->GetNN();    mreal *dd=d->a;
 #pragma omp parallel for
        for(long i=0;i<n;i++)   dd[i] = func(dd[i]);
@@ -55,9 +79,9 @@ HMDT mglApplyFunc(std::wstring str, mglParser *arg, const std::vector<mglDataA*>
 }
 //-----------------------------------------------------------------------------
 #if MGL_HAVE_GSL
-HMDT mglApplyFuncGSL(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double, gsl_mode_t))
+HMDT MGL_NO_EXPORT mglApplyFuncGSL(const std::wstring &str, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double, gsl_mode_t), const std::vector<std::wstring> &fns)
 {
-       HMDT d = mglFormulaCalc(str, arg, head);
+       HMDT d = mglFormulaCalcA(str, arg, head, fns);
        long n = d->GetNN();    mreal *dd=d->a;
 #pragma omp parallel for
        for(long i=0;i<n;i++)   dd[i] = func(dd[i],GSL_PREC_SINGLE);
@@ -65,9 +89,9 @@ HMDT mglApplyFuncGSL(std::wstring str, mglParser *arg, const std::vector<mglData
 }
 #endif
 //-----------------------------------------------------------------------------
-HMDT mglApplyOper(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double,double))
+HMDT MGL_NO_EXPORT mglApplyOper(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, double (*func)(double,double), const std::vector<std::wstring> &fns)
 {
-       HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d;
+       HMDT a = mglFormulaCalcA(a1,arg,head, fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -84,9 +108,9 @@ HMDT mglApplyOper(std::wstring a1, std::wstring a2, mglParser *arg, const std::v
        mgl_delete_data(d);     return r;
 }
 //-----------------------------------------------------------------------------
-HMDT mglApplyOperAdd(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HMDT MGL_NO_EXPORT mglApplyOperAdd(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d;
+       HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -100,9 +124,9 @@ HMDT mglApplyOperAdd(std::wstring a1, std::wstring a2, mglParser *arg, const std
        mgl_delete_data(d);     return r;
 }
 //-----------------------------------------------------------------------------
-HMDT mglApplyOperSub(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HMDT MGL_NO_EXPORT mglApplyOperSub(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d;
+       HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -119,9 +143,9 @@ HMDT mglApplyOperSub(std::wstring a1, std::wstring a2, mglParser *arg, const std
        mgl_delete_data(d);     return r;
 }
 //-----------------------------------------------------------------------------
-HMDT mglApplyOperMul(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HMDT MGL_NO_EXPORT mglApplyOperMul(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d;
+       HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -135,9 +159,9 @@ HMDT mglApplyOperMul(std::wstring a1, std::wstring a2, mglParser *arg, const std
        mgl_delete_data(d);     return r;
 }
 //-----------------------------------------------------------------------------
-HMDT mglApplyOperDiv(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HMDT MGL_NO_EXPORT mglApplyOperDiv(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HMDT a = mglFormulaCalc(a1,arg,head), b = mglFormulaCalc(a2,arg,head), r,d;
+       HMDT a = mglFormulaCalcA(a1,arg,head,fns), b = mglFormulaCalcA(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -157,18 +181,18 @@ HMDT mglApplyOperDiv(std::wstring a1, std::wstring a2, mglParser *arg, const std
        mgl_delete_data(d);     return r;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyFuncC(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head, dual (*func)(dual))
+HADT MGL_NO_EXPORT mglApplyFuncC(const std::wstring &str, mglParser *arg, const std::vector<mglDataA*> &head, dual (*func)(dual), const std::vector<std::wstring> &fns)
 {
-       HADT d = mglFormulaCalcC(str, arg, head);
+       HADT d = mglFormulaCalcAC(str, arg, head,fns);
        long n = d->GetNN();    dual *dd=d->a;
 #pragma omp parallel for
        for(long i=0;i<n;i++)   dd[i] = func(dd[i]);
        return d;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyOperC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head, dual (*func)(dual,dual))
+HADT MGL_NO_EXPORT mglApplyOperC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, dual (*func)(dual,dual), const std::vector<std::wstring> &fns)
 {
-       HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d;
+       HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -185,9 +209,9 @@ HADT mglApplyOperC(std::wstring a1, std::wstring a2, mglParser *arg, const std::
        mgl_delete_datac(d);    return r;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyOperAddC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HADT MGL_NO_EXPORT mglApplyOperAddC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d;
+       HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -201,9 +225,9 @@ HADT mglApplyOperAddC(std::wstring a1, std::wstring a2, mglParser *arg, const st
        mgl_delete_datac(d);    return r;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyOperSubC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HADT MGL_NO_EXPORT mglApplyOperSubC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d;
+       HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -220,9 +244,9 @@ HADT mglApplyOperSubC(std::wstring a1, std::wstring a2, mglParser *arg, const st
        mgl_delete_datac(d);    return r;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyOperMulC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HADT MGL_NO_EXPORT mglApplyOperMulC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d;
+       HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -236,9 +260,9 @@ HADT mglApplyOperMulC(std::wstring a1, std::wstring a2, mglParser *arg, const st
        mgl_delete_datac(d);    return r;
 }
 //-----------------------------------------------------------------------------
-HADT mglApplyOperDivC(std::wstring a1, std::wstring a2, mglParser *arg, const std::vector<mglDataA*> &head)
+HADT MGL_NO_EXPORT mglApplyOperDivC(const std::wstring &a1, const std::wstring &a2, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
-       HADT a = mglFormulaCalcC(a1,arg,head), b = mglFormulaCalcC(a2,arg,head), r,d;
+       HADT a = mglFormulaCalcAC(a1,arg,head,fns), b = mglFormulaCalcAC(a2,arg,head,fns), r,d;
        long na = a->GetNN(), nb = b->GetNN(), nn;
        if(na!=1)       {       r=a;    d=b;    nn=na;  }
        else            {       r=b;    d=a;    nn=nb;  }
@@ -270,14 +294,17 @@ bool MGL_LOCAL_PURE mglCheck(std::wstring str)
        return (s==0) ? true : false;
 }
 //-----------------------------------------------------------------------------
-long MGL_LOCAL_PURE mglFindInText(const std::wstring &str,const char *lst)
+long MGL_LOCAL_PURE mglFindInText(const std::wstring &str,const char *lst, int num=0)
 {
-       long l=0,r=0;
+       long l=0,r=0,ls=0,rs=0;
        for(long i=str.length()-1;i>=0;i--)
        {
                if(str[i]=='(') l++;
                if(str[i]==')') r++;
-               if(l==r && strchr(lst,str[i]))  return i;
+               if(str[i]=='[') ls++;
+               if(str[i]==']') rs++;
+               if(l==r && ls==rs && strchr(lst,str[i]))
+               {       num--;  if(num<0)       return i;       }
        }
        return -1;
 }
@@ -302,6 +329,7 @@ double MGL_LOCAL_CONST mgl_acosh(double x);
 double MGL_LOCAL_CONST mgl_atanh(double x);
 double MGL_LOCAL_CONST mgl_fmin(double a,double b);
 double MGL_LOCAL_CONST mgl_fmax(double a,double b);
+double MGL_LOCAL_CONST mgl_fmod(double a, double m);
 //-----------------------------------------------------------------------------
 // It seems that standard wcstombs() have a bug. So, I replace by my own.
 void MGL_EXPORT mgl_wcstombs(char *dst, const wchar_t *src, int size)
@@ -315,7 +343,8 @@ void MGL_EXPORT mgl_wcstombs(char *dst, const wchar_t *src, int size)
 MGL_LOCAL_PURE const mglDataA *FindVar(const std::vector<mglDataA*> &head, const std::wstring &name)
 {
        for(size_t i=0;i<head.size();i++)
-               if(head[i] && head[i]->Name()==name)    return head[i];
+               if(head[i] && !wcscmp(head[i]->Name(),name.c_str()))    // bypass std::string comparison warning
+                       return head[i];
        return 0;
 }
 //-----------------------------------------------------------------------------
@@ -326,7 +355,7 @@ void MGL_EXPORT mgl_wcslwr(wchar_t *str)
                str[k] = (str[k]>='A' && str[k]<='Z') ? str[k]+'a'-'A' : str[k];
 }
 //-----------------------------------------------------------------------------
-mreal mgl_gettime(const std::wstring &s)
+mreal MGL_NO_EXPORT mgl_gettime(const std::wstring &s)
 {
        mreal t=NAN;
        tm a;   memset(&a,0,sizeof(tm));
@@ -348,11 +377,117 @@ mreal mgl_gettime(const std::wstring &s)
        return t;
 }
 //-----------------------------------------------------------------------------
+double MGL_NO_EXPORT mgl_jac_sn(double a, double m)
+{
+       double sn=0, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return sn;
+}
+double MGL_NO_EXPORT mgl_jac_sc(double a, double m)
+{
+       double sn=0, cn=1, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return sn/cn;
+}
+double MGL_NO_EXPORT mgl_jac_sd(double a, double m)
+{
+       double sn=0, cn=0, dn=1;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return sn/dn;
+}
+
+double MGL_NO_EXPORT mgl_jac_cn(double a, double m)
+{
+       double sn=1, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return cn;
+}
+double MGL_NO_EXPORT mgl_jac_cs(double a, double m)
+{
+       double sn=1, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return cn/sn;
+}
+double MGL_NO_EXPORT mgl_jac_cd(double a, double m)
+{
+       double sn=0, cn=0, dn=1;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return cn/dn;
+}
+
+double MGL_NO_EXPORT mgl_jac_dn(double a, double m)
+{
+       double sn=0, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return dn;
+}
+double MGL_NO_EXPORT mgl_jac_ds(double a, double m)
+{
+       double sn=1, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return dn/sn;
+}
+double MGL_NO_EXPORT mgl_jac_dc(double a, double m)
+{
+       double sn=0, cn=1, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return dn/cn;
+}
+
+double MGL_NO_EXPORT mgl_jac_nd(double a, double m)
+{
+       double sn=0, cn=0, dn=1;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return 1./dn;
+}
+double MGL_NO_EXPORT mgl_jac_ns(double a, double m)
+{
+       double sn=1, cn=0, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return 1./sn;
+}
+double MGL_NO_EXPORT mgl_jac_nc(double a, double m)
+{
+       double sn=0, cn=1, dn=0;
+#if MGL_HAVE_GSL
+       gsl_sf_elljac_e(a,m, &sn, &cn, &dn);
+#endif
+       return 1./cn;
+}
+//-----------------------------------------------------------------------------
 /// Parse string and substitute the script argument
 // All numbers are presented as mglData(1). Do boundary checking.
 // NOTE: In any case where number is required the mglData::a[0] is used.
 // String flag is binary 0x1 -> 'x', 0x2 -> 'y', 0x4 -> 'z'
-HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head)
+HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &str, mglParser *arg, const std::vector<mglDataA*> &head)
+{
+       if(str.empty()) return NULL;
+       std::vector<std::wstring> fns = mgl_wcs_args(str,'\\');
+       return mglFormulaCalcA(fns[0],arg,head,fns);
+}
+HMDT MGL_NO_EXPORT mglFormulaCalcA(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
 #if MGL_HAVE_GSL
        gsl_set_error_handler_off();
@@ -419,18 +554,19 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
 
        n=mglFindInText(str,"&|");      // lowest priority -- logical
        if(n>=0)
-               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='|'?cor:cand);
+               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='|'?cor:cand,fns);
        n=mglFindInText(str,"<>=");     // low priority -- conditions
        if(n>=0)
-               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?clt:(str[n]=='>'?cgt:ceq));
+               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?clt:(str[n]=='>'?cgt:ceq),fns);
        n=mglFindInText(str,"+-");      // normal priority -- additions
-       if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2])) ))
-               return str[n]=='+'? mglApplyOperAdd(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperSub(str.substr(0,n),str.substr(n+1),arg, head);
+       if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2])) ))
+               return str[n]=='+'? mglApplyOperAdd(str.substr(0,n),str.substr(n+1),arg, head,fns) : 
+                               mglApplyOperSub(str.substr(0,n),str.substr(n+1),arg, head,fns);
        n=mglFindInText(str,"*/%");     // high priority -- multiplications
        if(n>=0)
-               return str[n]=='*'? mglApplyOperMul(str.substr(0,n),str.substr(n+1),arg, head) : 
-                       (str[n]=='/'? mglApplyOperDiv(str.substr(0,n),str.substr(n+1),arg, head) :
-                               mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, fmod));
+               return str[n]=='*'? mglApplyOperMul(str.substr(0,n),str.substr(n+1),arg, head,fns) : 
+                       (str[n]=='/'? mglApplyOperDiv(str.substr(0,n),str.substr(n+1),arg, head,fns) :
+                               mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmod,fns));
        n=mglFindInText(str,"@");       // high priority -- combine
        if(n>=0)
        {
@@ -441,7 +577,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                return res?res:new mglData;
        }
        n=mglFindInText(str,"^");       // highest priority -- power
-       if(n>=0)        return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, ipw);
+       if(n>=0)        return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, ipw,fns);
        n=mglFindInText(str,":");       // highest priority -- array
        if(n>=0 && str.compare(L":"))
        {
@@ -454,7 +590,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
        }
        n=mglFindInText(str,".");                               // highest priority -- suffixes
        wchar_t c0 = str[n+1];
-       if(n>=0  && c0>='a' && c0!='e')
+       if(n>=0  && c0>='a' && c0!='e' && c0!='E' && !isdigit(c0))
        {
                mreal x,y,z,k,v=NAN;
                HMDT d = mglFormulaCalc(str.substr(0,n), arg, head);
@@ -478,11 +614,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                        else if(!p.compare(L"nmin"))    {       v=d->Minimal(); v = v<0?v:0;    }
                }
                else if(c0=='k')
-               {
-                       d->Momentum(ch,x,y,z,k);
-                       if(ch=='a')     v = k;
-                       else if(ch>='x' && ch<='z')     v = k/ns[ch-'x'];
-               }
+               {       d->Momentum(ch,x,y,z,k);        v=k;    }
                else if(c0=='w')
                {
                        d->Momentum(ch,x,y);
@@ -506,10 +638,8 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                else if(c0=='s')
                {
                        if(ch=='u' && p[2]=='m')        v = d->Momentum('x',x,y);
-                       else if(ch=='a')
+                       else if(ch=='a' || (ch>='x' && ch<='z'))
                        {       d->Momentum(ch,x,y,z,k);        v = z;  }
-                       else if(ch>='x' && ch<='z')
-                       {       d->Momentum(ch,x,y,z,k);        v = z/ns[ch-'x'];       }
                }
                else if(!p.compare(L"fst"))     {       long i=-1,j=-1,l=-1;    v = d->Find(0,i,j,l);   }
                else if(!p.compare(L"lst"))     {       long i=-1,j=-1,l=-1;    v = d->Last(0,i,j,l);   }
@@ -559,7 +689,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                HMDT tmp = 0;
 //             mglVar *v = arg->FindVar(nm.c_str());
                if(!v && !nm.compare(0,7,L"jacobi_"))   nm = nm.substr(7);
-               if(!v && nm.empty())    
+               if(!v && nm.empty())
                {
                        long m=mglFindInText(str,")");
                        if(m>1)
@@ -606,15 +736,15 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                }
                else if(nm[0]=='a')     // function
                {
-                       if(!nm.compare(L"asin"))                return mglApplyFunc(str, arg, head, asin);
-                       else if(!nm.compare(L"acos"))   return mglApplyFunc(str, arg, head, acos);
-                       else if(!nm.compare(L"atan"))   return mglApplyFunc(str, arg, head, atan);
-                       else if(!nm.compare(L"asinh"))  return mglApplyFunc(str, arg, head, mgl_asinh);
-                       else if(!nm.compare(L"acosh"))  return mglApplyFunc(str, arg, head, mgl_acosh);
-                       else if(!nm.compare(L"atanh"))  return mglApplyFunc(str, arg, head, mgl_atanh);
+                       if(!nm.compare(L"asin"))                return mglApplyFunc(str, arg, head, asin,fns);
+                       else if(!nm.compare(L"acos"))   return mglApplyFunc(str, arg, head, acos,fns);
+                       else if(!nm.compare(L"atan"))   return mglApplyFunc(str, arg, head, atan,fns);
+                       else if(!nm.compare(L"asinh"))  return mglApplyFunc(str, arg, head, mgl_asinh,fns);
+                       else if(!nm.compare(L"acosh"))  return mglApplyFunc(str, arg, head, mgl_acosh,fns);
+                       else if(!nm.compare(L"atanh"))  return mglApplyFunc(str, arg, head, mgl_atanh,fns);
                        else if(!nm.compare(L"arg"))
                        {
-                               if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, atan2);
+                               if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, atan2,fns);
                                else
                                {
                                        HADT a1 = mglFormulaCalcC(str, arg, head);
@@ -624,7 +754,7 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                        }
                        else if(!nm.compare(L"abs"))
                        {
-                               if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot);
+                               if(n>0) return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot,fns);
                                else
                                {
                                        HADT a1 = mglFormulaCalcC(str, arg, head);
@@ -634,34 +764,34 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                        }
 #if MGL_HAVE_GSL
                        else if(!nm.compare(L"ai") || !nm.compare(L"airy_ai"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai,fns);
                        else if(!nm.compare(L"airy_dai"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai_deriv);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Ai_deriv,fns);
                        else if(!nm.compare(L"airy_bi"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi,fns);
                        else if(!nm.compare(L"airy_dbi"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi_deriv);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi_deriv,fns);
                }
                else if(nm[0]=='b')
                {
                        if(!nm.compare(L"beta") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_beta);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_beta,fns);
                        else if(!nm.compare(L"bi"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_airy_Bi,fns);
                        else if(!nm.compare(L"bessel_i") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu,fns);
                        else if(!nm.compare(L"bessel_j") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu,fns);
                        else if(!nm.compare(L"bessel_k") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu,fns);
                        else if(!nm.compare(L"bessel_y") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu,fns);
 #endif
                }
                else if(nm[0]=='c')
                {
-                       if(!nm.compare(L"cos")) return mglApplyFunc(str, arg, head, cos);
-                       else if(!nm.compare(L"cosh") || !nm.compare(L"ch"))     return mglApplyFunc(str, arg, head, cosh);
+                       if(!nm.compare(L"cos")) return mglApplyFunc(str, arg, head, cos,fns);
+                       else if(!nm.compare(L"cosh") || !nm.compare(L"ch"))     return mglApplyFunc(str, arg, head, cosh,fns);
                        else if(!nm.compare(L"conj"))
                        {
                                HADT a1 = mglFormulaCalcC(str, arg, head);
@@ -669,73 +799,136 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                                mgl_delete_datac(a1);   return res;
                        }
 #if MGL_HAVE_GSL
-                       else if(!nm.compare(L"ci"))     return mglApplyFunc(str, arg, head, gsl_sf_Ci);
+                       else if(!nm.compare(L"ci"))     return mglApplyFunc(str, arg, head, gsl_sf_Ci,fns);
+                       else if(!nm.compare(L"cn") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cn,fns);
+                       else if(!nm.compare(L"cs") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cs,fns);
+                       else if(!nm.compare(L"cd") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_cd,fns);
 #endif
                }
                else if(nm[0]=='e')
                {
-                       if(!nm.compare(L"exp")) return mglApplyFunc(str, arg, head, exp);
+                       if(!nm.compare(L"exp")) return mglApplyFunc(str, arg, head, exp,fns);
 #if MGL_HAVE_GSL
-                       else if(!nm.compare(L"erf"))    return mglApplyFunc(str, arg, head, gsl_sf_erf);
+                       else if(!nm.compare(L"erf"))    return mglApplyFunc(str, arg, head, gsl_sf_erf,fns);
                        else if(!nm.compare(L"ee") || !nm.compare(L"elliptic_ec"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Ecomp);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Ecomp,fns);
                        else if(!nm.compare(L"ek") || !nm.compare(L"elliptic_kc"))
-                               return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Kcomp);
+                               return mglApplyFuncGSL(str, arg, head, gsl_sf_ellint_Kcomp,fns);
                        else if((!nm.compare(L"e") || !nm.compare(L"elliptic_e")) && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllE);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllE,fns);
                        else if(!nm.compare(L"elliptic_f"))
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF,fns);
 
-                       else if(!nm.compare(L"ei"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_Ei);
-                       else if(!nm.compare(L"e1"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_E1);
-                       else if(!nm.compare(L"e2"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_E2);
-                       else if(!nm.compare(L"eta"))    return mglApplyFunc(str, arg, head, gsl_sf_eta);
-                       else if(!nm.compare(L"ei3"))    return mglApplyFunc(str, arg, head, gsl_sf_expint_3);
+                       else if(!nm.compare(L"ei"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_Ei,fns);
+                       else if(!nm.compare(L"e1"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_E1,fns);
+                       else if(!nm.compare(L"e2"))     return mglApplyFunc(str, arg, head, gsl_sf_expint_E2,fns);
+                       else if(!nm.compare(L"eta"))    return mglApplyFunc(str, arg, head, gsl_sf_eta,fns);
+                       else if(!nm.compare(L"ei3"))    return mglApplyFunc(str, arg, head, gsl_sf_expint_3,fns);
 #endif
                }
                else if(nm[0]=='l')
                {
                        if(!nm.compare(L"log") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, llg);
-                       else if(!nm.compare(L"lg"))     return mglApplyFunc(str, arg, head, log10);
-                       else if(!nm.compare(L"ln"))     return mglApplyFunc(str, arg, head, log);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, llg,fns);
+                       else if(!nm.compare(L"lg"))     return mglApplyFunc(str, arg, head, log10,fns);
+                       else if(!nm.compare(L"ln"))     return mglApplyFunc(str, arg, head, log,fns);
 #if MGL_HAVE_GSL
-                       else if(!nm.compare(L"li2"))    return mglApplyFunc(str, arg, head, gsl_sf_dilog);
+                       else if(!nm.compare(L"li2"))    return mglApplyFunc(str, arg, head, gsl_sf_dilog,fns);
                        else if(!nm.compare(L"legendre") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslLegP);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslLegP,fns);
 #endif
                }
                else if(nm[0]=='s')
                {
-                       if(!nm.compare(L"sqrt"))        return mglApplyFunc(str, arg, head, sqrt);
-                       else if(!nm.compare(L"sin"))    return mglApplyFunc(str, arg, head, sin);
-                       else if(!nm.compare(L"step"))   return mglApplyFunc(str, arg, head, stp);
-                       else if(!nm.compare(L"sign"))   return mglApplyFunc(str, arg, head, sgn);
-                       else if(!nm.compare(L"sinh") || !nm.compare(L"sh"))     return mglApplyFunc(str, arg, head, sinh);
+                       if(!nm.compare(L"sqrt"))        return mglApplyFunc(str, arg, head, sqrt,fns);
+                       else if(!nm.compare(L"sin"))    return mglApplyFunc(str, arg, head, sin,fns);
+                       else if(!nm.compare(L"step"))   return mglApplyFunc(str, arg, head, stp,fns);
+                       else if(!nm.compare(L"sign"))   return mglApplyFunc(str, arg, head, sgn,fns);
+                       else if(!nm.compare(L"sinh") || !nm.compare(L"sh"))     return mglApplyFunc(str, arg, head, sinh,fns);
 #if MGL_HAVE_GSL
-                       else if(!nm.compare(L"si"))             return mglApplyFunc(str, arg, head, gsl_sf_Si);
-                       else if(!nm.compare(L"sinc"))   return mglApplyFunc(str, arg, head, gsl_sf_sinc);
+                       else if(!nm.compare(L"si"))             return mglApplyFunc(str, arg, head, gsl_sf_Si,fns);
+                       else if(!nm.compare(L"sinc"))   return mglApplyFunc(str, arg, head, gsl_sf_sinc,fns);
+                       else if(!nm.compare(L"sn") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sn,fns);
+                       else if(!nm.compare(L"sc") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sc,fns);
+                       else if(!nm.compare(L"sd") && n>0)
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_sd,fns);
 #endif
+                       else if(!nm.compare(L"sum") && n>0)
+                       {
+                               HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                               long m = long(b->a[0]+0.5);
+                               const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                               if(m>0)
+                               {
+                                       std::vector<mglDataA*> hh(head);
+                                       int in=0;
+                                       if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                                       char name[3] = {'_',char('i'+in),0};
+                                       b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                                       a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                                       long nn = a->GetNN();
+                                       for(long i=1;i<m;i++)
+                                       {
+                                               b->a[0] = i;
+                                               HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                                               for(long j=0;j<nn;j++)  a->a[j] += c->a[j];
+                                               mgl_delete_data(c);
+                                       }
+                                       mgl_delete_data(b);
+                               }
+                               else
+                               {       a = new mglData;        a->a[0]=NAN;    }
+                               return a;
+                       }
+                       else if(!nm.compare(L"spline"))
+                       {
+                               HMDT a = mglFormulaCalcA(str.substr(0,n), arg, head, fns);
+                               long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2);
+                               HMDT ix, iy=NULL, iz=NULL;
+                               if(n1>0)
+                               {
+                                       ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns);
+                                       if(n2>0)
+                                       {
+                                               iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns);
+                                               iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns);
+                                       }
+                                       else    iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns);
+
+                               }
+                               else    ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                               HMDT res = mgl_data_evaluate(a, ix,iy,iz, false);
+                               if(a)   mgl_delete_data(a);
+                               if(ix)  mgl_delete_data(ix);
+                               if(iy)  mgl_delete_data(iy);
+                               if(iz)  mgl_delete_data(iz);
+                               return res;
+                       }
                }
                else if(nm[0]=='t')
                {
                        if(!nm.compare(L"tg") || !nm.compare(L"tan"))
-                               return mglApplyFunc(str, arg, head, tan);
+                               return mglApplyFunc(str, arg, head, tan,fns);
                        else if(!nm.compare(L"tanh") || !nm.compare(L"th"))
-                               return mglApplyFunc(str, arg, head, tanh);
+                               return mglApplyFunc(str, arg, head, tanh,fns);
                }
                else if(!nm.compare(L"pow") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, pow);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, pow,fns);
                else if(nm[0]=='m')
                {
                        if(!nm.compare(L"mod") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, fmod);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmod,fns);
                        else if(!nm.compare(L"min") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmin);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmin,fns);
                        else if(!nm.compare(L"max") && n>0)
-                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmax);
+                               return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_fmax,fns);
                }
-               else if(!nm.compare(L"int"))    return mglApplyFunc(str, arg, head, floor);
+               else if(!nm.compare(L"int"))    return mglApplyFunc(str, arg, head, floor,fns);
                else if(!nm.compare(L"random"))
                {       HMDT res=mglFormulaCalc(str, arg, head);        mreal *a = res->a;
                        for(long i=0;i<res->GetNN();i++)        a[i] = mgl_rnd();
@@ -759,27 +952,148 @@ HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring str, mglParser *arg, const std::v
                        mgl_delete_datac(a1);   return res;
                }
 #if MGL_HAVE_GSL
+               else if(!nm.compare(L"dn") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_dn,fns);
+               else if(!nm.compare(L"ds") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_ds,fns);
+               else if(!nm.compare(L"dc") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_dc,fns);
+               else if(!nm.compare(L"nc") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_nc,fns);
+               else if(!nm.compare(L"ns") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_ns,fns);
+               else if(!nm.compare(L"nd") && n>0)
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, mgl_jac_nd,fns);
                else if(!nm.compare(L"i") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Inu,fns);
                else if(!nm.compare(L"j") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Jnu,fns);
                else if(!nm.compare(L"k") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Knu,fns);
                else if(!nm.compare(L"y") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_bessel_Ynu,fns);
                else if(!nm.compare(L"f") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gslEllF,fns);
                else if(!nm.compare(L"hypot") && n>0)
-                       return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot);
-               else if(!nm.compare(L"gamma"))  return mglApplyFunc(str, arg, head, gsl_sf_gamma);
+                       return mglApplyOper(str.substr(n+1),str.substr(0,n),arg, head, hypot,fns);
+               else if(!nm.compare(L"gamma"))  return mglApplyFunc(str, arg, head, gsl_sf_gamma,fns);
                else if(!nm.compare(L"gamma_inc") && n>0)
-                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_gamma_inc);
-               else if(!nm.compare(L"w0"))     return mglApplyFunc(str, arg, head, gsl_sf_lambert_W0);
-               else if(!nm.compare(L"w1"))     return mglApplyFunc(str, arg, head, gsl_sf_lambert_Wm1);
-               else if(!nm.compare(L"psi"))    return mglApplyFunc(str, arg, head, gsl_sf_psi);
-               else if(!nm.compare(L"zeta"))   return mglApplyFunc(str, arg, head, gsl_sf_zeta);
-               else if(!nm.compare(L"z"))      return mglApplyFunc(str, arg, head, gsl_sf_dawson);
+                       return mglApplyOper(str.substr(0,n),str.substr(n+1),arg, head, gsl_sf_gamma_inc,fns);
+               else if(!nm.compare(L"w0"))     return mglApplyFunc(str, arg, head, gsl_sf_lambert_W0,fns);
+               else if(!nm.compare(L"w1"))     return mglApplyFunc(str, arg, head, gsl_sf_lambert_Wm1,fns);
+               else if(!nm.compare(L"psi"))    return mglApplyFunc(str, arg, head, gsl_sf_psi,fns);
+               else if(!nm.compare(L"zeta"))   return mglApplyFunc(str, arg, head, gsl_sf_zeta,fns);
+               else if(!nm.compare(L"z"))      return mglApplyFunc(str, arg, head, gsl_sf_dawson,fns);
 #endif
+               else if(!nm.compare(L"value"))
+               {
+                       HMDT a = mglFormulaCalcA(str.substr(0,n), arg, head, fns);
+                       long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2);
+                       HMDT ix, iy=NULL, iz=NULL;
+                       if(n1>0)
+                       {
+                               ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns);
+                               if(n2>0)
+                               {
+                                       iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns);
+                                       iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns);
+                               }
+                               else    iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns);
+
+                       }
+                       else    ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       HMDT res = mgl_data_subdata_ext(a, ix,iy,iz);
+                       if(a)   mgl_delete_data(a);
+                       if(ix)  mgl_delete_data(ix);
+                       if(iy)  mgl_delete_data(iy);
+                       if(iz)  mgl_delete_data(iz);
+                       return res;
+               }
+               else if(!nm.compare(L"dsum") && n>0)
+               {
+                       HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       long m = long(b->a[0]+0.5);
+                       const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                       if(m>0)
+                       {
+                               std::vector<mglDataA*> hh(head);
+                               int in=0, zn=1;
+                               if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                               char name[3] = {'_',char('i'+in),0};
+                               b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                               a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                               long nn = a->GetNN();
+                               for(long i=1;i<m;i++)
+                               {
+                                       b->a[0] = i;    zn *= -1;
+                                       HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                                       for(long j=0;j<nn;j++)  a->a[j] += zn*c->a[j];
+                                       mgl_delete_data(c);
+                               }
+                               mgl_delete_data(b);
+                       }
+                       else
+                       {       a = new mglData;        a->a[0]=NAN;    }
+                       return a;
+               }
+               else if(!nm.compare(L"prod") && n>0)
+               {
+                       HMDT a=NULL, b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       long m = long(b->a[0]+0.5);
+                       const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                       if(m>0)
+                       {
+                               std::vector<mglDataA*> hh(head);
+                               int in=0;
+                               if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                               char name[3] = {'_',char('i'+in),0};
+                               b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                               a = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                               long nn = a->GetNN();
+                               for(long i=1;i<m;i++)
+                               {
+                                       b->a[0] = i;
+                                       HMDT c = mglFormulaCalcA(str.substr(0,n), arg, hh, fns);
+                                       for(long j=0;j<nn;j++)  a->a[j] *= c->a[j];
+                                       mgl_delete_data(c);
+                               }
+                               mgl_delete_data(b);
+                       }
+                       else
+                       {       a = new mglData;        a->a[0]=NAN;    }
+                       return a;
+               }
+               else if(nm[0]=='f' && nm[1]=='n' && fns.size()>1)
+               {
+                       HMDT a=NULL, b=NULL, r=NULL;
+                       std::vector<mglDataA*> hh(head);
+                       std::vector<std::wstring> tmp;  // disable recursion
+                       if(n>0)
+                       {
+                               a = mglFormulaCalcA(str.substr(0,n), arg, head, fns);
+                               if(a)   {       a->s = "_1";    hh.push_back(a);        }
+                               b = mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                               if(b)   {       b->s = "_2";    hh.push_back(b);        }
+                       }
+                       else
+                       {
+                               a = mglFormulaCalcA(str, arg, head, fns);
+                               if(a)   {       a->s = "_1";    hh.push_back(a);        }
+                       }
+                       if(!nm.compare(L"fn1") && fns.size()>1) r = mglFormulaCalcA(fns[1], arg, hh, tmp);
+                       if(!nm.compare(L"fn2") && fns.size()>2) r = mglFormulaCalcA(fns[2], arg, hh, tmp);
+                       if(!nm.compare(L"fn3") && fns.size()>3) r = mglFormulaCalcA(fns[3], arg, hh, tmp);
+                       if(!nm.compare(L"fn4") && fns.size()>4) r = mglFormulaCalcA(fns[4], arg, hh, tmp);
+                       if(!nm.compare(L"fn5") && fns.size()>5) r = mglFormulaCalcA(fns[5], arg, hh, tmp);
+                       if(!nm.compare(L"fn6") && fns.size()>6) r = mglFormulaCalcA(fns[6], arg, hh, tmp);
+                       if(!nm.compare(L"fn7") && fns.size()>7) r = mglFormulaCalcA(fns[7], arg, hh, tmp);
+                       if(!nm.compare(L"fn8") && fns.size()>8) r = mglFormulaCalcA(fns[8], arg, hh, tmp);
+                       if(!nm.compare(L"fn9") && fns.size()>9) r = mglFormulaCalcA(fns[9], arg, hh, tmp);
+                       if(a)   mgl_delete_data(a);
+                       if(b)   mgl_delete_data(b);
+                       if(!r)  {       r = new mglData;        r->a[0]=NAN;    }
+                       return r;
+               }
        }
        HMDT res = new mglData; res->a[0]=NAN;  return res;
 }
@@ -822,7 +1136,13 @@ dual MGL_LOCAL_CONST normc(dual x);       //{     return norm(x); }
 // All numbers are presented as mglData(1). Do boundary checking.
 // NOTE: In any case where number is required the mglData::a[0] is used.
 // String flag is binary 0x1 -> 'x', 0x2 -> 'y', 0x4 -> 'z'
-HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head)
+HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &str, mglParser *arg, const std::vector<mglDataA*> &head)
+{
+       if(str.empty()) return NULL;
+       std::vector<std::wstring> fns = mgl_wcs_args(str,'\\');
+       return mglFormulaCalcAC(fns[0],arg,head,fns);
+}
+HADT MGL_NO_EXPORT mglFormulaCalcAC(std::wstring str, mglParser *arg, const std::vector<mglDataA*> &head, const std::vector<std::wstring> &fns)
 {
 #if MGL_HAVE_GSL
        gsl_set_error_handler_off();
@@ -881,13 +1201,13 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::
 
        n=mglFindInText(str,"<>=");     // low priority -- conditions
        if(n>=0)
-               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?cltc:(str[n]=='>'?cgtc:ceqc));
+               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, str[n]=='<'?cltc:(str[n]=='>'?cgtc:ceqc),fns);
        n=mglFindInText(str,"+-");      // normal priority -- additions
-       if(n>=0 && (n<2 || str[n-1]!='e' || (str[n-2]!='.' && !isdigit(str[n-2]))))
-               return str[n]=='+'? mglApplyOperAddC(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperSubC(str.substr(0,n),str.substr(n+1),arg, head);
+       if(n>=0 && (n<2 || !strchr("eE",str[n-1]) || (str[n-2]!='.' && !isdigit(str[n-2]))))
+               return str[n]=='+'? mglApplyOperAddC(str.substr(0,n),str.substr(n+1),arg, head,fns) : mglApplyOperSubC(str.substr(0,n),str.substr(n+1),arg, head,fns);
        n=mglFindInText(str,"*/");      // high priority -- multiplications
        if(n>=0)
-               return str[n]=='*'? mglApplyOperMulC(str.substr(0,n),str.substr(n+1),arg, head) : mglApplyOperDivC(str.substr(0,n),str.substr(n+1),arg, head);
+               return str[n]=='*'? mglApplyOperMulC(str.substr(0,n),str.substr(n+1),arg, head,fns) : mglApplyOperDivC(str.substr(0,n),str.substr(n+1),arg, head,fns);
        n=mglFindInText(str,"@");       // high priority -- combine
        if(n>=0)
        {
@@ -899,7 +1219,7 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::
        }
        n=mglFindInText(str,"^");                               // highest priority -- power
        if(n>=0)
-               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, ipwc);
+               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, ipwc,fns);
        n=mglFindInText(str,":");                               // highest priority -- array
        if(n>=0 && str.compare(L":"))
        {
@@ -912,7 +1232,7 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::
        }
        n=mglFindInText(str,".");                               // highest priority -- suffixes
        wchar_t c0 = str[n+1];
-       if(n>=0  && c0>='a' && c0!='e')
+       if(n>=0  && c0>='a' && c0!='e' && c0!='E' && !isdigit(c0))
        {
                dual v=NAN;
                HADT d = mglFormulaCalcC(str.substr(0,n), arg, head);
@@ -1066,51 +1386,214 @@ HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring str, mglParser *arg, const std::
                }
                else if(nm[0]=='a')     // function
                {
-                       if(!nm.compare(L"asin"))        return mglApplyFuncC(str, arg, head, asinc);
-                       else if(!nm.compare(L"acos"))   return mglApplyFuncC(str, arg, head, acosc);
-                       else if(!nm.compare(L"atan"))   return mglApplyFuncC(str, arg, head, atanc);
-                       else if(!nm.compare(L"asinh"))  return mglApplyFuncC(str, arg, head, asinhc);
-                       else if(!nm.compare(L"acosh"))  return mglApplyFuncC(str, arg, head, acoshc);
-                       else if(!nm.compare(L"atanh"))  return mglApplyFuncC(str, arg, head, atanhc);
-                       else if(!nm.compare(L"arg"))    return mglApplyFuncC(str, arg, head, argc);
-                       else if(!nm.compare(L"abs"))    return mglApplyFuncC(str, arg, head, absc);
+                       if(!nm.compare(L"asin"))        return mglApplyFuncC(str, arg, head, asinc,fns);
+                       else if(!nm.compare(L"acos"))   return mglApplyFuncC(str, arg, head, acosc,fns);
+                       else if(!nm.compare(L"atan"))   return mglApplyFuncC(str, arg, head, atanc,fns);
+                       else if(!nm.compare(L"asinh"))  return mglApplyFuncC(str, arg, head, asinhc,fns);
+                       else if(!nm.compare(L"acosh"))  return mglApplyFuncC(str, arg, head, acoshc,fns);
+                       else if(!nm.compare(L"atanh"))  return mglApplyFuncC(str, arg, head, atanhc,fns);
+                       else if(!nm.compare(L"arg"))    return mglApplyFuncC(str, arg, head, argc,fns);
+                       else if(!nm.compare(L"abs"))    return mglApplyFuncC(str, arg, head, absc,fns);
                }
                else if(nm[0]=='c')
                {
-                       if(!nm.compare(L"cos")) return mglApplyFuncC(str, arg, head, cosc);
-                       else if(!nm.compare(L"cosh") || !nm.compare(L"ch"))     return mglApplyFuncC(str, arg, head, coshc);
-                       else if(!nm.compare(L"conj"))   return mglApplyFuncC(str, arg, head, conjc);
+                       if(!nm.compare(L"cos")) return mglApplyFuncC(str, arg, head, cosc,fns);
+                       else if(!nm.compare(L"cosh") || !nm.compare(L"ch"))     return mglApplyFuncC(str, arg, head, coshc,fns);
+                       else if(!nm.compare(L"conj"))   return mglApplyFuncC(str, arg, head, conjc,fns);
                        else if(!nm.compare(L"cmplx") && n>0)
-                               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, cmplxc);
+                               return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, cmplxc,fns);
                }
-               else if(!nm.compare(L"exp"))    return mglApplyFuncC(str, arg, head, expc);
+               else if(!nm.compare(L"exp"))    return mglApplyFuncC(str, arg, head, expc,fns);
                else if(nm[0]=='l')
                {
-                       if(!nm.compare(L"log") || !nm.compare(L"ln"))   return mglApplyFuncC(str, arg, head, logc);
-                       else if(!nm.compare(L"lg"))     return mglApplyFuncC(str, arg, head, lgc);
+                       if(!nm.compare(L"log") || !nm.compare(L"ln"))   return mglApplyFuncC(str, arg, head, logc,fns);
+                       else if(!nm.compare(L"lg"))     return mglApplyFuncC(str, arg, head, lgc,fns);
                }
                else if(nm[0]=='s')
                {
-                       if(!nm.compare(L"sqrt"))        return mglApplyFuncC(str, arg, head, sqrtc);
-                       else if(!nm.compare(L"sin"))    return mglApplyFuncC(str, arg, head, sinc);
-                       else if(!nm.compare(L"sinh") || !nm.compare(L"sh"))     return mglApplyFuncC(str, arg, head, sinhc);
+                       if(!nm.compare(L"sqrt"))        return mglApplyFuncC(str, arg, head, sqrtc,fns);
+                       else if(!nm.compare(L"sin"))    return mglApplyFuncC(str, arg, head, sinc,fns);
+                       else if(!nm.compare(L"sinh") || !nm.compare(L"sh"))     return mglApplyFuncC(str, arg, head, sinhc,fns);
+                       else if(!nm.compare(L"sum") && n>0)
+                       {
+                               HADT a=NULL;
+                               HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                               long m = long(b->a[0]+0.5);
+                               const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                               if(m>0)
+                               {
+                                       std::vector<mglDataA*> hh(head);
+                                       int in=0;
+                                       if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                                       char name[3] = {'_',char('i'+in),0};
+                                       b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                                       a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                                       long nn = a->GetNN();
+                                       for(long i=1;i<m;i++)
+                                       {
+                                               b->a[0] = i;
+                                               HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                                               for(long j=0;j<nn;j++)  a->a[j] += c->a[j];
+                                               mgl_delete_datac(c);
+                                       }
+                                       mgl_delete_data(b);
+                               }
+                               else
+                               {       a = new mglDataC;       a->a[0]=NAN;    }
+                               return a;
+                       }
+                       else if(!nm.compare(L"spline"))
+                       {
+                               HADT a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns);
+                               long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2);
+                               HMDT ix, iy=NULL, iz=NULL;
+                               if(n1>0)
+                               {
+                                       ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns);
+                                       if(n2>0)
+                                       {
+                                               iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns);
+                                               iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns);
+                                       }
+                                       else    iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns);
+
+                               }
+                               else    ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                               HADT res = mgl_datac_evaluate(a, ix,iy,iz, false);
+                               if(a)   mgl_delete_datac(a);
+                               if(ix)  mgl_delete_data(ix);
+                               if(iy)  mgl_delete_data(iy);
+                               if(iz)  mgl_delete_data(iz);
+                               return res;
+                       }
                }
                else if(nm[0]=='t')
                {
-                       if(!nm.compare(L"tg") || !nm.compare(L"tan"))   return mglApplyFuncC(str, arg, head, tanc);
-                       else if(!nm.compare(L"tanh") || !nm.compare(L"th"))     return mglApplyFuncC(str, arg, head, tanhc);
+                       if(!nm.compare(L"tg") || !nm.compare(L"tan"))   return mglApplyFuncC(str, arg, head, tanc,fns);
+                       else if(!nm.compare(L"tanh") || !nm.compare(L"th"))     return mglApplyFuncC(str, arg, head, tanhc,fns);
                }
                else if(!nm.compare(L"pow") && n>0)
-                       return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, powc);
+                       return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, powc,fns);
                else if(!nm.compare(L"random"))
                {       HADT res=mglFormulaCalcC(str, arg, head);       dual *a = res->a;
                        for(long i=0;i<res->GetNN();i++)        a[i] = dual(mgl_rnd(), mgl_rnd());
                        return res;     }
                else if(!nm.compare(L"hypot"))
-                       return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, hypotc);
-               else if(!nm.compare(L"real"))   return mglApplyFuncC(str, arg, head, realc);
-               else if(!nm.compare(L"imag"))   return mglApplyFuncC(str, arg, head, imagc);
-               else if(!nm.compare(L"norm"))   return mglApplyFuncC(str, arg, head, normc);
+                       return mglApplyOperC(str.substr(0,n),str.substr(n+1),arg, head, hypotc,fns);
+               else if(!nm.compare(L"real"))   return mglApplyFuncC(str, arg, head, realc,fns);
+               else if(!nm.compare(L"imag"))   return mglApplyFuncC(str, arg, head, imagc,fns);
+               else if(!nm.compare(L"norm"))   return mglApplyFuncC(str, arg, head, normc,fns);
+               else if(!nm.compare(L"value"))
+               {
+                       HADT a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns);
+                       long n1 = mglFindInText(str,",",1), n2 = mglFindInText(str,",",2);
+                       HMDT ix, iy=NULL, iz=NULL;
+                       if(n1>0)
+                       {
+                               ix = mglFormulaCalcA(str.substr(n+1,n1), arg, head, fns);
+                               if(n2>0)
+                               {
+                                       iy = mglFormulaCalcA(str.substr(n1+1,n2), arg, head, fns);
+                                       iz = mglFormulaCalcA(str.substr(n2+1), arg, head, fns);
+                               }
+                               else    iy = mglFormulaCalcA(str.substr(n1+1), arg, head, fns);
+
+                       }
+                       else    ix = mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       HADT res = mgl_datac_subdata_ext(a, ix,iy,iz);
+                       if(a)   mgl_delete_datac(a);
+                       if(ix)  mgl_delete_data(ix);
+                       if(iy)  mgl_delete_data(iy);
+                       if(iz)  mgl_delete_data(iz);
+                       return res;
+               }
+               else if(!nm.compare(L"dsum") && n>0)
+               {
+                       HADT a=NULL;
+                       HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       long m = long(b->a[0]+0.5);
+                       const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                       if(m>0)
+                       {
+                               std::vector<mglDataA*> hh(head);
+                               int in=0, zn=1;
+                               if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                               char name[3] = {'_',char('i'+in),0};
+                               b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                               a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                               long nn = a->GetNN();
+                               for(long i=1;i<m;i++)
+                               {
+                                       b->a[0] = i;    zn *= -1;
+                                       HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                                       for(long j=0;j<nn;j++)  a->a[j] += mreal(zn)*c->a[j];
+                                       mgl_delete_datac(c);
+                               }
+                               mgl_delete_data(b);
+                       }
+                       else
+                       {       a = new mglDataC;       a->a[0]=NAN;    }
+                       return a;
+               }
+               else if(!nm.compare(L"prod") && n>0)
+               {
+                       HADT a=NULL;
+                       HMDT b=mglFormulaCalcA(str.substr(n+1), arg, head, fns);
+                       long m = long(b->a[0]+0.5);
+                       const char *s = head.size()>0?head[head.size()-1]->s.s:"";
+                       if(m>0)
+                       {
+                               std::vector<mglDataA*> hh(head);
+                               int in=0;
+                               if(s[0]=='_' && s[1]>='i' && s[1]<'z') in = s[1]-'i'+1;
+                               char name[3] = {'_',char('i'+in),0};
+                               b->s = name;    b->Create(1,1,1);       hh.push_back(b);
+                               a = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                               long nn = a->GetNN();
+                               for(long i=1;i<m;i++)
+                               {
+                                       b->a[0] = i;
+                                       HADT c = mglFormulaCalcAC(str.substr(0,n), arg, hh, fns);
+                                       for(long j=0;j<nn;j++)  a->a[j] *= c->a[j];
+                                       mgl_delete_datac(c);
+                               }
+                               mgl_delete_data(b);
+                       }
+                       else
+                       {       a = new mglDataC;       a->a[0]=NAN;    }
+                       return a;
+               }
+               else if(nm[0]=='f' && nm[1]=='n' && fns.size()>1)
+               {
+                       HADT a=NULL, b=NULL, r=NULL;
+                       std::vector<mglDataA*> hh(head);
+                       std::vector<std::wstring> tmp;  // disable recursion
+                       if(n>0)
+                       {
+                               a = mglFormulaCalcAC(str.substr(0,n), arg, head, fns);
+                               if(a)   {       a->s = "_1";    hh.push_back(a);        }
+                               b = mglFormulaCalcAC(str.substr(n+1), arg, head, fns);
+                               if(b)   {       b->s = "_2";    hh.push_back(b);        }
+                       }
+                       else
+                       {
+                               a = mglFormulaCalcAC(str, arg, head, fns);
+                               if(a)   {       a->s = "_1";    hh.push_back(a);        }
+                       }
+                       if(!nm.compare(L"fn1") && fns.size()>1) r = mglFormulaCalcAC(fns[1], arg, hh, tmp);
+                       if(!nm.compare(L"fn2") && fns.size()>3) r = mglFormulaCalcAC(fns[2], arg, hh, tmp);
+                       if(!nm.compare(L"fn3") && fns.size()>3) r = mglFormulaCalcAC(fns[3], arg, hh, tmp);
+                       if(!nm.compare(L"fn4") && fns.size()>4) r = mglFormulaCalcAC(fns[4], arg, hh, tmp);
+                       if(!nm.compare(L"fn5") && fns.size()>5) r = mglFormulaCalcAC(fns[5], arg, hh, tmp);
+                       if(!nm.compare(L"fn6") && fns.size()>6) r = mglFormulaCalcAC(fns[6], arg, hh, tmp);
+                       if(!nm.compare(L"fn7") && fns.size()>7) r = mglFormulaCalcAC(fns[7], arg, hh, tmp);
+                       if(!nm.compare(L"fn8") && fns.size()>8) r = mglFormulaCalcAC(fns[8], arg, hh, tmp);
+                       if(!nm.compare(L"fn9") && fns.size()>9) r = mglFormulaCalcAC(fns[9], arg, hh, tmp);
+                       if(a)   mgl_delete_datac(a);
+                       if(b)   mgl_delete_datac(b);
+                       if(!r)  {       r = new mglDataC;       r->a[0]=NAN;    }
+                       return r;
+               }
        }
        HADT res = new mglDataC;        res->a[0]=NAN;  return res;
 }
index a531fba956ab5b4cd040cec40c2070accfcae0b6..4070733235e457508891a2e164acd6501a2d3ed0 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -707,6 +707,20 @@ int static mgls_join(mglGraph *, long , mglArg *a, const char *k, const char *)
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_keep(mglGraph *, long , mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData *>(a[0].d);
+       mglDataC *c = dynamic_cast<mglDataC *>(a[0].d);
+       if(d && !strcmp(k,"dsn"))               d->Keep(a[1].s.s,a[2].v);
+       else if(c && !strcmp(k,"dsn"))  c->Keep(a[1].s.s,a[2].v);
+       else if(d && !strcmp(k,"dsnn")) d->Keep(a[1].s.s,a[2].v,a[3].v);
+       else if(c && !strcmp(k,"dsnn")) c->Keep(a[1].s.s,a[2].v,a[3].v);
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_limit(mglGraph *, long , mglArg *a, const char *k, const char *)
 {
        int res=0;
@@ -719,6 +733,26 @@ int static mgls_limit(mglGraph *, long , mglArg *a, const char *k, const char *)
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_first(mglGraph *, long , mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData *>(a[0].d);
+       if(d && !strcmp(k,"ddsn"))      *d = mglData(true,mgl_data_first_dir(a[1].d,a[2].s.s,a[3].v));
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int static mgls_last(mglGraph *, long , mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData *>(a[0].d);
+       if(d && !strcmp(k,"ddsn"))      *d = mglData(true,mgl_data_last_dir(a[1].d,a[2].s.s,a[3].v));
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_max(mglGraph *, long , mglArg *a, const char *k, const char *)
 {
        int res=0;
@@ -864,6 +898,10 @@ int static mgls_ode(mglGraph *, long , mglArg *a, const char *k, const char *)
                        *d = mglODE(a[1].s.s, a[2].s.s, *(a[3].d));
                else if(!strcmp(k,"dssdnn"))
                        *d = mglODE(a[1].s.s, a[2].s.s, *(a[3].d), a[4].v, a[5].v);
+               if(!strcmp(k,"dsssd"))
+                       *d = mglODEs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d));
+               else if(!strcmp(k,"dsssdnn"))
+                       *d = mglODEs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d), a[5].v, a[6].v);
        }
        else if(c)
        {
@@ -871,6 +909,10 @@ int static mgls_ode(mglGraph *, long , mglArg *a, const char *k, const char *)
                        *c = mglODEc(a[1].s.s, a[2].s.s, *(a[3].d));
                else if(!strcmp(k,"dssdnn"))
                        *c = mglODEc(a[1].s.s, a[2].s.s, *(a[3].d), a[4].v, a[5].v);
+               if(!strcmp(k,"dsssd"))
+                       *c = mglODEcs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d));
+               else if(!strcmp(k,"dsssdnn"))
+                       *c = mglODEcs(a[1].s.s, a[2].s.s, a[3].s.s[0], *(a[4].d), a[5].v, a[6].v);
        }
        else res = 1;
        return res;
@@ -1211,6 +1253,18 @@ int static mgls_readmat(mglGraph *gr, long , mglArg *a, const char *k, const cha
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_readbin(mglGraph *gr, long , mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       bool rr=true;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData *>(a[0].d);
+       if(d && !strcmp(k,"dsn"))               rr=d->ReadBin(a[1].s.s, mgl_int(a[2].v));
+       else res = 1;
+       if(!rr) gr->SetWarn(mglWarnFile,"ReadBin");
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_rearrange(mglGraph *, long , mglArg *a, const char *k, const char *)
 {
        int res=0;
@@ -1317,6 +1371,12 @@ int static mgls_save(mglGraph *, long , mglArg *a, const char *k, const char *)
 {
        int res=0;
        if(!strcmp(k,"ds"))     a[0].d->Save(a[1].s.s);
+       else if(!strcmp(k,"ns"))
+       {
+               FILE *fp = fopen(a[1].s.s,"w");
+               fprintf(fp,"%g",double(a[0].v));
+               fclose(fp);
+       }
        else if(!strcmp(k,"ss"))
        {
                FILE *fp = fopen(a[1].s.s,"a");
@@ -1344,6 +1404,8 @@ int static mgls_savehdf(mglGraph *, long , mglArg *a, const char *k, const char
        int res=0;
        if(!strcmp(k,"dss"))    a[0].d->SaveHDF(a[1].s.s, a[2].s.s);
        else if(!strcmp(k,"dssn"))      a[0].d->SaveHDF(a[1].s.s, a[2].s.s,mgl_int(a[3].v));
+       else if(!strcmp(k,"nss"))       mgl_real_save_hdf(a[0].v, a[1].s.s, a[2].s.s, 0);
+       else if(!strcmp(k,"nssn"))      mgl_real_save_hdf(a[0].v, a[1].s.s, a[2].s.s, mgl_int(a[3].v));
        else res = 1;
        return res;
 }
@@ -1694,6 +1756,7 @@ mglCommand mgls_dat_cmd[] = {
        {"minmax",_("Get positions of local maximums and minimums"),"minmax Res Dat", mgls_minmax ,4},
        {"fill",_("Fill data linearly in range [v1, v2]"),"fill Var v1 v2 ['dir']|Var 'eq' [Vdat Wdat]", mgls_fill ,3},
        {"fillsample",_("Fill x-,k-samples for transforms"),"fillsample Var 'how'", mgls_fillsample ,3},
+       {"first",_("Find first indexes of values larger val over direction"),"first Res Dat 'dir' val", mgls_first ,4},
        {"fit",_("Fit data to formula"),"fit Res A 'eq' 'var' [Ini]|Res X A 'eq' 'var' [Ini]|Res X Y A 'eq' 'var' [Ini]|Res X Y Z A 'eq' 'var' [Ini]", mgls_fit ,4},
        {"fits",_("Fit data to formula"),"fits Res A S 'eq' 'var' [Ini]|Res X A S 'eq' 'var' [Ini]|Res X Y A S 'eq' 'var' [Ini]|Res X Y Z A S 'eq' 'var' [Ini]", mgls_fits ,4},
        {"fourier",_("In-place Fourier transform"),"fourier ReDat ImDat 'dir'|Cmplx 'dir'", mgls_fourier , 16},
@@ -1707,6 +1770,8 @@ mglCommand mgls_dat_cmd[] = {
        {"integrate",_("Integrate data along direction(s)"),"integrate Dat 'dir'", mgls_integrate ,16},
        {"jacobian",_("Get Jacobian"),"jacobian Res Xdat Ydat [Zdat]", mgls_jacobian ,4},
        {"join",_("Join data arrays"),"join Dat Add1 ...", mgls_join ,3},
+       {"last",_("Find last indexes of values larger val over direction"),"last Res Dat 'dir' val", mgls_last ,4},
+       {"keep",_("Keep phase/amplitude along line"),"keep Dat 'dir' i [j]", mgls_keep ,16},
        {"limit",_("Limit data to be inside [-v,v]"),"limit Dat v", mgls_limit ,16},
        {"max",_("Find maximal value over direction"),"max Res Dat 'dir'", mgls_max ,4},
        {"min",_("Find minimal value over direction"),"min Res Dat 'dir'", mgls_min ,4},
@@ -1717,7 +1782,7 @@ mglCommand mgls_dat_cmd[] = {
        {"new",_("Create new data"),"new Dat nx ['eq']|Dat nx ny ['eq']|Dat nx ny nz ['eq']", mgls_new ,4},
        {"norm",_("Normalize data"),"norm Dat v1 v2 [sym dim]", mgls_norm ,16},
        {"normsl",_("Normalize data slice by slice"),"normsl Dat v1 v2 ['dir' keep sym] ", mgls_normsl ,16},
-       {"ode",_("Solve ODE"),"ode Res 'df' 'var' Ini [dt tmax]", mgls_ode ,4},
+       {"ode",_("Solve ODE"),"ode Res 'df' 'var' Ini [dt tmax]|Res 'df' 'var' 'brd' Ini [dt tmax]", mgls_ode ,4},
        {"openhdf",_("Open all data arrays from HDF file"),"openhdf 'fname'", mgls_openhdf ,3},
        {"pde",_("Solve PDE"),"pde Res 'ham' IniRe IniIm [dz k0]", mgls_pde ,4},
        {"print",_("Immediately print the message"),"print 'message'|Dat|const", mgls_print ,3},
@@ -1730,6 +1795,7 @@ mglCommand mgls_dat_cmd[] = {
        {"ray",_("Solve Hamiltonian ODE (find GO ray or trajectory)"),"ray Res 'ham' x0 y0 z0 px0 py0 pz0 [dt=0.1 tmax=10]", mgls_ray ,4},
        {"read",_("Read data from file"),"read Dat 'file' [nx ny nz]|ReDat ImDat 'file' [nx ny nz]", mgls_read ,4},
        {"readall",_("Read and join data from several files"),"readall Dat 'templ' [slice]|Dat 'templ' from to [step slice]", mgls_readall ,4},
+       {"readbin",_("Read data from binary file of specified type"),"readbin Dat 'file' type", mgls_readbin ,4},
        {"readhdf",_("Read data with name 'id' from HDF file"),"readhdf Dat 'file' 'id'", mgls_readhdf ,4},
        {"readmat",_("Read data from file with sizes specified in first row"),"readmat Dat 'file' [dim]", mgls_readmat ,4},
        {"rearrange",_("Rearrange data dimensions"),"rearrange Dat mx [my mz]", mgls_rearrange ,3},
@@ -1738,8 +1804,8 @@ mglCommand mgls_dat_cmd[] = {
        {"rkstep",_("Perform Runge-Kutta step"),"rkstep 'Diff1;Diff2;...' 'Var1;Var2;...' [dt]", mgls_rkstep, 6},
        {"roll",_("Roll data along direction(s)"),"roll Dat 'dir' num", mgls_roll ,16},
        {"roots",_("Find roots using data as initial values"), "roots Res 'func' Ini ['var']|Res 'func' ini ['var']|Res 'func' 'vars' Ini", mgls_roots ,4},
-       {"save",_("Save data to file"),"save Dat 'file'|'str' 'file' ['how']", mgls_save ,3},
-       {"savehdf",_("Save data to HDF5 file"),"savehdf Dat 'file' 'id' [rewrite]", mgls_savehdf ,3},
+       {"save",_("Save data to file"),"save Dat 'file'|val 'file'|'str' 'file' ['how']", mgls_save ,3},
+       {"savehdf",_("Save data to HDF5 file"),"savehdf Dat 'file' 'id' [rewrite]|val 'file' 'id' [rewrite]", mgls_savehdf ,3},
        {"scanfile",_("Get formated data from file"),"scanfile Dat 'fname 'templ'", mgls_scanfile ,4},
        {"section",_("Extract sub-array between values"),"section Res Dat id ['dir' val]|Res Dat Ids ['dir' val]", mgls_section ,4},
        {"sew",_("Remove jump into the data, like phase jumps"),"sew Dat ['dir' da]", mgls_sew ,16},
index c3edfd535b3813e9a26926f195629aac4df133f6..4f51c015603390ec736f0e85174e05621014e9c7 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -187,6 +187,19 @@ int static mgls_lamerey(mglGraph *gr, long , mglArg *a, const char *k, const cha
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_lines(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
+{
+       int res=0;
+       if(!strcmp(k,"dd"))     gr->Lines(*(a[0].d),*(a[1].d),"",opt);
+       else if(!strcmp(k,"dds"))       gr->Lines(*(a[0].d),*(a[1].d),a[2].s.s,opt);
+       else if(!strcmp(k,"dddd"))      gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt);
+       else if(!strcmp(k,"dddds"))     gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),a[4].s.s,opt);
+       else if(!strcmp(k,"dddddd"))    gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt);
+       else if(!strcmp(k,"dddddds"))   gr->Lines(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt);
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_mark(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
@@ -407,16 +420,21 @@ int static mgls_boxs(mglGraph *gr, long , mglArg *a, const char *k, const char *
 int static mgls_cont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"d"))      gr->Cont(*(a[0].d),"",opt);
        else if(!strcmp(k,"ds"))        gr->Cont(*(a[0].d),a[1].s.s,opt);
        else if(!strcmp(k,"dd"))        gr->Cont(*(a[0].d), *(a[1].d), "",opt);
        else if(!strcmp(k,"dds"))       gr->Cont(*(a[0].d), *(a[1].d), a[2].s.s,opt);
+       else if(!strcmp(k,"nd"))        gr->Cont(v, *(a[1].d), "",opt);
+       else if(!strcmp(k,"nds"))       gr->Cont(v, *(a[1].d), a[2].s.s,opt);
        else if(!strcmp(k,"ddd"))       gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), "",opt);
        else if(!strcmp(k,"ddds"))      gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt);
        else if(!strcmp(k,"dddd"))      gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
        else if(!strcmp(k,"dddds"))     gr->Cont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
+       else if(!strcmp(k,"nddd"))      gr->Cont(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
+       else if(!strcmp(k,"nddds"))     gr->Cont(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
        else if(!strcmp(k,"ndddd"))     gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d),"",opt);
-       else if(!strcmp(k,"ndddds"))    gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt);
+       else if(!strcmp(k,"ndddds"))gr->ContGen(a[0].v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt);
        else res = 1;
        return res;
 }
@@ -424,14 +442,19 @@ int static mgls_cont(mglGraph *gr, long , mglArg *a, const char *k, const char *
 int static mgls_contd(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"d"))      gr->ContD(*(a[0].d),"",opt);
        else if(!strcmp(k,"ds"))        gr->ContD(*(a[0].d),a[1].s.s,opt);
        else if(!strcmp(k,"dd"))        gr->ContD(*(a[0].d), *(a[1].d), "",opt);
        else if(!strcmp(k,"dds"))       gr->ContD(*(a[0].d), *(a[1].d), a[2].s.s,opt);
+       else if(!strcmp(k,"nd"))        gr->ContD(v, *(a[1].d), "",opt);
+       else if(!strcmp(k,"nds"))       gr->ContD(v, *(a[1].d), a[2].s.s,opt);
        else if(!strcmp(k,"ddd"))       gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), "",opt);
        else if(!strcmp(k,"ddds"))      gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt);
        else if(!strcmp(k,"dddd"))      gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
        else if(!strcmp(k,"dddds"))     gr->ContD(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
+       else if(!strcmp(k,"nddd"))      gr->ContD(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
+       else if(!strcmp(k,"nddds"))     gr->ContD(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
        else res = 1;
        return res;
 }
@@ -456,10 +479,13 @@ int static mgls_contf(mglGraph *gr, long , mglArg *a, const char *k, const char
 int static mgls_contp(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"dddd"))   gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
        else if(!strcmp(k,"dddds"))     gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
        else if(!strcmp(k,"ddddd"))     gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "",opt);
        else if(!strcmp(k,"ddddds"))    gr->ContP(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt);
+       else if(!strcmp(k,"ndddd"))             gr->ContP(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "",opt);
+       else if(!strcmp(k,"ndddds"))    gr->ContP(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,opt);
        else res = 1;
        return res;
 }
@@ -467,14 +493,19 @@ int static mgls_contp(mglGraph *gr, long , mglArg *a, const char *k, const char
 int static mgls_contv(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"d"))      gr->ContV(*(a[0].d),"",opt);
        else if(!strcmp(k,"ds"))        gr->ContV(*(a[0].d),a[1].s.s,opt);
        else if(!strcmp(k,"dd"))        gr->ContV(*(a[0].d), *(a[1].d), "",opt);
        else if(!strcmp(k,"dds"))       gr->ContV(*(a[0].d), *(a[1].d), a[2].s.s,opt);
+       else if(!strcmp(k,"nd"))        gr->ContV(v, *(a[1].d), "",opt);
+       else if(!strcmp(k,"nds"))       gr->ContV(v, *(a[1].d), a[2].s.s,opt);
        else if(!strcmp(k,"ddd"))       gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), "",opt);
        else if(!strcmp(k,"ddds"))      gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s,opt);
        else if(!strcmp(k,"dddd"))      gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
        else if(!strcmp(k,"dddds"))     gr->ContV(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
+       else if(!strcmp(k,"nddd"))      gr->ContV(v, *(a[1].d), *(a[2].d), *(a[3].d), "",opt);
+       else if(!strcmp(k,"nddds"))     gr->ContV(v, *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,opt);
        else res = 1;
        return res;
 }
@@ -661,6 +692,7 @@ int static mgls_quadplot(mglGraph *gr, long , mglArg *a, const char *k, const ch
 int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"dddd"))
                gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt);
        else if(!strcmp(k,"dddds"))
@@ -673,6 +705,14 @@ int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const cha
                gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt);
        else if(!strcmp(k,"dddddds"))
                gr->TriCont(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt);
+       else if(!strcmp(k,"ndddd"))
+               gr->TriContV(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),"",opt);
+       else if(!strcmp(k,"ndddds"))
+               gr->TriContV(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),a[5].s.s,opt);
+       else if(!strcmp(k,"nddddd"))
+               gr->TriCont(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt);
+       else if(!strcmp(k,"nddddds"))
+               gr->TriCont(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt);
        else res = 1;
        return res;
 }
@@ -680,6 +720,7 @@ int static mgls_tricont(mglGraph *gr, long , mglArg *a, const char *k, const cha
 int static mgls_tricontv(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"dddd"))
                gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),"",opt);
        else if(!strcmp(k,"dddds"))
@@ -692,6 +733,10 @@ int static mgls_tricontv(mglGraph *gr, long , mglArg *a, const char *k, const ch
                gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt);
        else if(!strcmp(k,"dddddds"))
                gr->TriContVt(*(a[0].d),*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt);
+       else if(!strcmp(k,"nddddd"))
+               gr->TriContVt(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),"",opt);
+       else if(!strcmp(k,"nddddds"))
+               gr->TriContVt(v,*(a[1].d),*(a[2].d),*(a[3].d),*(a[4].d),*(a[5].d),a[6].s.s,opt);
        else res = 1;
        return res;
 }
@@ -733,18 +778,25 @@ int static mgls_cloud(mglGraph *gr, long , mglArg *a, const char *k, const char
 int static mgls_cont3(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
+       mglData v;      v.a[0]=a[0].v;
        if(!strcmp(k,"d"))      gr->Cont3(*(a[0].d), "", -1,opt);
        else if(!strcmp(k,"ds"))        gr->Cont3(*(a[0].d), a[1].s.s, -1,opt);
        else if(!strcmp(k,"dsn"))       gr->Cont3(*(a[0].d), a[1].s.s, mgl_int(a[2].v),opt);
        else if(!strcmp(k,"dd"))        gr->Cont3(*(a[0].d), *(a[1].d), "", -1,opt);
        else if(!strcmp(k,"dds"))       gr->Cont3(*(a[0].d), *(a[1].d), a[2].s.s,-1,opt);
        else if(!strcmp(k,"ddsn"))      gr->Cont3(*(a[0].d), *(a[1].d), a[2].s.s,mgl_int(a[3].v),opt);
+       else if(!strcmp(k,"nd"))        gr->Cont3(v, *(a[1].d), "", -1,opt);
+       else if(!strcmp(k,"nds"))       gr->Cont3(v, *(a[1].d), a[2].s.s,-1,opt);
+       else if(!strcmp(k,"ndsn"))      gr->Cont3(v, *(a[1].d), a[2].s.s,mgl_int(a[3].v),opt);
        else if(!strcmp(k,"dddd"))      gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), "", -1,opt);
        else if(!strcmp(k,"dddds"))     gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,-1,opt);
-       else if(!strcmp(k,"ddddsn"))    gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,mgl_int(a[5].v),opt);
-       else if(!strcmp(k,"ddddd"))     gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt);
+       else if(!strcmp(k,"ddddsn"))gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), a[4].s.s,mgl_int(a[5].v),opt);
+       else if(!strcmp(k,"ddddd"))             gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt);
        else if(!strcmp(k,"ddddds"))    gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,-1,opt);
-       else if(!strcmp(k,"dddddsn"))gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt);
+       else if(!strcmp(k,"dddddsn"))   gr->Cont3(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt);
+       else if(!strcmp(k,"ndddd"))             gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", -1,opt);
+       else if(!strcmp(k,"ndddds"))    gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,-1,opt);
+       else if(!strcmp(k,"nddddsn"))   gr->Cont3(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s,mgl_int(a[6].v),opt);
        else res = 1;
        return res;
 }
@@ -837,6 +889,26 @@ int static mgls_crust(mglGraph *gr, long , mglArg *a, const char *k, const char
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_dcont(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
+{
+       int res=0;
+       mglData v;      v.a[0]=a[0].v;
+       if(!strcmp(k,"dd"))     gr->DCont(*(a[0].d), *(a[1].d), "", opt);
+       else if(!strcmp(k,"dds"))       gr->DCont(*(a[0].d), *(a[1].d), a[2].s.s, opt);
+       else if(!strcmp(k,"ddd"))       gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), "", opt);
+       else if(!strcmp(k,"ddds"))      gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), a[3].s.s, opt);
+       else if(!strcmp(k,"ndd"))       gr->DCont(v, *(a[1].d), *(a[2].d), "", opt);
+       else if(!strcmp(k,"ndds"))      gr->DCont(v, *(a[1].d), *(a[2].d), a[3].s.s, opt);
+       else if(!strcmp(k,"ddddd"))     gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), "", opt);
+       else if(!strcmp(k,"ddddds"))    gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), a[5].s.s, opt);
+       else if(!strcmp(k,"dddddd"))    gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), "", opt);
+       else if(!strcmp(k,"dddddds"))   gr->DCont(*(a[0].d), *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.s, opt);
+       else if(!strcmp(k,"nddddd"))    gr->DCont(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), "", opt);
+       else if(!strcmp(k,"nddddds"))   gr->DCont(v, *(a[1].d), *(a[2].d), *(a[3].d), *(a[4].d), *(a[5].d), a[6].s.s, opt);
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_dens3(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;
@@ -1159,6 +1231,7 @@ mglCommand mgls_grf_cmd[] = {
        {"conty",_("Draw contour lines at y-slice (or y-plane)"),"conty Dat ['fmt' pos num]", mgls_conty ,0},
        {"contz",_("Draw contour lines at z-slice (or z-plane)"),"contz Dat ['fmt' pos num]", mgls_contz ,0},
        {"crust",_("Draw reconstructed surface for arbitrary data points"),"crust Xdat Ydat Zdat ['fmt']", mgls_crust ,0},
+       {"dcont",_("Draw curves of cross-section of isosurfaces a,b for 3D data"),"dcont Adat Bdat ['fmt']|Vdat Adat Bdat ['fmt']|Xdat Ydat Zdat Adat Bdat ['fmt']|Vdat Xdat Ydat Zdar Adat Bdat ['fmt']", mgls_dcont ,9},
        {"dens",_("Draw density plot"),"dens Zdat ['fmt' zpos]|Xdat Ydat Zdat ['fmt' zpos]", mgls_dens ,8},
        {"dens3",_("Draw density plot at slices of 3D data"),"dens3 Adat 'dir' [pos 'fmt']|Xdat Ydat Zdat Adat 'dir' [pos 'fmt']", mgls_dens3 ,9},
        {"densx",_("Draw density plot at x-slice (or x-plane)"),"densx Dat ['fmt' pos]", mgls_densx ,0},
@@ -1177,6 +1250,7 @@ mglCommand mgls_grf_cmd[] = {
        {"iris",_("Draw Iris plots"),"iris Dats 'ids' ['fmt']|Dats Ranges 'ids' ['fmt']", mgls_iris,13},
        {"label",_("Draw label at arbitrary position"),"label Ydat 'txt' ['fmt'='']|Xdat Ydat 'txt' ['fmt'='']|Xdat Ydat Zdat 'txt' ['fmt'='']", mgls_label ,7},
        {"lamerey",_("Draw Lamerey diagram"),"lamerey x0 Func ['fmt']|x0 'func' ['fmt']", mgls_lamerey ,13},
+       {"lines",_("Draw lines with arrows for 1D data"),"lines Y1dat Y2dat ['fmt']|X1dat Y1dat X2dat Y2dat ['fmt']|X1dat Y1dat Z1dat X2dat Y2dat Z2dat ['fmt']", mgls_lines ,7},
        {"map",_("Draw mapping plot"),"map Udat Vdat ['fmt']|Xdat Ydat Udat Vdat ['fmt']", mgls_map ,10},
        {"mark",_("Draw mark plot for 1D data"),"mark Ydat Rdat ['fmt']|Xdat Ydat Rdat ['fmt']|Xdat Ydat Zdat Rdat ['fmt']", mgls_mark ,7},
        {"mesh",_("Draw mesh surface"),"mesh Zdat ['fmt']|Xdat Ydat Zdat ['fmt']", mgls_mesh ,8},
index 9e88964bfd3914ab9d112e686c0cd10a8e1a5137..94bc8cc9f43d9d5c2c0d1693224d65843318b50e 100644 (file)
@@ -1,9 +1,9 @@
 /***************************************************************************
- * exec_2d.cpp is part of Math Graphic Library
+ * exec_prm.cpp is part of Math Graphic Library
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -67,6 +67,9 @@ int static mgls_background(mglGraph *gr, long , mglArg *a, const char *k, const
        int res=0;
        if(!strcmp(k,"s"))      gr->LoadBackground(a[0].s.s);
        else if(!strcmp(k,"sn"))        gr->LoadBackground(a[0].s.s,a[1].v);
+       else if(!strcmp(k,"ss"))        gr->LoadBackground(a[0].s.s,a[1].s.s);
+       else if(!strcmp(k,"ssn"))       gr->LoadBackground(a[0].s.s,a[1].s.s,a[2].v);
+       else if(!strcmp(k,"nnn"))       gr->FillBackground(mglColor(a[0].v,a[1].v,a[2].v));
        else res = 1;
        return res;
 }
@@ -106,19 +109,20 @@ int static mgls_circle(mglGraph *gr, long , mglArg *a, const char *k, const char
 int static mgls_colorbar(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
 {
        int res=0;      gr->Self()->SaveState(opt);
-       if(k[0]==0)     gr->Colorbar();
+       if(k[0]==0)     gr->Colorbar("");
        else if(!strcmp(k,"s"))         gr->Colorbar(a[0].s.s);
        else if(!strcmp(k,"d"))         gr->Colorbar(*(a[0].d));
        else if(!strcmp(k,"ds"))        gr->Colorbar(*(a[0].d), a[1].s.s);
-       else if(!strcmp(k,"snn"))       gr->Colorbar(a[0].s.s, a[1].v, a[2].v);
+       else if(!strcmp(k,"snn"))       gr->Colorbar(a[0].s.s, a[1].v, a[2].v,1,1);
        else if(!strcmp(k,"snnn"))      gr->Colorbar(a[0].s.s, a[1].v, a[2].v, a[3].v,1);
        else if(!strcmp(k,"snnnn"))     gr->Colorbar(a[0].s.s, a[1].v, a[2].v, a[3].v,a[4].v);
-       else if(!strcmp(k,"dsnn"))      gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v);
+       else if(!strcmp(k,"dsnn"))      gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v,1,1);
        else if(!strcmp(k,"dsnnn"))     gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v, a[4].v,1);
        else if(!strcmp(k,"dsnnnn"))
                gr->Colorbar(*(a[0].d), a[1].s.s, a[2].v, a[3].v, a[4].v,a[5].v);
        else res = 1;
-       gr->Self()->LoadState();        return res;
+       gr->Self()->LoadState();
+       return res;
 }
 //-----------------------------------------------------------------------------
 int static mgls_cone(mglGraph *gr, long , mglArg *a, const char *k, const char *opt)
@@ -623,7 +627,7 @@ int static mgls_zlabel(mglGraph *gr, long , mglArg *a, const char *k, const char
 mglCommand mgls_prm_cmd[] = {
        {"arc",_("Draw angle arc"),"arc x0 y0 x1 y1 a ['fmt']|x0 y0 z0 x1 y1 a ['fmt']|x0 y0 z0 xr yr zr x1 y1 z1 a ['fmt']", mgls_arc ,13},
        {"axis",_("Setup or draw axis"),"axis ['dir' 'fmt']|'fx' 'fy' 'fz' ['fc']|how", mgls_axis ,12},
-       {"background",_("Load image for background"),"background 'fname' [alpha]", mgls_background ,12},
+       {"background",_("Load image for background"),"background 'fname' [alpha]| 'fname' 'how' [alpha]", mgls_background ,12},
        {"ball",_("Draw point (ball)"),"ball posx posy ['fmt']|posx posy posz ['fmt']", mgls_ball ,13},
        {"box",_("Draw bounding box"),"box ['fmt' ticks]", mgls_box ,12},
        {"circle",_("Draw circle"),"circle x y r ['fmt']|x y z r ['fmt']", mgls_circle ,13},
index bd37129633945f3304c2d7d842a4635264c6de45..28ec455baafc0a10a5fd9d5f200c7ce7011abf70 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -506,6 +506,14 @@ int static mgls_setsizescl(mglGraph *gr, long , mglArg *a, const char *k, const
        return res;
 }
 //-----------------------------------------------------------------------------
+int static mgls_texparse(mglGraph *gr, long , mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(!strcmp(k,"n"))      gr->SetTeXparse(a[0].v);
+       else res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
 int static mgls_setup(mglGraph *gr, long , mglArg *a, const char *k, const char *)
 {
        int res=0;
@@ -845,6 +853,7 @@ mglCommand mgls_set_cmd[] = {
        {"stickplot",_("Set position of plot inside cell of rotated stick"), "stickplot num ind tet phi", mgls_stickplot ,5},
        {"subplot",_("Set position of plot as cell of matrix"),"subplot m n pos ['style' dx dy]", mgls_subplot ,5},
        {"ternary",_("Switch on/off to use ternary axis"),"ternary val", mgls_ternary ,14},
+       {"texparse",_("Switch on/off TeX parsing at text output"), "texparse val", mgls_texparse, 2},
        {"ticklen",_("Set tick length"),"ticklen val [stt]", mgls_ticklen ,14},
        {"tickshift",_("Set additional tick and axis labels shift"),"tickshift dx [dy dz dc]", mgls_tickshift ,14},
        {"ticktime",_("Set ticks in time format"),"ticktime 'dir' [dv 'tmpl']", mgls_ticktime ,14},
index f26fb9456da6ff1396e51fde668df942ecc4600b..eb672575b66dba7972a256d9e27abf330e60765c 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -65,7 +65,7 @@ int MGL_NO_EXPORT mgl_pnga_save(const char *fname, int w, int h, unsigned char *
                                                PNG_FILTER_TYPE_DEFAULT);
                        png_set_rows(png_ptr, info_ptr, p);
                        png_write_png(png_ptr, info_ptr,  PNG_TRANSFORM_IDENTITY, 0);
-                       png_write_end(png_ptr, info_ptr);
+//                     png_write_end(png_ptr, info_ptr);
                }
                png_destroy_write_struct(&png_ptr, &info_ptr);
        }
@@ -99,7 +99,7 @@ int MGL_NO_EXPORT mgl_png_save(const char *fname, int w, int h, unsigned char **
                                                PNG_FILTER_TYPE_DEFAULT);
                        png_set_rows(png_ptr, info_ptr, p);
                        png_write_png(png_ptr, info_ptr,  PNG_TRANSFORM_IDENTITY, 0);
-                       png_write_end(png_ptr, info_ptr);
+//                     png_write_end(png_ptr, info_ptr);
                }
                png_destroy_write_struct(&png_ptr, &info_ptr);
        }
index 9d7148625f91bc1a00c31b86d4e2f6e7b5f95ed3..bd074043536631fa675198f047a33243a49c6359 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -131,7 +131,7 @@ void static put_desc(HMGL gr, void *fp, bool gz, const char *pre, const char *ln
        int *s = new int[n];    n=0;
        for(long i=0;i<gr->GetPrmNum();i++)
        {
-               const mglPrim q = gr->GetPrm(i);
+               const mglPrim &q = gr->GetPrm(i);
                if(q.type!=4 || (q.n3&8))       continue;       // not a glyph
                bool is=false;
                for(long j=0;j<n;j++)   if(g[j]==q.n4 && s[j]==(q.n3&7))        is = true;
@@ -210,7 +210,10 @@ void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr)
        int w = _Gr_->GetWidth(), h = _Gr_->GetHeight();
 
        int x1=gr->BBoxX1, x2=gr->BBoxX2<0?w:gr->BBoxX2, y1=gr->BBoxY1, y2=gr->BBoxY2<0?h:gr->BBoxY2;
-       if(x1<0 || x1>=x2 || y1<0 || y1>=y2)    {       x1=y1=0;        x2=w;   y2=h;   }
+       if(x2>w)        x2=w;
+       if(y2>h)        y2=h;
+       if(x1<0 || x1>=x2)      {       x1=0;   x2=w;   }
+       if(y1<0 || y1>=y2)      {       y1=0;   y2=h;   }
 
        if(gz)
        {
@@ -250,7 +253,7 @@ void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr)
        // add mark definition if present
        for(long i=0;i<gr->GetPrmNum();i++)
        {
-               const mglPrim q = gr->GetPrm(i);
+               const mglPrim &q = gr->GetPrm(i);
                if(q.type>0)    continue;
                if(q.n4=='+')   m_p = true;
                if(q.n4=='x')   m_x = true;
@@ -329,7 +332,7 @@ void MGL_EXPORT mgl_write_eps(HMGL gr, const char *fname,const char *descr)
                const mglPrim &q = gr->GetPrm(i);
                if(q.type<0)    continue;       // q.n1>=0 always
                cp.c = _Gr_->GetPrmCol(i);
-               const mglPnt p1 = gr->GetPnt(q.n1);
+               const mglPnt &p1 = gr->GetPnt(q.n1);
                if(q.type>1)
                {
                        snprintf(str,256,"%.2g %.2g %.2g rgb ", cp.r[0]/255.,cp.r[1]/255.,cp.r[2]/255.);        str[255]=0;
@@ -459,7 +462,10 @@ void MGL_EXPORT mgl_write_svg(HMGL gr, const char *fname,const char *descr)
        if(!fp)         {       gr->SetWarn(mglWarnOpen,fname); return; }
 
        int x1=gr->BBoxX1, x2=gr->BBoxX2<0?ww:gr->BBoxX2, y1=gr->BBoxY1, y2=gr->BBoxY2<0?hh:gr->BBoxY2;
-       if(x1<0 || x1>=x2 || y1<0 || y1>=y2)    {       x1=y1=0;        x2=ww;  y2=hh;  }
+       if(x2>ww)       x2=ww;
+       if(y2>hh)       y2=hh;
+       if(x1<0 || x1>=x2)      {       x1=0;   x2=ww;  }
+       if(y1<0 || y1>=y2)      {       y1=0;   y2=hh;  }
        ww = x2-x1;     hh = y2-y1;
 
        const std::string loc = setlocale(LC_NUMERIC, "C");
@@ -517,7 +523,7 @@ void MGL_EXPORT mgl_write_svg(HMGL gr, const char *fname,const char *descr)
                const mglPrim &q = gr->GetPrm(i);
                if(q.type<0)    continue;       // q.n1>=0 always
                cp.c = _Gr_->GetPrmCol(i);
-               const mglPnt p1=gr->GetPnt(q.n1);
+               const mglPnt &p1=gr->GetPnt(q.n1);
                if(q.type==0)
                {
                        mreal x=p1.x-x1,y=hh-p1.y,s=q.s;
@@ -692,7 +698,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr)
                cp.c = _Gr_->GetPrmCol(i);
                snprintf(cname,128,"color={rgb,255:red,%d;green,%d;blue,%d}",cp.r[0],cp.r[1],cp.r[2]);  cname[127]=0;
 
-               const mglPnt p1=gr->GetPnt(q.n1);
+               const mglPnt &p1=gr->GetPnt(q.n1);
                mreal x=p1.x/100,y=p1.y/100,s=q.s/100;
                if(q.type==0)
                {
@@ -729,7 +735,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr)
                }
                else if(q.type==2 && cp.r[3])
                {
-                       const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3);
+                       const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3);
                        if(cp.r[3]<255)
                                fwprintf(fp, L"\\fill[%s, fill opacity=%.4g] (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- cycle;\n", cname,cp.r[3]/255., x,y, p2.x/100,p2.y/100, p3.x/100,p3.y/100);
                        else
@@ -737,7 +743,7 @@ void MGL_EXPORT mgl_write_tex(HMGL gr, const char *fname,const char *descr)
                }
                else if(q.type==3 && cp.r[3])
                {
-                       const mglPnt p2=gr->GetPnt(q.n2), p3=gr->GetPnt(q.n3), p4=gr->GetPnt(q.n4);
+                       const mglPnt &p2=gr->GetPnt(q.n2), &p3=gr->GetPnt(q.n3), &p4=gr->GetPnt(q.n4);
                        if(cp.r[3]<255)
                                fwprintf(fp, L"\\fill[%s, fill opacity=%.4g] (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- (%.4g,%.4g) -- cycle;\n", cname,cp.r[3]/255., x,y, p2.x/100,p2.y/100, p4.x/100,p4.y/100, p3.x/100,p3.y/100);
                        else
index 58360e97f92e33c2a1704662a071b00d498eb112..208c67d34eda4af20a4fa321c39f729565a94edf 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index 4ac30213ac06436739c37aa0186b4b3fa0798192..f63b511e64f07ef089248ad350876b895c24ea50 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
index e112af69b4f17bf8cfecbd01a23e807cef3cd941..25c7d62575419ad1b2f4768d2e599f1589f99133 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -28,7 +28,6 @@
 #include <gsl/gsl_multifit_nlin.h>\r
 #include <gsl/gsl_blas.h>\r
 #endif\r
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 int mglFitPnts=100;            ///< Number of output points in fitting\r
 char mglFitRes[1024];  ///< Last fitted formula\r
index 912f2e3b9f797642f79fbe6cf5a12867f72ba84d..4d265cf691932228109262c149d090368fa5636e 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
 #include "tex_table.cc"\r
 //-----------------------------------------------------------------------------\r
 //mglFont mglDefFont("nofont");\r
-mglFont mglDefFont;\r
 #define MGL_USE_H12    {if(h1<y1) y1=h1;       if(h2>y2) y2=h2;        h1=1e5; h2=-1e5;}\r
 //-----------------------------------------------------------------------------\r
+mglFont *mglDefFont=NULL;\r
+//-----------------------------------------------------------------------------\r
 size_t MGL_EXPORT_PURE mgl_wcslen(const wchar_t *str)\r
 {\r
        long i=0;\r
@@ -228,7 +229,7 @@ float mglFont::Height(int font) const
 {\r
        if(GetNumGlyph()==0)    return 0;\r
        int s = (font/MGL_FONT_BOLD)&3;\r
-       return 660/fact[s];\r
+       return Hscale*660/fact[s];\r
 }\r
 //-----------------------------------------------------------------------------\r
 float mglFont::Height(const char *how) const\r
@@ -240,7 +241,7 @@ float mglFont::Height(const char *how) const
                if(strchr(how,'b'))     s = s|1;\r
                if(strchr(how,'i'))     s = s|2;\r
        }\r
-       return 660/fact[s];\r
+       return Hscale*660/fact[s];\r
 }\r
 //-----------------------------------------------------------------------------\r
 /// Table of acents and its UTF8 codes\r
@@ -731,7 +732,7 @@ bool mglFont::read_main(const char *fname, std::vector<short> &buf)
 //-----------------------------------------------------------------------------\r
 void mglFont::FillY12()\r
 {\r
-#pragma omp parallel\r
+//#pragma omp parallel // TODO problem at initialization of global object ... enable back after fixing global obj issue\r
        for(long i=0;i<long(glyphs.size());i++)\r
        {\r
                for(int s=0;s<4;s++)\r
@@ -941,7 +942,7 @@ bool mglFont::Load(const char *base, const char *path)
        }\r
        if(ex_b.size()>0)\r
        {\r
-               glyphs.reserve(ex_b.size());    // preallocate memory\r
+               glyphs.reserve(ex_b.size());    // pmgl_reallocate memory\r
                glyphs.insert(glyphs.end(), ex_b.begin(), ex_b.end());\r
                std::sort(glyphs.begin(),glyphs.end());\r
        }\r
@@ -955,37 +956,20 @@ bool mglFont::Load(const char *base, const char *path)
        return true;\r
 }\r
 //-----------------------------------------------------------------------------\r
-#if MGL_HAVE_PTHREAD\r
-pthread_mutex_t mutexRnd;\r
-#endif\r
-//-----------------------------------------------------------------------------\r
-float mgl_cos[360];\r
-void static mgl_init()\r
-{\r
-       mgl_textdomain(NULL,"");\r
-#if MGL_HAVE_PTHREAD\r
-       pthread_mutex_init(&mutexRnd,0);\r
-#endif\r
-#ifndef WIN32  // win32 don't initialized threads before main()\r
-#pragma omp parallel for\r
-#endif\r
-       for(long i=0;i<360;i++) mgl_cos[i] = cos(i*M_PI/180.);\r
-}\r
-//-----------------------------------------------------------------------------\r
 mglFont::mglFont(const char *name, const char *path)\r
 {\r
-       parse = true;   gr=0;   Buf=0;\r
-//     if(this==&mglDefFont)   Load(name, path);       else    Copy(&mglDefFont);\r
+       parse = true;   gr=0;   Buf=0;  Hscale=1;\r
        if(name && *name)       Load(name, path);\r
-       else if(this!=&mglDefFont)      Copy(&mglDefFont);\r
-       else\r
-       {\r
-               mgl_init();             // NOTE: this call init function for the library.\r
-               Load(MGL_DEF_FONT_NAME,0);\r
-       }\r
+       else    Load(MGL_DEF_FONT_NAME,0);\r
+}\r
+mglFont::mglFont()\r
+{\r
+       parse = true;   gr=0;   Buf=0;  Hscale=1;\r
+       if(!mglDefFont) mgl_init();\r
+       Copy(mglDefFont);\r
 }\r
 mglFont::~mglFont()    {       if(Buf) delete []Buf;   }\r
-void mglFont::Restore()        {       Copy(&mglDefFont);      }\r
+void mglFont::Restore()        {       Copy(mglDefFont);       }\r
 //-----------------------------------------------------------------------------\r
 void mglFont::Clear()\r
 {\r
index 7cc9431445e3fc000d49b2ca9a3c87c53530f2ea..f80fcc6a3fe1cb9a5b0695fae4b18ca22fc4660a 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
index 211201caa496d170209c9fc97112920b1673f920..960656d8b190247b3830e86aadc3587cf8aa91bf 100644 (file)
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mglLineart(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z)
-{
-       if(!a || nx<1 || ny<1 || nz<1)  return 0;
-       Treal b=0,dx,dy,dz,b1,b0;
-       if(x<0 || y<0 || z<0 || x>nx-1 || y>ny-1 || z>nz-1)
-               return 0;
-       if(nz>1 && z!=floor(z))         // 3d interpolation
-       {
-               long kx=long(x), ky=long(y), kz=long(z);
-               dx = x-mreal(kx);       dy = y-mreal(ky);       dz = z-mreal(kz);
-
-               long i0 = kx+nx*(ky+ny*kz);
-               b0 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +
-                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];
-               i0 = kx+nx*(ky+ny*(kz+1));
-               b1 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +
-                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];
-               b = b0 + dz*(b1-b0);
-       }
-       else if(ny>1 && y!=floor(y))    // 2d interpolation
-       {
-               long kx=long(x), ky=long(y);
-               dx = x-kx;      dy=y-ky;
-               long i0 = kx+nx*ky;
-               b = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +
-                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];
-       }
-       else if(nx>1 && x!=floor(x))    // 1d interpolation
-       {
-               long kx = long(x);
-               b = a[kx] + (x-kx)*(a[kx+1]-a[kx]);
-       }
-       else                                            // no interpolation
-               b = a[long(x+nx*(y+ny*z))];
-       return b;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mgl_spline3t(const Treal y[4], long n, mreal dx, Treal &dy)
-{
-       Treal d[3];
-       d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2);
-       d[1] = (y[2]-y[0])/mreal(2);
-       d[2] = (y[3]-y[1])/mreal(2);
-
-       Treal t0 = (y[2]+y[0])/mreal(2)-y[1];
-       Treal t1 = (y[3]+y[1])/mreal(2)-y[2];
-       Treal f0 = y[n], d0 = d[n], res = 0;
-       if(n==1)
-       {
-               Treal df = y[2]-f0, d1 = d[2];
-               Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0;
-               Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0;
-               Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0;
-               dy = d0 + dx*(mreal(2)*t0+dx*(mreal(3)*b3+dx*(mreal(4)*b4+dx*mreal(5)*b5)));
-//             d2y = mreal(2)*t0 + dx*(mreal(6)*b3+dx*(mreal(12)*b4+dx*mreal(20)*b5)); // 2nd derivative for future
-               res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5))));
-       }
-       else if(n<1)
-       {       res = f0 + dx*(d0+dx*t0);       dy = d0+dx*t0*mreal(2); }
-       else
-       {       res = f0 + dx*(d0+dx*t1);       dy = d0+dx*t1*mreal(2); }
-       return res;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mgl_spline3st(const Treal y[4], long n, mreal dx)
-{
-       Treal d[3];
-       d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2);
-       d[1] = (y[2]-y[0])/mreal(2);
-       d[2] = (y[3]-y[1])/mreal(2);
-
-       Treal f0 = y[n], d0 = d[n], res;
-       Treal t0 = (y[2]+y[0])/mreal(2)-y[1];
-       Treal t1 = (y[3]+y[1])/mreal(2)-y[2];
-       if(n==1)
-       {
-               Treal df = y[2]-f0, d1 = d[2];
-               Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0;
-               Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0;
-               Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0;
-               res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5))));
-       }
-       else    res = f0 + dx*(d0+dx*(n<1?t0:t1));
-       return res;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mglSpline1t(const Treal *a, long nx, mreal x, Treal *dx=0)
-{
-       Treal r,d;
-       if(nx>3)
-       {
-               long k = long(x);
-               if(k>0 && k<nx-2)       r = mgl_spline3t<Treal>(a+k-1, 1, x-k, d);
-               else if(k<1)            r = mgl_spline3t<Treal>(a, 0, x, d);
-               else    r = mgl_spline3t<Treal>(a+nx-4, 2, x+2-nx, d);
-       }
-       else if(nx<2)   {       d=0;    r = a[0];       }
-       else if(nx==2)  {       d=a[1]-a[0];    r = a[0]+(a[1]-a[0])*x; }
-       else    // nx==3
-       {
-               Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2);
-               d = b1+mreal(2)*b2*x;   r = a[0]+x*(b1+b2*x);
-       }
-       if(dx)  *dx=d;
-       return r;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mglSpline1st(const Treal *a, long nx, mreal x)
-{
-       Treal r;
-       if(nx>3)
-       {
-               long k = long(x);
-               if(k>0 && k<nx-2)       r = mgl_spline3st<Treal>(a+k-1, 1, x-k);
-               else if(k<1)            r = mgl_spline3st<Treal>(a, 0, x);
-               else    r = mgl_spline3st<Treal>(a+nx-4, 2, x+2-nx);
-       }
-       else if(nx<2)   r = a[0];
-       else if(nx==2)  r = a[0]+(a[1]-a[0])*x;
-       else    // nx==3
-       {
-               Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2);
-               r = a[0]+x*(b1+b2*x);
-       }
-       return r;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mglSpline3t(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z, Treal *dx=0, Treal *dy=0, Treal *dz=0)
-{
-//     if(!a || nx<1 || ny<1 || nz<1)  return 0;       // NOTE remove this line because this should already checked
-       Treal gx=0,gy=0,gz=0;
-       x = x>0 ?(x<nx-1 ? x:nx-1):0;
-       y = y>0 ?(y<ny-1 ? y:ny-1):0;
-       z = z>0 ?(z<nz-1 ? z:nz-1):0;
-       Treal b;
-       if(nz>1)                // 3d interpolation
-       {
-               Treal tz[4], yz[4], xz[4];
-               long kz=long(z)-1, mz, k=long(y)-1, m;
-               if(nz>3)
-               {       mz = 4; kz = kz>=0?kz:0;
-                       if(kz>nz-4)     kz = nz-4;      }
-               else    {       mz = nz;        kz=0;   }
-               if(ny>3)
-               {       m = 4;  k = k>=0?k:0;
-                       if(k>ny-4)      k = ny-4;       }
-               else    {       m = ny; k=0;    }
-               for(long j=0;j<mz;j++)
-               {
-                       Treal t[4], d[4];
-                       for(long i=0;i<m;i++)
-                               t[i] = mglSpline1t<Treal>(a+nx*(i+k+ny*(j+kz)),nx,x,d+i);
-                       tz[j] = mglSpline1t<Treal>(t,m,y-k,yz+j);
-                       xz[j] = mglSpline1t<Treal>(d,m,y-k,0);
-               }
-               b = mglSpline1t<Treal>(tz,mz,z-kz,&gz);
-               gx = mglSpline1t<Treal>(xz,mz,z-kz,0);
-               gy = mglSpline1t<Treal>(yz,mz,z-kz,0);
-       }
-       else if(ny>1)   // 2d interpolation
-       {
-               Treal t[4], d[4];
-               long k = long(y)-1, m;
-               if(ny>3)
-               {       m = 4;  k = k>=0?k:0;   if(k>ny-4)      k = ny-4;       }
-               else    {       m = ny; k=0;    }
-               for(long i=0;i<m;i++)
-                       t[i] = mglSpline1t<Treal>(a+nx*(i+k),nx,x,d+i);
-               b = mglSpline1t<Treal>(t,m,y-k,&gy);
-               gx = mglSpline1t<Treal>(d,m,y-k,0);
-       }
-       else    // 1d interpolation
-               b = mglSpline1t<Treal>(a,nx,x,&gx);
-       if(dx)  *dx=gx;
-       if(dy)  *dy=gy;
-       if(dz)  *dz=gz;
-       return b;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> Treal mglSpline3st(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z)
-{
-//     if(!a || nx<1 || ny<1 || nz<1)  return 0;       // NOTE remove this line because this should already checked
-       x = x>0 ?(x<nx-1 ? x:nx-1):0;
-       y = y>0 ?(y<ny-1 ? y:ny-1):0;
-       z = z>0 ?(z<nz-1 ? z:nz-1):0;
-       Treal b;
-       if(nz>1)                // 3d interpolation
-       {
-               Treal tz[4], t[4];
-               long kz=long(z)-1, mz, k=long(y)-1, m;
-               if(nz>3)
-               {       mz = 4; kz = kz>=0?kz:0;
-                       if(kz>nz-4)     kz = nz-4;      }
-               else    {       mz = nz;        kz=0;   }
-               if(ny>3)
-               {       m = 4;  k = k>=0?k:0;
-                       if(k>ny-4)      k = ny-4;       }
-               else    {       m = ny; k=0;    }
-               for(long j=0;j<mz;j++)
-               {
-                       for(long i=0;i<m;i++)
-                               t[i] = mglSpline1st<Treal>(a+nx*(i+k+ny*(j+kz)),nx,x);
-                       tz[j] = mglSpline1st<Treal>(t,m,y-k);
-               }
-               b = mglSpline1st<Treal>(tz,mz,z-kz);
-       }
-       else if(ny>1)   // 2d interpolation
-       {
-               Treal t[4];
-               long k = long(y)-1, m;
-               if(ny>3)
-               {       m = 4;  k = k>=0?k:0;
-                       if(k>ny-4)      k = ny-4;       }
-               else    {       m = ny; k=0;    }
-               for(long i=0;i<m;i++)
-                       t[i] = mglSpline1st<Treal>(a+nx*(i+k),nx,x);
-               b = mglSpline1st<Treal>(t,m,y-k);
-       }
-       else    // 1d interpolation
-               b = mglSpline1st<Treal>(a,nx,x);
-       return b;
-}
-//-----------------------------------------------------------------------------
-template <class Treal> void mgl_gspline_init(long n, const mreal *x, const Treal *v, Treal *c)
-{      // c must have size 5*(n-1) !!!
-//     if(n<2) return; // NOTE remove this line because this should already checked
-       Treal *a = new Treal[n], *b = new Treal[n];
-       for(long i=0;i<n-1;i++) // basic coefficients
-       {       c[5*i] = x[i+1]-x[i];   c[5*i+1] = v[i];        }
-       // progonka
-       a[0] = -0.5;    b[0] = mreal(1.5)*(v[1]-v[0])/(x[1]-x[0]);
-       for(long i=1;i<n-1;i++)
-       {
-               mreal h0 = x[i]-x[i-1], h1 = x[i+1]-x[i];
-               Treal r = mreal(1)/(2/h0+2/h1 + a[i-1]/h0);
-               a[i] = - r/h1;
-               b[i] = ((3/h0/h0)*(v[i]-v[i-1]) + (1/h1/h1)*(v[i+1]-v[i]) + a[i-1]/h0)*r;
-       }
-       b[n-1] = ( (6/(x[n-1]-x[n-2]))*(v[n-1]-v[n-2]) - mreal(2)*b[n-2] )/(mreal(4)+mreal(2)*a[n-2]);
-       for(long i=n-2;i>=0;i--)        b[i] += a[i]*b[i+1];
-       // no spline coefficients
-       for(long i=0;i<n-1;i++)
-       {
-               c[5*i+2] = b[i];
-               mreal h = 1/(x[i+1]-x[i]), h2 = h*h;
-               c[5*i+3] = (3*h2)*(v[i+1]-v[i]) - (b[i+1]+b[i]+b[i])*h;
-               c[5*i+4] = (2*h2*h)*(v[i]-v[i+1]) + (b[i+1]+b[i])*h2;
-       }
-       delete []a;     delete []b;
-}
-//-----------------------------------------------------------------------------
+#ifndef INTERP_HPP\r
+#define INTERP_HPP\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mglLineart(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z)\r
+{\r
+       if(!a || nx<1 || ny<1 || nz<1)  return 0;\r
+       Treal b=0,dx,dy,dz,b1,b0;\r
+       if(x<0 || y<0 || z<0 || x>nx-1 || y>ny-1 || z>nz-1)\r
+               return 0;\r
+       if(nz>1 && z!=floor(z))         // 3d interpolation\r
+       {\r
+               long kx=long(x), ky=long(y), kz=long(z);\r
+               dx = x-mreal(kx);       dy = y-mreal(ky);       dz = z-mreal(kz);\r
+\r
+               long i0 = kx+nx*(ky+ny*kz);\r
+               b0 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +\r
+                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];\r
+               i0 = kx+nx*(ky+ny*(kz+1));\r
+               b1 = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +\r
+                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];\r
+               b = b0 + dz*(b1-b0);\r
+       }\r
+       else if(ny>1 && y!=floor(y))    // 2d interpolation\r
+       {\r
+               long kx=long(x), ky=long(y);\r
+               dx = x-kx;      dy=y-ky;\r
+               long i0 = kx+nx*ky;\r
+               b = a[i0]*(mreal(1)-dx-dy+dx*dy) + dx*(mreal(1)-dy)*a[i0+1] +\r
+                       dy*(mreal(1)-dx)*a[i0+nx] + dx*dy*a[i0+nx+1];\r
+       }\r
+       else if(nx>1 && x!=floor(x))    // 1d interpolation\r
+       {\r
+               long kx = long(x);\r
+               b = a[kx] + (x-kx)*(a[kx+1]-a[kx]);\r
+       }\r
+       else                                            // no interpolation\r
+               b = a[long(x+nx*(y+ny*z))];\r
+       return b;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mgl_spline3t(const Treal y[4], long n, mreal dx, Treal &dy)\r
+{\r
+       Treal d[3];\r
+       d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2);\r
+       d[1] = (y[2]-y[0])/mreal(2);\r
+       d[2] = (y[3]-y[1])/mreal(2);\r
+\r
+       Treal t0 = (y[2]+y[0])/mreal(2)-y[1];\r
+       Treal t1 = (y[3]+y[1])/mreal(2)-y[2];\r
+       Treal f0 = y[n], d0 = d[n], res = 0;\r
+       if(n==1)\r
+       {\r
+               Treal df = y[2]-f0, d1 = d[2];\r
+               Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0;\r
+               Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0;\r
+               Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0;\r
+               dy = d0 + dx*(mreal(2)*t0+dx*(mreal(3)*b3+dx*(mreal(4)*b4+dx*mreal(5)*b5)));\r
+//             d2y = mreal(2)*t0 + dx*(mreal(6)*b3+dx*(mreal(12)*b4+dx*mreal(20)*b5)); // 2nd derivative for future\r
+               res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5))));\r
+       }\r
+       else if(n<1)\r
+       {       res = f0 + dx*(d0+dx*t0);       dy = d0+dx*t0*mreal(2); }\r
+       else\r
+       {       res = f0 + dx*(d0+dx*t1);       dy = d0+dx*t1*mreal(2); }\r
+       return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mgl_spline3st(const Treal y[4], long n, mreal dx)\r
+{\r
+       Treal d[3];\r
+       d[0] = -(y[2]-mreal(4)*y[1]+mreal(3)*y[0])/mreal(2);\r
+       d[1] = (y[2]-y[0])/mreal(2);\r
+       d[2] = (y[3]-y[1])/mreal(2);\r
+\r
+       Treal f0 = y[n], d0 = d[n], res;\r
+       Treal t0 = (y[2]+y[0])/mreal(2)-y[1];\r
+       Treal t1 = (y[3]+y[1])/mreal(2)-y[2];\r
+       if(n==1)\r
+       {\r
+               Treal df = y[2]-f0, d1 = d[2];\r
+               Treal b3 = mreal(10)*df+t1-mreal(3)*t0-mreal(4)*d1-mreal(6)*d0;\r
+               Treal b4 = mreal(-15)*df-mreal(2)*t1+mreal(3)*t0+mreal(7)*d1+mreal(8)*d0;\r
+               Treal b5 = mreal(6)*df+t1-t0-mreal(3)*d1-mreal(3)*d0;\r
+               res = f0 + dx*(d0+dx*(t0+dx*(b3+dx*(b4+dx*b5))));\r
+       }\r
+       else    res = f0 + dx*(d0+dx*(n<1?t0:t1));\r
+       return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mglSpline1t(const Treal *a, long nx, mreal x, Treal *dx=0)\r
+{\r
+       Treal r,d;\r
+       if(nx>3)\r
+       {\r
+               long k = long(x);\r
+               if(k>0 && k<nx-2)       r = mgl_spline3t<Treal>(a+k-1, 1, x-k, d);\r
+               else if(k<1)            r = mgl_spline3t<Treal>(a, 0, x, d);\r
+               else    r = mgl_spline3t<Treal>(a+nx-4, 2, x+2-nx, d);\r
+       }\r
+       else if(nx<2)   {       d=0;    r = a[0];       }\r
+       else if(nx==2)  {       d=a[1]-a[0];    r = a[0]+(a[1]-a[0])*x; }\r
+       else    // nx==3\r
+       {\r
+               Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2);\r
+               d = b1+mreal(2)*b2*x;   r = a[0]+x*(b1+b2*x);\r
+       }\r
+       if(dx)  *dx=d;\r
+       return r;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mglSpline1st(const Treal *a, long nx, mreal x)\r
+{\r
+       Treal r;\r
+       if(nx>3)\r
+       {\r
+               long k = long(x);\r
+               if(k>0 && k<nx-2)       r = mgl_spline3st<Treal>(a+k-1, 1, x-k);\r
+               else if(k<1)            r = mgl_spline3st<Treal>(a, 0, x);\r
+               else    r = mgl_spline3st<Treal>(a+nx-4, 2, x+2-nx);\r
+       }\r
+       else if(nx<2)   r = a[0];\r
+       else if(nx==2)  r = a[0]+(a[1]-a[0])*x;\r
+       else    // nx==3\r
+       {\r
+               Treal b1=-(a[2]-mreal(4)*a[1]+mreal(3)*a[0])/mreal(2), b2=(a[2]-mreal(2)*a[1]+a[0])/mreal(2);\r
+               r = a[0]+x*(b1+b2*x);\r
+       }\r
+       return r;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mglSpline3t(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z, Treal *dx=0, Treal *dy=0, Treal *dz=0)\r
+{\r
+//     if(!a || nx<1 || ny<1 || nz<1)  return 0;       // NOTE remove this line because this should already checked\r
+       Treal gx=0,gy=0,gz=0;\r
+       x = x>0 ?(x<nx-1 ? x:nx-1):0;\r
+       y = y>0 ?(y<ny-1 ? y:ny-1):0;\r
+       z = z>0 ?(z<nz-1 ? z:nz-1):0;\r
+       Treal b;\r
+       if(nz>1)                // 3d interpolation\r
+       {\r
+               Treal tz[4], yz[4], xz[4];\r
+               long kz=long(z)-1, mz, k=long(y)-1, m;\r
+               if(nz>3)\r
+               {       mz = 4; kz = kz>=0?kz:0;\r
+                       if(kz>nz-4)     kz = nz-4;      }\r
+               else    {       mz = nz;        kz=0;   }\r
+               if(ny>3)\r
+               {       m = 4;  k = k>=0?k:0;\r
+                       if(k>ny-4)      k = ny-4;       }\r
+               else    {       m = ny; k=0;    }\r
+               for(long j=0;j<mz;j++)\r
+               {\r
+                       Treal t[4], d[4];\r
+                       for(long i=0;i<m;i++)\r
+                               t[i] = mglSpline1t<Treal>(a+nx*(i+k+ny*(j+kz)),nx,x,d+i);\r
+                       tz[j] = mglSpline1t<Treal>(t,m,y-k,yz+j);\r
+                       xz[j] = mglSpline1t<Treal>(d,m,y-k,0);\r
+               }\r
+               b = mglSpline1t<Treal>(tz,mz,z-kz,&gz);\r
+               gx = mglSpline1t<Treal>(xz,mz,z-kz,0);\r
+               gy = mglSpline1t<Treal>(yz,mz,z-kz,0);\r
+       }\r
+       else if(ny>1)   // 2d interpolation\r
+       {\r
+               Treal t[4], d[4];\r
+               long k = long(y)-1, m;\r
+               if(ny>3)\r
+               {       m = 4;  k = k>=0?k:0;   if(k>ny-4)      k = ny-4;       }\r
+               else    {       m = ny; k=0;    }\r
+               for(long i=0;i<m;i++)\r
+                       t[i] = mglSpline1t<Treal>(a+nx*(i+k),nx,x,d+i);\r
+               b = mglSpline1t<Treal>(t,m,y-k,&gy);\r
+               gx = mglSpline1t<Treal>(d,m,y-k,0);\r
+       }\r
+       else    // 1d interpolation\r
+               b = mglSpline1t<Treal>(a,nx,x,&gx);\r
+       if(dx)  *dx=gx;\r
+       if(dy)  *dy=gy;\r
+       if(dz)  *dz=gz;\r
+       return b;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> Treal mglSpline3st(const Treal *a, long nx, long ny, long nz, mreal x, mreal y, mreal z)\r
+{\r
+//     if(!a || nx<1 || ny<1 || nz<1)  return 0;       // NOTE remove this line because this should already checked\r
+       x = x>0 ?(x<nx-1 ? x:nx-1):0;\r
+       y = y>0 ?(y<ny-1 ? y:ny-1):0;\r
+       z = z>0 ?(z<nz-1 ? z:nz-1):0;\r
+       Treal b;\r
+       if(nz>1)                // 3d interpolation\r
+       {\r
+               Treal tz[4], t[4];\r
+               long kz=long(z)-1, mz, k=long(y)-1, m;\r
+               if(nz>3)\r
+               {       mz = 4; kz = kz>=0?kz:0;\r
+                       if(kz>nz-4)     kz = nz-4;      }\r
+               else    {       mz = nz;        kz=0;   }\r
+               if(ny>3)\r
+               {       m = 4;  k = k>=0?k:0;\r
+                       if(k>ny-4)      k = ny-4;       }\r
+               else    {       m = ny; k=0;    }\r
+               for(long j=0;j<mz;j++)\r
+               {\r
+                       for(long i=0;i<m;i++)\r
+                               t[i] = mglSpline1st<Treal>(a+nx*(i+k+ny*(j+kz)),nx,x);\r
+                       tz[j] = mglSpline1st<Treal>(t,m,y-k);\r
+               }\r
+               b = mglSpline1st<Treal>(tz,mz,z-kz);\r
+       }\r
+       else if(ny>1)   // 2d interpolation\r
+       {\r
+               Treal t[4];\r
+               long k = long(y)-1, m;\r
+               if(ny>3)\r
+               {       m = 4;  k = k>=0?k:0;\r
+                       if(k>ny-4)      k = ny-4;       }\r
+               else    {       m = ny; k=0;    }\r
+               for(long i=0;i<m;i++)\r
+                       t[i] = mglSpline1st<Treal>(a+nx*(i+k),nx,x);\r
+               b = mglSpline1st<Treal>(t,m,y-k);\r
+       }\r
+       else    // 1d interpolation\r
+               b = mglSpline1st<Treal>(a,nx,x);\r
+       return b;\r
+}\r
+//-----------------------------------------------------------------------------\r
+template <class Treal> void mgl_gspline_init(long n, const mreal *x, const Treal *v, Treal *c)\r
+{      // c must have size 5*(n-1) !!!\r
+//     if(n<2) return; // NOTE remove this line because this should already checked\r
+       Treal *a = new Treal[n], *b = new Treal[n];\r
+       for(long i=0;i<n-1;i++) // basic coefficients\r
+       {       c[5*i] = x[i+1]-x[i];   c[5*i+1] = v[i];        }\r
+       // progonka\r
+       a[0] = -0.5;    b[0] = mreal(1.5)*(v[1]-v[0])/(x[1]-x[0]);\r
+       for(long i=1;i<n-1;i++) // solve relative derivative\r
+       {\r
+               mreal h0 = x[i]-x[i-1], h1 = x[i+1]-x[i];\r
+               Treal r = mreal(1)/(2/h0+2/h1 + a[i-1]/h0);\r
+               a[i] = - r/h1;\r
+               b[i] = ((3/h0/h0)*(v[i]-v[i-1]) + (3/h1/h1)*(v[i+1]-v[i]) - b[i-1]/h0)*r;\r
+       }\r
+       b[n-1] = ( (6/(x[n-1]-x[n-2]))*(v[n-1]-v[n-2]) - mreal(2)*b[n-2] )/(mreal(4)+mreal(2)*a[n-2]);\r
+       for(long i=n-2;i>=0;i--)        b[i] += a[i]*b[i+1];\r
+       // now spline coefficients\r
+       for(long i=0;i<n-1;i++)\r
+       {\r
+               c[5*i+2] = b[i];\r
+               mreal h = 1/(x[i+1]-x[i]), h2 = h*h;\r
+               c[5*i+3] = (3*h2)*(v[i+1]-v[i]) - (b[i+1]+b[i]+b[i])*h;\r
+               c[5*i+4] = (2*h2*h)*(v[i]-v[i+1]) + (b[i+1]+b[i])*h2;\r
+       }\r
+       delete []a;     delete []b;\r
+}\r
+//-----------------------------------------------------------------------------\r
 struct mglEqTxT\r
 {\r
        std::vector<std::string> str;\r
        HAEX *eqC;\r
        HMEX *eqR;\r
        const char *var;\r
+       char brd;\r
+       long m,n;\r
+       std::vector<mglDataA*> head;\r
+       HMDT t;\r
 \r
-       mglEqTxT(const char *vars=0):eqC(0),eqR(0),var(vars)    {}\r
+       mglEqTxT(const char *vars=0):eqC(0),eqR(0),var(vars),brd(0)     {}\r
        ~mglEqTxT()\r
        {\r
                if(eqR) {       for(size_t i=0;i<str.size();i++)        mgl_delete_expr(eqR[i]);        delete []eqR;   }\r
@@ -290,3 +296,4 @@ struct mglEqTxT
        }\r
 };\r
 //-----------------------------------------------------------------------------\r
+#endif\r
index 93a0231e146fed0113d50a2579271fbdc1d0d686..2069386e68a2dc22a17615ef0901f9777a8fb98b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -30,8 +30,6 @@ void MGL_NO_EXPORT mgl_printf(void *fp, bool gz, const char *str, ...);
 #include <climits>\r
 #include <cassert>\r
 #include <float.h>\r
-#include <math.h>\r
-\r
 #include <deque>\r
 #include <map>\r
 #include <iostream>\r
@@ -147,8 +145,8 @@ class ObjXYZ
   { x = fx; y = fy; z = fz; }\r
   mreal Dot(const ObjXYZ & sPt) const\r
   { return(x*sPt.x)+(y*sPt.y)+(z*sPt.z); }\r
-  mreal LengthSquared()\r
-  { return(x*x+y*y+z*z); }\r
+//  mreal LengthSquared()\r
+//  { return(x*x+y*y+z*z); }\r
 \r
   friend ObjXYZ operator + (const ObjXYZ& a, const ObjXYZ& b)\r
   { return ObjXYZ(a.x+b.x,a.y+b.y,a.z+b.z); }\r
index 3f1b15c86130dab894036cb9a9ffa28bd666bd74..e8ccd285049c501523e4c0cc738dddf47dff66c3 100644 (file)
@@ -18,7 +18,7 @@ uintptr_t MGL_EXPORT mgl_create_graph_gl_()
 {      return uintptr_t(new mglCanvasGL);      }\r
 //-----------------------------------------------------------------------------\r
 mglCanvasGL::mglCanvasGL() : mglCanvas(1,1)\r
-{      Clf();  Zoom(0,0,1,1);  set(MGL_FULL_CURV);     }\r
+{      Clf();  Zoom(0,0,1,1);  set(MGL_FULL_CURV);     limit_pm1=true; }\r
 //-----------------------------------------------------------------------------\r
 mglCanvasGL::~mglCanvasGL(){}\r
 //-----------------------------------------------------------------------------\r
@@ -131,7 +131,6 @@ void mglCanvasGL::AddLight(int n,mglPoint r,mglPoint d,char cc, mreal br,mreal a
                spc[0] = spc[1] = spc[2] = br;\r
                amb[0] = amb[1] = amb[2] = AmbBr;\r
        }\r
-       ap = 90-180*atan(fabs(ap))/M_PI;\r
        dif[0] = dif[1] = dif[2] = DifBr;\r
        dif[3] = amb[3] = spc[3] = 1.;\r
        if(inf)\r
@@ -146,6 +145,7 @@ void mglCanvasGL::AddLight(int n,mglPoint r,mglPoint d,char cc, mreal br,mreal a
        glLightfv(GL_LIGHT0+n, GL_POSITION, pos);\r
        if(!inf)\r
        {\r
+//             ap = 90-180*atan(fabs(ap))/M_PI;\r
 //             float dir[4]={d.x, d.y, d.z, 0};\r
 //             glLightfv(GL_LIGHT0+n, GL_SPOT_DIRECTION, dir);\r
 //             glLightf(GL_LIGHT0+n, GL_SPOT_CUTOFF, ap);\r
index e235c8f48fb4f4a60d4063fbda2185477faa0b9d..530e829fb1e51353947fb4591d6c0d31ad551cdd 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -155,7 +155,7 @@ void MGL_EXPORT mgl_dens_z_(uintptr_t *gr, uintptr_t *a, const char *sch, mreal
 //     ContX, ContY, ContZ series\r
 //\r
 //-----------------------------------------------------------------------------\r
-void MGL_EXPORT mgl_cont_gen(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak);\r
+void MGL_EXPORT mgl_cont_genI(HMGL gr, mreal val, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, int text,long ak);\r
 void MGL_EXPORT mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt)\r
 {\r
        long n=a->GetNx(),m=a->GetNy();\r
@@ -177,7 +177,7 @@ void MGL_EXPORT mgl_cont_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx();i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
+               mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -203,7 +203,7 @@ void MGL_EXPORT mgl_cont_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx();i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
+               mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -229,7 +229,7 @@ void MGL_EXPORT mgl_cont_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx();i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_cont_gen(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
+               mgl_cont_genI(gr,v0,a,&xx,&yy,&zz,gr->GetC(ss,v0),text,0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -295,7 +295,7 @@ void MGL_EXPORT mgl_cont_z_val_(uintptr_t *gr, uintptr_t *v, uintptr_t *a, const
 //     ContFX, ContFY, ContFZ series\r
 //\r
 //-----------------------------------------------------------------------------\r
-void MGL_EXPORT mgl_contf_gen(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak);\r
+void MGL_EXPORT mgl_contf_genI(HMGL gr, mreal v1, mreal v2, HCDT a, HCDT x, HCDT y, HCDT z, mreal c, long ak);\r
 void MGL_EXPORT mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double sv, const char *opt)\r
 {\r
        long n=a->GetNx(),m=a->GetNy();\r
@@ -312,7 +312,7 @@ void MGL_EXPORT mgl_contf_x_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx()-1;i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -333,7 +333,7 @@ void MGL_EXPORT mgl_contf_y_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx()-1;i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
        }\r
        gr->EndGroup();\r
 }\r
@@ -354,7 +354,7 @@ void MGL_EXPORT mgl_contf_z_val(HMGL gr, HCDT v, HCDT a, const char *sch, double
        for(long i=0;i<v->GetNx()-1;i++)\r
        {\r
                mreal v0 = v->v(i);\r
-               mgl_contf_gen(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
+               mgl_contf_genI(gr,v0,v->v(i+1),a,&xx,&yy,&zz,gr->GetC(ss,v0),0);\r
        }\r
        gr->EndGroup();\r
 }\r
index d4a9c926975de85cda864dda686644e38a3d7db9..8db774ae81d44c1ab07ca83136ce494de8792ab5 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -33,18 +33,20 @@ mglCommand *mglParser::BaseCmd=NULL;        ///< Base table of MGL commands. It MUST be
 void mglParser::FillBaseCmd()
 {
        if(BaseCmd)     return;
-       size_t na=0, nd=0, ng=0, np=0, ns=0, nsum=0;
+       size_t na=0, nd=0, ng=0, np=0, ns=0, nr=0, nsum=0;
        while(mgls_prg_cmd[na].name[0]) na++;
        while(mgls_dat_cmd[nd].name[0]) nd++;
        while(mgls_grf_cmd[ng].name[0]) ng++;
        while(mgls_prm_cmd[np].name[0]) np++;
        while(mgls_set_cmd[ns].name[0]) ns++;
-       BaseCmd = new mglCommand[na+nd+ng+np+ns+1];
+       while(mgls_rnd_cmd[nr].name[0]) nr++;
+       BaseCmd = new mglCommand[na+nd+ng+np+ns+nr+1];
        memcpy(BaseCmd,         mgls_prg_cmd, na*sizeof(mglCommand));   nsum+=na;
        memcpy(BaseCmd+nsum,mgls_dat_cmd, nd*sizeof(mglCommand));       nsum+=nd;
        memcpy(BaseCmd+nsum,mgls_grf_cmd, ng*sizeof(mglCommand));       nsum+=ng;
        memcpy(BaseCmd+nsum,mgls_prm_cmd, np*sizeof(mglCommand));       nsum+=np;
-       memcpy(BaseCmd+nsum,mgls_set_cmd, (ns+1)*sizeof(mglCommand));   nsum+=ns;
+       memcpy(BaseCmd+nsum,mgls_rnd_cmd, nr*sizeof(mglCommand));       nsum+=nr;
+       memcpy(BaseCmd+nsum,mgls_set_cmd,(ns+1)*sizeof(mglCommand));nsum+=ns;
        qsort(BaseCmd, nsum, sizeof(mglCommand), mgl_cmd_cmp);
 #if DEBUG
        long stat[17];  memset(stat,0,17*sizeof(long));
@@ -55,8 +57,8 @@ void mglParser::FillBaseCmd()
 #endif
 }
 //-----------------------------------------------------------------------------
-HMDT MGL_NO_EXPORT mglFormulaCalc(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
-HADT MGL_NO_EXPORT mglFormulaCalcC(std::wstring string, mglParser *arg, const std::vector<mglDataA*> &head);
+HMDT MGL_NO_EXPORT mglFormulaCalc(const std::wstring &string, mglParser *arg, const std::vector<mglDataA*> &head);
+HADT MGL_NO_EXPORT mglFormulaCalcC(const std::wstring &string, mglParser *arg, const std::vector<mglDataA*> &head);
 //-----------------------------------------------------------------------------
 MGL_EXPORT void (*mgl_ask_func)(const wchar_t *, wchar_t *)=0;
 void MGL_EXPORT mgl_ask_gets(const wchar_t *quest, wchar_t *res)
@@ -73,9 +75,9 @@ MGL_EXPORT void (*mgl_progress_func)(int value, int maximal, HMGL)=mgl_progress_
 void MGL_EXPORT mgl_progress(int value, int maximal, HMGL gr)
 {      mgl_progress_func(value, maximal, gr);  }
 //-----------------------------------------------------------------------------
-mglFunc::mglFunc(long p, const wchar_t *f)
+mglFunc::mglFunc(long p, const wchar_t *f):func(f)
 {
-       pos = p;        func = f;
+       pos = p;
        size_t i;
        for(i=0;(isalnum(f[i]) || f[i]=='_');i++);
        narg = wcstol(f+i+1,0,0);       func.crop(0,i);
@@ -182,10 +184,13 @@ int mglParser::Exec(mglGraph *gr, const wchar_t *com, long n, mglArg *a, const s
                                                if(s[k]>' ')    alph=true;
                                                if(alph && s[k]<=' ')   break;
                                        }
-                                       HMDT d1 = mglFormulaCalc(s.substr(j+1,k-j),this, DataList);
-                                       HMDT d2 = mglFormulaCalc(s.substr(k+1),this, DataList);
-                                       mglprintf(buf,64,L" %g %g",d1->a[0],d2->a[0]);
-                                       s = o+buf;      delete d1;      delete d2;
+                                       if(k<s.length())
+                                       {
+                                               HMDT d1 = mglFormulaCalc(s.substr(j+1,k-j),this, DataList);
+                                               HMDT d2 = mglFormulaCalc(s.substr(k+1),this, DataList);
+                                               mglprintf(buf,64,L" %g %g",d1->a[0],d2->a[0]);
+                                               s = o+buf;      delete d1;      delete d2;
+                                       }
                                }
                                else if(o!=L"legend")   // 1 argument
                                {
@@ -424,7 +429,11 @@ void mglParser::FillArg(mglGraph *gr, int k, std::wstring *arg, mglArg *a)
                                        id.push_back(4);        s.push_back(str.substr(ii,i-ii));
                                        op=0;   ii=i+1; ns--;
                                }
-                               else if(na%2==0 && np==1 && str[i]==')' && ns==0)       np--;
+                               else if(na%2==0 && np>0 && ns==0)
+                               {
+                                       if(str[i]==')') np--;
+                                       if(str[i]=='(') np++;
+                               }
                        }
                        if(op && ll>ii)
                        {       id.push_back(op);       s.push_back(str.substr(ii,ll-ii));      }
@@ -853,7 +862,7 @@ int mglParser::Parse(mglGraph *gr, std::wstring str, long pos)
                        if(n)   st.state = MGL_ST_BREAK;
                        stack.push_back(st);    delete []a;     return n;
                }
-               // alocate new arrays and execute the command itself
+               // allocate new arrays and execute the command itself
                n = PreExec(gr, k, &(arg[0]), a);
                if(n>0) n--;
                else if(!arg[0].compare(L"setsize") && !AllowSetSize)   n = 2;
@@ -1090,7 +1099,7 @@ void mglParser::Execute(mglGraph *gr, const wchar_t *text)
                if(text[i]=='\\')       next = i;
                else if(text[i]>' ')next = 0;
                if(text[i]=='\n')
-               {       // if string need to be continued then I but ' ' instead of 0x0 and
+               {       // if string need to be continued then I put ' ' instead of 0x0 and
                        // pointer next string to 0x0. Last one for keeping number of strings.
                        if(next)
                        {       for(size_t ii=next;ii<=i;ii++)  wcs[ii]='\b';   str[n] = wcs+s-1;       next=0; }
index 36219e1b42514bd07eed315f9823d76fa43614ae..a97f42ae77d483d89a1bf9f652330d55f48242a0 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -24,7 +24,6 @@
 #include "mgl2/base.h"\r
 #include "interp.hpp"\r
 const double GAMMA=0.1;        ///< value for damping\r
-HADT MGL_NO_EXPORT mglFormulaCalcC(const char *str, const std::vector<mglDataA*> &head);\r
 //-----------------------------------------------------------------------------\r
 //\r
 //             Advanced PDE series in 2D case\r
@@ -252,7 +251,7 @@ uintptr_t MGL_EXPORT mgl_pde_adv_(uintptr_t* gr, const char *ham, uintptr_t* ini
 //-----------------------------------------------------------------------------\r
 struct mgl_pde_ham\r
 {\r
-       dual *a,*hxy,*hxv,*huv,*huy;\r
+       ddual *a,*hxy,*hxv,*huv,*huy;\r
        const char *eqs;\r
        long nx,ny;\r
        double xx,yy,xs,ys,dx,dy,dq,dp,zz;\r
@@ -315,19 +314,19 @@ HADT MGL_EXPORT mgl_pde_solve_c(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_
        {       gr->SetWarn(mglWarnDim,"PDE");  return 0;       }\r
        mglDataC *res=new mglDataC(nz, nx, ny);\r
 \r
-       dual *a = new dual[4*nx*ny], hh0;       // Add "damping" area\r
-       dual *hxy = new dual[4*nx*ny], *hxv = new dual[4*nx*ny];\r
-       dual *huy = new dual[4*nx*ny], *huv = new dual[4*nx*ny];\r
-       dual *hx = new dual[2*nx], *hv = new dual[2*ny];\r
-       dual *hy = new dual[2*ny], *hu = new dual[2*nx];\r
+       ddual *a = new ddual[4*nx*ny], hh0;     // Add "damping" area\r
+       ddual *hxy = new ddual[4*nx*ny], *hxv = new ddual[4*nx*ny];\r
+       ddual *huy = new ddual[4*nx*ny], *huv = new ddual[4*nx*ny];\r
+       ddual *hx = new ddual[2*nx], *hv = new ddual[2*ny];\r
+       ddual *hy = new ddual[2*ny], *hu = new ddual[2*nx];\r
        double *dmp = new double[4*nx*ny];\r
-       memset(a,0,4*nx*ny*sizeof(dual));\r
+       memset(a,0,4*nx*ny*sizeof(ddual));\r
        memset(dmp,0,4*nx*ny*sizeof(double));\r
 #pragma omp parallel for collapse(2)\r
        for(long j=0;j<ny;j++)  for(long i=0;i<nx;i++)  // Initial conditions\r
        {\r
                long i0 = i+nx/2+2*nx*(j+ny/2);\r
-               a[i0] = dual(ini_re->v(i,j), ini_im->v(i,j));\r
+               a[i0] = ddual(ini_re->v(i,j), ini_im->v(i,j));\r
                res->a[nz*(i+nx*j)] = a[i0];\r
        }\r
 #pragma omp parallel for collapse(2)\r
@@ -357,8 +356,8 @@ HADT MGL_EXPORT mgl_pde_solve_c(HMGL gr, const char *ham, HCDT ini_re, HCDT ini_
        {\r
                if(gr->NeedStop())      break;\r
                tmp.zz = Min.z+dz*k;\r
-               memset(hxy,0,4*nx*ny*sizeof(dual));     memset(hxv,0,4*nx*ny*sizeof(dual));\r
-               memset(huv,0,4*nx*ny*sizeof(dual));     memset(huy,0,4*nx*ny*sizeof(dual));\r
+               memset(hxy,0,4*nx*ny*sizeof(ddual));    memset(hxv,0,4*nx*ny*sizeof(ddual));\r
+               memset(huv,0,4*nx*ny*sizeof(ddual));    memset(huy,0,4*nx*ny*sizeof(ddual));\r
                mgl_pde_hprep(&tmp);\r
                for(long i=0;i<2*nx;i++)        {       hx[i] = hxv[i];                 hu[i] = huv[i];         }\r
                for(long j=0;j<2*ny;j++)        {       hy[j] = huy[2*nx*j];    hv[j] = huv[2*nx*j];}\r
@@ -446,15 +445,190 @@ uintptr_t MGL_EXPORT mgl_pde_solve_(uintptr_t* gr, const char *ham, uintptr_t* i
 //             ODE series\r
 //\r
 //-----------------------------------------------------------------------------\r
+void MGL_NO_EXPORT mgl_set_func(const mreal *x, mreal *dx, void *par)\r
+{\r
+       mglEqTxT *p=(mglEqTxT *)par;\r
+       long n = p->n/p->m;\r
+       for(long i=0;i<p->m;i++)\r
+       {\r
+               HMDT d = static_cast<HMDT>(p->head[i]);\r
+               memcpy(d->a, x+i*n, n*sizeof(mreal));\r
+       }\r
+       p->t->a[0] = x[p->n];\r
+//#pragma omp parallel for collapse(2)\r
+       for(long j=0;j<p->m;j++)\r
+       {\r
+               HMDT d = mglFormulaCalc(p->str[j].c_str(),p->head);\r
+               mreal val = d->a[0];\r
+               if(d->nx<n)\r
+               {\r
+                       d->Create(n);\r
+                       for(long i=0;i<n;i++)   d->a[i] = val;\r
+               }\r
+               else switch(p->brd)\r
+               {\r
+                       default:        // zero instead of NAN\r
+                       case 0: \r
+                       case 'z':\r
+                       case '0':\r
+                               for(long i=0;i<n;i++)   if(mgl_isbad(d->a[i]))  d->a[i] = 0;\r
+                               break;\r
+                       case 1:         // constant at border\r
+                       case 'c':\r
+                       case '1':\r
+                               d->a[0] = d->a[1];      d->a[n-1] = d->a[n-2];  break;\r
+                       case 2:         // linear at border\r
+                       case 'l':\r
+                       case '2':\r
+                               d->a[0] = mreal(2)*d->a[1]-d->a[2];\r
+                               d->a[n-1] = mreal(2)*d->a[n-2]-d->a[n-3];       break;\r
+                       case 3:         // square at border\r
+                       case 's':\r
+                       case '3':\r
+                               d->a[0] = d->a[3]+mreal(3)*(d->a[1]-d->a[2]);\r
+                               d->a[n-1] = d->a[n-4]+mreal(3)*(d->a[n-2]-d->a[n-3]);   break;\r
+               }\r
+               memcpy(dx+j*n, d->a, n*sizeof(mreal));\r
+               delete d;\r
+       }\r
+}\r
+HMDT MGL_EXPORT mgl_ode_solve_set(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax)\r
+{\r
+       if(!var || !(*var) || !func || !x0)     return 0;\r
+       mglEqTxT par;\r
+       par.var=var;    par.brd=brd;    par.FillStr(func);\r
+       const long n = par.n = x0->GetNx();\r
+       const long m = par.m = long(strlen(var)), nn = n/m;     // number of variables\r
+       \r
+       HMDT dat = new mglData[m+3];\r
+       for(long i=0;i<m;i++)\r
+       {\r
+               HMDT d = dat+i; d->Create(nn);\r
+               d->s = var[i];  par.head.push_back(d);\r
+       }\r
+       HMDT d = dat+m+1;       d->Create(nn);\r
+       for(long i=0;i<nn;i++)  d->a[i] = i;\r
+       d->s = 'j';     par.head.push_back(d);\r
+       (dat+m+2)->Create(nn);  (dat+m+2)->s = "#$mgl";\r
+       par.head.push_back(dat+m+2);\r
+       par.t = dat+m;  par.t->s = 't'; par.head.push_back(par.t);\r
+       \r
+       mreal *xx = new mreal[n];\r
+       for(long i=0;i<n;i++)   xx[i] = x0->vthr(i);\r
+       HMDT res = mgl_ode_solve_ex(mgl_set_func,n,xx,dt,tmax,&par,NULL);\r
+       delete []xx;    delete []dat;   return res;\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_NO_EXPORT mgl_set_funcC(const mreal *x, mreal *dx, void *par)\r
+{\r
+       mglEqTxT *p=(mglEqTxT *)par;\r
+       long n = p->n/p->m;\r
+       for(long i=0;i<p->m;i++)\r
+       {\r
+               HADT d = static_cast<HADT>(p->head[i]);\r
+               memcpy(d->a, x+2*i*n, 2*n*sizeof(mreal));\r
+       }\r
+       p->t->a[0] = x[2*p->n];\r
+//#pragma omp parallel for collapse(2)\r
+       for(long j=0;j<p->m;j++)\r
+       {\r
+               HADT d = mglFormulaCalcC(p->str[j].c_str(),p->head);\r
+               dual val = d->a[0];\r
+               if(d->nx<n)\r
+               {\r
+                       d->Create(n);\r
+                       for(long i=0;i<n;i++)   d->a[i] = val;\r
+               }\r
+               else switch(p->brd)\r
+               {\r
+                       default:\r
+                       case 0:         // zero instead of NAN\r
+                       case 'z':\r
+                       case '0':\r
+                               for(long i=0;i<n;i++)   if(mgl_isbad(d->a[i]))  d->a[i] = 0;\r
+                               break;\r
+                       case 1:         // constant at border\r
+                       case 'c':\r
+                       case '1':\r
+                               d->a[0] = d->a[1];      d->a[n-1] = d->a[n-2];  break;\r
+                       case 2:         // linear at border\r
+                       case 'l':\r
+                       case '2':\r
+                               d->a[0] = mreal(2)*d->a[1]-d->a[2];\r
+                               d->a[n-1] = mreal(2)*d->a[n-2]-d->a[n-3];       break;\r
+                       case 3:         // square at border\r
+                       case 's':\r
+                       case '3':\r
+                               d->a[0] = d->a[3]+mreal(3)*(d->a[1]-d->a[2]);\r
+                               d->a[n-1] = d->a[n-4]+mreal(3)*(d->a[n-2]-d->a[n-3]);   break;\r
+                       case -1:                // exponent at border\r
+                       case 4:\r
+                       case 'e':\r
+                       case '4':\r
+                               d->a[0] = norm(d->a[2])<norm(d->a[1]) ? d->a[1] : d->a[1]*d->a[1]/d->a[2];\r
+                               d->a[n-1] = norm(d->a[n-3])<norm(d->a[n-2]) ? d->a[n-2] : d->a[n-2]*d->a[n-2]/d->a[n-3];\r
+                               break;\r
+                       case -2:                // gaussian at border\r
+                       case 5:\r
+                       case 'g':\r
+                       case '5':\r
+                               d->a[0] = norm(d->a[2])<norm(d->a[1]) ? d->a[3] : pow(d->a[1]/d->a[2],3)*d->a[3];\r
+                               d->a[n-1] = norm(d->a[n-3])<norm(d->a[n-2]) ? d->a[n-4] : pow(d->a[n-2]/d->a[n-3],3)*d->a[n-4];\r
+                               break;\r
+               }\r
+               memcpy(dx+2*j*n, d->a, 2*n*sizeof(mreal));\r
+               delete d;\r
+       }\r
+}\r
+HADT MGL_EXPORT mgl_ode_solve_set_c(const char *func, const char *var, char brd, HCDT x0, mreal dt, mreal tmax)\r
+{\r
+       if(!var || !(*var) || !func || !x0)     return 0;\r
+       mglEqTxT par;\r
+       par.var=var;    par.brd=brd;    par.FillStr(func);\r
+       const long n = par.n = x0->GetNx();\r
+       const long m = par.m = long(strlen(var)), nn = n/m;     // number of variables\r
+       \r
+       HADT dat = new mglDataC[m];\r
+       for(long i=0;i<m;i++)\r
+       {\r
+               HADT d = dat+i; d->Create(nn);\r
+               d->s = var[i];  par.head.push_back(d);\r
+       }\r
+       HMDT d = new mglData[3];\r
+       d->Create(nn);  d->s = 'j';\r
+       for(long i=0;i<nn;i++)  d->a[i] = i;\r
+       par.head.push_back(d);\r
+       (d+1)->Create(nn);      (d+1)->s = "#$mgl";\r
+       par.head.push_back(d+1);\r
+       par.t = d+2;    par.t->s = 't';\r
+       par.head.push_back(par.t);\r
+\r
+       mreal *xx = new mreal[2*n];\r
+       const mglDataC *c = dynamic_cast<const mglDataC *>(x0);\r
+       if(c)           for(long i=0;i<n;i++)   \r
+       {       xx[2*i]=real(c->a[i]);  xx[2*i+1]=imag(c->a[i]);        }\r
+       else if(x0)     for(long i=0;i<n;i++)   \r
+       {       xx[2*i] = x0->vthr(i);  xx[2*i+1]=0;    }\r
+       else            for(long i=0;i<n;i++)   xx[2*i] = xx[2*i+1]=0;\r
+\r
+       HMDT res = mgl_ode_solve_ex(mgl_set_funcC,2*n,xx,dt,tmax,&par,NULL);\r
+       delete []xx;    delete []d;     delete []dat;\r
+       const long nt=res->ny;\r
+       mglDataC *out = new mglDataC(n, nt);\r
+#pragma omp parallel for\r
+       for(long i=0;i<nt*n;i++)        out->a[i] = dual(res->a[2*i],res->a[2*i+1]);\r
+       delete res;     return out;\r
+}\r
+//-----------------------------------------------------------------------------\r
 void MGL_NO_EXPORT mgl_txt_func(const mreal *x, mreal *dx, void *par)\r
 {\r
        mglEqTxT *p=(mglEqTxT *)par;\r
        mreal vars[MGL_VS];\r
-       size_t n = p->str.size();\r
-       for(size_t i=0;i<n;i++)\r
+       const long n = p->n;\r
+       for(long i=0;i<n;i++)\r
        {       char ch = p->var[i];    if(ch>='a' && ch<='z')  vars[ch-'a']=x[i];      }\r
-#pragma omp parallel for\r
-       for(long i=0;i<long(n);i++)\r
+//#pragma omp parallel for\r
+       for(long i=0;i<n;i++)\r
                dx[i] = mgl_expr_eval_v(p->eqR[i], vars);\r
 }\r
 HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mreal dt, mreal tmax)\r
@@ -462,9 +636,9 @@ HMDT MGL_EXPORT mgl_ode_solve_str(const char *func, const char *var, HCDT x0, mr
        if(!var || !(*var) || !func)    return 0;\r
        mglEqTxT par;\r
        par.var=var;    par.FillReal(func);\r
-       size_t n = par.str.size();\r
+       long n = par.n = long(par.str.size());\r
        mreal *xx = new mreal[n];\r
-       for(size_t i=0;i<n;i++) xx[i] = x0?x0->vthr(i):0;\r
+       for(long i=0;i<n;i++)   xx[i] = x0?x0->vthr(i):0;\r
        HMDT res = mgl_ode_solve_ex(mgl_txt_func,n,xx,dt,tmax,&par,NULL);\r
        delete []xx;    return res;\r
 }\r
@@ -473,11 +647,11 @@ void MGL_NO_EXPORT mgl_txt_funcC(const mreal *x, mreal *dx, void *par)
 {\r
        mglEqTxT *p=(mglEqTxT *)par;\r
        mdual vars[MGL_VS];\r
-       size_t n = p->str.size();\r
-       for(size_t i=0;i<n;i++)\r
+       const long n = p->n;\r
+       for(long i=0;i<n;i++)\r
        {       char ch = p->var[i];    if(ch>='a' && ch<='z')  vars[ch-'a']=dual(x[2*i],x[2*i+1]);     }\r
-#pragma omp parallel for\r
-       for(long i=0;i<long(n);i++)\r
+//#pragma omp parallel for\r
+       for(long i=0;i<n;i++)\r
        {\r
                dual r = mgl_cexpr_eval_v(p->eqC[i], vars);\r
                dx[2*i] = real(r);      dx[2*i+1] = imag(r);\r
@@ -488,20 +662,20 @@ HADT MGL_EXPORT mgl_ode_solve_str_c(const char *func, const char *var, HCDT x0,
        if(!var || !(*var) || !func)    return 0;\r
        mglEqTxT par;   par.var=var;\r
        par.var=var;    par.FillCmplx(func);\r
-       size_t n = par.str.size();\r
+       long n = par.n = long(par.str.size());\r
        mreal *xx = new mreal[2*n];\r
        const mglDataC *c = dynamic_cast<const mglDataC *>(x0);\r
-       for(size_t i=0;i<n;i++)\r
+       for(long i=0;i<n;i++)\r
        {\r
                if(c)   {       xx[2*i]=real(c->a[i]);  xx[2*i+1]=imag(c->a[i]);        }\r
                else    {       xx[2*i] = x0?x0->vthr(i):0;     xx[2*i+1]=0;    }\r
        }\r
        HMDT res = mgl_ode_solve_ex(mgl_txt_funcC,2*n,xx,dt,tmax,&par,NULL);\r
        delete []xx;\r
-       const long nn=n, nt=res->ny;\r
-       mglDataC *out = new mglDataC(nn, nt);\r
+       const long nt=res->ny;\r
+       mglDataC *out = new mglDataC(n, nt);\r
 #pragma omp parallel for\r
-       for(long i=0;i<nt*nn;i++)       out->a[i] = dual(res->a[2*i],res->a[2*i+1]);\r
+       for(long i=0;i<nt*n;i++)        out->a[i] = dual(res->a[2*i],res->a[2*i+1]);\r
        delete res;     return out;\r
 }\r
 //-----------------------------------------------------------------------------\r
@@ -509,24 +683,60 @@ HMDT MGL_EXPORT mgl_ode_solve(void (*func)(const mreal *x, mreal *dx, void *par)
 {      return mgl_ode_solve_ex(func,n,x0,dt,tmax,par,0);       }\r
 HMDT MGL_EXPORT mgl_ode_solve_ex(void (*func)(const mreal *x, mreal *dx, void *par), int n, const mreal *x0, mreal dt, mreal tmax, void *par, void (*bord)(mreal *x, const mreal *xp, void *par))\r
 {\r
+       bool scale=false;\r
+       if(dt*tmax<0)   {       scale = true;   dt = fabs(dt);  tmax = fabs(tmax);      }\r
        if(tmax<dt)     return 0;       // nothing to do\r
        const long nt = int(tmax/dt+0.5)+1;\r
        mglData *res=new mglData(n,nt);\r
-       mreal *x=new mreal[n], *k1=new mreal[n], *k2=new mreal[n], *k3=new mreal[n], *v=new mreal[n], hh=dt/2;\r
+       mreal *x=new mreal[n+1], *k1=new mreal[n], *k2=new mreal[n], *k3=new mreal[n], *v=new mreal[n+1], hh=dt/2;\r
        // initial conditions\r
        for(long i=0;i<n;i++)   x[i] = res->a[i] = x0[i];\r
        // Runge Kutta scheme of 4th order\r
        bool good=true;\r
        long k;\r
+       x[n] = 0;\r
        for(k=1;k<nt && good;k++)\r
        {\r
+               double m0=0,m1=0,m2=0,m3=0, t = x[n];\r
                func(x,k1,par);\r
+               if(scale)\r
+               {\r
+                       for(long i=0;i<n;i++)\r
+                       {       double kk = fabs(k1[i]);        if(kk>m0)       m0 = kk;        }\r
+                       for(long i=0;i<n;i++)   k1[i] /= m0;\r
+               }\r
+               else m0 = 1;\r
                for(long i=0;i<n;i++)   v[i] = x[i]+k1[i]*hh;\r
+               v[n] = t+hh/m0;\r
                func(v,k2,par);\r
+               if(scale)\r
+               {\r
+                       for(long i=0;i<n;i++)\r
+                       {       double kk = fabs(k2[i]);        if(kk>m1)       m1 = kk;        }\r
+                       for(long i=0;i<n;i++)   k2[i] /= m1;\r
+               }\r
+               else m1 = 1;\r
                for(long i=0;i<n;i++)   v[i] = x[i]+k2[i]*hh;\r
+               v[n] = t+hh/m1;\r
                func(v,k3,par);\r
+               if(scale)\r
+               {\r
+                       for(long i=0;i<n;i++)\r
+                       {       double kk = fabs(k3[i]);        if(kk>m2)       m2 = kk;        }\r
+                       for(long i=0;i<n;i++)   k3[i] /= m2;\r
+               }\r
+               else m2 = 1;\r
                for(long i=0;i<n;i++)   {       v[i] = x[i]+k3[i]*dt;   k3[i] += k2[i]; }\r
+               v[n] = t+dt/m2;\r
                func(v,k2,par);\r
+               if(scale)\r
+               {\r
+                       for(long i=0;i<n;i++)\r
+                       {       double kk = fabs(k2[i]);        if(kk>m3)       m3 = kk;        }\r
+                       for(long i=0;i<n;i++)   k2[i] /= m3;\r
+               }\r
+               else m3 = 1;\r
+               x[n] = t + (1/m0+2/m1+2/m2+1/m3)*dt/6;\r
                for(long i=0;i<n;i++)   x[i] += (k1[i]+k2[i]+2*k3[i])*dt/6;\r
                if(bord)        bord(x,res->a+n*(k-1),par);\r
                for(long i=0;i<n;i++)\r
@@ -658,11 +868,11 @@ static void *mgl_qo2d_hprep(void *par)
                hh = sqrt(sqrt(0.041+hh*hh*hh*hh));\r
                mreal tt = (ra->pt + ra->d1*x1)/hh - ra->pt;\r
                dual tmp = f->ham(abs(f->a[i]), r[0]+ra->x1*x1, r[1]+ra->y1*x1, r[3]+ra->x0*tt, r[4]+ra->y0*tt, f->par);\r
-               f->hx[i] = tmp - f->h0/2.;\r
+               f->hx[i] = tmp - f->h0/mreal(2);\r
                // u-y terms\r
                x1 = f->dk/2*(i<nx/2 ? i:i-nx);\r
                tmp = f->ham(0, r[0], r[1], r[3]+ra->x1*x1, r[4]+ra->y1*x1, f->par);\r
-               f->hu[i] = tmp - f->h0/2.;\r
+               f->hu[i] = tmp - f->h0/mreal(2);\r
 \r
                if(imag(f->hx[i])>0)    f->hx[i] = f->hx[i].real();\r
                if(imag(f->hu[i])>0)    f->hu[i] = f->hu[i].real();\r
@@ -702,7 +912,7 @@ HADT MGL_EXPORT mgl_qo2d_func_c(mdual (*ham)(mreal u, mreal x, mreal y, mreal px
        for(long k=0;k<nt;k++)\r
        {\r
                for(long i=0;i<nx;i++)  // "save"\r
-                       res->a[i+k*nx]=a[i+nx/2]*sqrt(ra[0].ch/ra[k].ch);\r
+                       res->a[i+k*nx]=a[i+nx/2]*mreal(sqrt(ra[0].ch/ra[k].ch));\r
                if(xx && yy)    for(long i=0;i<nx;i++)  // prepare xx, yy\r
                {\r
                        mreal x1 = (2*i-nx+1)*dr;\r
@@ -841,13 +1051,13 @@ static void *mgl_qo3d_post(void *par)
        for(long ii=t->id;ii<nx*nx;ii+=mglNumThr)\r
        {\r
                long i = ii%nx, j = ii/nx;\r
-               f->hxy[ii] -= (f->hx[i]+f->hy[j]-f->h0/2.)/2.;\r
+               f->hxy[ii] -= (f->hx[i]+f->hy[j]-f->h0/mreal(2))/mreal(2);\r
                if(imag(f->hxy[ii])>0)  f->hxy[ii] = f->hxy[ii].real();\r
-               f->hxv[ii] -= (f->hx[i]+f->hv[j]-f->h0/2.)/2.;\r
+               f->hxv[ii] -= (f->hx[i]+f->hv[j]-f->h0/mreal(2))/mreal(2);\r
                if(imag(f->hxv[ii])>0)  f->hxv[ii] = f->hxv[ii].real();\r
-               f->huy[ii] -= (f->hu[i]+f->hy[j]-f->h0/2.)/2.;\r
+               f->huy[ii] -= (f->hu[i]+f->hy[j]-f->h0/mreal(2))/mreal(2);\r
                if(imag(f->huy[ii])>0)  f->huy[ii] = f->huy[ii].real();\r
-               f->huv[ii] -= (f->hu[i]+f->hv[j]-f->h0/2.)/2.;\r
+               f->huv[ii] -= (f->hu[i]+f->hv[j]-f->h0/mreal(2))/mreal(2);\r
                if(imag(f->huv[ii])>0)  f->huv[ii] = f->huv[ii].real();\r
                // add boundary conditions for x-direction\r
                f->hxy[ii] -= dual(0,f->dmp[ii]);\r
@@ -895,7 +1105,7 @@ HADT MGL_EXPORT mgl_qo3d_func_c(mdual (*ham)(mreal u, mreal x, mreal y, mreal z,
        {\r
 #pragma omp parallel for collapse(2)\r
                for(long i=0;i<nx;i++)  for(long j=0;j<nx;j++)  // "save"\r
-                       res->a[i+nx*(j+k*nx)]=a[i+nx/2+2*nx*(j+nx/2)]*sqrt(ra[0].ch/ra[k].ch);\r
+                       res->a[i+nx*(j+k*nx)]=a[i+nx/2+2*nx*(j+nx/2)]*mreal(sqrt(ra[0].ch/ra[k].ch));\r
                if(xx && yy && zz)\r
 #pragma omp parallel for collapse(2)\r
                        for(long i=0;i<nx;i++)  for(long j=0;j<nx;j++)  // prepare xx, yy, zz\r
@@ -1221,57 +1431,65 @@ HMDT MGL_EXPORT mgl_data_tridmat(HCDT A, HCDT B, HCDT C, HCDT D, const char *how
        if(mglchr(how,'x') && (na==nn || na==np || na==nx))\r
 #pragma omp parallel\r
        {\r
-               mglData T(nx,4);        mreal *uu=T.a+(per?3:2)*nx;\r
+               mreal *tt = new mreal[4*nx], *uu=tt+(per?3:2)*nx;\r
+//             mglData T(nx,4);        mreal *uu=T.a+(per?3:2)*nx;\r
 #pragma omp for collapse(2)\r
                for(long k=0;k<nz;k++)  for(long j=0;j<ny;j++)\r
                {\r
                        long i0=0, i1=nx*(j+ny*k);\r
                        if(na==nn)      i0=nx*(j+ny*k); else if(na==np) i0=nx*j;\r
-                       if(per) mgl_progonka_pr(A,B,C,D,T.a,nx,i1,i0,1,difr);\r
-                       else    mgl_progonka_sr(A,B,C,D,T.a,nx,i1,i0,1,difr);\r
+                       if(per) mgl_progonka_pr(A,B,C,D,tt,nx,i1,i0,1,difr);\r
+                       else    mgl_progonka_sr(A,B,C,D,tt,nx,i1,i0,1,difr);\r
                        i0 = nx*(j+ny*k);\r
                        for(long i=0;i<nx;i++)  r->a[i+i0] = uu[i];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'y') && (na==nn || na==np || na==ny))\r
 #pragma omp parallel\r
        {\r
-               mglData T(ny,4);        mreal *uu=T.a+(per?3:2)*ny;\r
+               mreal *tt = new mreal[4*ny], *uu=tt+(per?3:2)*ny;\r
+// /           mglData T(ny,4);        mreal *uu=T.a+(per?3:2)*ny;\r
 #pragma omp for collapse(2)\r
                for(long k=0;k<nz;k++)  for(long i=0;i<nx;i++)\r
                {\r
                        long i0=0, i1 = i+np*k;\r
                        if(na==nn)      i0=i+np*k;      else if(na==np) i0=i;\r
-                       if(per) mgl_progonka_pr(A,B,C,D,T.a,ny,i1,i0,nx,difr);\r
-                       else    mgl_progonka_sr(A,B,C,D,T.a,ny,i1,i0,nx,difr);\r
+                       if(per) mgl_progonka_pr(A,B,C,D,tt,ny,i1,i0,nx,difr);\r
+                       else    mgl_progonka_sr(A,B,C,D,tt,ny,i1,i0,nx,difr);\r
                        i0 = i+np*k;\r
                        for(long j=0;j<ny;j++)  r->a[j*nx+i0] = uu[j];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'z') && (na==nn || na==nz))\r
 #pragma omp parallel\r
        {\r
-               mglData T(nz,4);        mreal *uu=T.a+(per?3:2)*nz;\r
+               mreal *tt = new mreal[4*nz], *uu=tt+(per?3:2)*nz;\r
+//             mglData T(nz,4);        mreal *uu=T.a+(per?3:2)*nz;\r
 #pragma omp for collapse(2)\r
                for(long j=0;j<ny;j++)  for(long i=0;i<nx;i++)\r
                {\r
                        long i0 = na==nn?i+nx*j:0, i1 = i+nx*j;\r
-                       if(per) mgl_progonka_pr(A,B,C,D,T.a,nz,i1,i0,np,difr);\r
-                       else    mgl_progonka_sr(A,B,C,D,T.a,nz,i1,i0,np,difr);\r
+                       if(per) mgl_progonka_pr(A,B,C,D,tt,nz,i1,i0,np,difr);\r
+                       else    mgl_progonka_sr(A,B,C,D,tt,nz,i1,i0,np,difr);\r
                        i0 = i+nx*j;\r
                        for(long k=0;k<nz;k++)  r->a[k*np+i0] = uu[k];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'h') && ny==nx && (na==nn || na==np) && nx>1)\r
 #pragma omp parallel\r
        {\r
-               mglData T(np,2);\r
+               mreal *tt = new mreal[2*np];\r
+//             mglData T(np,2);\r
 #pragma omp for\r
                for(long k=0;k<nz;k++)\r
                {\r
-                       mgl_progonka_hr(A,B,C,D,T.a,nx,k*np,na==nn ? k*np:0,difr);\r
-                       memcpy(r->a+k*np, T.a+np, np*sizeof(mreal));\r
+                       mgl_progonka_hr(A,B,C,D,tt,nx,k*np,na==nn ? k*np:0,difr);\r
+                       memcpy(r->a+k*np, tt+np, np*sizeof(mreal));\r
                }\r
+               delete []tt;\r
        }\r
        else    {       delete r;       r=0;    }\r
        return r;\r
@@ -1381,55 +1599,63 @@ HADT MGL_EXPORT mgl_datac_tridmat(HCDT A, HCDT B, HCDT C, HCDT D, const char *ho
        if(mglchr(how,'x') && (na==nn || na==np || na==nx))\r
 #pragma omp parallel\r
        {\r
-               mglDataC T(nx,4);       dual *uu=T.a+(per?3:2)*nx;\r
+               dual *tt = new dual[4*nx], *uu=tt+(per?3:2)*nx;\r
+//             mglDataC T(nx,4);       dual *uu=T.a+(per?3:2)*nx;\r
 #pragma omp for collapse(2)\r
                for(long k=0;k<nz;k++)  for(long j=0;j<ny;j++)\r
                {\r
                        long i0=0, i1=nx*(j+ny*k);\r
                        if(na==nn)      i0=i1;  else if(na==np) i0=nx*j;\r
-                       if(per) mgl_progonka_pc(A,B,C,D,T.a,nx,i1,i0,1,difr);\r
-                       else    mgl_progonka_sc(A,B,C,D,T.a,nx,i1,i0,1,difr);\r
+                       if(per) mgl_progonka_pc(A,B,C,D,tt,nx,i1,i0,1,difr);\r
+                       else    mgl_progonka_sc(A,B,C,D,tt,nx,i1,i0,1,difr);\r
                        for(long i=0;i<nx;i++)  r->a[i+i1] = uu[i];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'y') && (na==nn || na==np || na==ny))\r
 #pragma omp parallel\r
        {\r
-               mglDataC T(ny,4);       dual *uu=T.a+(per?3:2)*ny;\r
+               dual *tt = new dual[4*ny], *uu=tt+(per?3:2)*ny;\r
+//             mglDataC T(ny,4);       dual *uu=T.a+(per?3:2)*ny;\r
 #pragma omp for collapse(2)\r
                for(long k=0;k<nz;k++)  for(long i=0;i<nx;i++)\r
                {\r
                        long i0=0, i1 = i+np*k;\r
                        if(na==nn)      i0=i1;  else if(na==np) i0=i;\r
-                       if(per) mgl_progonka_pc(A,B,C,D,T.a,ny,i1,i0,nx,difr);\r
-                       else    mgl_progonka_sc(A,B,C,D,T.a,ny,i1,i0,nx,difr);\r
+                       if(per) mgl_progonka_pc(A,B,C,D,tt,ny,i1,i0,nx,difr);\r
+                       else    mgl_progonka_sc(A,B,C,D,tt,ny,i1,i0,nx,difr);\r
                        i0 = i+np*k;\r
                        for(long j=0;j<ny;j++)  r->a[j*nx+i0] = uu[j];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'z') && (na==nn || na==nz))\r
 #pragma omp parallel\r
        {\r
-               mglDataC T(nz,4);       dual *uu=T.a+(per?3:2)*nz;\r
+               dual *tt = new dual[4*nz], *uu=tt+(per?3:2)*ny;\r
+//             mglDataC T(nz,4);       dual *uu=T.a+(per?3:2)*nz;\r
 #pragma omp for collapse(2)\r
                for(long j=0;j<ny;j++)  for(long i=0;i<nx;i++)\r
                {\r
                        long i0 = na==nn?i+nx*j:0, i1 = i+nx*j;\r
-                       if(per) mgl_progonka_pc(A,B,C,D,T.a,nz,i1,i0,np,difr);\r
-                       else    mgl_progonka_sc(A,B,C,D,T.a,nz,i1,i0,np,difr);\r
+                       if(per) mgl_progonka_pc(A,B,C,D,tt,nz,i1,i0,np,difr);\r
+                       else    mgl_progonka_sc(A,B,C,D,tt,nz,i1,i0,np,difr);\r
                        for(long k=0;k<nz;k++)  r->a[k*np+i1] = uu[k];\r
                }\r
+               delete []tt;\r
        }\r
        else if(mglchr(how,'h') && ny==nx && (na==nn || na==np) && nx>1)\r
 #pragma omp parallel\r
        {\r
-               mglDataC T(np,2);\r
+               dual *tt = new dual[2*np];\r
+//             mglDataC T(np,2);\r
 #pragma omp for\r
                for(long k=0;k<nz;k++)\r
                {\r
-                       mgl_progonka_hc(A,B,C,D,T.a,nx,k*np, na==nn ? k*np:0,difr);\r
-                       memcpy(r->a+k*np, T.a+np, np*sizeof(dual));\r
+                       mgl_progonka_hc(A,B,C,D,tt,nx,k*np, na==nn ? k*np:0,difr);\r
+                       memcpy(r->a+k*np, tt+np, np*sizeof(dual));\r
                }\r
+               delete []tt;\r
        }\r
        else    {       delete r;       r=0;    }\r
        return r;\r
index c17aea3bc281d91dd382721ea76f1cc64ee4f290..f05417d5d4ea8dc5222f3fd941026b7eec1c3b91 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -55,7 +55,7 @@ void mglCanvas::pxl_backgr(long id, long n, const void *)
 #pragma omp parallel for\r
 #endif\r
        for(long i=id;i<n;i+=mglNumThr)\r
-       {       unsigned char *b=GB+4*i, c[4]={b[0],b[1],b[2],b[3]}, *g=G+3*i;\r
+       {       unsigned char *b=GB+4*i, c[4]={BDef[0],BDef[1],BDef[2],BDef[3]}, *g=G+3*i;\r
                combine(c,G4+4*i);      g[0]=c[0];      g[1]=c[1];      g[2]=c[2];      }\r
 }\r
 //-----------------------------------------------------------------------------\r
index db4fd1b4c99d50cdfea3e65ed4f6e09f9c90f4af..0e243c3c8fcd78bf2f6e2a1a6f211762dd88f9fe 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -79,7 +79,7 @@ void mglCanvas::SetSize(int w,int h,bool clf)
 #pragma omp parallel for\r
        for(long i=0;i<s;i++)\r
        {       unsigned char *b=GB+4*i;\r
-               b[0]=BDef[0];   b[1]=BDef[1];   b[2]=BDef[2];   b[3]=BDef[3];   }\r
+               b[0]=BDef[0];   b[1]=BDef[1];   b[2]=BDef[2];   b[3]=0/*BDef[3]*/;      }\r
 #if MGL_HAVE_PTHREAD\r
        pthread_mutex_unlock(&mutexClf);\r
 #elif MGL_HAVE_OMP\r
@@ -316,7 +316,7 @@ void mglCanvas::CalcScr(mglPoint p, int *xs, int *ys) const
        if(ys)  *ys=int(p.y);\r
 }\r
 //-----------------------------------------------------------------------------\r
-mglPoint mglCanvas::CalcScr(mglPoint p) const\r
+mglPoint mglCanvas::CalcScr(const mglPoint &p) const\r
 {      int x,y;        CalcScr(p,&x,&y);       return mglPoint(x,y);   }\r
 //-----------------------------------------------------------------------------\r
 /*void static mgl_prm_swap(mglPrim &s1,mglPrim &s2,mglPrim *buf)\r
@@ -473,6 +473,8 @@ void mglCanvas::Finish()
                mglStartThread(&mglCanvas::pxl_memcpy,this,n);\r
        }\r
        int x2 = BBoxX2<0?Width:BBoxX2, y2 = BBoxY2<0?Height:BBoxY2;\r
+       if(x2>Width)    x2=Width;\r
+       if(y2>Height)   y2=Height;\r
        if(BBoxX1>=0 && BBoxX1<x2 && BBoxY1>=0 && BBoxY1<y2)\r
        {\r
                unsigned char ff[8]={255,255,255,255, 0,0,0,255}, *g1 = G4+BBoxX1*4-4;\r
@@ -550,6 +552,73 @@ void mglCanvas::LoadBackground(const char *fname, double alpha)
                for(long i=0;i<Width*Height;i++)        GB[4*i+3] = (unsigned char)(GB[4*i+3]*alpha);\r
 }\r
 //-----------------------------------------------------------------------------\r
+void mglCanvas::LoadBackground(const char *fname, const char *how, double alpha)\r
+{\r
+       int w,h;        // bitmap sizes\r
+       unsigned char *g=NULL;\r
+       mgl_read_image(&g,w,h,fname);\r
+       if(!g)  return;\r
+       if(alpha<1 && alpha>0)\r
+#pragma omp parallel for\r
+               for(long i=0;i<w*h;i++) g[4*i+3] = (unsigned char)(g[4*i+3]*alpha);\r
+       int ww=Width, hh=Height, ii=0, jj=0;    // canvas range\r
+       if(mglchr(how,'a'))     {       ww=inW; hh=inH; ii=inX; jj=Height-inY-inH;      }\r
+       int di = 0, dj=0;       // bitmap shift\r
+       bool center=false;\r
+       if(mglchr(how,'c'))     {       center=true;    di = (w-ww)/2;  dj = (h-hh)/2;  }\r
+       if(mglchr(how,'s'))     // spline resizing\r
+       {\r
+               double ki=double(w-1)/(ww-1), kj=double(h-1)/(hh-1);\r
+               for(int j=0;j<hh-1;j++)\r
+               {\r
+                       double tj = kj*j;\r
+                       int pj = int(tj);\r
+                       if(pj>h-1)      {       pj--;   tj=1;   }       else    tj -= pj;\r
+                       for(int i=0;i<ww-1;i++)\r
+                       {\r
+                               unsigned char *b=GB+4*(ii+i+Width*(jj+j));\r
+                               int pi = int(ki*i);\r
+                               double ti = ki*i-pi;\r
+                               const unsigned char *p=g+4*(pi+w*pj), *q=g+4*(pi+w*pj+w);\r
+                               b[0] = p[0]*(1-ti)*(1-tj) + p[4]*ti*(1-tj) + q[0]*(1-ti)*tj + q[4]*ti*tj;\r
+                               b[1] = p[1]*(1-ti)*(1-tj) + p[5]*ti*(1-tj) + q[1]*(1-ti)*tj + q[5]*ti*tj;\r
+                               b[2] = p[2]*(1-ti)*(1-tj) + p[6]*ti*(1-tj) + q[2]*(1-ti)*tj + q[6]*ti*tj;\r
+                               b[3] = p[3]*(1-ti)*(1-tj) + p[7]*ti*(1-tj) + q[3]*(1-ti)*tj + q[7]*ti*tj;\r
+                       }\r
+                       unsigned char *b=GB+4*(ii+ww-1+Width*(jj+j));\r
+                       const unsigned char *p=g+4*(w*(pj+1)-1), *q=g+4*(w*(pj+2)-1);\r
+                       b[0] = q[0]*tj + p[0]*(1-tj);\r
+                       b[1] = q[1]*tj + p[1]*(1-tj);\r
+                       b[2] = q[2]*tj + p[2]*(1-tj);\r
+                       b[3] = q[3]*tj + p[3]*(1-tj);\r
+               }\r
+       }\r
+       else if(mglchr(how,'m'))        // mosaic\r
+       {\r
+               while(di<0)     di+=w;  // stupid correction\r
+               while(dj<0)     dj+=h;\r
+               for(int j=0;j<hh;j++)\r
+               {\r
+                       int pj = (j+dj)%h;\r
+                       for(int i=0;i<ww;i++)\r
+                       {\r
+                               unsigned char *b=GB+4*(ii+i+Width*(jj+j));\r
+                               int pi = (i+di)%w;\r
+                               unsigned char *p=g+4*(pi+w*pj);\r
+                               b[0] = p[0];    b[1] = p[1];    b[2] = p[2];    b[3] = p[3];\r
+                       }\r
+               }\r
+       }\r
+       else\r
+       {\r
+               if(w<ww)        {       ww=w;   if(center)      {       ii-=di; di=0;   }       }\r
+               if(h<hh)        {       hh=h;   if(center)      {       jj-=dj; dj=0;   }       }\r
+               for(int j=0;j<hh;j++)\r
+                       memcpy(GB+4*(ii+Width*(jj+j)), g+4*(di+w*(dj+j)), 4*ww);\r
+       }\r
+       if(g)   delete []g;\r
+}\r
+//-----------------------------------------------------------------------------\r
 void mglCanvas::FillBackground(const mglColor &cc)\r
 {\r
        BDef[0] = (unsigned char)(255*cc.r);    BDef[1] = (unsigned char)(255*cc.g);\r
@@ -573,6 +642,8 @@ unsigned char **mglCanvas::GetRGBLines(long &w, long &h, unsigned char *&f, bool
        long c = alpha?4:3, d = c*Width;\r
        unsigned char *gg = (alpha?G4:G);\r
        int x2 = BBoxX2<0?Width:BBoxX2, y2 = BBoxY2<0?Height:BBoxY2;\r
+       if(x2>Width)    x2=Width;\r
+       if(y2>Height)   y2=Height;\r
        if(BBoxX1>=0 && BBoxX1<x2 && BBoxY1>=0 && BBoxY1<y2)\r
        {\r
                gg += c*BBoxX1 + d*BBoxY1;\r
index 06098615654bab908c04d2f1ce8417be1e3725e4..e4c03da91c3c69af2752a5076b9329dce8320ca7 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index ec445d230c4646cac07d1d747b815aaa79235697..3199c50fb3106773b8fa676fbc56779dd7f1f2ca 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -212,7 +212,7 @@ void MGL_EXPORT mgl_candle_xyv(HMGL gr, HCDT x, HCDT v1, HCDT v2, HCDT y1, HCDT
        {       if(d1)  delete y1;      if(d2)  delete y2;\r
                gr->SetWarn(mglWarnDim,"Candle");       return; }\r
        static int cgid=1;      gr->StartGroup("Candle",cgid++);\r
-       gr->SaveState(opt);     gr->SetPenPal(pen,&pal);\r
+       gr->SaveState(opt);     gr->SetPenPal(pen,&pal);        gr->SetMask(pen);\r
        long kq = gr->AllocPnts(8*n);\r
        bool sh = mglchr(pen,'!');\r
        bool wire = mglchr(pen,'#');\r
@@ -505,7 +505,8 @@ void MGL_EXPORT mgl_area_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c
        bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a');\r
 \r
        double z0=gr->GetOrgZ('x');\r
-       gr->SetPenPal(pen,&pal);        gr->Reserve(2*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(2*n*m);\r
+\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -556,7 +557,7 @@ void MGL_EXPORT mgl_area_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char
        mglPoint nn(0,0,1);\r
        bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a');\r
 \r
-       gr->SetPenPal(pen,&pal);        gr->Reserve(2*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(2*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -697,7 +698,7 @@ void MGL_EXPORT mgl_region_3d(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT
 //     bool inside = (mglchr(pen,'i'));        // NOTE: check if 'i' is free (used here for inside flag)\r
        bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a');\r
 \r
-       gr->SetPenPal(pen,&pal);        gr->Reserve(2*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(2*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -761,7 +762,7 @@ void MGL_EXPORT mgl_region_xy(HMGL gr, HCDT x, HCDT y1, HCDT y2, const char *pen
        bool inside = mglchr(pen,'i');  // NOTE: check if 'i' is free (used here for inside flag)\r
        bool sh = mglchr(pen,'!'), wire = mglchr(pen,'#'), orig = !mglchr(pen,'a');\r
 \r
-       gr->SetPenPal(pen,&pal);        gr->Reserve(2*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(2*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -969,6 +970,92 @@ void MGL_EXPORT mgl_step_(uintptr_t *gr, uintptr_t *y,     const char *pen, const ch
 //     Stem series\r
 //\r
 //-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_xyz(HMGL gr, HCDT x1, HCDT y1, HCDT z1, HCDT x2, HCDT y2, HCDT z2, const char *pen, const char *opt)\r
+{\r
+       long m,n=y1->GetNx(), pal;\r
+       if(mgl_check_dim1(gr,x1,y1,z1,x2,"Lines"))      return;\r
+       if(mgl_check_dim1(gr,x2,y2,z2,NULL,"Lines"))    return;\r
+       if(x1->GetNy()!=x2->GetNy() || y1->GetNy()!=y2->GetNy() || z1->GetNy()!=z2->GetNy())    return;\r
+\r
+       gr->SaveState(opt);\r
+       static int cgid=1;      gr->StartGroup("Lines",cgid++);\r
+       m = x1->GetNy() > y1->GetNy() ? x1->GetNy() : y1->GetNy();      m = z1->GetNy() > m ? z1->GetNy() : m;\r
+       bool sh = mglchr(pen,'!');\r
+\r
+       gr->SetPenPal(pen,&pal);        gr->Reserve(2*n*m);\r
+       for(long j=0;j<m;j++)\r
+       {\r
+               if(gr->NeedStop())      break;\r
+               long mx = j<x1->GetNy() ? j:0, my = j<y1->GetNy() ? j:0, mz = j<z1->GetNy() ? j:0;\r
+               double c1=gr->NextColor(pal), c2=c1;\r
+               if(gr->GetNumPal(pal)==2*m && !sh)      c2=gr->NextColor(pal);\r
+               long kq = gr->AllocPnts(2*n);\r
+#pragma omp parallel for\r
+               for(long i=0;i<n;i++)\r
+               {\r
+                       double cc=gr->NextColor(pal,i);\r
+                       gr->AddPntQ(kq+2*i,mglPoint(x1->v(i,mx), y1->v(i,my), z1->v(i,mz)),sh?cc:c1);\r
+                       gr->AddPntQ(kq+2*i+1,mglPoint(x2->v(i,mx), y2->v(i,my), z2->v(i,mz)),sh?cc:c2);\r
+               }\r
+               for(long i=0;i<n;i++)\r
+               {\r
+                       long iq = kq+2*i;       gr->line_plot(iq,iq+1);\r
+                       gr->arrow_plot(iq,iq+1,gr->Arrow2);\r
+                       gr->arrow_plot(iq+1,iq,gr->Arrow1);\r
+               }\r
+       }\r
+       gr->EndGroup();\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_xy(HMGL gr, HCDT x1, HCDT y1, HCDT x2, HCDT y2, const char *pen, const char *opt)\r
+{\r
+       gr->SaveState(opt);\r
+       mglDataV z(y1->GetNx());        z.Fill(gr->Min.z,gr->Min.z);\r
+       mgl_lines_xyz(gr,x1,y1,&z,x2,y2,&z,pen,0);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_x(HMGL gr, HCDT x1, HCDT x2, const char *pen, const char *opt)\r
+{\r
+       gr->SaveState(opt);\r
+       mglDataV y(x1->GetNx()), z(x1->GetNx());\r
+       y.Fill(gr->Min.y,gr->Max.y);\r
+       z.Fill(gr->Min.z,gr->Min.z);\r
+       mgl_lines_xyz(gr,x1,&y,&z,x2,&y,&z,pen,0);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines(HMGL gr, HCDT y1, HCDT y2, const char *pen, const char *opt)\r
+{\r
+       gr->SaveState(opt);\r
+       mglDataV x(y1->GetNx()), z(y1->GetNx());\r
+       x.Fill(gr->Min.x,gr->Max.x);\r
+       z.Fill(gr->Min.z,gr->Min.z);\r
+       mgl_lines_xyz(gr,&x,y1,&z,&x,y2,&z,pen,0);\r
+}\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_xyz_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *z1, uintptr_t *x2, uintptr_t *y2, uintptr_t *z2, const char *pen, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,pen,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_lines_xyz(_GR_,_DA_(x1),_DA_(y1),_DA_(z1),_DA_(x2),_DA_(y2),_DA_(z2),s,o);  delete []o;     delete []s;     }\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_xy_(uintptr_t *gr, uintptr_t *x1, uintptr_t *y1, uintptr_t *x2, uintptr_t *y2, const char *pen, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,pen,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_lines_xy(_GR_,_DA_(x1),_DA_(y1),_DA_(x2),_DA_(y2),s,o);     delete []o;     delete []s;     }\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_x_(uintptr_t *gr, uintptr_t *x1,     uintptr_t *x2,  const char *pen, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,pen,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_lines_x(_GR_,_DA_(x1),_DA_(x2),s,o);        delete []o;     delete []s;     }\r
+//-----------------------------------------------------------------------------\r
+void MGL_EXPORT mgl_lines_(uintptr_t *gr, uintptr_t *y1,       uintptr_t *y2,  const char *pen, const char *opt,int l,int lo)\r
+{      char *s=new char[l+1];  memcpy(s,pen,l);        s[l]=0;\r
+       char *o=new char[lo+1]; memcpy(o,opt,lo);       o[lo]=0;\r
+       mgl_lines(_GR_,_DA_(y1),_DA_(y2),s,o);  delete []o;     delete []s;     }\r
+//-----------------------------------------------------------------------------\r
+//\r
+//     Stem series\r
+//\r
+//-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_stem_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, const char *opt)\r
 {\r
        long m,n=y->GetNx(), pal;\r
@@ -1096,8 +1183,7 @@ void MGL_EXPORT mgl_bars_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c
        }\r
        if(dc==0)       fixed=false;    // NOTE: disable fixed width if it is zero\r
 \r
-       gr->SetPenPal(pen,&pal);\r
-       gr->Reserve(4*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(4*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -1181,8 +1267,7 @@ void MGL_EXPORT mgl_bars_xy(HMGL gr, HCDT x, HCDT y, const char *pen, const char
        }\r
        if(dx==0)       fixed=false;    // NOTE: disable fixed width if it is zero\r
 \r
-       gr->SetPenPal(pen,&pal);\r
-       gr->Reserve(4*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(4*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -1287,8 +1372,7 @@ void MGL_EXPORT mgl_barh_yx(HMGL gr, HCDT y, HCDT v, const char *pen, const char
        }\r
        if(dy==0)       fixed=false;    // NOTE: disable fixed width if it is zero\r
 \r
-       gr->SetPenPal(pen,&pal);\r
-       gr->Reserve(4*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(4*n*m);\r
        for(long j=0;j<m;j++)\r
        {\r
                if(gr->NeedStop())      break;\r
@@ -1765,7 +1849,7 @@ void MGL_EXPORT mgl_error_exy_(uintptr_t *gr, uintptr_t *x, uintptr_t *y, uintpt
 //             Chart series\r
 //\r
 //-----------------------------------------------------------------------------\r
-void face_plot(mglBase *gr, mglPoint o, mglPoint d1, mglPoint d2, double c, bool wire)\r
+void face_plot(mglBase *gr, const mglPoint &o, mglPoint d1, mglPoint d2, double c, bool wire)\r
 {\r
        const int num=10;\r
        mglPoint nn=d1^d2;\r
@@ -1818,6 +1902,7 @@ void MGL_EXPORT mgl_chart(HMGL gr, HCDT a, const char *cols, const char *opt)
 \r
        double dy = (gr->Max.y-gr->Min.y)/a->GetNy(), dx, ss, cs, x1, y1, dz=gr->Max.z-gr->Min.z, vv;\r
        mglPoint d1,d2,o;\r
+       gr->SetMask(cols);\r
 \r
        for(j=0;j<a->GetNy();j++)\r
        {\r
@@ -2064,7 +2149,7 @@ void MGL_EXPORT mgl_tape_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, const char *pen, c
        double rr = gr->SaveState(opt);\r
        if(rr==0 || mgl_isnan(rr))      rr = mgl_norm(gr->Max-gr->Min)*gr->BarWidth/25;\r
        m = x->GetNy() > y->GetNy() ? x->GetNy() : y->GetNy();  m = z->GetNy() > m ? z->GetNy() : m;\r
-       gr->SetPenPal(pen,&pal);        gr->Reserve(4*n*m);\r
+       gr->SetPenPal(pen,&pal);        gr->SetMask(pen);       gr->Reserve(4*n*m);\r
        mglPoint qn(NAN,NAN);\r
        bool sh = mglchr(pen,'!'), xo = mglchr(pen,'x'), zo = mglchr(pen,'z'), wire = mglchr(pen,'#');\r
        if(!xo && !zo)  xo = zo = true;\r
index 49f742cdddc08b93aebea09b8aed47c78ad7637b..1525580b469527a57169f110b5445add62e5a742 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -313,7 +313,7 @@ void MGL_EXPORT mgl_write_prc(HMGL gr, const char *fname,const char* /*descr*/,
                                PNG_FILTER_TYPE_DEFAULT);\r
                png_set_rows(png_ptr, info_ptr, pbuf);\r
                png_write_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, 0);\r
-               png_write_end(png_ptr, info_ptr);\r
+//             png_write_end(png_ptr, info_ptr);\r
 \r
                png_destroy_write_struct(&png_ptr, &info_ptr);\r
                delete []pbuf;  delete []buf;\r
index 27815081213753482e79a87b1943b3d8b1f9fb1d..14dc2082187c238f552aecdd1bdf9a84f5cc2fed 100644 (file)
@@ -4,16 +4,16 @@
 *   Copyright (C) 2008  Orest Shardt <shardtor (at) gmail dot com>
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
@@ -59,7 +59,7 @@ void PRCbitStream::compress()
     ++chunks;
     // strm.avail_out should be 0 if we got Z_OK
     compressedDataSize = sizeAvailable - strm.avail_out;
-    compressedData = (uint8_t*) realloc(compressedData,CHUNK*chunks);
+    compressedData = (uint8_t*)realloc(compressedData,CHUNK*chunks);
     strm.next_out = (Bytef*)(compressedData + compressedDataSize);
     strm.avail_out += CHUNK;
     sizeAvailable += CHUNK;
index f240baf1eaf99689a549ca366ad5d096ebb01560..58a4f68a008ed932db0086827f851fc3674379f4 100644 (file)
@@ -4,16 +4,16 @@
 *   Copyright (C) 2008  Orest Shardt <shardtor (at) gmail dot com>
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
index d9f758959687e5344e4cebf327f06d187f997170..70a0d206b9e265fbb65bf23aa6324ae55fd42a7f 100644 (file)
@@ -5,16 +5,16 @@
 *   with enhancements contributed by Michail Vidiassov.
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
index 33f97dbefe38e8a3d61a83fb661bcc2850bb9e17..053143f11daedfb76ea7b99899b8657bf17aebf4 100644 (file)
@@ -4,16 +4,16 @@
 *   Copyright (C) 2008  Orest Shardt <shardtor (at) gmail dot com>
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
index 098b4b76ac42d98eb7c95c531f4ce18f69e76332..a4c27199e9437b43c09a9d9902d6ed0a0e96f60d 100644 (file)
@@ -5,16 +5,16 @@
 *   with enhancements contributed by Michail Vidiassov.
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
index f09b55e570e146ea40b66d033ff1b856b2fc7d40..d0b4e0ea470bc77322cfc39c92d6b44366536cca 100644 (file)
@@ -4,16 +4,16 @@
 *   Copyright (C) 2008  Orest Shardt <shardtor (at) gmail dot com>
 *
 *   This program is free software: you can redistribute it and/or modify
-*   it under the terms of the GNU Lesser General Public License as published by
+*   it under the terms of the GNU Lesser General Public License  as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program 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 Lesser General Public License for more details.
+*   GNU Lesser General Public License  for more details.
 *
-*   You should have received a copy of the GNU Lesser General Public License
+*   You should have received a copy of the GNU Lesser General Public License 
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 *************/
index a812afeecb675606e6bda1c6aa721bbbebf2375b..2e963ad340343baebda0cbc79a7ea0878341f2ad 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -139,7 +139,7 @@ void MGL_EXPORT mgl_face(HMGL gr, double x0, double y0, double z0, double x1, do
 {\r
        static int cgid=1;      gr->StartGroup("Face",cgid++);\r
        long pal;\r
-       gr->SetPenPal(stl,&pal);\r
+       gr->SetPenPal(stl,&pal);        gr->SetMask(stl);\r
 //     mreal c1,c2,c3,c4,zz=(gr->Min.z+gr->Max.z)/2;\r
        mreal c1,c2,c3,c4,zz=2*gr->Max.z-gr->Min.z;\r
        c1=c2=c3=c4=gr->CDef;\r
@@ -383,7 +383,7 @@ void MGL_EXPORT mgl_polygon(HMGL gr, double x1, double y1, double z1, double x2,
        if(n<3) return;\r
        long pal=0, n0;\r
        static int cgid=1;      gr->StartGroup("Polygon",cgid++);\r
-       gr->SetPenPal(stl,&pal);\r
+       gr->SetPenPal(stl,&pal);        gr->SetMask(stl);\r
        mreal c=gr->NextColor(pal);\r
        mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');\r
        bool fill = !mglchr(stl,'#'), box = mglchr(stl,'@') || !fill;\r
@@ -465,7 +465,7 @@ void MGL_EXPORT mgl_ellipse(HMGL gr, double x1, double y1, double z1, double x2,
        const int n = 41;\r
        long pal=0,n0;\r
        static int cgid=1;      gr->StartGroup("Ellipse",cgid++);\r
-       gr->SetPenPal(stl,&pal);\r
+       gr->SetPenPal(stl,&pal);        gr->SetMask(stl);\r
        mreal c=gr->NextColor(pal), d;\r
        mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');\r
        bool fill = !mglchr(stl,'#'), box = mglchr(stl,'@') || !fill;\r
@@ -513,7 +513,7 @@ void MGL_EXPORT mgl_rhomb(HMGL gr, double x1, double y1, double z1, double x2, d
 {\r
        long pal=0;\r
        static int cgid=1;      gr->StartGroup("Rhomb",cgid++);\r
-       gr->SetPenPal(stl,&pal);\r
+       gr->SetPenPal(stl,&pal);        gr->SetMask(stl);\r
        mreal c=gr->NextColor(pal);\r
        mreal k=(gr->GetNumPal(pal)>1)?gr->NextColor(pal):gr->AddTexture('k');\r
        mreal b=(gr->GetNumPal(pal)>2)?gr->NextColor(pal):c;\r
diff --git a/src/random.cpp b/src/random.cpp
new file mode 100644 (file)
index 0000000..4cb7be1
--- /dev/null
@@ -0,0 +1,358 @@
+/***************************************************************************
+ * random.cpp is part of Math Graphic Library                              *
+ * Copyright (C) 2020-??? Diego Sejas Viscarra <dsejas.math@pm.me>,        *
+ *                        Alexey Balakin <mathgl.abalakin@gmail.ru>        *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU Lesser General Public License  as       *
+ *   published by the Free Software Foundation; either version 3 of the    *
+ *   License, or (at your option) any later version.                       *
+ *                                                                         *
+ *   This program 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 Lesser General Public     *
+ *   License along with this program; if not, write to the                 *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include <math.h>
+#include <mgl2/data.h>
+#include <mgl2/parser.h>
+//-----------------------------------------------------------------------------
+//
+//     Basic random functions
+// The following code is partially based on the book 
+// "Introduction to Programming in Python. An Interdisciplinary Approach," 
+// by Robert Sedgewick, Kevin Wayne, and Robert Dondero. 
+// A copy of the book can be obtained at https://introcs.cs.princeton.edu/python/home/
+//
+//-----------------------------------------------------------------------------
+mreal MGL_EXPORT mgl_rnd_integer(long lo, long hi)
+{      return round((hi - lo)*mgl_rnd() + lo); }
+double MGL_EXPORT mgl_rnd_integer_(int *lo, int *hi)
+{      return mgl_rnd_integer(*lo, *hi);       }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_integer(HMDT d, long lo, long hi)
+{
+       const long n = d->GetNN(), da=hi-lo;
+       for (long i=0; i<n; i++)    d->a[i] = round(da*mgl_rnd() + lo);
+}
+void MGL_EXPORT mgl_data_rnd_integer_(uintptr_t *d, int *lo, int *hi)
+{      mgl_data_rnd_integer(_DT_,*lo,*hi);     }
+//-----------------------------------------------------------------------------
+mreal MGL_EXPORT mgl_rnd_uniform(mreal lo, mreal hi)
+{      return (hi - lo) * mgl_rnd() + lo;      }
+double MGL_EXPORT mgl_rnd_uniform_(double *lo, double *hi)
+{      return mgl_rnd_uniform(*lo,*hi);        }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_uniform(HMDT d, mreal lo, mreal hi)
+{
+       const long n = d->GetNN();
+       const mreal da = hi-lo;
+       for (long i=0; i<n; i++)    d->a[i] = da*mgl_rnd() + lo;
+}
+void MGL_EXPORT mgl_data_rnd_uniform_(uintptr_t *d, double *lo, double *hi)
+{      mgl_data_rnd_uniform(_DT_,*lo,*hi);     }
+//-----------------------------------------------------------------------------
+mreal MGL_EXPORT mgl_rnd_bernoulli(mreal p)
+{      return (mgl_rnd() < p)? 1:0;    }
+double MGL_EXPORT mgl_rnd_bernoulli_(double *p)
+{      return mgl_rnd_bernoulli(*p);   }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_bernoulli(HMDT d, mreal p=0.5)
+{
+       const long n = d->GetNN();
+       for (long i=0; i<n; i++)    d->a[i] = (mgl_rnd() < p)? 1:0;
+}
+void MGL_EXPORT mgl_data_rnd_bernoulli_(uintptr_t *d, double *p)
+{      mgl_data_rnd_bernoulli(_DT_,*p);        }
+//-----------------------------------------------------------------------------
+long MGL_EXPORT mgl_rnd_binomial(long trials, mreal p)
+{
+       long heads=0;
+       for(long i=0; i<trials; i++)
+               if(mgl_rnd()<p)  heads++;
+       return heads;
+}
+int MGL_EXPORT mgl_rnd_binomial_(int *trials, double *p)
+{      return mgl_rnd_binomial(*trials, *p);   }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_binomial(HMDT d, long trials, mreal p=0.5)
+{
+       const long n = d->GetNN();
+       for (long i=0; i<n; i++)    d->a[i] = mgl_rnd_binomial(trials, p);
+}
+void MGL_EXPORT mgl_data_rnd_binomial_(uintptr_t *d, double *p)
+{      mgl_data_rnd_binomial(_DT_,*p); }
+//-----------------------------------------------------------------------------
+mreal MGL_EXPORT mgl_rnd_gaussian(mreal mu, mreal sigma)
+{
+       mreal x, y, r=0.0;
+       while (r >= 1 || r == 0)
+       {
+               x = 2.0 * mgl_rnd() - 1.0;
+               y = 2.0 * mgl_rnd() - 1.0;
+               r = x*x + y*y;
+       }
+       return mu + sigma * x * sqrt(-2.0 * log(r) / r);
+}
+double MGL_EXPORT mgl_rnd_gaussian_(double *mu, double *sigma)
+{      return mgl_rnd_gaussian(*mu, *sigma);   }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_gaussian(HMDT d, mreal mu=0.0, mreal sigma=1.0)
+{
+       const long n = d->GetNN();
+       for (long i=0; i<n; i++)    d->a[i] = mgl_rnd_gaussian(mu, sigma);
+}
+void MGL_EXPORT mgl_data_rnd_gaussian_(uintptr_t *d, double *mu, double *s)
+{      mgl_data_rnd_gaussian(_DT_,*mu,*s);     }
+//-----------------------------------------------------------------------------
+mreal MGL_EXPORT mgl_rnd_exponential(mreal lambda)
+{      return -log(1.0 - mgl_rnd()) / lambda;  }
+double MGL_EXPORT mgl_rnd_exponential_(double *lambda)
+{      return mgl_rnd_exponential(*lambda);    }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_exponential(HMDT d, mreal lambda)
+{
+       const long n = d->GetNN();
+       for (long i=0; i<n; i++)    d->a[i] = -log(1.0 - mgl_rnd()) / lambda;
+}
+void MGL_EXPORT mgl_data_rnd_exponential_(uintptr_t *d, double *l)
+{      mgl_data_rnd_exponential(_DT_,*l);      }
+//-----------------------------------------------------------------------------
+long MGL_EXPORT mgl_rnd_discrete(HCDT A) // this assumes A to be 1d
+{
+       long n=A->GetNx();
+       mreal amax=0.0, sum_prob=0.0;
+
+       mreal *sum = new mreal[n];
+       for(long i=0; i<n; i++)
+       {       sum[i] = amax;  amax += A->v(i);        }
+
+       mreal r=amax*mgl_rnd();
+//     for(i=0; i<n; i++)
+//     {
+//             sum_prob += A->v(i);
+//             if(sum_prob > r)   break;
+//     }
+       long i1=0,i2=n-1,i=0;
+       while(i2>i1+1)
+       {
+               i = (i1+i2)/2;
+               if(sum[i]<r)    i1=i;   else    i2=i;
+       }
+       delete []sum;
+       return i+1;
+}
+double MGL_EXPORT mgl_rnd_discrete_(uintptr_t *d)
+{      return mgl_rnd_discrete(_DT_);  }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_data_rnd_discrete(HMDT d, HCDT a)
+{
+       if (!d || !a)    return;
+       const long m = d->GetNN(), n=a->GetNx();
+       mreal amax=0;
+       mreal *sum = new mreal[n];
+       for(long i=0; i<n; i++)
+       {       sum[i] = amax;  amax += a->v(i);        }
+#pragma omp parallel for
+       for(long j=0;j<m;j++)
+       {
+               mreal r=amax*mgl_rnd();
+               long i1=0,i2=n-1,i=0;
+               while(i2>i1+1)
+               {
+                       i = (i1+i2)/2;
+                       if(sum[i]<r)    i1=i;   else    i2=i;
+               }
+               d->a[j] = i+1;
+       }
+       delete []sum;
+}
+void MGL_EXPORT mgl_data_rnd_discrete_(uintptr_t *d, uintptr_t *a)
+{      mgl_data_rnd_discrete(_DT_,_DM_(a));    }
+//-----------------------------------------------------------------------------
+void MGL_EXPORT mgl_shuffle(HMDT d, char dir)
+{
+       if(dir=='x')
+       {
+               long n = d->GetNx(), m = d->ny*d->nz;
+               for(long i=0;i<n-1;i++)
+               {
+                       long j = long((n-i)*mgl_rnd() + i);
+                       for(long k=0;k<m;k++)
+                       {       long ii = i+k*n, jj = j+k*n;
+                               mreal temp = d->a[ii];  d->a[ii] = d->a[jj];    d->a[jj] = temp;        }
+               }
+       }
+       if(dir=='y')
+       {
+               long n = d->GetNy(), m = d->nx, l = d->nz;
+               for(long i=0;i<n-1;i++)
+               {
+                       long j = long((n-i)*mgl_rnd() + i);
+                       for(long q=0;q<l;q++)   for(long k=0;k<m;k++)
+                       {       long ii = k+m*(i+q*n), jj = k+m*(j+q*n);
+                               mreal temp = d->a[ii];  d->a[ii] = d->a[jj];    d->a[jj] = temp;        }
+               }
+       }
+       if(dir=='z')
+       {
+               long n = d->GetNz(), m = d->ny*d->nx;
+               for(long i=0;i<n-1;i++)
+               {
+                       long j = long((n-i)*mgl_rnd() + i);
+                       for(long k=0;k<m;k++)
+                       {       long ii = m*i+k, jj = m*j+k;
+                               mreal temp = d->a[ii];  d->a[ii] = d->a[jj];    d->a[jj] = temp;        }
+               }
+       }
+       if(dir=='a')
+       {
+               long n = d->GetNN();
+               for(long i=0;i<n-1;i++)
+               {
+                       long j = long((n-i)*mgl_rnd() + i);
+                       mreal temp = d->a[i];   d->a[i] = d->a[j];      d->a[j] = temp;
+               }
+       }
+}
+void MGL_EXPORT mgl_shuffle_(uintptr_t *d, char *dir, int)
+{      mgl_shuffle(_DT_,*dir); }
+//-----------------------------------------------------------------------------
+void MGL_NO_EXPORT mgl_fill_brownian(HMDT d, long n1, long n2, mreal sigma, mreal alpha)
+{
+       if (n1+1<n2)
+       {
+               long n = d->nx, nn = d->ny*d->nz, m = (n1+n2)/2;
+               for(long i=0;i<nn;i++)
+               {
+                       mreal delta = mgl_rnd_gaussian(0, sigma);
+                       d->a[m+n*i] = (d->a[n1+n*i]+d->a[n2+n*i])/2 + delta;
+               }
+               mgl_fill_brownian(d, n1, m, sigma/alpha, alpha);        // NOTE: probably stack overflow for huge d->nx
+               mgl_fill_brownian(d, m, n2, sigma/alpha, alpha);
+       }
+}
+void MGL_EXPORT mgl_data_brownian(HMDT d, mreal y1, mreal y2, mreal sigma, mreal alpha)
+{
+       long n = d->nx, nn = d->ny*d->nz;
+       for(long i=0;i<nn;i++)  {       d->a[n*i] = y1;   d->a[n*(i+1)-1] = y2; }
+       mgl_fill_brownian(d, 0, n-1, sigma, alpha);
+}
+void MGL_EXPORT mgl_data_brownian_(uintptr_t *d, double *y1, double *y2, double *sigma, double *alpha)
+{      mgl_data_brownian(_DT_,*y1,*y2,*sigma,*alpha);  }
+//-----------------------------------------------------------------------------
+//
+//     MGL commands
+//
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_integer(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dnn"))     d->RndInteger(mgl_int(a[1].v), mgl_int(a[2].v));
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_uniform(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dnn"))     d->RndUniform(a[1].v,a[2].v);
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_bernoulli(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dn"))      d->RndBernoulli(a[1].v);
+       else if (d && !strcmp(k, "d"))  d->RndBernoulli();
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_binomial(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dnn"))     d->RndBinomial(mgl_int(a[1].v),a[2].v);
+       else if (d && !strcmp(k, "dn")) d->RndBinomial(mgl_int(a[1].v));
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_gaussian(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dnn"))     d->RndGaussian(a[1].v,a[2].v);
+       else if (d && !strcmp(k, "d"))  d->RndGaussian();
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_exponential(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dn"))      d->RndExponential(a[1].v);
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_data_rnd_discrete(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dd"))      mgl_data_rnd_discrete(d, a[1].d);
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_shuffle(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "ds"))      d->RndShuffle(a[1].s[0]);
+       else if (d && !strcmp(k, "d"))  d->RndShuffle();
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+int MGL_NO_EXPORT mgls_brownian(mglGraph *, long, mglArg *a, const char *k, const char *)
+{
+       int res=0;
+       if(k[0]=='d' && a[0].d->temp)   return 5;
+       mglData *d = dynamic_cast<mglData*>(a[0].d);
+       if (d && !strcmp(k, "dnnnn"))   d->RndBrownian(a[1].v,a[2].v,a[3].v,a[4].v);
+       else    res = 1;
+       return res;
+}
+//-----------------------------------------------------------------------------
+mglCommand mgls_rnd_cmd[] = {
+       {"bernoulli", _("Fills by random numbers according to Bernoulli distribution with probability p"), "bernoulli A [p]", mgls_data_rnd_bernoulli, 3},
+       {"binomial", _("Fills by random numbers according to binomial distribution in n coin flips with probability p"), "binomial A n [p]", mgls_data_rnd_binomial, 3},
+       {"brownian", _("Fills by fractional brownian motion"), "brownian A y1 y2 sigma h", mgls_brownian, 3},
+       {"discrete", _("Fills by random numbers according to discrete distribution"), "discrete A D", mgls_data_rnd_discrete, 3},
+       {"exponential", _("Fills by random numbers according to exponential distribution with probability p"), "exponential A p", mgls_data_rnd_exponential, 3},
+       {"gaussian", _("Fills by random numbers according to Gaussian distribution"), "gaussian A [mu sigma]", mgls_data_rnd_gaussian, 3},
+       {"shuffle", _("Shuffle data cells (for dir='a') or slices (for dir='xyz')"), "shuffle A ['dir']", mgls_shuffle, 3},
+       {"uniform", _("Fills by random numbers uniformly chosen in [lo,hi)"), "uniform A lo hi", mgls_data_rnd_uniform, 3},
+       {"uniformint", _("Fills by random integers uniformly chosen in [lo, hi)"), "uniformint A lo hi", mgls_data_rnd_integer, 3},
+{"","","",NULL,0}};
+//-----------------------------------------------------------------------------
index 8f1567e1c070491013cace8afd78d3b7f12567bd..7c82fb56379ef31dd8cdaa26e1b24333ab90410c 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -40,7 +40,7 @@ void static mgl_mesh_plot(mglBase *gr, long kq, long n, long m, int how)
                long s=0;\r
                for(long j=0;j<m-1;j++)\r
                {       long iq=kq+i+n*j;       if(gr->ValidPnt(iq) && gr->ValidPnt(iq+n))      s++;    }\r
-               d = gr->FaceNum>0 ? gr->FaceNum+1 : n;  s = s>d?s/d:1;\r
+               d = gr->FaceNum>0 ? gr->FaceNum+1 : m;  s = s>d?s/d:1;\r
                gr->curve_plot(1+(m-1)/s,kq+i,n*s);\r
        }\r
 }\r
@@ -66,8 +66,6 @@ void static mgl_surf_plot(mglBase *gr, long kq, long n, long m)
 //     Plot by formulas series\r
 //\r
 //-----------------------------------------------------------------------------\r
-HMDT MGL_NO_EXPORT mglFormulaCalc(const char *str, const std::vector<mglDataA*> &head);\r
-//-----------------------------------------------------------------------------\r
 void MGL_EXPORT mgl_fsurf(HMGL gr, const char *eqZ, const char *sch, const char *opt)\r
 {      // NOTE Strong function variation analysis can be added here\r
        if(eqZ==0 || eqZ[0]==0) return;         // nothing to plot\r
index 86deba28bd475d631c4e18fbff411c4c92e07af1..8177b8758d579ca3deace455b20125ff679da7e9 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -20,7 +20,7 @@
 #include "mgl2/font.h"
 
 /// Table of LaTeX symbols and its UTF8 codes. This array MUST BE sorted!!!
-const size_t mgl_tex_num=1924;
+const size_t mgl_tex_num=1925;
 const mglTeXsymb mgl_tex_symb[] = {
        {0x23, L"#"},
        {0x25, L"%"},
@@ -1201,7 +1201,7 @@ const mglTeXsymb mgl_tex_symb[] = {
        {0x2a35, L"otimesrhrim"},
        {0x23de, L"overbrace"},
        {0x23b4, L"overbracket"},
-       {0x203e, L"overline"},
+//     {0x203e, L"overline"},
        {0x23dc, L"overparen"},
        {0x220b, L"owns"},
        {0x2225, L"parallel"},
index a70a0e0e31b1dfc6682fa4d5605bdb7619b4c23a..0ba89a716df66a7346f7963a500fea234502d299 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
@@ -122,13 +122,13 @@ void MGL_EXPORT mgl_vect_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const cha
        if(tx<1)        tx=1;\r
        if(ty<1)        ty=1;\r
 \r
-       double xm=0,cm=0,ca=0;\r
+       double xm=0,cm=0;\r
        double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5;\r
        // use whole array for determining maximal vectors length\r
 #pragma omp parallel\r
        {\r
                double xm1=0,cm1=0,xx,c1,c2;\r
-#pragma omp for nowait collapse(3) reduction(+:ca)\r
+#pragma omp for nowait collapse(3)\r
                for(long k=0;k<l;k++)   for(long j=0;j<m;j+=ty) for(long i=0;i<n;i+=tx)\r
                {\r
                        mglPoint d(GetX(x,i,j,k).x, GetY(y,i,j,k).x),p1;\r
@@ -138,12 +138,11 @@ void MGL_EXPORT mgl_vect_xy(HMGL gr, HCDT x, HCDT y, HCDT ax, HCDT ay, const cha
                        c1 = fabs(v*p1);        xx = p1.norm(); c1 *= xx?1/(xx*xx):0;\r
                        p1 = j<m-1 ? mglPoint(GetX(x,i,j+ty,k).x, GetY(y,i,j+ty,k).x)-d : d-mglPoint(GetX(x,i,j-ty,k).x, GetY(y,i,j-ty,k).x);\r
                        c2 = fabs(v*p1);        xx = p1.norm(); c2 *= xx?1/(xx*xx):0;\r
-                       c1 = c1<c2 ? c2:c1;     ca+=c1; cm1 = cm1<c1 ? c1:cm1;\r
+                       c1 = c1<c2 ? c2:c1;     cm1 = cm1<c1 ? c1:cm1;\r
                }\r
 #pragma omp critical(max_vec)\r
                {cm = cm<cm1 ? cm1:cm;  xm = xm<xm1 ? xm1:xm;}\r
        }\r
-       ca /= (n*m*l)/(tx*ty);\r
        xm = xm?1./xm:0;        cm = cm?fact/cm:0;\r
 \r
        for(long k=0;k<l;k++)\r
@@ -225,13 +224,13 @@ void MGL_EXPORT mgl_vect_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay,
        if(ty<1)        ty=1;\r
        if(tz<1)        tz=1;\r
 \r
-       double xm=0,cm=0,ca=0, asize = gr->GetArrowSize();\r
+       double xm=0,cm=0, asize = gr->GetArrowSize();\r
        double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5;\r
        // use whole array for determining maximal vectors length\r
 #pragma omp parallel\r
        {\r
                double c1,c2,c3, xm1=0,cm1=0,xx;\r
-#pragma omp for nowait collapse(3) reduction(+:ca)\r
+#pragma omp for nowait collapse(3)\r
                for(long k=0;k<l;k+=tz) for(long i=0;i<n;i+=tx) for(long j=0;j<m;j+=ty)\r
                {\r
                        mglPoint d(GetX(x,i,j,k).x, GetY(y,i,j,k).x, GetZ(z,i,j,k).x);\r
@@ -244,12 +243,11 @@ void MGL_EXPORT mgl_vect_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay,
                        p1 = k<l-1 ? mglPoint(GetX(x,i,j,k+tz).x, GetY(y,i,j,k+tz).x, GetZ(z,i,j,k+tz).x)-d : d-mglPoint(GetX(x,i,j,k-tz).x, GetY(y,i,j,k-tz).x, GetZ(z,i,j,k-tz).x);\r
                        c3 = fabs(v*p1);        xx = p1.norm(); c3 *= xx?1/(xx*xx):0;\r
                        c1 = c1<c2 ? c2:c1;     c1 = c1<c3 ? c3:c1;\r
-                       ca+=c1; cm1 = cm1<c1 ? c1:cm1;\r
+                       cm1 = cm1<c1 ? c1:cm1;\r
                }\r
 #pragma omp critical(max_vec)\r
                {cm = cm<cm1 ? cm1:cm;  xm = xm<xm1 ? xm1:xm;}\r
        }\r
-       ca /= double(n*m*l)/double(tx*ty*tz);\r
        xm = xm?1./xm:0;        cm = cm?fact/cm:0;\r
 \r
        const long ni = 1+((n-1)/tx), nj = 1+((m-1)/ty), nk = 1+((l-1)/tz);\r
@@ -430,7 +428,7 @@ void MGL_EXPORT mgl_vect3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay,
        if(gr->MeshNum>1)       {       tx=(n-1)/(gr->MeshNum-1);       ty=(m-1)/(gr->MeshNum-1);       }\r
        if(tx<1)        tx=1;\r
        if(ty<1)        ty=1;\r
-       double xm=0,cm=0,ca=0, asize = gr->GetArrowSize();\r
+       double xm=0,cm=0, asize = gr->GetArrowSize();\r
        double dm=(fabs(gr->Max.c)+fabs(gr->Min.c))*1e-5;\r
        // use whole array for determining maximal vectors length\r
        mglPoint d=(gr->Max-gr->Min)/mglPoint(1./ax->GetNx(),1./ax->GetNy(),1./ax->GetNz());\r
@@ -440,7 +438,7 @@ void MGL_EXPORT mgl_vect3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay,
        {\r
                double xm1=0,cm1=0, xx,yy,zz, c1,c2;\r
                mglPoint p1, p2, v;\r
-#pragma omp for nowait collapse(2) reduction(+:ca)\r
+#pragma omp for nowait collapse(2)\r
                for(long i=0;i<n;i+=tx) for(long j=0;j<m;j+=ty)\r
                {\r
                        long i0 = i+n*j;\r
@@ -453,12 +451,11 @@ void MGL_EXPORT mgl_vect3_xyz(HMGL gr, HCDT x, HCDT y, HCDT z, HCDT ax, HCDT ay,
                        c1 = fabs(v*p1);        xx = p1.norm(); c1 *= xx?1/(xx*xx):0;\r
                        c2 = fabs(v*p2);        xx = p2.norm(); c2 *= xx?1/(xx*xx):0;\r
                        c1 = c1<c2 ? c2:c1;     c1 = c1<yy ? yy:c1;\r
-                       ca+=c1; cm1 = cm1<c1 ? c1:cm1;\r
+                       cm1 = cm1<c1 ? c1:cm1;\r
                }\r
 #pragma omp critical(max_vec)\r
                {cm = cm<cm1 ? cm1:cm;  xm = xm<xm1 ? xm1:xm;}\r
        }\r
-       ca /= mreal(n*m)/mreal(tx*ty);\r
        xm = xm?1./xm:0;        cm = cm?fact/cm:0;\r
 \r
        const long ni = 1+((n-1)/tx), nj = 1+((m-1)/ty);\r
@@ -1126,10 +1123,8 @@ void MGL_EXPORT mgl_flowp_xyz(HMGL gr, double x0, double y0, double z0, HCDT x,
                mreal dx=INFINITY, dy=INFINITY, dz=INFINITY;\r
                for(long i=0;i<n;i++)\r
                {       mreal d = fabs(x->v(i)-p.x);    if(d<dx)        {       i0=i;   dx=d;   }       }\r
-               dm = INFINITY;\r
                for(long j=0;j<m;j++)\r
                {       mreal d = fabs(y->v(j)-p.y);    if(d<dy)        {       j0=j;   dy=d;   }       }\r
-               dm = INFINITY;\r
                for(long k=0;k<l;k++)\r
                {       mreal d = fabs(z->v(k)-p.z);    if(d<dz)        {       k0=k;   dz=d;   }       }\r
                dm = sqrt(dx*dx+dy*dy+dz*dz);\r
index 728483150714fd43733e06ec04a76a10b3eaa0bf..abe4fe56a60f450c633d9b68778e129f1be8b851 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index ad27995223df2a57bc81057537b413302775343a..b419503cd05c08b0388fb396f6294b1800389b92 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index f3d7ffeab6570760e21f759671f3541a2471b113..055ff5e8dc6e0f02fb108a9f71c4f8701f0cdd4b 100644 (file)
@@ -3,7 +3,7 @@ configure_file(${MathGL2_SOURCE_DIR}/texinfo/version.texi.in ${MathGL2_BINARY_DI
 #set(MGL_EXTRA light pendelta)
 set(MGL_EXTRA )
 set(MGL_PNG_ONLY quality0 quality1 quality2 quality4 quality5 quality6 quality8 pendelta fexport) 
-set(MGL_PNG 3wave alpha apde area aspect axial axis barh bars belt bifurcation box boxplot boxs candle chart cloud colorbar combined cones cont cont_xyz cont3 contd contf contf_xyz contf3 conts contv correl curvcoor cut dat_diff dat_extra data1 data2 dens dens_xyz dens3 detect dew diffract dilate dots earth error error2 export fall fit flame2d flow flow3 fog fonts grad hist ifs2d ifs3d indirect inplot iris label lamerey legend light loglog map mark mask mesh minmax mirror molecule ode ohlc param1 param2 param3 paramv parser pde pipe plot pmap primitives projection projection5 pulse qo2d radar refill region scanfile schemes section several_light solve stem step stereo stfa style surf surf3 surf3a surf3c surf3ca surfa surfc surfca table tape tens ternary text text2 textmark ticks tile tiles torus traj triangulation triplot tube type0 type1 type2 vect vect3 venn )
+set(MGL_PNG 3wave alpha apde area aspect axial axis background barh bars belt beltc bifurcation box boxplot boxs candle chart cloud colorbar combined cones cont cont3 cont_xyz contd contf contf3 contf_xyz conts contv correl curvcoor cut daisy dat_diff dat_extra data1 data2 dcont dens dens3 dens_xyz detect dew diffract dilate dots earth error error2 export fall fit flame2d flow flow3 fog fonts grad hist icon ifs2d ifs3d indirect inplot iris keep label lamerey legend light lines loglog map mark mask mesh minmax mirror molecule ode ohlc param1 param2 param3 paramv parser pde pipe plot pmap primitives projection projection5 pulse qo2d radar refill region scanfile schemes section several_light solve stem step stereo stfa style surf surf3 surf3a surf3c surf3ca surfa surfc surfca table tape tens ternary text text2 textmark ticks tile tiles torus traj triangulation triplot tube type0 type1 type2 vect vect3 venn )
 set(MGL_PNG_N )
 set(MGL_PNG_S )
 set(MGL_PNG_J )
@@ -22,6 +22,10 @@ file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/png)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/small)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/json)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/iris.dat DESTINATION ${MGL_OUT}/pdf)
+file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/png)
+file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/small)
+file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/json)
+file(COPY ${CMAKE_SOURCE_DIR}/udav_new.png DESTINATION ${MGL_OUT}/pdf)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/png)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/small)
 file(COPY ${CMAKE_SOURCE_DIR}/examples/Equirectangular-projection.jpg DESTINATION ${MGL_OUT}/json)
index 4b63d2686f717d5c7e2287e9212e36e2063af26b..a71b9a4a3aa520139591a2dcf8871b629202df8f 100644 (file)
@@ -91,13 +91,13 @@ The line style is defined by the string which may contain specifications for col
 @html
 By default palette contain following colors: <span style="color: rgb(76, 76, 76);">dark gray</span> &lsquo;<samp>H</samp>&rsquo;, <span style="color: rgb(0, 0, 255);">blue</span> &lsquo;<samp>b</samp>&rsquo;, <span style="color: rgb(0, 255, 0);">green</span> &lsquo;<samp>g</samp>&rsquo;, <span style="color: rgb(255, 0, 0);">red</span> &lsquo;<samp>r</samp>&rsquo;, <span style="color: rgb(0, 255, 255);">cyan</span> &lsquo;<samp>c</samp>&rsquo;, <span style="color: rgb(255, 0, 255);">magenta</span> &lsquo;<samp>m</samp>&rsquo;, <span style="color: rgb(255, 255, 0);">yellow</span> &lsquo;<samp>y</samp>&rsquo;, <span style="color: rgb(127, 127, 127);">gray</span> &lsquo;<samp>h</samp>&rsquo;, <span style="color: rgb(0, 255, 127);">green-blue</span> &lsquo;<samp>l</samp>&rsquo;, <span style="color: rgb(0, 127, 255);">sky-blue</span> &lsquo;<samp>n</samp>&rsquo;, <span style="color: rgb(255, 127, 0);">orange</span> &lsquo;<samp>q</samp>&rsquo;, <span style="color: rgb(127, 255, 0);">green-yellow</span> &lsquo;<samp>e</samp>&rsquo;, <span style="color: rgb(127, 0, 255);">blue-violet</span> &lsquo;<samp>u</samp>&rsquo;, <span style="color: rgb(255, 0, 127);">purple</span> &lsquo;<samp>p</samp>&rsquo;.
 
-<p>Dashing style has the following meaning: space &ndash; no line (usable for plotting only marks), &lsquo;<samp>-</samp>&rsquo; &ndash; solid line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;), &lsquo;<samp>|</samp>&rsquo; &ndash; long dashed line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>;</samp>&rsquo; &ndash; dashed line (&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>=</samp>&rsquo; &ndash; small dashed line (&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;), &lsquo;<samp>:</samp>&rsquo; &ndash; dotted line (&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;), &lsquo;<samp>j</samp>&rsquo; &ndash; dash-dotted line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>i</samp>&rsquo; &ndash; small dash-dotted line (&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;), &lsquo;<samp>{dNNNN}</samp>&rsquo; &ndash; manual mask style (for v.2.3 and later, like &lsquo;<samp>{df090}</samp>&rsquo; for (&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9633;)).</p>
+<p>Dashing style has the following meaning: space &ndash; no line (usable for plotting only marks), &lsquo;<samp>-</samp>&rsquo; &ndash; solid line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;), &lsquo;<samp>|</samp>&rsquo; &ndash; long dashed line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>;</samp>&rsquo; &ndash; dashed line (&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>=</samp>&rsquo; &ndash; small dashed line (&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;&#9632;&#9632;&#9633;&#9633;), &lsquo;<samp>:</samp>&rsquo; &ndash; dotted line (&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;), &lsquo;<samp>j</samp>&rsquo; &ndash; dash-dotted line (&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9633;), &lsquo;<samp>i</samp>&rsquo; &ndash; small dash-dotted line (&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;&#9632;&#9632;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;), &lsquo;<samp>{dNNNN}</samp>&rsquo; &ndash; manual dash style (for v.2.3 and later, like &lsquo;<samp>{df090}</samp>&rsquo; for (&#9632;&#9632;&#9632;&#9632;&#9633;&#9633;&#9633;&#9633;&#9632;&#9633;&#9633;&#9632;&#9633;&#9633;&#9633;&#9633;)).</p>
 @end html
 @end ifhtml
 @ifnothtml
 By default palette contain following colors: dark gray @samp{H}, blue @samp{b}, green @samp{g}, red @samp{r}, cyan @samp{c}, magenta @samp{m}, yellow @samp{y}, gray @samp{h}, blue-green @samp{l}, sky-blue @samp{n}, orange @samp{q}, yellow-green @samp{e}, blue-violet @samp{u}, purple @samp{p}.
 
-Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__), @samp{@{dNNNN@}} -- manual mask style (for v.2.3 and later, like @samp{@{df090@}} for (####____#__#____)).
+Dashing style has the following meaning: space -- no line (usable for plotting only marks), @samp{-} -- solid line (################), @samp{|} -- long dashed line (########________), @samp{;} -- dashed line (####____####____), @samp{=} -- small dashed line (##__##__##__##__), @samp{:} -- dotted line (#___#___#___#___), @samp{j} -- dash-dotted line (#######____#____), @samp{i} -- small dash-dotted line (###__#__###__#__), @samp{@{dNNNN@}} -- manual dash style (for v.2.3 and later, like @samp{@{df090@}} for (####____#__#____)).
 @end ifnothtml
 
 Marker types are: @samp{o} -- circle, @samp{+} -- cross, @samp{x} -- skew cross, @samp{s} -- square, @samp{d} -- rhomb (or diamond), @samp{.} -- dot (point), @samp{^} -- triangle up, @samp{v} -- triangle down, @samp{<} -- triangle left, @samp{>} -- triangle right, @samp{#*} -- Y sign, @samp{#+} -- squared cross, @samp{#x} -- squared skew cross, @samp{#.} -- circled dot. If string contain symbol @samp{#} then the solid versions of markers are used.
@@ -203,6 +203,8 @@ MathGL have the fast variant of textual formula evaluation
 @end ifclear
 . There are a lot of functions and operators available. The operators are: @samp{+} -- addition, @samp{-} -- subtraction, @samp{*} -- multiplication, @samp{/} -- division, @samp{%} -- modulo, @samp{^} -- integer power. Also there are logical ``operators'': @samp{<} -- true if x<y, @samp{>} -- true if x>y, @samp{=} -- true if x=y, @samp{&} -- true if x and y both nonzero, @samp{|} -- true if x or y nonzero. These logical operators have lowest priority and return 1 if true or 0 if false.
 
+
+
 The basic functions are: @samp{sqrt(x)} -- square root of @var{x}, @samp{pow(x,y)} -- power @var{x} in @var{y}, @samp{ln(x)} -- natural logarithm of @var{x}, @samp{lg(x)} -- decimal logarithm of @var{x}, @samp{log(a,x)} -- logarithm base @var{a} of @var{x}, @samp{abs(x)} -- absolute value of @var{x}, @samp{sign(x)} -- sign of @var{x}, @samp{mod(x,y)} -- @var{x} modulo @var{y}, @samp{step(x)} -- step function, @samp{int(x)} -- integer part of @var{x}, @samp{rnd} -- random number, @samp{random(x)} -- random data of size as in @var{x}, @samp{hypot(x,y)}=sqrt(x^2+y^2) -- hypotenuse, @samp{cmplx(x,y)}=x+i*y -- complex number,  @samp{pi} -- number
 @ifhtml
 @html
@@ -244,6 +246,8 @@ Note, some of these functions are unavailable if MathGL was compiled without GSL
 
 There is no difference between lower or upper case in formulas. If argument value lie outside the range of function definition then function returns NaN.
 
+MathGL version 2.5 introduce user-defined functions @samp{fn1()...fn9()} at formula evaluation, which are defined after symbol @samp{\}. For example, "fn1(3)\x^_1" will produce "x^3". Also functions @samp{sum}, @samp{dsum}, @samp{prod} are added at formula evaluation for summation, summation with variable sign and product evaluation. For example, "sum(_i^2,5)" will produce "30"=0+1^2+2^2+3^2+4^2, "dsum(_i^2,5)" will produce "10"=0-1^2+2^2-3^2+4^2, and "prod(1+_i,5)" will produce 5!="120". You can nest them for variables _i,_j,...,_z, like "sum(sum(_j+_i^2,5),5)" will give "200". Also you can use user-defined functions, like "sum(fn1(_i)-fn2(_i),4)\_1^4\_1^3" is the same as "sum(_i^4-_i^3,4)" and will produce "62".
+
 @c ------------------------------------------------------------------
 @external{}
 @node  Command options, Interfaces, Textual formulas, General concepts
index ba72042125471b8609c79ccc3c92136f3b255e99..9c3a5494124429059f0036bfbf0e7a9794627b18 100644 (file)
@@ -242,6 +242,8 @@ MathGL имеет быстрый парсер текстовых формул
 
 При разборе формул нет различия между верхним и нижним регистром. Если аргумент лежит вне области определения функции, то возвращается NaN.
 
+MathGL версии 2.5 позволяет использовать пользовательские функции fn1()...fn9() при вычислении формул, определенные после символа(ов) '\'. Например, "fn1(3)\x^_1" даст "x^3". Кроме того, добавлены функции 'sum', 'dsum', 'prod' для вычисления сумм, сумм с переменным знаком и произведений в формулах. Например, "sum(_i^2,5)" даст "30"=0+1^2+2^2+3^2+4^2, "dsum(_i^2,5)" даст "10"=0-1^2+2^2-3^2+4^2, и "prod(1+_i,5)" даст 5!="120". Вызовы суммирования и произведения можно делать вложенными, используя переменные _i,_j,...,_z. Например, "sum(sum(_j+_i^2,5),5)" даст "200". Кроме того, в аргументах можно использовать и пользовательские функции. Например, "sum(fn1(_i)-fn2(_i),4)\_1^4\_1^3" эквивалентно "sum(_i^4-_i^3,4)" и даст "62".
+
 @c ------------------------------------------------------------------
 @external{}
 @node  Command options, Interfaces, Textual formulas, General concepts
@@ -258,14 +260,14 @@ MathGL имеет быстрый парсер текстовых формул
 @deffn {Опция MGL} alpha @code{val}
 Задает величину прозрачности поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{alphadef}
 @end deffn
-@c @cindex ambient
-@c @deffn {Опция MGL} ambient @code{val}
-@c Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient}
-@c @end deffn
-@c @cindex diffuse
-@c @deffn {Опция MGL} diffuse @code{val}
-@c Задает яркость диффузного освещения для поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{diffuse}.
-@c @end deffn
+@cindex ambient
+@deffn {Опция MGL} ambient @code{val}
+Задает яркость фонового освещения. Значение должно быть в диапазоне [0, 1]. См. также @ref{ambient}
+@end deffn
+@cindex diffuse
+@deffn {Опция MGL} diffuse @code{val}
+Задает яркость диффузного освещения для поверхности. Значение должно быть в диапазоне [0, 1]. См. также @ref{diffuse}.
+@end deffn
 
 @cindex xrange
 @deffn {Опция MGL} xrange @code{val1 val2}
index 8be0332a14a0fd91e5b7a242926880d671af51ca..f461f811024f034872f807fe4963d0b81dfa7e58 100644 (file)
@@ -66,6 +66,10 @@ Deletes the instance of class mglGraph.
 @deftypefn {Method on @code{mglGraph}} @code{HMGL} Self ()
 Returns the pointer to internal object of type @code{HMGL}.
 @end deftypefn
+
+@deftypefn {C function} @code{HMGL} mgl_default_graph ()
+Returns pointer to default instance of class mglGraph. This is default instance, used with new classes, which can be used to keep plot settings and to speed up initialization in small different plots.
+@end deftypefn
 @end ifclear
 
 @ifset UDAV
@@ -453,6 +457,15 @@ Sets to use or not text rotation.
 Sets to scale text in relative @ref{inplot} (including @ref{columnplot}, @ref{gridplot}, @ref{stickplot}, @ref{shearplot}) or not.
 @end deftypefn
 
+@anchor{texparse}
+@deftypefn {MGL command} {} texparse @code{val}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} SetTeXparse (@code{bool} val)
+@deftypefnx {C function} @code{void} mgl_set_tex_parse (@code{HMGL} gr, @code{int} val)
+@end ifclear
+Enables/disables TeX-like command parsing at text output.
+@end deftypefn
+
 @anchor{loadfont}
 @deftypefn {MGL command} {} loadfont ['name'='']
 @ifclear UDAV
@@ -662,6 +675,11 @@ Set warning message @var{info} for global scope.
 Get warning message(s) for global scope.
 @end deftypefn
 
+@deftypefn {Method on @code{mglGraph}} @code{void} ClearGlobalWarn () static
+@deftypefnx {C function} @code{void} mgl_clear_global_warn ()
+Clears global warning messages.
+@end deftypefn
+
 @end ifclear
 
 @c ==================================================================
@@ -1184,6 +1202,7 @@ font style (see, @ref{Font styles});
 @samp{#} for box around the title.
 @end itemize
 Parameter @var{size} set font size. This function set off any aspects or rotations. So it should be used just after creating subplot.
+Note, that each call of this command will reserve extra space. So, you need to manually call @ref{subplot} command after @ref{rasterize} if you want to combine bitmap and vector graphics.
 @end deftypefn
 
 @anchor{rotate}
@@ -1613,7 +1632,7 @@ Set the numeric id for object or subplot/inplot.
 
 @deftypefn {Method on @code{mglGraph}} @code{int} GetObjId (@code{int} xs, @code{int} ys)
 @deftypefnx {C function} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{int} xs, @code{int} ys)
-Get the numeric id for most upper object at pixel @{xs, ys@} of the picture.
+Get the numeric id for most upper object at pixel @{xs, ys@} of the picture. Note, that all plots in the same line of MGL script have the same id.
 @end deftypefn
 
 @deftypefn {Method on @code{mglGraph}} @code{int} GetSplId (@code{int} xs, @code{int} ys)
@@ -1708,18 +1727,28 @@ Clear the picture and fill background by specified color.
 @deftypefnx {Method on @code{mglGraph}} @code{void} Rasterize ()
 @deftypefnx {C function} @code{void} mgl_rasterize (@code{HMGL} gr)
 @end ifclear
-Force drawing the plot and use it as background. After it, function clear the list of primitives, like @ref{clf}. This function is useful if you want save part of plot as bitmap one (for example, large surfaces, isosurfaces or vector fields) and keep some parts as vector one (like annotation, curves, axis and so on).
+Force drawing the plot and use it as background. After it, function clear the list of primitives, like @ref{clf}. This function is useful if you want save part of plot as bitmap one (for example, large surfaces, isosurfaces or vector fields) and keep some parts as vector one (like annotation, curves, axis and so on). Often, you need to manually call @ref{subplot} command after @ref{rasterize} to avoid extra space allocation or plot rotation.
 @end deftypefn
 
 @anchor{background}
 @deftypefn {MGL command} {} background 'fname' [@code{alpha=1}]
+@deftypefnx {MGL command} {} background 'fname' 'how' [@code{alpha=1}]
 @ifclear UDAV
 @deftypefnx {Method on @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{double} alpha=@code{1})
 @deftypefnx {C function} @code{void} mgl_load_background (@code{HMGL} gr, @code{const char *} fname, @code{double} alpha)
+@deftypefnx {Method on @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{const char *} how, @code{double} alpha=@code{1})
+@deftypefnx {C function} @code{void} mgl_load_background_ext (@code{HMGL} gr, @code{const char *} fname, @code{const char *} how, @code{double} alpha)
 @end ifclear
-Load PNG or JPEG file @var{fname} as background for the plot. Parameter @var{alpha} manually set transparency of the background.
+Load PNG or JPEG file @var{fname} as background for the plot. Parameter @var{alpha} manually set transparency of the background. Parameter @var{how} can be: @samp{a} for filling current subplot only, @samp{s} for scaling (resizing) image to whole area, @samp{c} for centering image, @samp{m} for tessellate image as mosaic.
 @end deftypefn
 
+@deftypefn {MGL command} {} background @code{r g b}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} FillBackground (@code{const mglColor &}rgb)
+@deftypefnx {C function} @code{void} mgl_fill_background (@code{HMGL} gr, @code{double} r, @code{double} g, @code{double} b)
+@end ifclear
+Fill background by the specified color. Values should be in range [0,1].
+@end deftypefn
 
 
 @c ##################################################################
@@ -1794,13 +1823,13 @@ Draws Bezier-like curve from point @var{p1} to @var{p2} using line style @var{st
 @deftypefnx {Method on @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"})
 @deftypefnx {C function} @code{void} mgl_face (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} x3, @code{mreal} y3, @code{mreal} z3, @code{mreal} x4, @code{mreal} y4, @code{mreal} z4, @code{const char *}stl)
 @end ifclear
-Draws the solid quadrangle (face) with vertexes @var{p1}, @var{p2}, @var{p3}, @var{p4} and with color(s) @var{stl}. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box.
+Draws the solid quadrangle (face) with vertexes @var{p1}, @var{p2}, @var{p3}, @var{p4} and with color(s) @var{stl}. At this colors can be the same for all vertexes or different if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}).
 @end deftypefn
 
 @anchor{rect}
 @deftypefn {MGL command} {} rect @code{x1 y1 x2 y2} ['stl'='']
 @deftypefnx {MGL command} {} rect @code{x1 y1 z1 x2 y2 z2} ['stl'='']
-Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@} with color @var{stl}. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box.
+Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@} with color @var{stl}. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Face will be drawn even if it lies out of bounding box. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}).
 @end deftypefn
 
 @anchor{facex}
@@ -1817,7 +1846,7 @@ Draws the solid rectangle (face) with vertexes @{@var{x1}, @var{y1}, @var{z1}@}
 @deftypefnx {C function} @code{void} mgl_facey (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wz, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2)
 @deftypefnx {C function} @code{void} mgl_facez (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wy, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2)
 @end ifclear
-Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position @{@var{x0}, @var{y0}, @var{z0}@} with color @var{stl} and with widths @var{wx}, @var{wy}, @var{wz} along corresponding directions. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle). Face will be drawn even if it lies out of bounding box.
+Draws the solid rectangle (face) perpendicular to [x,y,z]-axis correspondingly at position @{@var{x0}, @var{y0}, @var{z0}@} with color @var{stl} and with widths @var{wx}, @var{wy}, @var{wz} along corresponding directions. At this colors can be the same for all vertexes or separately if all 4 colors are specified for each vertex. Argument @var{stl} can also contain mask specification (see @ref{Color scheme}). Parameters @var{d1}!=0, @var{d2}!=0 set additional shift of the last vertex (i.e. to draw quadrangle). Face will be drawn even if it lies out of bounding box.
 @end deftypefn
 
 @anchor{sphere}
@@ -1872,7 +1901,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co
 @item
 @samp{#} for wire figure (boundary only);
 @item
-@samp{@@} for filling and boundary.
+@samp{@@} for filling and boundary;
+@item
+mask specification (see @ref{Color scheme}).
 @end itemize
 @end deftypefn
 
@@ -1890,7 +1921,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co
 @item
 @samp{#} for wire figure (boundary only);
 @item
-@samp{@@} for filling and boundary.
+@samp{@@} for filling and boundary;
+@item
+mask specification (see @ref{Color scheme}).
 @end itemize
 @end deftypefn
 
@@ -1908,7 +1941,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co
 @item
 @samp{#} for wire figure (boundary only);
 @item
-@samp{@@} for filling and boundary.
+@samp{@@} for filling and boundary;
+@item
+mask specification (see @ref{Color scheme}).
 @end itemize
 @end deftypefn
 
@@ -1939,7 +1974,9 @@ colors for filling and boundary (second one if style @samp{@@} is used, black co
 @item
 @samp{#} for wire figure (boundary only);
 @item
-@samp{@@} for filling and boundary.
+@samp{@@} for filling and boundary;
+@item
+mask specification (see @ref{Color scheme}).
 @end itemize
 @end deftypefn
 
@@ -2354,7 +2391,7 @@ These functions draw continuous lines between points @{@var{x}[i], @var{y}[i], @
 @deftypefnx {C function} @code{void} mgl_tape_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_tape_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-These functions draw tapes of normals for curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Initial tape(s) was selected in x-y plane (for @samp{x} in @var{pen}) and/or y-z plane (for @samp{x} in @var{pen}). The width of tape is proportional to @ref{barwidth} and can be changed by option @code{value}. See also @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample}
+These functions draw tapes of normals for curve between points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Initial tape(s) was selected in x-y plane (for @samp{x} in @var{pen}) and/or y-z plane (for @samp{x} in @var{pen}). Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). The width of tape is proportional to @ref{barwidth} and can be changed by option @code{value}. See also @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample}
 @end deftypefn
 
 @anchor{area}
@@ -2369,7 +2406,7 @@ These functions draw tapes of normals for curve between points @{@var{x}[i], @va
 @deftypefnx {C function} @code{void} mgl_area_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-These functions draw continuous lines between points and fills it to axis plane. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample}
+These functions draw continuous lines between points and fills it to axis plane. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). See also @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample}
 @end deftypefn
 
 @anchor{region}
@@ -2386,7 +2423,7 @@ These functions draw continuous lines between points and fills it to axis plane.
 @deftypefnx {C function} @code{void} mgl_region_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_region_3d (@code{HMGL} gr, @code{HCDT} x1, @code{HCDT} y1, @code{HCDT} z1, @code{HCDT} x2, @code{HCDT} y2, @code{HCDT} z2, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-These functions fill area between 2 curves. Dimensions of arrays @var{y1} and @var{y2} must be equal. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If for 2D version @var{pen} contain symbol @samp{i} then only area with y1<y<y2 will be filled else the area with y2<y<y1 will be filled too. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. See also @ref{area}, @ref{bars}, @ref{stem}. @sref{region sample}
+These functions fill area between 2 curves. Dimensions of arrays @var{y1} and @var{y2} must be equal. Also you can use gradient filling if number of specified colors is equal to 2*number of curves. If for 2D version @var{pen} contain symbol @samp{i} then only area with y1<y<y2 will be filled else the area with y2<y<y1 will be filled too. If @var{pen} contain @samp{#} then wired plot is drawn. If @var{pen} contain @samp{a} then segments between points outside of axis range are drawn too. Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). See also @ref{area}, @ref{bars}, @ref{stem}. @sref{region sample}
 @end deftypefn
 
 @anchor{stem}
@@ -2425,7 +2462,9 @@ These functions draw vertical bars from points to axis plane. Parameter @var{pen
 @item
 @samp{F} for using fixed (minimal) width for all bars;
 @item
-@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates.
+@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates;
+@item 
+mask specification (see @ref{Color scheme}).
 @end itemize
 You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. If @var{x}.nx>@var{y}.nx then @var{x} set the edges of bars, rather than its central positions. See also @ref{barh}, @ref{cones}, @ref{area}, @ref{stem}, @ref{chart}, @ref{barwidth}. @sref{bars sample}
 @end deftypefn
@@ -2448,7 +2487,9 @@ These functions draw horizontal bars from points to axis plane. Parameter @var{p
 @item
 @samp{F} for using fixed (minimal) width for all bars;
 @item
-@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates.
+@samp{<}, @samp{^} or @samp{>} for aligning boxes left, right or centering them at its x-coordinates;
+@item 
+mask specification (see @ref{Color scheme}).
 @end itemize
 You can give different colors for positive and negative values if number of specified colors is equal to 2*number of curves. If @var{x}.nx>@var{y}.nx then @var{x} set the edges of bars, rather than its central positions. See also @ref{bars}, @ref{barwidth}. @sref{barh sample}
 @end deftypefn
@@ -2489,7 +2530,7 @@ See also @ref{bars}, @ref{cone}, @ref{barwidth}. @sref{cones sample}
 @deftypefnx {Method on @code{mglGraph}} @code{void} Chart (@code{const mglDataA &}a, @code{const char *}col=@code{""}, @code{const char *}opt=@code{""})
 @deftypefnx {C function} @code{void} mgl_chart (@code{HMGL} gr, @code{HCDT} a, @code{const char *}col, @code{const char *}opt)
 @end ifclear
-The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (see @ref{Palette and colors}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{chart sample}
+The function draws colored stripes (boxes) for data in array @var{a}. The number of stripes is equal to the number of rows in @var{a} (equal to @var{a.ny}). The color of each next stripe is cyclically changed from colors specified in string @var{col} or in palette Pal (see @ref{Palette and colors}).  Argument @var{col} can also contain mask specification (see @ref{Color scheme}). Spaces in colors denote transparent ``color'' (i.e. corresponding stripe(s) are not drawn). The stripe width is proportional to value of element in @var{a}. Chart is plotted only for data with non-negative elements. If string @var{col} have symbol @samp{#} then black border lines are drawn. The most nice form the chart have in 3d (after rotation of coordinates) or in cylindrical coordinates (becomes so called Pie chart). @sref{chart sample}
 @end deftypefn
 
 @anchor{boxplot}
@@ -2520,7 +2561,7 @@ These functions draw boxplot (also known as a box-and-whisker diagram) at points
 @deftypefnx {C function} @code{void} mgl_candle_yv (@code{HMGL} gr, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_candle_xyv (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-These functions draw candlestick chart at points @var{x}[i]. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. Wire (or white) candle correspond to price growth @var{v1}[i]<@var{v2}[i], opposite case -- solid (or dark) candle. You can give different colors for growth and decrease values if number of specified colors is equal to 2. If @var{pen} contain @samp{#} then the wire candle will be used even for 2-color scheme. "Shadows" show the minimal @var{y1} and maximal @var{y2} prices. If @var{v2} is absent then it is determined as @var{v2}[i]=@var{v1}[i+1]. See also @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample}
+These functions draw candlestick chart at points @var{x}[i]. This is a combination of a line-chart and a bar-chart, in that each bar represents the range of price movement over a given time interval. Wire (or white) candle correspond to price growth @var{v1}[i]<@var{v2}[i], opposite case -- solid (or dark) candle. You can give different colors for growth and decrease values if number of specified colors is equal to 2. If @var{pen} contain @samp{#} then the wire candle will be used even for 2-color scheme. Argument @var{pen} can also contain mask specification (see @ref{Color scheme}). "Shadows" show the minimal @var{y1} and maximal @var{y2} prices. If @var{v2} is absent then it is determined as @var{v2}[i]=@var{v1}[i+1]. See also @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample}
 @end deftypefn
 
 @anchor{ohlc}
@@ -3086,7 +3127,7 @@ The function draws contour plot for 3d data specified parametrically @var{a}[i,j
 @deftypefn {MGL command} {} cont3 adat ['sch'='' @code{sval=-1}]
 @deftypefnx {MGL command} {} cont3 xdat ydat zdat adat ['sch'='' @code{sval=-1}]
 @ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Method on @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {C function} @code{void} mgl_cont3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
@@ -3109,7 +3150,7 @@ The function draws solid (or filled) contour plot for 3d data specified parametr
 @deftypefn {MGL command} {} contf3 adat ['sch'='' @code{sval=-1}]
 @deftypefnx {MGL command} {} contf3 xdat ydat zdat adat ['sch'='' @code{sval=-1}]
 @ifclear UDAV
-@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Method on @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {C function} @code{void} mgl_contf3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
@@ -3129,6 +3170,30 @@ The same as previous with vector @var{v} of @var{num}-th elements equidistantly
 The function draws grid for 3d data specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Grid is plotted at slice @var{sVal} in direction @{@samp{x}, @samp{y}, @samp{z}@} if @var{sch} contain corresponding symbol (by default, @samp{y} direction is used). See also @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}, @ref{meshnum}.
 @end deftypefn
 
+
+@anchor{dcont}
+@deftypefn {MGL command} {} dcont vdat adat bdat ['sch'='']
+@deftypefnx {MGL command} {} dcont vdat xdat ydat zdat adat bdat ['sch'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_dcont_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_dcont_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+The function draws lines at intersections of isosurfaces for 3d data @var{a}, @var{b} specified parametrically @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Isosurfaces are taken for values specified in array @var{v}. See also @ref{cont}, @ref{cont3}. @sref{dcont sample}
+@end deftypefn
+
+@deftypefn {MGL command} {} dcont adat bdat ['sch'='' @code{sval=-1}]
+@deftypefnx {MGL command} {} dcont xdat ydat zdat adat bdat ['sch'='' @code{sval=-1}]
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_dcont (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_@code{HCDT} b, cont_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+The same as previous with vector @var{v} of @var{num}-th elements equidistantly distributed in color range. Here @var{num} is equal to parameter @code{value} in options @var{opt} (default is 7).
+@end deftypefn
+
 @anchor{beam}
 @deftypefn {MGL command} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}]
 @ifclear UDAV
@@ -3178,7 +3243,7 @@ The function draws surface specified parametrically @{@var{x}[i,j], @var{y}[i,j]
 @deftypefnx {C function} @code{void} mgl_beltc (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_beltc_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
 @end ifclear
-The function draws belts for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. This plot can be used as 3d generalization of @ref{plot}). If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) belts are drawn along y-direction. See also @ref{belt}, @ref{surfc}, @ref{meshnum}. @c TODO @sref{beltc sample}
+The function draws belts for surface specified parametrically @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} and color it by matrix @var{c}[i,j]. This plot can be used as 3d generalization of @ref{plot}). If @var{sch} contain @samp{x} then belts are drawn along x-direction else (by default) belts are drawn along y-direction. See also @ref{belt}, @ref{surfc}, @ref{meshnum}. @sref{beltc sample}
 @end deftypefn
 
 
@@ -3324,6 +3389,7 @@ Draws spectrogram of complex array @var{re}+i*@var{im} for Fourier size of @var{
 @node Vector fields, Other plotting, Dual plotting, MathGL core
 @section Vector fields
 @nav{}
+@cindex Lines
 @cindex Traj
 @cindex Vect
 @cindex Dew
@@ -3333,6 +3399,21 @@ Draws spectrogram of complex array @var{re}+i*@var{im} for Fourier size of @var{
 
 These functions perform plotting of 2D and 3D vector fields. There are 5 generally different types of vector fields representations: simple vector field (Vect), vectors along the curve (Traj), vector field by dew-drops (Dew), flow threads (Flow, FlowP), flow pipes (Pipe). By default (if absent) values of @var{x}, @var{y}, @var{z} are equidistantly distributed in axis range. The minor dimensions of arrays @var{x}, @var{y}, @var{z}, @var{ax} should be equal. The size of @var{ax}, @var{ay} and @var{az} must be equal. Arrays @var{x}, @var{y}, @var{z} can be vectors (not matrices as @var{ax}). String @var{sch} sets the color scheme (see @ref{Color scheme}) for plot. String @var{opt} contain command options (see @ref{Command options}).
 
+@anchor{lines}
+@deftypefn {MGL command} {} lines y1dat y2dat ['sch'='']
+@deftypefnx {MGL command} {} lines x1dat y1dat x2dat y2dat ['sch'='']
+@deftypefnx {MGL command} {} lines x1dat y1dat z1dat x2dat y2dat z2dat ['sch'='']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}y1, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Method on @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}z1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const mglDataA &}z2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {C function} @code{void} mgl_lines_xyz (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}z1, @code{HCDT}x2, @code{HCDT}y2, @code{HCDT}z2, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_lines_xy (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}x2, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {C function} @code{void} mgl_lines (@code{HMGL} gr, @code{HCDT}y1, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+The function draws lines between points @{@var{x1}, @var{y1}, @var{z1}@} and @{@var{x2}, @var{y2}, @var{z2}@}. String @var{pen} specifies the color (see @ref{Line styles}). By default (@code{pen=""}) color from palette is used (see @ref{Palette and colors}). The minor sizes of all arrays must be the same. The plots are drawn for each row if one of the data is the matrix. See also @ref{plot}, @ref{traj}. @sref{lines sample}
+@end deftypefn
+
 @anchor{traj}
 @deftypefn {MGL command} {} traj xdat ydat udat vdat ['sch'='']
 @deftypefnx {MGL command} {} traj xdat ydat zdat udat vdat wdat ['sch'='']
@@ -3688,6 +3769,7 @@ The function draws the surface of triangles. Triangle vertexes are set by indexe
 The function draws contour lines for surface of triangles at @var{z}=@var{v}[k] (or at  @var{z} equal to minimal z-axis value if @var{sch} contain symbol @samp{_}). Triangle vertexes are set by indexes @var{id} of data points @{@var{x}[i], @var{y}[i], @var{z}[i]@}. Contours are plotted for @var{z}[i,j]=@var{v}[k] where @var{v}[k] are values of data array @var{v}. If @var{v} is absent then arrays of option @code{value} elements  equidistantly distributed in color range is used. String @var{sch} sets the color scheme. Array @var{c} (if specified) is used for contour coloring. First dimensions of @var{id} must be 3 or greater. Arrays @var{x}, @var{y}, @var{z} must have equal sizes. Parameter @var{c} set the colors of triangles (if @var{id}.ny=@var{c}.nx) or colors of vertexes (if @var{x}.nx=@var{c}.nx). See also @ref{triplot}, @ref{cont}, @ref{triangulation}.
 @end deftypefn
 
+
 @anchor{quadplot}
 @deftypefn {MGL command} {} quadplot idat xdat ydat ['sch'='']
 @deftypefnx {MGL command} {} quadplot idat xdat ydat zdat ['sch'='']
index 6c92fbf87714ac171ee42d5d72d6ade72f4f9850..c465cb821835902a39547a3a11e70e42037889bf 100644 (file)
 @deftypefn {Метод класса @code{mglGraph}} @code{HMGL} Self ()
 Возвращает указатель на используемый объект типа @code{HMGL}.
 @end deftypefn
+
+@deftypefn {Функция С} @code{HMGL} mgl_default_graph ()
+Возвращает указатель на экземпляр класса mglGraph. Этот объект используется по умолчанию при создании нового класса с целью сохранения настроек и ускорения инициализации в различных графиках.
+@end deftypefn
 @end ifclear
 
 @ifset UDAV
@@ -452,6 +456,15 @@ MGL не требует создания данного типа объекто
 Включает/выключает масштабирование текста в относительных @ref{inplot}-ах (в том числе @ref{columnplot}, @ref{gridplot}, @ref{stickplot}, @ref{shearplot}).
 @end deftypefn
 
+@anchor{texparse}
+@deftypefn {Команда MGL} {} texparse @code{val}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} SetTeXparse (@code{bool} val)
+@deftypefnx {Функция С} @code{void} mgl_set_tex_parse (@code{HMGL} gr, @code{int} val)
+@end ifclear
+Включает/выключает распознавание TeX-подобных команд при печати текста.
+@end deftypefn
+
 @anchor{loadfont}
 @deftypefn {Команда MGL} {} loadfont ['name'='']
 @ifclear UDAV
@@ -661,6 +674,11 @@ Setsize: размер(ы) равны нулю или отрицательны
 Возвращает предупреждения, не привязанные к конкретному объекту рисования.
 @end deftypefn
 
+@deftypefn {Метод класса @code{mglGraph}} @code{void} ClearGlobalWarn () static
+@deftypefnx {Функция С} @code{void} mgl_clear_global_warn ()
+Удаляет общие предупреждения.
+@end deftypefn
+
 
 @end ifclear
 
@@ -1177,6 +1195,7 @@ Ternary -- специальный тип графика для 3 зависим
 @deftypefnx {Функция С} @code{void} mgl_titlew (@code{HMGL} gr, @code{const wchar_t *}txt, @code{const char *}stl, @code{mreal} size)
 @end ifclear
 Выводит заголовок @var{title} для текущего "подграфика" шрифтом @var{stl} с размером @var{size}. Если строка @var{stl} содержит @samp{#}, то рисуется обрамляющий прямоугольник. Функция сбрасывает матрицу трансформации (повороты и сжатие графика) и должна вызываться сразу после создания "подграфика".
+Следует отметить, что каждый последующий вызов команды резервирует дополнительное место. Поэтому следует вручную вызвать @ref{subplot} после @ref{rasterize} если требуется совместить растровые и векторные куски графика.
 @end deftypefn
 
 @anchor{rotate}
@@ -1612,7 +1631,7 @@ gr.GetBGRN(bits, len(bits));
 
 @deftypefn {Метод класса @code{mglGraph}} @code{int} GetObjId (@code{int} xs, @code{int} ys)
 @deftypefnx {Функция С} @code{int} mgl_get_obj_id (@code{HMGL} gr, @code{int} xs, @code{int} ys)
-Возвращает числовой идентификатор верхнего объекта в точке @{xs, ys@} рисунка.
+Возвращает числовой идентификатор верхнего объекта в точке @{xs, ys@} рисунка. Следует отметить, что все графики из одной строки MGL скрипта имеют одинаковый идентификатор.
 @end deftypefn
 
 @deftypefn {Метод класса @code{mglGraph}} @code{int} GetSplId (@code{int} xs, @code{int} ys)
@@ -1706,18 +1725,28 @@ These functions change background image.
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Rasterize ()
 @deftypefnx {Функция С} @code{void} mgl_rasterize (@code{HMGL} gr)
 @end ifclear
-Завершает рисование графика и помещает результат в качестве фона. После этого, очищает список примитивов (как @ref{clf}). Функция полезна для сохранения части графика (например, поверхностей или векторных полей) в растровом виде, а другой части (кривых, осей и пр.) в векторном.
+Завершает рисование графика и помещает результат в качестве фона. После этого, очищает список примитивов (как @ref{clf}). Функция полезна для сохранения части графика (например, поверхностей или векторных полей) в растровом виде, а другой части (кривых, осей и пр.) в векторном. Часто требуется вызвать команду @ref{subplot} после @ref{rasterize} во избежание выделения дополнительного места или вращения графика.
 @end deftypefn
 
 @anchor{background}
 @deftypefn {Команда MGL} {} background 'fname' [@code{alpha=1}]
+@deftypefnx {Команда MGL} {} background 'fname' 'how' [@code{alpha=1}]
 @ifclear UDAV
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{double} alpha=@code{1})
 @deftypefnx {Функция С} @code{void} mgl_load_background (@code{HMGL} gr, @code{const char *} fname, @code{double} alpha)
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} LoadBackground (@code{const char *} fname, @code{const char *} how, @code{double} alpha=@code{1})
+@deftypefnx {Функция С} @code{void} mgl_load_background_ext (@code{HMGL} gr, @code{const char *} fname, @code{const char *} how, @code{double} alpha)
 @end ifclear
-Загружает PNG или JPEG файл @var{fname} в качестве фона для графика. Параметр @var{alpha} задает прозрачность фона вручную.
+Загружает PNG или JPEG файл @var{fname} в качестве фона для графика. Параметр @var{alpha} задает прозрачность фона вручную. Параметр @var{how} может содержать: @samp{a} для заполнения текущего @ref{subplot}, @samp{s} для растягивания на всю область, @samp{c} для центрирования, @samp{m} для заполнения мозаикой.
 @end deftypefn
 
+@deftypefn {Команда MGL} {} background [@code{r g b}]
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} FillBackground (@code{const mglColor &}rgb)
+@deftypefnx {Функция С} @code{void} mgl_fill_background (@code{HMGL} gr, @code{double} r, @code{double} g, @code{double} b)
+@end ifclear
+Заполняет фон указанным цветом. Значения должны быть в диапазоне от 0 до 1.
+@end deftypefn
 
 @c ##################################################################
 @external{}
@@ -1791,13 +1820,13 @@ These functions change background image.
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Face (@code{mglPoint} p1, @code{mglPoint} p2, @code{mglPoint} p3, @code{mglPoint} p4, @code{const char *}stl=@code{"w"})
 @deftypefnx {Функция С} @code{void} mgl_face (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} x3, @code{mreal} y3, @code{mreal} z3, @code{mreal} x4, @code{mreal} y4, @code{mreal} z4, @code{const char *}stl)
 @end ifclear
-Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
+Рисует заполненный четырехугольник (грань) с углами в точках @var{p1}, @var{p2}, @var{p3}, @var{p4} и цветом(-ами) @var{stl}. При этом цвет может быть один для всей грани, или различным если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}).
 @end deftypefn
 
 @anchor{rect}
 @deftypefn {Команда MGL} {} rect @code{x1 y1 x2 y2} ['stl'='']
 @deftypefnx {Команда MGL} {} rect @code{x1 y1 z1 x2 y2 z2} ['stl'='']
-Рисует закрашенный прямоугольник (грань) с вершинами @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@} цветом @var{stl}. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
+Рисует закрашенный прямоугольник (грань) с вершинами @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@} цветом @var{stl}. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Грань будет нарисована даже если часть ее лежит вне диапазона осей координат. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}).
 @end deftypefn
 
 @anchor{facex}
@@ -1814,7 +1843,7 @@ These functions change background image.
 @deftypefnx {Функция С} @code{void} mgl_facey (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wz, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2)
 @deftypefnx {Функция С} @code{void} mgl_facez (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} wx, @code{mreal} wy, @code{const char *}stl, @code{mreal} d1, @code{mreal} d2)
 @end ifclear
-Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
+Рисует закрашенный прямоугольник (грань) перпендикулярно оси [x,y,z] в точке @{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl} и шириной @var{wx}, @var{wy}, @var{wz} вдоль соответствующего направления. При этом цвет может быть один для всей грани, или различным для разных вершин если указаны все 4 цвета. Параметр @var{stl} может также содержать параметры маски (см. @ref{Color scheme}). Параметры @var{d1}!=0, @var{d2}!=0 задают дополнительный сдвиг последней точки (т.е. рисуют четырехугольник). Грань будет нарисована даже если часть ее лежит вне диапазона осей координат.
 @end deftypefn
 
 @anchor{sphere}
@@ -1863,7 +1892,7 @@ These functions change background image.
 @ifclear UDAV
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Circle (@code{mglPoint} p, @code{mreal} r, @code{const char *}stl=@code{"r"})
 @end ifclear
-Рисует круг радиуса @var{r} с центром в точке @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными).
+Рисует круг радиуса @var{r} с центром в точке @var{p}=@{@var{x0}, @var{y0}, @var{z0}@} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}).
 @end deftypefn
 
 @anchor{ellipse}
@@ -1873,7 +1902,7 @@ These functions change background image.
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Ellipse (@code{mglPoint} p1, @code{mglPoint} p2, @code{mreal} r, @code{const char *}col=@code{"r"})
 @deftypefnx {Функция С} @code{void} mgl_ellipse (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} r, @code{const char *}col)
 @end ifclear
-Рисует эллипс радиуса @var{r} с фокусами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными).
+Рисует эллипс радиуса @var{r} с фокусами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}).
 @end deftypefn
 
 @anchor{rhomb}
@@ -1883,7 +1912,7 @@ These functions change background image.
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Rhomb (@code{mglPoint} p1, @code{mglPoint} p2, @code{mreal} r, @code{const char *}col=@code{"r"})
 @deftypefnx {Функция С} @code{void} mgl_rhomb (@code{HMGL} gr, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{mreal} x2, @code{mreal} y2, @code{mreal} z2, @code{mreal} r, @code{const char *}col)
 @end ifclear
-Рисует ромб ширины @var{r} с вершинами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Если @var{col} содержит 3 цвета, то используется градиентная заливка.
+Рисует ромб ширины @var{r} с вершинами в точках @var{p1}, @var{p2} цветом @var{stl}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Если @var{col} содержит 3 цвета, то используется градиентная заливка. Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}).
 @end deftypefn
 
 @anchor{arc}
@@ -1906,7 +1935,7 @@ These functions change background image.
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Polygon (@code{mglPoint} p0, @code{mglPoint} p1, @code{int} num, @code{const char *}col=@code{"r"})
 @deftypefnx {Функция С} @code{void} mgl_polygon (@code{HMGL} gr, @code{mreal} x0, @code{mreal} y0, @code{mreal} z0, @code{mreal} x1, @code{mreal} y1, @code{mreal} z1, @code{int} num, @code{const char *}col)
 @end ifclear
-Рисует правильный @var{num}-угольник с центром в @var{p0} с первой вершиной в @var{p1} цветом @var{col}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными).
+Рисует правильный @var{num}-угольник с центром в @var{p0} с первой вершиной в @var{p1} цветом @var{col}. Если @var{col} содержит: @samp{#} то рисуется только граница, @samp{@@} то рисуется граница (вторым цветом из @var{col} или черными). Параметр @var{col} может также содержать параметры маски (см. @ref{Color scheme}).
 @c Если @var{col} содержит 3 цвета, то используется градиентная заливка.
 @end deftypefn
 
@@ -1921,8 +1950,6 @@ These functions change background image.
 Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command options}. Bitmap can be loaded from file or specified as RGBA values for pixels. Parameter @var{smooth} set to draw bitmap without or with color interpolation.
 @end deftypefn
 
-
-
 @anchor{symbol}
 @deftypefn {Команда MGL} {} symbol @code{x y} 'id' ['fnt'='' @code{size=-1}]
 @deftypefnx {Команда MGL} {} symbol @code{x y z} 'id' ['fnt'='' @code{size=-1}]
@@ -2319,7 +2346,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Функция С} @code{void} mgl_tape_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_tape_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-Функции рисуют ленты, которые вращаются вокруг кривой @{@var{x}[i], @var{y}[i], @var{z}[i]@} как её нормали. Начальная лента(ы) выбираются в плоскости x-y (для @samp{x} в @var{pen}) и/или y-z (для @samp{x} в @var{pen}). Ширина лент пропорциональна @ref{barwidth}, а также может быть изменена опцией @code{value}. См. также @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample}
+ФÑ\83нкÑ\86ии Ñ\80иÑ\81Ñ\83Ñ\8eÑ\82 Ð»ÐµÐ½Ñ\82Ñ\8b, ÐºÐ¾Ñ\82оÑ\80Ñ\8bе Ð²Ñ\80аÑ\89аÑ\8eÑ\82Ñ\81Ñ\8f Ð²Ð¾ÐºÑ\80Ñ\83г ÐºÑ\80ивой @{@var{x}[i], @var{y}[i], @var{z}[i]@} ÐºÐ°Ðº ÐµÑ\91 Ð½Ð¾Ñ\80мали. Ð\9dаÑ\87алÑ\8cнаÑ\8f Ð»ÐµÐ½Ñ\82а(Ñ\8b) Ð²Ñ\8bбиÑ\80аÑ\8eÑ\82Ñ\81Ñ\8f Ð² Ð¿Ð»Ð¾Ñ\81коÑ\81Ñ\82и x-y (длÑ\8f @samp{x} Ð² @var{pen}) Ð¸/или y-z (длÑ\8f @samp{x} Ð² @var{pen}). Ð\9fаÑ\80амеÑ\82Ñ\80 @var{pen} Ð¼Ð¾Ð¶ÐµÑ\82 Ñ\82акже Ñ\81одеÑ\80жаÑ\82Ñ\8c Ð¿Ð°Ñ\80амеÑ\82Ñ\80Ñ\8b Ð¼Ð°Ñ\81ки (Ñ\81м. @ref{Color scheme}). Ð¨Ð¸Ñ\80ина Ð»ÐµÐ½Ñ\82 Ð¿Ñ\80опоÑ\80Ñ\86ионалÑ\8cна @ref{barwidth}, Ð° Ñ\82акже Ð¼Ð¾Ð¶ÐµÑ\82 Ð±Ñ\8bÑ\82Ñ\8c Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð° Ð¾Ð¿Ñ\86ией @code{value}. Ð¡Ð¼. Ñ\82акже @ref{plot}, @ref{flow}, @ref{barwidth}. @sref{tape sample}
 @end deftypefn
 
 @anchor{area}
@@ -2334,7 +2361,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Функция С} @code{void} mgl_area_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_area_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-Функции рисуют ломанную линию между точками и закрашивает её вниз до плоскости осей координат. Градиентная заливка используется если число цветов равно удвоенному число кривых. Если @var{pen} содержит @samp{#}, то рисуется только каркас. Если @var{pen} содержит @samp{a}, то рисуются и сегменты между точками вне диапазона осей координат. См. также @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample}
+ФÑ\83нкÑ\86ии Ñ\80иÑ\81Ñ\83Ñ\8eÑ\82 Ð»Ð¾Ð¼Ð°Ð½Ð½Ñ\83Ñ\8e Ð»Ð¸Ð½Ð¸Ñ\8e Ð¼ÐµÐ¶Ð´Ñ\83 Ñ\82оÑ\87ками Ð¸ Ð·Ð°ÐºÑ\80аÑ\88иваеÑ\82 ÐµÑ\91 Ð²Ð½Ð¸Ð· Ð´Ð¾ Ð¿Ð»Ð¾Ñ\81коÑ\81Ñ\82и Ð¾Ñ\81ей ÐºÐ¾Ð¾Ñ\80динаÑ\82. Ð\93Ñ\80адиенÑ\82наÑ\8f Ð·Ð°Ð»Ð¸Ð²ÐºÐ° Ð¸Ñ\81полÑ\8cзÑ\83еÑ\82Ñ\81Ñ\8f ÐµÑ\81ли Ñ\87иÑ\81ло Ñ\86веÑ\82ов Ñ\80авно Ñ\83двоенномÑ\83 Ñ\87иÑ\81ло ÐºÑ\80ивÑ\8bÑ\85. Ð\95Ñ\81ли @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{#}, Ñ\82о Ñ\80иÑ\81Ñ\83еÑ\82Ñ\81Ñ\8f Ñ\82олÑ\8cко ÐºÐ°Ñ\80каÑ\81. Ð\95Ñ\81ли @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{a}, Ñ\82о Ñ\80иÑ\81Ñ\83Ñ\8eÑ\82Ñ\81Ñ\8f Ð¸ Ñ\81егменÑ\82Ñ\8b Ð¼ÐµÐ¶Ð´Ñ\83 Ñ\82оÑ\87ками Ð²Ð½Ðµ Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½Ð° Ð¾Ñ\81ей ÐºÐ¾Ð¾Ñ\80динаÑ\82. Ð\9fаÑ\80амеÑ\82Ñ\80 @var{pen} Ð¼Ð¾Ð¶ÐµÑ\82 Ñ\82акже Ñ\81одеÑ\80жаÑ\82Ñ\8c Ð¿Ð°Ñ\80амеÑ\82Ñ\80Ñ\8b Ð¼Ð°Ñ\81ки (Ñ\81м. @ref{Color scheme}). Ð¡Ð¼. Ñ\82акже @ref{plot}, @ref{bars}, @ref{stem}, @ref{region}. @sref{area sample}
 @end deftypefn
 
 @anchor{region}
@@ -2351,7 +2378,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Функция С} @code{void} mgl_region_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_region_3d (@code{HMGL} gr, @code{HCDT} x1, @code{HCDT} y1, @code{HCDT} z1, @code{HCDT} x2, @code{HCDT} y2, @code{HCDT} z2, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-Функции закрашивают область между 2 кривыми. Градиентная заливка используется если число цветов равно удвоенному число кривых. Если в 2d версии @var{pen} содержит @samp{i}, то закрашивается только область y1<y<y2, в противном случае будет закрашена и область y2<y<y1. Если @var{pen} содержит @samp{#}, то рисуется только каркас. Если @var{pen} содержит @samp{a}, то рисуются и сегменты между точками вне диапазона осей координат. См. также @ref{area}, @ref{bars}, @ref{stem}. @sref{region sample}
+ФÑ\83нкÑ\86ии Ð·Ð°ÐºÑ\80аÑ\88иваÑ\8eÑ\82 Ð¾Ð±Ð»Ð°Ñ\81Ñ\82Ñ\8c Ð¼ÐµÐ¶Ð´Ñ\83 2 ÐºÑ\80ивÑ\8bми. Ð\93Ñ\80адиенÑ\82наÑ\8f Ð·Ð°Ð»Ð¸Ð²ÐºÐ° Ð¸Ñ\81полÑ\8cзÑ\83еÑ\82Ñ\81Ñ\8f ÐµÑ\81ли Ñ\87иÑ\81ло Ñ\86веÑ\82ов Ñ\80авно Ñ\83двоенномÑ\83 Ñ\87иÑ\81ло ÐºÑ\80ивÑ\8bÑ\85. Ð\95Ñ\81ли Ð² 2d Ð²ÐµÑ\80Ñ\81ии @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{i}, Ñ\82о Ð·Ð°ÐºÑ\80аÑ\88иваеÑ\82Ñ\81Ñ\8f Ñ\82олÑ\8cко Ð¾Ð±Ð»Ð°Ñ\81Ñ\82Ñ\8c y1<y<y2, Ð² Ð¿Ñ\80оÑ\82ивном Ñ\81лÑ\83Ñ\87ае Ð±Ñ\83деÑ\82 Ð·Ð°ÐºÑ\80аÑ\88ена Ð¸ Ð¾Ð±Ð»Ð°Ñ\81Ñ\82Ñ\8c y2<y<y1. Ð\95Ñ\81ли @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{#}, Ñ\82о Ñ\80иÑ\81Ñ\83еÑ\82Ñ\81Ñ\8f Ñ\82олÑ\8cко ÐºÐ°Ñ\80каÑ\81. Ð\95Ñ\81ли @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{a}, Ñ\82о Ñ\80иÑ\81Ñ\83Ñ\8eÑ\82Ñ\81Ñ\8f Ð¸ Ñ\81егменÑ\82Ñ\8b Ð¼ÐµÐ¶Ð´Ñ\83 Ñ\82оÑ\87ками Ð²Ð½Ðµ Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½Ð° Ð¾Ñ\81ей ÐºÐ¾Ð¾Ñ\80динаÑ\82. Ð\9fаÑ\80амеÑ\82Ñ\80 @var{pen} Ð¼Ð¾Ð¶ÐµÑ\82 Ñ\82акже Ñ\81одеÑ\80жаÑ\82Ñ\8c Ð¿Ð°Ñ\80амеÑ\82Ñ\80Ñ\8b Ð¼Ð°Ñ\81ки (Ñ\81м. @ref{Color scheme}). Ð¡Ð¼. Ñ\82акже @ref{area}, @ref{bars}, @ref{stem}. @sref{region sample}
 @end deftypefn
 
 @anchor{stem}
@@ -2390,7 +2417,9 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @item
 @samp{F} для использования одинаковой (минимальной) ширины полосок;
 @item
-@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат.
+@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат;
+@item
+параметры маски (см. @ref{Color scheme}).
 @end itemize
 Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. Если @var{x}.nx>@var{y}.nx, то массив @var{x} задает границы полос, а не их центр. См. также @ref{barh}, @ref{cones}, @ref{area}, @ref{stem}, @ref{chart}, @ref{barwidth}. @sref{bars sample}
 @end deftypefn
@@ -2413,7 +2442,9 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @item
 @samp{F} для использования одинаковой (минимальной) ширины полосок;
 @item
-@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат.
+@samp{<}, @samp{^} or @samp{>} для выравнивания полосок влево, вправо или центрирования относительно их координат;
+@item
+параметры маски (см. @ref{Color scheme}).
 @end itemize
 Можно использовать разные цвета для положительных и отрицательных значений если число указанных цветов равно удвоенному числу кривых для построения. Если @var{x}.nx>@var{y}.nx, то массив @var{x} задает границы полос, а не их центр. См. также @ref{bars}, @ref{barwidth}. @sref{barh sample}
 @end deftypefn
@@ -2454,7 +2485,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Chart (@code{const mglDataA &}a, @code{const char *}col=@code{""}, @code{const char *}opt=@code{""})
 @deftypefnx {Функция С} @code{void} mgl_chart (@code{HMGL} gr, @code{HCDT} a, @code{const char *}col, @code{const char *}opt)
 @end ifclear
-Рисует цветные полосы (пояса) для массива данных @var{a}. Число полос равно числу строк @var{a} (равно @var{a.ny}). Цвет полос поочерёдно меняется из цветов указанных в @var{col} или в палитре (см. @ref{Palette and colors}). Пробел в цветах соответствует прозрачному "цвету", т.е. если @var{col} содержит пробел(ы), то соответствующая полоса не рисуется. Ширина полосы пропорциональна значению элемента в @var{a}. График строится только для массивов не содержащих отрицательных значений. Если строка @var{col} содержит @samp{#}, то рисуется также чёрная граница полос. График выглядит лучше в (после вращения системы координат) и/или в полярной системе координат (становится Pie chart). @sref{chart sample}
+РиÑ\81Ñ\83еÑ\82 Ñ\86веÑ\82нÑ\8bе Ð¿Ð¾Ð»Ð¾Ñ\81Ñ\8b (поÑ\8fÑ\81а) Ð´Ð»Ñ\8f Ð¼Ð°Ñ\81Ñ\81ива Ð´Ð°Ð½Ð½Ñ\8bÑ\85 @var{a}. Ð§Ð¸Ñ\81ло Ð¿Ð¾Ð»Ð¾Ñ\81 Ñ\80авно Ñ\87иÑ\81лÑ\83 Ñ\81Ñ\82Ñ\80ок @var{a} (Ñ\80авно @var{a.ny}). Ð¦Ð²ÐµÑ\82 Ð¿Ð¾Ð»Ð¾Ñ\81 Ð¿Ð¾Ð¾Ñ\87еÑ\80Ñ\91дно Ð¼ÐµÐ½Ñ\8fеÑ\82Ñ\81Ñ\8f Ð¸Ð· Ñ\86веÑ\82ов Ñ\83казаннÑ\8bÑ\85 Ð² @var{col} Ð¸Ð»Ð¸ Ð² Ð¿Ð°Ð»Ð¸Ñ\82Ñ\80е (Ñ\81м. @ref{Palette and colors}). Ð\9fÑ\80обел Ð² Ñ\86веÑ\82аÑ\85 Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83еÑ\82 Ð¿Ñ\80озÑ\80аÑ\87номÑ\83 "Ñ\86веÑ\82Ñ\83", Ñ\82.е. ÐµÑ\81ли @var{col} Ñ\81одеÑ\80жиÑ\82 Ð¿Ñ\80обел(Ñ\8b), Ñ\82о Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83Ñ\8eÑ\89аÑ\8f Ð¿Ð¾Ð»Ð¾Ñ\81а Ð½Ðµ Ñ\80иÑ\81Ñ\83еÑ\82Ñ\81Ñ\8f. Ð¨Ð¸Ñ\80ина Ð¿Ð¾Ð»Ð¾Ñ\81Ñ\8b Ð¿Ñ\80опоÑ\80Ñ\86ионалÑ\8cна Ð·Ð½Ð°Ñ\87ениÑ\8e Ñ\8dлеменÑ\82а Ð² @var{a}. Ð\93Ñ\80аÑ\84ик Ñ\81Ñ\82Ñ\80оиÑ\82Ñ\81Ñ\8f Ñ\82олÑ\8cко Ð´Ð»Ñ\8f Ð¼Ð°Ñ\81Ñ\81ивов Ð½Ðµ Ñ\81одеÑ\80жаÑ\89иÑ\85 Ð¾Ñ\82Ñ\80иÑ\86аÑ\82елÑ\8cнÑ\8bÑ\85 Ð·Ð½Ð°Ñ\87ений. Ð\95Ñ\81ли Ñ\81Ñ\82Ñ\80ока @var{col} Ñ\81одеÑ\80жиÑ\82 @samp{#}, Ñ\82о Ñ\80иÑ\81Ñ\83еÑ\82Ñ\81Ñ\8f Ñ\82акже Ñ\87Ñ\91Ñ\80наÑ\8f Ð³Ñ\80аниÑ\86а Ð¿Ð¾Ð»Ð¾Ñ\81. Ð\9fаÑ\80амеÑ\82Ñ\80 @var{col} Ð¼Ð¾Ð¶ÐµÑ\82 Ñ\82акже Ñ\81одеÑ\80жаÑ\82Ñ\8c Ð¿Ð°Ñ\80амеÑ\82Ñ\80Ñ\8b Ð¼Ð°Ñ\81ки (Ñ\81м. @ref{Color scheme}). Ð\93Ñ\80аÑ\84ик Ð²Ñ\8bглÑ\8fдиÑ\82 Ð»Ñ\83Ñ\87Ñ\88е Ð² (поÑ\81ле Ð²Ñ\80аÑ\89ениÑ\8f Ñ\81иÑ\81Ñ\82емÑ\8b ÐºÐ¾Ð¾Ñ\80динаÑ\82) Ð¸/или Ð² Ð¿Ð¾Ð»Ñ\8fÑ\80ной Ñ\81иÑ\81Ñ\82еме ÐºÐ¾Ð¾Ñ\80динаÑ\82 (Ñ\81Ñ\82ановиÑ\82Ñ\81Ñ\8f Pie chart). @sref{chart sample}
 @end deftypefn
 
 @anchor{boxplot}
@@ -2485,7 +2516,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Функция С} @code{void} mgl_candle_yv (@code{HMGL} gr, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_candle_xyv (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} v1, @code{HCDT} v2, @code{HCDT} y1, @code{HCDT} y2, @code{const char *}pen, @code{const char *}opt)
 @end ifclear
-Функции рисуют candlestick chart в точках @var{x}[i]. Этот график показывает прямоугольником ("свечой") диапазон изменения величины. Прозрачная (белая) свеча соответствует росту величины @var{v1}[i]<@var{v2}[i], чёрная -- уменьшению. "Тени" показывают минимальное @var{y1} и максимальное @var{y2} значения. Если @var{v2} отсутствует, то он определяется как @var{v2}[i]=@var{v1}[i+1]. Можно использовать разные цвета для растущих и падающих дней если число указанных цветов равно удвоенному числу кривых для построения. Если @var{pen} содержит @samp{#}, то прозрачная свеча будет использована и при 2-цветной схеме. См. также @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample}
+ФÑ\83нкÑ\86ии Ñ\80иÑ\81Ñ\83Ñ\8eÑ\82 candlestick chart Ð² Ñ\82оÑ\87каÑ\85 @var{x}[i]. Ð­Ñ\82оÑ\82 Ð³Ñ\80аÑ\84ик Ð¿Ð¾ÐºÐ°Ð·Ñ\8bваеÑ\82 Ð¿Ñ\80Ñ\8fмоÑ\83голÑ\8cником ("Ñ\81веÑ\87ой") Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½ Ð¸Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ\8f Ð²ÐµÐ»Ð¸Ñ\87инÑ\8b. Ð\9fÑ\80озÑ\80аÑ\87наÑ\8f (белаÑ\8f) Ñ\81веÑ\87а Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83еÑ\82 Ñ\80оÑ\81Ñ\82Ñ\83 Ð²ÐµÐ»Ð¸Ñ\87инÑ\8b @var{v1}[i]<@var{v2}[i], Ñ\87Ñ\91Ñ\80наÑ\8f -- Ñ\83менÑ\8cÑ\88ениÑ\8e. "Тени" Ð¿Ð¾ÐºÐ°Ð·Ñ\8bваÑ\8eÑ\82 Ð¼Ð¸Ð½Ð¸Ð¼Ð°Ð»Ñ\8cное @var{y1} Ð¸ Ð¼Ð°ÐºÑ\81ималÑ\8cное @var{y2} Ð·Ð½Ð°Ñ\87ениÑ\8f. Ð\95Ñ\81ли @var{v2} Ð¾Ñ\82Ñ\81Ñ\83Ñ\82Ñ\81Ñ\82вÑ\83еÑ\82, Ñ\82о Ð¾Ð½ Ð¾Ð¿Ñ\80еделÑ\8fеÑ\82Ñ\81Ñ\8f ÐºÐ°Ðº @var{v2}[i]=@var{v1}[i+1]. Ð\9cожно Ð¸Ñ\81полÑ\8cзоваÑ\82Ñ\8c Ñ\80азнÑ\8bе Ñ\86веÑ\82а Ð´Ð»Ñ\8f Ñ\80аÑ\81Ñ\82Ñ\83Ñ\89иÑ\85 Ð¸ Ð¿Ð°Ð´Ð°Ñ\8eÑ\89иÑ\85 Ð´Ð½ÐµÐ¹ ÐµÑ\81ли Ñ\87иÑ\81ло Ñ\83казаннÑ\8bÑ\85 Ñ\86веÑ\82ов Ñ\80авно Ñ\83двоенномÑ\83 Ñ\87иÑ\81лÑ\83 ÐºÑ\80ивÑ\8bÑ\85 Ð´Ð»Ñ\8f Ð¿Ð¾Ñ\81Ñ\82Ñ\80оениÑ\8f. Ð\95Ñ\81ли @var{pen} Ñ\81одеÑ\80жиÑ\82 @samp{#}, Ñ\82о Ð¿Ñ\80озÑ\80аÑ\87наÑ\8f Ñ\81веÑ\87а Ð±Ñ\83деÑ\82 Ð¸Ñ\81полÑ\8cзована Ð¸ Ð¿Ñ\80и 2-Ñ\86веÑ\82ной Ñ\81Ñ\85еме. Ð\9fаÑ\80амеÑ\82Ñ\80 @var{pen} Ð¼Ð¾Ð¶ÐµÑ\82 Ñ\82акже Ñ\81одеÑ\80жаÑ\82Ñ\8c Ð¿Ð°Ñ\80амеÑ\82Ñ\80Ñ\8b Ð¼Ð°Ñ\81ки (Ñ\81м. @ref{Color scheme}). Ð¡Ð¼. Ñ\82акже @ref{plot}, @ref{bars}, @ref{ohlc}, @ref{barwidth}. @sref{candle sample}
 @end deftypefn
 
 @anchor{ohlc}
@@ -3054,7 +3085,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefn {Команда MGL} {} cont3 adat ['sch'='' @code{sval=-1}]
 @deftypefnx {Команда MGL} {} cont3 xdat ydat zdat adat ['sch'='' @code{sval=-1}]
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Cont3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Функция С} @code{void} mgl_cont3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_cont3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
@@ -3077,7 +3108,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefn {Команда MGL} {} contf3 adat ['sch'='' @code{sval=-1}]
 @deftypefnx {Команда MGL} {} contf3 xdat ydat zdat adat ['sch'='' @code{sval=-1}]
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Метод класса @code{mglGraph}} @code{void} Contf3 (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const char *}sch=@code{""}, @code{mreal} sVal=@code{-1}, @code{const char *}opt=@code{""})
 @deftypefnx {Функция С} @code{void} mgl_contf3 (@code{HMGL} gr, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_contf3_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
@@ -3097,6 +3128,29 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 Рисует сетку для 3d массива, заданного параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). График рисуется на срезе @var{sVal} в направлении @{@samp{x}, @samp{y}, @samp{z}@}, указанном в строке @var{sch} (по умолчанию, в напралении @samp{y}). См. также @ref{cont3}, @ref{contf3}, @ref{dens3}, @ref{grid2}, @ref{meshnum}.
 @end deftypefn
 
+@anchor{dcont}
+@deftypefn {Команда MGL} {} dcont vdat adat bdat ['sch'='']
+@deftypefnx {Команда MGL} {} dcont vdat xdat ydat zdat adat bdat ['sch'='']
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}v, @code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Функция С} @code{void} mgl_dcont_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {Функция С} @code{void} mgl_dcont_xyz_val (@code{HMGL} gr, @code{HCDT} v, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+Рисует линии пересечений поверхностей постоянного уровня для 3d данных @var{a}, @var{b} заданных параметрически @var{a}[i,j,k](@var{x}[i,j,k], @var{y}[i,j,k], @var{z}[i,j,k]). Поверхности уровня берутся при значениях функции равных элементам массива @var{v}. См. также @ref{cont}, @ref{cont3}. @sref{dcont sample}
+@end deftypefn
+
+@deftypefn {Команда MGL} {} dcont adat bdat ['sch'='' @code{sval=-1}]
+@deftypefnx {Команда MGL} {} dcont xdat ydat zdat adat bdat ['sch'='' @code{sval=-1}]
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} DCont (@code{const mglDataA &}x, @code{const mglDataA &}y, @code{const mglDataA &}z, @code{const mglDataA &}a, @code{const mglDataA &}b, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Функция С} @code{void} mgl_dcont (@code{HMGL} gr, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{mreal} sVal, @code{const char *}opt)
+@deftypefnx {Функция С} @code{void} mgl_@code{HCDT} b, cont_xyz (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{HCDT} a, @code{HCDT} b, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+Аналогично предыдущему для @var{num} уровней равномерно распределённых в диапазоне изменения цвета. Величина @var{num} равна значению параметра @code{value} в опциях @var{opt} (по умолчанию 7).
+@end deftypefn
+
 @anchor{beam}
 @deftypefn {Команда MGL} {} beam tr g1 g2 adat @code{rval} ['sch'='' @code{flag=0 num=3}]
 @ifclear UDAV
@@ -3147,7 +3201,7 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 @deftypefnx {Функция С} @code{void} mgl_beltc (@code{HMGL} gr, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_beltc_xy (@code{HMGL} gr, @code{HCDT} x, @code{HCDT} y, @code{HCDT} z, @code{const char *}sch, @code{const char *}opt)
 @end ifclear
-Рисует ленточки для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с цветом, заданным массивом @var{c}[i,j]. График может использоваться как 3d обобщение графика @ref{plot}. Если @var{sch} содержит @samp{x}, то ленточки рисуются вдоль оси x, иначе (по умолчанию) вдоль оси y. См. также @ref{belt}, @ref{surfc}, @ref{meshnum}. @c TODO @sref{beltc sample}
+Рисует ленточки для параметрически заданной поверхности @{@var{x}[i,j], @var{y}[i,j], @var{z}[i,j]@} с цветом, заданным массивом @var{c}[i,j]. График может использоваться как 3d обобщение графика @ref{plot}. Если @var{sch} содержит @samp{x}, то ленточки рисуются вдоль оси x, иначе (по умолчанию) вдоль оси y. См. также @ref{belt}, @ref{surfc}, @ref{meshnum}. @sref{beltc sample}
 @end deftypefn
 
 
@@ -3302,6 +3356,21 @@ Draw bitmap (logo) along whole axis range, which can be changed by @ref{Command
 
 Эти функции рисуют графики для 2D и 3D векторных полей. Есть несколько типов графиков: просто векторное поле (Vect), вектора вдоль траектории (Traj), векторное поле каплями (Dew), нити тока (Flow, FlowP), трубки тока (Pipe). По умолчанию (если отсутствуют) значения @var{x}, @var{y} и @var{z} равно распределены в диапазоне осей координат. Младшие размерности массивов @var{x}, @var{y}, @var{z} и @var{ax} должны быть одинаковы. Размеры массивов @var{ax}, @var{ay} и @var{az} должны быть одинаковы. Массивы @var{x}, @var{y} и @var{z} могут быть векторами (не матрицами как @var{ax}). Строка @var{sch} задает цветовую схему (см. @ref{Color scheme}). Строка @var{opt} задает опции графика (см. @ref{Command options}).
 
+@anchor{lines}
+@deftypefn {Команда MGL} {} lines y1dat y2dat ['sch'='']
+@deftypefnx {Команда MGL} {} lines x1dat y1dat x2dat y2dat ['sch'='']
+@deftypefnx {Команда MGL} {} lines x1dat y1dat z1dat x2dat y2dat z2dat ['sch'='']
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}y1, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Метод класса @code{mglGraph}} @code{void} Lines (@code{const mglDataA &}x1, @code{const mglDataA &}y1, @code{const mglDataA &}z1, @code{const mglDataA &}x2, @code{const mglDataA &}y2, @code{const mglDataA &}z2, @code{const char *}sch=@code{""}, @code{const char *}opt=@code{""})
+@deftypefnx {Функция С} @code{void} mgl_lines_xyz (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}z1, @code{HCDT}x2, @code{HCDT}y2, @code{HCDT}z2, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {Функция С} @code{void} mgl_lines_xy (@code{HMGL} gr, @code{HCDT}x1, @code{HCDT}y1, @code{HCDT}x2, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt)
+@deftypefnx {Функция С} @code{void} mgl_lines (@code{HMGL} gr, @code{HCDT}y1, @code{HCDT}y2, @code{const char *}sch, @code{const char *}opt)
+@end ifclear
+Функция рисует линии между точками @{@var{x1}, @var{y1}, @var{z1}@} и @{@var{x2}, @var{y2}, @var{z2}@}. Строка @var{pen} задает цвет (см. @ref{Line styles}). По умолчанию (@code{pen=""}) используется текущий цвет из палитры (см. @ref{Palette and colors}). Размер по 1-му индексу должен быть одинаков. График рисуется для каждой строки если один из массивов матрица. См. также @ref{plot}, @ref{traj}. @sref{lines sample}
+@end deftypefn
+
 @anchor{traj}
 @deftypefn {Команда MGL} {} traj xdat ydat udat vdat ['sch'='']
 @deftypefnx {Команда MGL} {} traj xdat ydat zdat udat vdat wdat ['sch'='']
index 5e6814ef106c4d139090e3a64430fd27b11a7c4a..684afc1cb379f4328650a33b1e951cf57a85931e 100644 (file)
@@ -453,11 +453,28 @@ Allocates memory and copies the data from the @code{std::vector<T>} array.
 Allocates memory and scanf the data from the string.
 @end deftypefn
 
-
 @deftypefn {Method on @code{mglData}} @code{void} SetList (@code{long} n, ...)
 Allocate memory and set data from variable argument list of @emph{double} values. Note, you need to specify decimal point @samp{.} for integer values! For example, the code @code{SetList(2,0.,1.);} is correct, but the code @code{SetList(2,0,1);} is incorrect.
 @end deftypefn
 
+@deftypefn {Method on @code{mglData}} @code{void} Set (@code{const arma::vec &}d)
+@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const arma::mat &}d)
+@deftypefnx {Method on @code{mglData}} @code{void} Set (@code{const arma::cube &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::vec &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_vec &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::mat &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_mat &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cube &}d)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Set (@code{const arma::cx_cube &}d)
+Allocates memory and copies the data from the Armadillo structures.
+@end deftypefn
+
+@deftypefn {Method on @code{mglData}} @code{arma::mat} arma_mat (@code{long} k=0)
+@deftypefnx {Method on @code{mglData}} @code{arma::cube} arma_cube ()
+@deftypefnx {Method on @code{mglData}} @code{arma::cx_mat} arma_mat (@code{long} k=0)
+@deftypefnx {Method on @code{mglData}} @code{arma::cx_cube} arma_cube ()
+Return data in Armadillo format.
+@end deftypefn
 
 
 @deftypefn {Method on @code{mglData}} @code{void} Link (@code{mglData &}from)
@@ -497,7 +514,7 @@ Equidistantly fills the data values to range [@var{v1}, @var{v2}] in direction @
 @deftypefnx {C function} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt)
 @deftypefnx {C function} @code{void} mgl_datac_fill_eq (@code{HMGL} gr, @code{HADT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt)
 @end ifclear
-Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending  on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in axis range of canvas @var{gr} (in difference from @code{Modify} functions). Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat} which can be @code{NULL} (i.e. can be omitted).
+Fills the value of array according to the formula in string @var{eq}. Formula is an arbitrary expression depending  on variables @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in axis range of canvas @var{gr} (in difference from @code{Modify} functions). Variables @samp{i}, @samp{j}, @samp{k} denote corresponding index. At this, zero value is used for variables if corresponding dimension is absent in the data. Variable @samp{u} is the original value of the array. Variables @samp{v} and @samp{w} are values of @var{vdat}, @var{wdat} which can be @code{NULL} (i.e. can be omitted).
 @end deftypefn
 
 @anchor{modify}
@@ -515,7 +532,7 @@ Fills the value of array according to the formula in string @var{eq}. Formula is
 @deftypefnx {C function} @code{void} mgl_datac_modify (@code{HADT} dat, @code{const char *}eq, @code{int} dim)
 @deftypefnx {C function} @code{void} mgl_datac_modify_vw (@code{HADT} dat, @code{const char *}eq, @code{HCDT} v, @code{HCDT} w)
 @end ifclear
-The same as previous ones but coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1]. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}.
+The same as previous ones but coordinates @samp{x}, @samp{y}, @samp{z} are supposed to be normalized in range [0,1]. Variables @samp{i}, @samp{j}, @samp{k} denote corresponding index. At this, zero value is used for variables if corresponding dimension is absent in the data. If @var{dim}>0 is specified then modification will be fulfilled only for slices >=@var{dim}. 
 @end deftypefn
 
 @anchor{fillsample}
@@ -602,6 +619,99 @@ Sets the symbol @var{ids} for data columns. The string should contain one symbol
 @end deftypefn
 
 
+@anchor{bernoulli}
+@deftypefn {MGL command} {} bernoulli dat [@code{p=0.5}]
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndBernoulli (@code{mreal} p=0.5)
+@deftypefnx {C function} @code{void} mgl_data_rnd_bernoulli (@code{HMDT} dat, @code{mreal} p)
+@deftypefnx {C function} @code{mreal} mgl_rnd_bernoulli (@code{mreal} p)
+@end ifclear
+Fills data by random numbers of Bernoulli distribution with probability @var{p}.
+@end deftypefn
+
+@anchor{binomial}
+@deftypefn {MGL command} {} binomial dat @code{n [p=0.5]}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndBinomial (@code{long} n, @code{mreal} p=0.5)
+@deftypefnx {C function} @code{void} mgl_data_rnd_binomial (@code{HMDT} dat, @code{long} n, @code{mreal} p)
+@deftypefnx {C function} @code{mreal} mgl_rnd_binomial (@code{long} n, @code{mreal} p)
+@end ifclear
+Fills by random numbers according to binomial distribution in @var{n} coin flips with probability @var{p}.
+@end deftypefn
+
+@anchor{brownian}
+@deftypefn {MGL command} {} brownian dat @code{y1 y2 sigma h}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndBrownian (@code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h)
+@deftypefnx {C function} @code{void} mgl_data_rnd_brownian (@code{HMDT} dat, @code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h)
+@end ifclear
+Fills by fractional brownian motion.
+@end deftypefn
+
+@anchor{discrete}
+@deftypefn {MGL command} {} discrete dat vdat
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndDiscrete (@code{const mglDataA &}vdat)
+@deftypefnx {C function} @code{void} mgl_data_rnd_discrete (@code{HMDT} dat, @code{HCDT} vdat)
+@deftypefnx {C function} @code{mreal} mgl_rnd_discrete (@code{HCDT} vdat)
+@end ifclear
+Fills by random numbers according to discrete distribution.
+@end deftypefn
+
+@anchor{exponential}
+@deftypefn {MGL command} {} exponential dat [@code{p}]
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndExponential (@code{mreal} p)
+@deftypefnx {C function} @code{void} mgl_data_rnd_exponential (@code{HMDT} dat, @code{mreal} p)
+@deftypefnx {C function} @code{mreal} mgl_rnd_exponential (@code{mreal} p)
+@end ifclear
+Fills by random numbers according to exponential distribution with scale @var{p}.
+@end deftypefn
+
+@anchor{gaussian}
+@deftypefn {MGL command} {} gaussian dat [@code{mu=0 sigma=1}]
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndGaussian (@code{mreal} mu=0, @code{mreal} sigma=1)
+@deftypefnx {C function} @code{void} mgl_data_rnd_gaussian (@code{HMDT} dat, @code{mreal} mu, @code{mreal} sigma)
+@deftypefnx {C function} @code{mreal} mgl_rnd_gaussian (@code{mreal} mu, @code{mreal} sigma)
+@end ifclear
+Fills by random numbers according to Gaussian distribution with average @var{mu} and scale @var{sigma}.
+@end deftypefn
+
+@anchor{shuffle}
+@deftypefn {MGL command} {} shuffle dat ['dir'='a']
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndShuffle (@code{char} dir='a')
+@deftypefnx {C function} @code{void} mgl_data_rnd_shuffle (@code{HMDT} dat, @code{char} dir)
+@end ifclear
+Shuffle data cells (for @var{dir}=@samp{a}) or slices (for @var{dir}=@samp{xyz}).
+@end deftypefn
+
+@anchor{uniform}
+@deftypefn {MGL command} {} uniform dat @code{lo hi}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndUniform (@code{mreal} lo, @code{mreal} hi)
+@deftypefnx {C function} @code{void} mgl_data_rnd_uniform (@code{HMDT} dat, @code{mreal} lo, @code{mreal} hi)
+@deftypefnx {C function} @code{mreal} mgl_rnd_uniform (@code{mreal} lo, @code{mreal} hi)
+@end ifclear
+Fills by random numbers uniformly chosen in (@var{lo},@var{hi}).
+@end deftypefn
+
+@anchor{uniformint}
+@deftypefn {MGL command} {} uniformint dat @code{lo hi}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} RndInteger (@code{long} lo, @code{long} hi)
+@deftypefnx {C function} @code{void} mgl_data_rnd_integer (@code{HMDT} dat, @code{long} lo, @code{mreal} hi)
+@deftypefnx {C function} @code{long} mgl_rnd_integer (@code{long} lo, @code{long} hi)
+@end ifclear
+Fills by random integers uniformly chosen in [@var{lo},@var{hi}).
+@end deftypefn
+
+
+
+
+
+
 @c ------------------------------------------------------------------
 @external{}
 @node File I/O, Make another data, Data filling, Data processing
@@ -691,6 +801,10 @@ Read file @var{fname} line-by-line and scan each line for numbers according the
 Saves the whole data array (for @var{ns}=@code{-1}) or only @var{ns}-th slice to the text file @var{fname}.
 @end deftypefn
 
+@deftypefn {MGL command} {} save @code{val} dat 'fname'
+Saves the value @var{val} to the text file @var{fname}.
+@end deftypefn
+
 @deftypefn {MGL command} {} save 'str' 'fname' ['mode'='a']
 Saves the string @var{str} to the text file @var{fname}. For parameter @var{mode}=@samp{a} will append string to the file (default); for @var{mode}=@samp{w} will overwrite the file. @sref{Saving and scanning file}
 @end deftypefn
@@ -717,6 +831,15 @@ Reads data array named @var{dname} from HDF5 or HDF4 file. This function does no
 Saves data array named @var{dname} to HDF5 file. This function does nothing if HDF5 was disabled during library compilation.
 @end deftypefn
 
+@deftypefn {MGL command} {} savehdf @code{val} 'fname' 'dname' [@code{rewrite}=@code{off}]
+@ifclear UDAV
+@deftypefnx {C function} @code{void} mgl_real_save_hdf (@code{real} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@deftypefnx {C function} @code{void} mgl_dual_save_hdf (@code{dual} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@deftypefnx {C function} @code{void} mgl_int_save_hdf (@code{long} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@end ifclear
+Saves value @code{val} named @var{dname} to HDF5 file. This function does nothing if HDF5 was disabled during library compilation.
+@end deftypefn
+
 @anchor{datas}
 @deftypefn {MGL command} {} datas 'fname'
 @ifclear UDAV
@@ -760,6 +883,17 @@ Reads data from bitmap file (now support only PNG format). The RGB values of bit
 Saves data matrix (or @code{ns}-th slice for 3d data) to bitmap file (now support only PNG format). The data values are transformed from range [@var{v1}, @var{v2}] to RGB pixels of bitmap using color scheme @var{scheme} (@pxref{Color scheme}). If @var{v1}>=@var{v2} then the values of @var{v1}, @var{v2} are automatically determined as minimal and maximal value of the data array.
 @end deftypefn
 
+
+@anchor{readbin}
+@deftypefn {MGL command} {} readbin dat 'fname' @code{type}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{bool} ReadBin (@code{const char *}fname, @code{int} type)
+@deftypefnx {C function} @code{int} mgl_data_read_bin (@code{HMDT} dat, @code{const char *}fname, @code{int} type)
+@end ifclear
+Reads data from binary file. Parameter @var{type} determine the number format: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. NOTE: this function may not correctly read binary files written in different CPU kind! It is better to use HDF files, see @ref{readhdf}.
+@end deftypefn
+
+
 @c ------------------------------------------------------------------
 @external{}
 @node Make another data, Data changing, File I/O, Data processing
@@ -911,7 +1045,7 @@ Get curves @{x,y@}, separated by NAN values, for local maximal values of array @
 @deftypefnx {C function} @code{HMDT} mgl_data_hist (@code{HCDT} dat, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub)
 @deftypefnx {C function} @code{HMDT} mgl_data_hist_w (@code{HCDT} dat, @code{HCDT} w, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub)
 @end ifclear
-Creates @var{n}-th points distribution of the data values in range [@var{v1}, @var{v2}]. Array @var{w} specifies weights of the data elements (by default is 1). Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{Data manipulation}
+Creates @var{n}-th points distribution of the data values in range [@var{v1}, @var{v2}]. Array @var{w} specifies weights of the data elements (by default is 1). Parameter @var{nsub} define the number of additional interpolated points (for smoothness of histogram). If @var{nsub}<0 then linear interpolation is used instead of spline one. Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{Data manipulation}
 @end deftypefn
 
 @anchor{momentum}
@@ -1040,6 +1174,33 @@ Gets array of arguments of the data.
 Find pulse properties along direction @var{dir}: pulse maximum (in column 0) and its position (in column 1), pulse width near maximum (in column 3) and by half height (in column 2), energy in first pulse (in column 4). NAN values are used for widths if maximum is located near the edges. Note, that there is uncertainty for complex data. Usually one should use square of absolute value (i.e. |dat[i]|^2) for them. So, MathGL don't provide this function for complex data arrays. However, C function will work even in this case but use absolute value (i.e. |dat[i]|). Function return NULL or create empty data if data cannot be created for given arguments. See also @ref{max}, @ref{min}, @ref{momentum}, @ref{sum}. @sref{Pulse properties}
 @end deftypefn
 
+@anchor{first}
+@deftypefn {MGL command} {} first @sc{res} dat 'dir' @code{val}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Method on @code{mglDataC}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {C function} @code{HMDT} mgl_data_first_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val)
+@end ifclear
+Get array of positions of first value large @var{val}. For complex data the absolute value is used. See also @ref{last}.
+@end deftypefn
+
+@anchor{last}
+@deftypefn {MGL command} {} last @sc{res} dat 'dir' @code{val}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Method on @code{mglDataC}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {C function} @code{HMDT} mgl_data_last_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val)
+@end ifclear
+Get array of positions of last value large @var{val}. For complex data the absolute value is used. See also @ref{first}.
+@end deftypefn
+
+@ifclear UDAV
+@deftypefn {C function} @code{HMDT} mgl_formula_calc (@code{const char *}str, @code{long} n, ...)
+@deftypefnx {C function} @code{HADT} mgl_formula_calc_c (@code{const char *}str, @code{long} n, ...)
+Evaluate formula @var {str} for the given list of @var{n} data arrays of type @code{HCDT}. Variable names correspond to data names. You need to delete returned data array after usage! See also @ref{fill}.
+@end deftypefn
+@end ifclear
+
 
 @c ------------------------------------------------------------------
 @external{}
@@ -1231,6 +1392,8 @@ Smooths the data on specified direction or directions. String @var{dirs} specifi
 @item
 @samp{d1}...@samp{d9} for linear averaging over (2*N+1)-th points,
 @item
+@samp{p1}...@samp{p9} for parabolic averaging over (2*N+1)-th points,
+@item
 @samp{^} for finding upper bound,
 @item
 @samp{_} for finding lower bound.
@@ -1297,6 +1460,17 @@ Normalizes data slice-by-slice along direction @var{dir} the data in slices to r
 @end ifnottex
 @end deftypefn
 
+@anchor{keep}
+@deftypefn {MGL command} {} keep dat 'dir' @code{i [j=0]}
+@ifclear UDAV
+@deftypefnx {Method on @code{mglData}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0)
+@deftypefnx {Method on @code{mglDataC}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0)
+@deftypefnx {C function} @code{void} mgl_data_keep (@code{HMDT} dat, @code{const char *}dir, @code{long} i, @code{long} j)
+@deftypefnx {C function} @code{void} mgl_datac_keep (@code{HADT} dat, @code{const char *}dir, @code{long} i, @code{long} j=0)
+@end ifclear
+Conserves phase/sign or amplitude (if @var{dir} contain @samp{a}) of data along directions @var{dir} by fixing one at point @{@var{i},@var{j}@} of the initial slice. The function is useful for removing common phase change of a complex data. @sref{keep sample}
+@end deftypefn
+
 @anchor{limit}
 @deftypefn {MGL command} {} limit dat @code{val}
 @ifclear UDAV
@@ -1819,9 +1993,26 @@ Solves GO ray equation like dr/dt = d @var{ham}/dp, dp/dt = -d @var{ham}/dr. Thi
 @deftypefnx {C function} @code{HMDT} mgl_ode_solve (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax)
 @deftypefnx {C function} @code{HMDT} mgl_ode_solve_ex (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax, @code{void (*}bord@code{)(mreal *x, const mreal *xprev, void *par)})
 @end ifclear
-Solves ODE equations dx/dt = df(x). The functions @var{df} can be specified as string of ';'-separated textual formulas (argument @var{var} set the character ids of variables x[i]) or as callback function, which fill @code{dx} array for give @code{x}'s. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1)
+Solves ODE equations dx/dt = df(x). The functions @var{df} can be specified as string of ';'-separated textual formulas (argument @var{var} set the character ids of variables x[i]) or as callback function, which fill @code{dx} array for give @code{x}'s. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1). 
+
+If @var{dt}*@var{tmax}<0 then regularization is switched on, which change equations to dx/ds = df(x)/max(|df(x)|) to allow accurately passes region of strong df variation or quickly bypass region of small df. Here s is the new "time". At this, real time is determined as dt/ds=max(|df(x)|). If you need real time, then add it into equations manually, like @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. This also preserve accuracy at stationary points (i.e. at small df in periodic case).
+@end deftypefn
+
+
+
+@deftypefn {MGL command} {} ode @sc{res} 'df' 'var' 'brd' ini [@code{dt=0.1 tmax=10}]
+@ifclear UDAV
+@deftypefnx {Global function} @code{mglData} mglODEs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10})
+@deftypefnx {Global function} @code{mglDataC} mglODEcs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10})
+@deftypefnx {C function} @code{HMDT} mgl_ode_solve_set (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax)
+@deftypefnx {C function} @code{HADT} mgl_ode_solve_set_c (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax)
+@end ifclear
+Solves difference approximation of PDE as a set of ODE dx/dt = df(x,j). Functions @var{df} can be specified as string of ';'-separated textual formulas, which can depend on index @var{j} and current time @samp{t}. Argument @var{var} set the character ids of variables x[i]. Parameter @var{brd} sets the kind of boundary conditions on @var{j}: @samp{0} or @samp{z} -- zero at border, @samp{1} or @samp{c} -- constant at border, @samp{2} or @samp{l} -- linear at border (laplacian is zero), @samp{3} or @samp{s} -- square at border, @samp{4} or @samp{e} -- exponential at border, @samp{5} or @samp{g} -- gaussian at border. The cases @samp{e} and @samp{g} are applicable for the complex variant only. Parameters @var{ini}, @var{dt}, @var{tmax} set initial values, time step and maximal time of the calculation. Function stop execution if @code{NAN} or @code{INF} values appears. Result is data array with dimensions @{@var{n} * @var{Nt}@}, where @var{Nt} <= int(@var{tmax}/@var{dt}+1). For example, difference aprroximation of diffusion equation with zero boundary conditions can be solved by call: @samp{ode res 'u(j+1)-2*u(j)+u(j-1)' 'u' '0' u0}, where @samp{u0} is an initial data array.
+
+If @var{dt}*@var{tmax}<0 then regularization is switched on, which change equations to dx/ds = df(x)/max(|df(x)|) to allow accurately passes region of strong df variation or quickly bypass region of small df. Here s is the new "time". At this, real time is determined as dt/ds=max(|df(x)|). If you need real time, then add it into equations manually, like @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. This also preserve accuracy at stationary points (i.e. at small df in periodic case).
 @end deftypefn
 
+
 @anchor{qo2d}
 @deftypefn {MGL command} {} qo2d @sc{res} 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx yy]
 @ifclear UDAV
index c70f9f7d52d8294744d2c5c8118685454c8ec9f0..c15d3a35e21d4ac195efeaab153a183dd996a068 100644 (file)
@@ -456,6 +456,28 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @end deftypefn
 
 
+
+@deftypefn {Метод класса @code{mglData}} @code{void} Set (@code{const arma::vec &}d)
+@deftypefnx {Метод класса @code{mglData}} @code{void} Set (@code{const arma::mat &}d)
+@deftypefnx {Метод класса @code{mglData}} @code{void} Set (@code{const arma::cube &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::vec &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_vec &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::mat &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_mat &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cube &}d)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Set (@code{const arma::cx_cube &}d)
+Выделяет память и копирует данные из Armadillo структур.
+@end deftypefn
+
+@deftypefn {Метод класса @code{mglData}} @code{arma::mat} arma_mat (@code{long} k=0)
+@deftypefnx {Метод класса @code{mglData}} @code{arma::cube} arma_cube ()
+@deftypefnx {Метод класса @code{mglData}} @code{arma::cx_mat} arma_mat (@code{long} k=0)
+@deftypefnx {Метод класса @code{mglData}} @code{arma::cx_cube} arma_cube ()
+Возвращает данные в формате структур Armadillo.
+@end deftypefn
+
+
+
 @deftypefn {Метод класса @code{mglData}} @code{void} Link (@code{mglData &}from)
 @deftypefnx {Метод класса @code{mglData}} @code{void} Link (@code{mreal *}A, @code{int} NX, @code{int} NY=@code{1}, @code{int} NZ=@code{1})
 @deftypefnx {Функция С} @code{void} mgl_data_link (@code{HMDT} dat, @code{const mreal *}A, @code{int} NX, @code{int} NY, @code{int} NZ)
@@ -493,7 +515,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @deftypefnx {Функция С} @code{void} mgl_data_fill_eq (@code{HMGL} gr, @code{HMDT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt)
 @deftypefnx {Функция С} @code{void} mgl_datac_fill_eq (@code{HMGL} gr, @code{HADT} dat, @code{const char *}eq, @code{HCDT} vdat, @code{HCDT} wdat, @code{const char *}opt)
 @end ifclear
-Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне @var{Min} x @var{Max} (в отличие от функции @code{Modify}). Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть @code{NULL}, т.е. опущены.
+Заполняет значениями вычисленными по формуле @var{eq}. Формула представляет собой произвольное выражение, зависящее от переменных @samp{x}, @samp{y}, @samp{z}, @samp{u}, @samp{v}, @samp{w}. Координаты @samp{x}, @samp{y}, @samp{z} полагаются меняющимися в диапазоне @var{Min} x @var{Max} (в отличие от функции @code{Modify}). Переменные @samp{i}, @samp{j}, @samp{k} равны значениям соответствующего индекса. При этом, используются нулевые значения для переменных, отвечающих отсутствующим размерностям. Переменная @samp{u} -- значения исходного массива, переменные @samp{v}, @samp{w} -- значения массивов @var{vdat}, @var{wdat}. Последние могут быть @code{NULL}, т.е. опущены.
 @end deftypefn
 
 @anchor{modify}
@@ -511,7 +533,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @deftypefnx {Функция С} @code{void} mgl_datac_modify (@code{HADT} dat, @code{const char *}eq, @code{int} dim)
 @deftypefnx {Функция С} @code{void} mgl_datac_modify_vw (@code{HADT} dat, @code{const char *}eq, @code{HCDT} v, @code{HCDT} w)
 @end ifclear
-Аналогично предыдущему с координатами @samp{x}, @samp{y}, @samp{z}, меняющимися в диапазоне [0,1]. Если указан @var{dim}>0, то изменяются только слои >=@var{dim}.
\90налогиÑ\87но Ð¿Ñ\80едÑ\8bдÑ\83Ñ\89емÑ\83 Ñ\81 ÐºÐ¾Ð¾Ñ\80динаÑ\82ами @samp{x}, @samp{y}, @samp{z}, Ð¼ÐµÐ½Ñ\8fÑ\8eÑ\89имиÑ\81Ñ\8f Ð² Ð´Ð¸Ð°Ð¿Ð°Ð·Ð¾Ð½Ðµ [0,1]. Ð\9fеÑ\80еменнÑ\8bе @samp{i}, @samp{j}, @samp{k} Ñ\80авнÑ\8b Ð·Ð½Ð°Ñ\87ениÑ\8fм Ñ\81ооÑ\82веÑ\82Ñ\81Ñ\82вÑ\83Ñ\8eÑ\89его Ð¸Ð½Ð´ÐµÐºÑ\81а. Ð\9fÑ\80и Ñ\8dÑ\82ом, Ð¸Ñ\81полÑ\8cзÑ\83Ñ\8eÑ\82Ñ\81Ñ\8f Ð½Ñ\83левÑ\8bе Ð·Ð½Ð°Ñ\87ениÑ\8f Ð´Ð»Ñ\8f Ð¿ÐµÑ\80еменнÑ\8bÑ\85, Ð¾Ñ\82веÑ\87аÑ\8eÑ\89иÑ\85 Ð¾Ñ\82Ñ\81Ñ\83Ñ\82Ñ\81Ñ\82вÑ\83Ñ\8eÑ\89им Ñ\80азмеÑ\80ноÑ\81Ñ\82Ñ\8fм. Ð\95Ñ\81ли Ñ\83казан @var{dim}>0, Ñ\82о Ð¸Ð·Ð¼ÐµÐ½Ñ\8fÑ\8eÑ\82Ñ\81Ñ\8f Ñ\82олÑ\8cко Ñ\81лои >=@var{dim}.
 @end deftypefn
 
 @anchor{fillsample}
@@ -598,6 +620,99 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @end deftypefn
 
 
+
+@anchor{bernoulli}
+@deftypefn {Команда MGL} {} bernoulli dat [@code{p=0.5}]
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndBernoulli (@code{mreal} p=0.5)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_bernoulli (@code{HMDT} dat, @code{mreal} p)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_bernoulli (@code{mreal} p)
+@end ifclear
+Заполняет массив случайными числами с распределением Бернулли вероятности @var{p}.
+@end deftypefn
+
+@anchor{binomial}
+@deftypefn {Команда MGL} {} binomial dat @code{n [p=0.5]}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndBinomial (@code{long} n, @code{mreal} p=0.5)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_binomial (@code{HMDT} dat, @code{long} n, @code{mreal} p)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_binomial (@code{long} n, @code{mreal} p)
+@end ifclear
+Заполняет массив случайными числами с биномиальным распределением в @var{n} бросков с вероятностью @var{p}.
+@end deftypefn
+
+@anchor{brownian}
+@deftypefn {Команда MGL} {} brownian dat @code{y1 y2 sigma h}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndBrownian (@code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_brownian (@code{HMDT} dat, @code{mreal} y1, @code{mreal} y2, @code{mreal} sigma, @code{mreal} h)
+@end ifclear
+Заполняет массив случайным броуновским движением.
+@end deftypefn
+
+@anchor{discrete}
+@deftypefn {Команда MGL} {} discrete dat vdat
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndDiscrete (@code{const mglDataA &}vdat)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_discrete (@code{HMDT} dat, @code{HCDT} vdat)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_discrete (@code{HCDT} vdat)
+@end ifclear
+Заполняет массив случайными числами с дискретным распределением.
+@end deftypefn
+
+@anchor{exponential}
+@deftypefn {Команда MGL} {} exponential dat [@code{p}]
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndExponential (@code{mreal} p)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_exponential (@code{HMDT} dat, @code{mreal} p)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_exponential (@code{mreal} p)
+@end ifclear
+Заполняет массив случайными числами с экспоненциальным распределением масштаба @var{p}.
+@end deftypefn
+
+@anchor{gaussian}
+@deftypefn {Команда MGL} {} gaussian dat [@code{mu=0 sigma=1}]
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndGaussian (@code{mreal} mu=0, @code{mreal} sigma=1)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_gaussian (@code{HMDT} dat, @code{mreal} mu, @code{mreal} sigma)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_gaussian (@code{mreal} mu, @code{mreal} sigma)
+@end ifclear
+Заполняет массив случайными числами с гауссовым распределением со средним @var{mu} и масштабом @var{sigma}.
+@end deftypefn
+
+@anchor{shuffle}
+@deftypefn {Команда MGL} {} shuffle dat ['dir'='a']
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndShuffle (@code{char} dir='a')
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_shuffle (@code{HMDT} dat, @code{char} dir)
+@end ifclear
+Перемешивает содержимое ячеек (для @var{dir}=@samp{a}) или срезов (для @var{dir}=@samp{xyz}).
+@end deftypefn
+
+@anchor{uniform}
+@deftypefn {Команда MGL} {} uniform dat @code{lo hi}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndUniform (@code{mreal} lo, @code{mreal} hi)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_uniform (@code{HMDT} dat, @code{mreal} lo, @code{mreal} hi)
+@deftypefnx {Функция С} @code{mreal} mgl_rnd_uniform (@code{mreal} lo, @code{mreal} hi)
+@end ifclear
+Заполняет массив случайными числами с равномерным распределением в интервале (@var{lo},@var{hi}).
+@end deftypefn
+
+@anchor{uniformint}
+@deftypefn {Команда MGL} {} uniformint dat @code{lo hi}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} RndInteger (@code{long} lo, @code{long} hi)
+@deftypefnx {Функция С} @code{void} mgl_data_rnd_integer (@code{HMDT} dat, @code{long} lo, @code{mreal} hi)
+@deftypefnx {Функция С} @code{long} mgl_rnd_integer (@code{long} lo, @code{long} hi)
+@end ifclear
+Заполняет массив случайными целыми числами с равномерным распределением в интервале [@var{lo},@var{hi}).
+@end deftypefn
+
+
+
+
+
 @c ------------------------------------------------------------------
 @external{}
 @node File I/O, Make another data, Data filling, Data processing
@@ -617,7 +732,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @deftypefn {Команда MGL} {} read @sc{dat} 'fname'
 @deftypefnx {Команда MGL} {} read @sc{redat} @sc{imdat} 'fname'
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglData}} @code{void} Read (@code{const char *}fname)
+@deftypefnx {Метод класса @code{mglData}} @code{bool} Read (@code{const char *}fname)
 @deftypefnx {Метод класса @code{mglDataC}} @code{bool} Read (@code{const char *}fname)
 @deftypefnx {Функция С} @code{int} mgl_data_read (@code{HMDT} dat, @code{const char *}fname)
 @deftypefnx {Функция С} @code{int} mgl_datac_read (@code{HADT} dat, @code{const char *}fname)
@@ -628,7 +743,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @deftypefn {Команда MGL} {} read @sc{dat} 'fname' @code{mx [my=1 mz=1]}
 @deftypefnx {Команда MGL} {} read @sc{redat} @sc{imdat} 'fname' @code{mx [my=1 mz=1]}
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglData}} @code{void} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1})
+@deftypefnx {Метод класса @code{mglData}} @code{bool} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1})
 @deftypefnx {Метод класса @code{mglDataC}} @code{bool} Read (@code{const char *}fname, @code{int} mx, @code{int} my=@code{1}, @code{int} mz=@code{1})
 @deftypefnx {Функция С} @code{int} mgl_data_read_dim (@code{HMDT} dat, @code{const char *}fname, @code{int} mx, @code{int} my, @code{int} mz)
 @deftypefnx {Функция С} @code{int} mgl_datac_read_dim (@code{HADT} dat, @code{const char *}fname, @code{int} mx, @code{int} my, @code{int} mz)
@@ -639,7 +754,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @anchor{readmat}
 @deftypefn {Команда MGL} {} readmat @sc{dat} 'fname' [@code{dim=2}]
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglData}} @code{void} ReadMat (@code{const char *}fname, @code{int} dim=@code{2})
+@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadMat (@code{const char *}fname, @code{int} dim=@code{2})
 @deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadMat (@code{const char *}fname, @code{int} dim=@code{2})
 @deftypefnx {Функция С} @code{int} mgl_data_read_mat (@code{HMDT} dat, @code{const char *}fname, @code{int} dim)
 @deftypefnx {Функция С} @code{int} mgl_datac_read_mat (@code{HADT} dat, @code{const char *}fname, @code{int} dim)
@@ -650,8 +765,8 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @anchor{readall}
 @deftypefn {Команда MGL} {} readall @sc{dat} 'templ' @code{v1 v2 [dv=1 slice=off]}
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglData}} @code{void} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1.f}, @code{bool} as_slice=@code{false})
-@deftypefnx {Метод класса @code{mglDataC}} @code{void} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1}, @code{bool} as_slice=@code{false})
+@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1.f}, @code{bool} as_slice=@code{false})
+@deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadRange (@code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step=@code{1}, @code{bool} as_slice=@code{false})
 @deftypefnx {Функция С} @code{int} mgl_data_read_range (@code{HMDT} dat, @code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step, @code{int} as_slice)
 @deftypefnx {Функция С} @code{int} mgl_datac_read_range (@code{HADT} dat, @code{const char *}templ, @code{mreal} from, @code{mreal} to, @code{mreal} step, @code{int} as_slice)
 @end ifclear
@@ -660,8 +775,8 @@ Allocate memory and set data from variable argument list of @emph{double} values
 
 @deftypefn {Команда MGL} {} readall @sc{dat} 'templ' @code{[slice=off]}
 @ifclear UDAV
-@deftypefnx {Метод класса @code{mglData}} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false})
-@deftypefnx {Метод класса @code{mglDataC}} @code{void} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false})
+@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false})
+@deftypefnx {Метод класса @code{mglDataC}} @code{bool} ReadAll (@code{const char *}templ, @code{bool} as_slice=@code{false})
 @deftypefnx {Функция С} @code{int} mgl_data_read_all (@code{HMDT} dat, @code{const char *}templ, @code{int} as_slice)
 @deftypefnx {Функция С} @code{int} mgl_datac_read_all (@code{HADT} dat, @code{const char *}templ, @code{int} as_slice)
 @end ifclear
@@ -687,6 +802,10 @@ Allocate memory and set data from variable argument list of @emph{double} values
 Сохраняет весь массив данных при @var{ns}=@code{-1} или только @var{ns}-ый срез в текстовый файл.
 @end deftypefn
 
+@deftypefn {Команда MGL} {} save @code{val} 'fname'
+Сохраняет значение @var{val} в файл @var{fname}.
+@end deftypefn
+
 @deftypefn {Команда MGL} {} save 'str' 'fname' ['mode'='a']
 Сохраняет строку @var{str} в файл @var{fname}. Для параметра @var{mode}=@samp{a} происходит добавление строки (по умолчанию): для  @var{mode}=@samp{w} файл будет перезаписан. @sref{Saving and scanning file}
 @end deftypefn
@@ -712,6 +831,15 @@ Allocate memory and set data from variable argument list of @emph{double} values
 Сохраняет массив под именем @var{dname} в HDF5 или HDF4 файл @var{fname}. Функция ничего не делает если библиотека была собрана без поддержки HDF5|HDF4.
 @end deftypefn
 
+@deftypefn {Команда MGL} {} savehdf @code{val} 'fname' 'dname' [@code{rewrite}=@code{off}]
+@ifclear UDAV
+@deftypefnx {Функция С} @code{void} mgl_real_save_hdf (@code{real} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@deftypefnx {Функция С} @code{void} mgl_dual_save_hdf (@code{dual} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@deftypefnx {Функция С} @code{void} mgl_int_save_hdf (@code{long} val, @code{const char *}fname, @code{const char *}dname, @code{int} rewrite)
+@end ifclear
+Сохраняет значение @code{val} под именем @var{dname} в HDF5 файл @var{fname}. Функция ничего не делает если библиотека была собрана без поддержки HDF5.
+@end deftypefn
+
 @anchor{datas}
 @deftypefn {Команда MGL} {} datas 'fname'
 @ifclear UDAV
@@ -754,6 +882,15 @@ Allocate memory and set data from variable argument list of @emph{double} values
 Сохраняет данные в растровый файл. Числовые значения, нормированные в диапазон [@var{v1}, @var{v2}], преобразуются в RGB значения пикселов, используя цветовую схему @var{sch} (@pxref{Color scheme}). Если @var{v1}>=@var{v2}, то значения @var{v1}, @var{v2} определяются автоматически как минимальное и максимальное значение данных.
 @end deftypefn
 
+@anchor{readbin}
+@deftypefn {Команда MGL} {} readbin dat 'fname' @code{type}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{bool} ReadBin (@code{const char *}fname, @code{int} type)
+@deftypefnx {Функция С} @code{int} mgl_data_read_bin (@code{HMDT} dat, @code{const char *}fname, @code{int} type)
+@end ifclear
+Читает данные из файла в бинарном формате. Параметр @var{type} задает тип данных в файле: 0 - double, 1 - float, 2 - long double, 3 - long int, 4 - int, 5 - short int, 6 - char. Внимание! Эту функцию не рекомендуется использовать с данными, сохраненными на других компьютерах из-за возможных проблем с бинарным представлением чисел. Предпочтительнее использовать HDF формат, см. @ref{readhdf}.
+@end deftypefn
+
 @c ------------------------------------------------------------------
 @external{}
 @node Make another data, Data changing, File I/O, Data processing
@@ -898,7 +1035,7 @@ Allocate memory and set data from variable argument list of @emph{double} values
 @deftypefnx {Функция С} @code{HMDT} mgl_data_hist (@code{HCDT} dat, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub)
 @deftypefnx {Функция С} @code{HMDT} mgl_data_hist_w (@code{HCDT} dat, @code{HCDT} w, @code{int} n, @code{mreal} v1, @code{mreal} v2, @code{int} nsub)
 @end ifclear
-Возвращает распределение (гистограмму) из @var{n} точек от значений массива в диапазоне [@var{v1}, @var{v2}]. Массив @var{w} задает веса элементов (по умолчанию все веса равны 1). Параметр @var{nsub} задает число дополнительных точек интерполяции (для сглаживания получившейся гистограммы). Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{Data manipulation}
+Возвращает распределение (гистограмму) из @var{n} точек от значений массива в диапазоне [@var{v1}, @var{v2}]. Массив @var{w} задает веса элементов (по умолчанию все веса равны 1). Параметр @var{nsub} задает число дополнительных точек интерполяции (для сглаживания получившейся гистограммы).  Если @var{nsub}<0, то используется линейная интерполяция вместо сплайнов. Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{Data manipulation}
 @end deftypefn
 
 @anchor{momentum}
@@ -1027,6 +1164,33 @@ res_k = \sum_ij how(x_i,y_j,z_k) a_ij/ \sum_ij a_ij
 Находит параметры импульса вдоль направления @var{dir}: максимальное значение (в колонке 0), его положение (в колонке 1), ширина по параболлической аппроксимации (в колонке 3) и по полувысоте (в колонке 2), энергию около максимума (в колонке 4). NAN значения используются для ширин если максимум расположен вблизи границ массива. Отмечу, что для комплексных массивов есть неопределенность определения параметров. Обычно следует использовать квадрат абсолютного значения амплитуды (т.е. |dat[i]|^2). Поэтому MathGL не включает эту функцию в @code{mglDataC}, хотя формально C функция будет работать и для них, но будет использовать абсолютное значение амплитуды (т.е. |dat[i]|). Функция возвращает NULL или пустой массив если данные не могут быть созданы при данных значениях аргументов. См. также @ref{max}, @ref{min}, @ref{momentum}, @ref{sum}. @sref{Pulse properties}
 @end deftypefn
 
+@anchor{first}
+@deftypefn {Команда MGL} {} first @sc{res} dat 'dir' @code{val}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Метод класса @code{mglDataC}} @code{mglData} First (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Функция С} @code{HMDT} mgl_data_first_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val)
+@end ifclear
+Возвращает массив положений ячеек со значениями впервые превысившими @var{val}. Для комплексных данных используется абсолютное значение. См. также @ref{last}.
+@end deftypefn
+
+@anchor{last}
+@deftypefn {Команда MGL} {} last @sc{res} dat 'dir' @code{val}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Метод класса @code{mglDataC}} @code{mglData} Last (@code{const char *}dir, @code{mreal} val) @code{const}
+@deftypefnx {Функция С} @code{HMDT} mgl_data_last_dir (@code{HCDT} dat, @code{const char *}dir, @code{mreal} val)
+@end ifclear
+Возвращает массив положений ячеек со значениями последний раз превысившими @var{val}. Для комплексных данных используется абсолютное значение. См. также @ref{first}.
+@end deftypefn
+
+@ifclear UDAV
+@deftypefn {Функция С} @code{HMDT} mgl_formula_calc (@code{const char *}str, @code{long} n, ...)
+@deftypefnx {Функция С} @code{HADT} mgl_formula_calc_c (@code{const char *}str, @code{long} n, ...)
+Вычисляет формулу @var{str} для заданного списка из @var{n} массивов данных типа @code{HCDT}. Имена переменных соответствуют именам массивов. Возвращенный массив должен быть удален пользователем по окончании использования. См. также @ref{fill}.
+@end deftypefn
+@end ifclear
+
 @c ------------------------------------------------------------------
 @external{}
 @node Data changing, Interpolation, Make another data, Data processing
@@ -1217,6 +1381,8 @@ These functions change the data in some direction like differentiations, integra
 @item
 @samp{d1}...@samp{d9} -- линейное усреднение по (2*N+1) точкам,
 @item
+@samp{p1}...@samp{p9} -- параболличсеское усреднение по (2*N+1) точкам,
+@item
 @samp{^} -- определение верхней границы,
 @item
 @samp{_} -- определение нижней границы.
@@ -1283,6 +1449,18 @@ These functions change the data in some direction like differentiations, integra
 @end ifnottex
 @end deftypefn
 
+@anchor{keep}
+@deftypefn {Команда MGL} {} keep dat 'dir' @code{i [j=0]}
+@ifclear UDAV
+@deftypefnx {Метод класса @code{mglData}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0)
+@deftypefnx {Метод класса @code{mglDataC}} @code{void} Keep (@code{const char *}dir, @code{long} i, @code{long} j=0)
+@deftypefnx {Функция С} @code{void} mgl_data_keep (@code{HMDT} dat, @code{const char *}dir, @code{long} i, @code{long} j)
+@deftypefnx {Функция С} @code{void} mgl_datac_keep (@code{HADT} dat, @code{const char *}dir, @code{long} i, @code{long} j=0)
+@end ifclear
+Ограничивает изменение фазы/знака или амплитуды (если @var{dir} содержит @samp{a}) данных вдоль направления @var{dir} фиксируя значение в точке @{@var{i},@var{j}@} начального среза. Функция полезна для удаления общего набега фазы в комплексных данных. @sref{keep sample}
+@end deftypefn
+
+
 @anchor{limit}
 @deftypefn {Команда MGL} {} limit dat @code{val}
 @ifclear UDAV
@@ -1802,8 +1980,25 @@ These functions change the data in some direction like differentiations, integra
 @deftypefnx {Функция С} @code{HMDT} mgl_ode_solve_ex (@code{void (*}df@code{)(const mreal *x, mreal *dx, void *par)}, @code{int} n, @code{const mreal *}ini, @code{mreal} dt, @code{mreal} tmax, @code{void (*}bord@code{)(mreal *x, const mreal *xprev, void *par)})
 @end ifclear
 Решает систему обыкновенных дифференциальных уравнений dx/dt = df(x). Функции @var{df} могут быть заданны строкой с разделенными ';' формулами (аргумент @var{var} задает символы для переменных x[i]) или указателем на функцию, которая заполняет @code{dx} по заданным значениям @code{x}. Параметры @var{ini}, @var{dt}, @var{tmax} задают начальные значения, шаг и максимальное время интегрирования. Функция обрывает расчет при появлении значений @code{NAN} или @code{INF}. Результат -- массив размером @{@var{n} * @var{Nt}@}, где @var{Nt} <= int(@var{tmax}/@var{dt}+1).
+
+Если @var{dt}*@var{tmax}<0, то включается регуляризация, при которой уравнение заменяется на dx/ds = df(x)/max(|df(x)|) для более аккуратного прохождения областей резкого изменения df и более быстрого расчета в области малых df. Здесь s -- новое "время". При этом реальное время определяется уравнением dt/ds=max(|df(x)|). Поэтому для вывода реального времени его следует явно добавить в уравнение, например @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. Оно также сохранит точность вблизи стационарных точек (т.е. при малых df в периодическом движении).
+@end deftypefn
+
+
+@deftypefn {Команда MGL} {} ode @sc{res} 'df' 'var' 'brd' ini [@code{dt=0.1 tmax=10}]
+@ifclear UDAV
+@deftypefnx {Общая функция} @code{mglData} mglODEs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10})
+@deftypefnx {Общая функция} @code{mglDataC} mglODEcs (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{const mglDataA &}ini, @code{mreal} dt=@code{0.1}, @code{mreal} tmax=@code{10})
+@deftypefnx {Функция С} @code{HMDT} mgl_ode_solve_set (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax)
+@deftypefnx {Функция С} @code{HADT} mgl_ode_solve_set_c (@code{const char *}df, @code{const char *}var, @code{char} brd, @code{HCDT} ini, @code{mreal} dt, @code{mreal} tmax)
+@end ifclear
+Решает разностную аппроксимацию уравнений в частных производных как систему обыкновенных дифференциальных уравнений dx/dt = df(x,j). Функции @var{df} могут быть заданны строкой с разделенными ';' формулами, зависящими от индекса @var{j} и текущего времени @samp{t}. Аргумент @var{var} задает символы для переменных x[i]. Параметр @var{brd} задает тип граничных условий по @var{j}: @samp{0} или @samp{z} -- нулевые, @samp{1} или @samp{c} -- постоянные, @samp{2} или @samp{l} -- линейные (ноль лапласиана), @samp{3} или @samp{s} -- квадратичные, @samp{4} или @samp{e} -- экспоненциальные, @samp{5} или @samp{g} -- гауссовы. Последние два типа условий применимы только в случае комплексных переменных. Параметры @var{ini}, @var{dt}, @var{tmax} задают начальные значения, шаг и максимальное время интегрирования. Функция обрывает расчет при появлении значений @code{NAN} или @code{INF}. Результат -- массив размером @{@var{n} * @var{Nt}@}, где @var{Nt} <= int(@var{tmax}/@var{dt}+1). Например, разностная аппроксимация уравнения диффузии с нулевыми граничными условиями находится вызовом: @samp{ode res 'u(j+1)-2*u(j)+u(j-1)' 'u' '0' u0}, где @samp{u0} -- массив начальных значений.
+
+Если @var{dt}*@var{tmax}<0, то включается регуляризация, при которой уравнение заменяется на dx/ds = df(x)/max(|df(x)|) для более аккуратного прохождения областей резкого изменения df и более быстрого расчета в области малых df. Здесь s -- новое "время". При этом реальное время определяется уравнением dt/ds=max(|df(x)|). Поэтому для вывода реального времени его следует явно добавить в уравнение, например @samp{ode res 'y;-sin(x);1' 'xyt' [3,0] 0.3 -100}. Оно также сохранит точность вблизи стационарных точек (т.е. при малых df в периодическом движении).
 @end deftypefn
 
+
+
 @anchor{qo2d}
 @deftypefn {Команда MGL} {} qo2d @sc{res} 'ham' ini_re ini_im ray [@code{r=1 k0=100} xx yy]
 @ifclear UDAV
index a97f4770abb2559305b7e530914eb168db0a6258..5390441cb5db5240f1de770afb1680dd40413902 100644 (file)
@@ -1,4 +1,5 @@
-@set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION}
+@set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}
+@c @set VERSION ${MathGL_VERSION_MAJOR}.${MathGL_VERSION_MINOR}.${MathGL_PATCH_VERSION}
 @set MINVER 
 @c @set MINVER .1
 @set NIGHT ${MGL_NIGHT}
index 9fecf1affd6371cf26462361ce1c3293cd4b2032..77540af24ef5f2ff60260debfdaa511fd3e2d7b1 100644 (file)
@@ -1,3 +1,6 @@
+2.5    Released 8 December 2021
+2.4.4  Released 8 July 2019
+2.4.3  Released 14 March 2019
 2.4.2.1        Released 31 March 2018
 2.4.2  Released 21 March 2018
 2.4.1  Released 20 July 2017
index 20f336de212a32e096c6118cd34ae75bce289cf3..ed8cb601d6e5a72cbef5919d286bfeb5eea19dfe 100644 (file)
@@ -53,6 +53,9 @@ Generally, MathGL is GPL library. However, you can use LGPL license for MathGL c
 @strong{Latest news}
 @itemize
 
+@item @strong{8 December 2021.}
+New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are big improve in formula evaluation (user-defined function, summation and product, new functions for data interpolation), new plot kind @ref{dcont} and @ref{lines}, set of functions for random distributions, new data handling functions (like, @ref{keep}), extend @ref{ode} to solve PDE/cascade/etc, add mask for most of plotting functions and bugfixes, which denoted @ref{News, here}.
+
 @item @strong{8 July 2019.}
 New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are new @ref{minmax} for positions of local minimums and maximums, add @ref{conts} for coordinates of contour lines, extend formula evaluation to read and interpolate data files.
 
@@ -77,6 +80,39 @@ Javascript interface was developed with support of @url{http://www.datadvance.ne
 
 @itemize
 
+@item @strong{8 December 2021}
+New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released.
+@itemize @bullet
+
+@item Add functions @samp{sum}, @samp{prod} at formula evaluation, like @samp{sum(_i^2,5)} will produce @code{30=0+1^2+2^2+3^2+4^2}, and @samp{prod(1+_i,5)} will produce @code{120=5!}. You can nest them for variables @samp{_i},@samp{_j},...,@samp{_z}, like @samp{sum(sum(_j+_i^2,5),5)} will give @code{200}.
+@item Add user-defined functions @samp{fn1()}...@samp{fn9()} at formula evaluation, like @samp{fn1(3)\x^_1} will produce @code{x^3}.
+@item Add functions @samp{value}, @samp{spline} at formula evaluation, like @samp{value(a,5)} will give value of 6-th element of a, i.e. a[5].
+@item Add @ref{keep} for keeping the data phase/sign or value along line @var{i} and @var{j} in given direction
+@item Add mglODEs() (i.e. extend @ref{ode}) for solving PDE, cascades and etc.
+@item Add @ref{dcont} to draw a set of curves, which are intersection of two isosurfaces at given level.
+@item Add @ref{lines} to draw a set of lines with arrows between points.
+@item Add @ref{first}, @ref{last} to get array of first/last indexes of values larger specified one along given direction.
+@item Add @ref{bernoulli}, @ref{binomial}, @ref{brownian}, @ref{discrete}, @ref{exponential}, @ref{gaussian}, @ref{shuffle}, @ref{uniform}, @ref{uniformint} for data filling by random numbers with different distributions.
+@item Add @ref{readbin} to read data from binary files.
+@item Add @ref{texparse} to enable/disable TeX-like command parsing at text output.
+@item Update @ref{ode}: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same).
+@item Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI.
+@item Add style @samp{p} in command @ref{smooth} to use parabolic smoothing of arbitrary points.
+@item Allow @ref{background} for scaling image, centering image and tessellate image as mosaic.
+@item Allow filling @ref{background} by the specified color.
+@item Allow masks for @ref{candle}, @ref{area}, @ref{region}, @ref{bars}, @ref{barh}, @ref{chart}, @ref{tape}, @ref{face}, @ref{polygon}, @ref{ellipse}, @ref{rhomb}.
+@item Allow single value specification for contour level in @ref{cont}, @ref{contd}, @ref{contp}, @ref{contv}, @ref{cont3}, @ref{dcont}, @ref{tricont}.
+@item Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands @ref{save} and @ref{savehdf} can save single value now.
+@item Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays.
+@item Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...).
+@item Add Armadillo interface for mglData and mglDataC.
+@item If nsub parameter of command @ref{hist} is negative (nsub<0) then the linear interpolation is used instead of spline one.
+@item Add dark text colors for mgllab.
+@item Minor bugfixes.
+@item OBSOLETE: Qt4 interface will be disabled in the next release.
+@item OBSOLETE: Functions @ref{colorbar} will have extra argument @var{opt} for options, similarly to @ref{axis} and other plotting functions. In C++ and SWIG-based interfaces this change "masked" by providing the default value for the argument.
+@end itemize
+
 @item @strong{8 July 2019}
 New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released.
 @itemize @bullet
@@ -308,12 +344,13 @@ You may download current version of MathGL for following configurations:
 @itemize @bullet
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.tar.gz, Source} file with cmake build system.
-@item
-@uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV.
+@c@item
+@c @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV.
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win64.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win64.7z,LGPL} binaries for MinGW, 64-bit build.
 @item
-MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
+@c MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
+MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.eng.pdf,PDF} documentation in English.
 @item
index 8accf24b576426aee7d19b2b39da2f234afa75d2..30abbc3315979751baccb6a306b74f1a7473cb59 100644 (file)
@@ -53,6 +53,9 @@ Generally, MathGL is GPL library. However, you can use LGPL license for MathGL c
 @strong{Latest news}
 @itemize
 
+@item @strong{8 December 2021.}
+New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are big improve in formula evaluation (user-defined function, summation and product, new functions for data interpolation), new plot kind @ref{dcont} and @ref{lines}, set of functions for random distributions, new data handling functions (like, @ref{keep}), extend @ref{ode} to solve PDE/cascade/etc, add mask for most of plotting functions and bugfixes, which denoted @ref{News, here}.
+
 @item @strong{8 July 2019.}
 New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released. There are new @ref{minmax} for positions of local minimums and maximums, add @ref{conts} for coordinates of contour lines, extend formula evaluation to read and interpolate data files.
 
@@ -77,6 +80,39 @@ Javascript interface was developed with support of @url{http://www.datadvance.ne
 
 @itemize
 
+@item @strong{8 December 2021}
+New version (v.2.5) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released.
+@itemize @bullet
+
+@item Add functions @samp{sum}, @samp{prod} at formula evaluation, like @samp{sum(_i^2,5)} will produce @code{30=0+1^2+2^2+3^2+4^2}, and @samp{prod(1+_i,5)} will produce @code{120=5!}. You can nest them for variables @samp{_i},@samp{_j},...,@samp{_z}, like @samp{sum(sum(_j+_i^2,5),5)} will give @code{200}.
+@item Add user-defined functions @samp{fn1()}...@samp{fn9()} at formula evaluation, like @samp{fn1(3)\x^_1} will produce @code{x^3}.
+@item Add functions @samp{value}, @samp{spline} at formula evaluation, like @samp{value(a,5)} will give value of 6-th element of a, i.e. a[5].
+@item Add @ref{keep} for keeping the data phase/sign or value along line @var{i} and @var{j} in given direction
+@item Add mglODEs() (i.e. extend @ref{ode}) for solving PDE, cascades and etc.
+@item Add @ref{dcont} to draw a set of curves, which are intersection of two isosurfaces at given level.
+@item Add @ref{lines} to draw a set of lines with arrows between points.
+@item Add @ref{first}, @ref{last} to get array of first/last indexes of values larger specified one along given direction.
+@item Add @ref{bernoulli}, @ref{binomial}, @ref{brownian}, @ref{discrete}, @ref{exponential}, @ref{gaussian}, @ref{shuffle}, @ref{uniform}, @ref{uniformint} for data filling by random numbers with different distributions.
+@item Add @ref{readbin} to read data from binary files.
+@item Add @ref{texparse} to enable/disable TeX-like command parsing at text output.
+@item Update @ref{ode}: regularization is used if dt*tmax<0 (total time may differ, but number of steps still the same).
+@item Add mgl_default_graph() -- the global (default) pointer to HMGL for keeping plot settings, simplifying external scripts and capture it in GUI.
+@item Add style @samp{p} in command @ref{smooth} to use parabolic smoothing of arbitrary points.
+@item Allow @ref{background} for scaling image, centering image and tessellate image as mosaic.
+@item Allow filling @ref{background} by the specified color.
+@item Allow masks for @ref{candle}, @ref{area}, @ref{region}, @ref{bars}, @ref{barh}, @ref{chart}, @ref{tape}, @ref{face}, @ref{polygon}, @ref{ellipse}, @ref{rhomb}.
+@item Allow single value specification for contour level in @ref{cont}, @ref{contd}, @ref{contp}, @ref{contv}, @ref{cont3}, @ref{dcont}, @ref{tricont}.
+@item Add mgl_dual_save_hdf(), mgl_real_save_hdf(), mgl_int_save_hdf() for saving single number in HDF5 file. Correspondingly, commands @ref{save} and @ref{savehdf} can save single value now.
+@item Add mgl_formula_calc(), mgl_formula_calc_c() for evaluating textual formulas of arbitrary set of data arrays.
+@item Add mglDataList -- global mglDataA* collection for viewing/changing in GUI data from external languages (like, Python, ...).
+@item Add Armadillo interface for mglData and mglDataC.
+@item If nsub parameter of command @ref{hist} is negative (nsub<0) then the linear interpolation is used instead of spline one.
+@item Add dark text colors for mgllab.
+@item Minor bugfixes.
+@item OBSOLETE: Qt4 interface will be disabled in the next release.
+@item OBSOLETE: Functions @ref{colorbar} will have extra argument @var{opt} for options, similarly to @ref{axis} and other plotting functions. In C++ and SWIG-based interfaces this change "masked" by providing the default value for the argument.
+@end itemize
+
 @item @strong{8 July 2019}
 New version (v.2.4.4) of @uref{http://sourceforge.net/projects/mathgl, MathGL} is released.
 @itemize @bullet
@@ -308,12 +344,13 @@ You may download current version of MathGL for following configurations:
 @itemize @bullet
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.tar.gz, Source} file with cmake build system.
-@item
-@uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV.
+@c @item
+@c @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win32.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win32.7z,LGPL} binaries for MinGW, 32-bit build for Pentium IV.
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}-mingw.win64.7z,GPL} or @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.LGPL-mingw.win64.7z,LGPL} binaries for MinGW, 64-bit build.
 @item
-MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
+@c MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win32.7z,32-bit} and @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
+MathGL utilities with all required DLL files for @uref{http://downloads.sourceforge.net/mathgl/mgl_scripts-@value{VERSION}.win64.7z,64-bit} versions of MS Windows.
 @item
 @uref{http://downloads.sourceforge.net/mathgl/mathgl-@value{VERSION}@value{MINVER}.eng.pdf,PDF} documentation in English.
 @item
index 0414293fc905118a224e4b5ec355ed32f3c130a7..5de7340294681ea7d91f6ea0a13b5820af524f60 100644 (file)
@@ -58,6 +58,8 @@ Creates a FLTK-based window for plotting. Parameter @var{draw} sets a pointer to
 Creates a GLUT-based window for plotting. Parameter @var{draw} sets a pointer to drawing function (this is the name of function) or instance of @code{mglDraw} class. There is support of a list of plots (frames). So as one can prepare a set of frames at first and redraw it fast later (but it requires more memory). Function should return positive number of frames for the list or zero if it will plot directly. Note, that @var{draw} can be @code{NULL} for displaying static bitmaps only (no animation or slides). Parameter @var{title} sets the title of the window. Parameter @var{par} contains pointer to data for the plotting function @var{draw}. GLUT-based windows are fastest one but there is no toolbar, and plot have some issues due to OpenGL limitations.
 
 There are some keys handles for manipulating by the plot: 'a', 'd', 'w', 's' for the rotating; ',', '.' for viewing of the previous or next frames in the list; 'r' for the switching of transparency; 'f' for the switching of lightning; 'x' for hiding (closing) the window.
+
+Note, that you can terminate GLUT event loop by call @code{glutLeaveMainLoop()}.
 @end deftypefn
 
 @menu
index ac1fe0abc1652a2fe1d8fe7d8f8dd3b179cfbed6..8a8df805d6e7f5192432c43e84ba6485e8b93e49 100644 (file)
@@ -59,6 +59,8 @@ public:
 Создает окно для вывода графика. Параметр @var{draw} -- указатель (имя) функции рисования. Есть возможность создания нескольких кадров вначале (требует больше памяти) и их быстрая анимации в дальнейшем. В этом случае функция @var{draw} должна возвращать число кадров или ноль для рисования по запросу. Замечу, что @var{draw} может быть равна @code{NULL} для отображения статической (текущей) картинки. Параметр @var{title} задает заголовок окна. Параметр @var{par} содержит указатель на данные, передаваемые функции рисования @var{draw}. Параметр @var{kind} может иметь следующие значения: @samp{0} -- использовать окно FLTK, @samp{1} -- использовать окно Qt.
 
 В окне просмотра можно использовать клавиши: 'a', 'd', 'w', 's' для вращения; ',', '.' для просмотра предыдущего и следующего кадров; 'r' для переключения прозрачности; 'f' для переключения оспещенности; 'x' для закрытия окна.
+
+Следует отметить, что цикл обработки сообщений GLUT можно остановить вызовом функции @code{glutLeaveMainLoop()}.
 @end deftypefn
 
 
index c55f2774ad48aa660667f80d3efe18a4f0f3f51d..1c5bb7b17d98e7108a05865cb92b0102347f461f 100644 (file)
--- a/todo.txt
+++ b/todo.txt
 12. \overline{\overline{a}} ???
 13. Use arrow_plot_3d ???
 14. Mask in SVG ???
+15. Add quadratic and cubic Bezier curves as primitives (update export to SVG/EPS + simplify some functions) ?!?
+16. Bypass realloc() ???
+17. Add PGM|PPM export (see https://en.wikipedia.org/wiki/Netpbm_format)
+
+18. Chord diagram ???
+19. Dendrogram specified by string "{val, {lVal,{...},{...}}, {rVal,{...},{...}} }" with styles: 's' for hor/vert lines, or straight lines by default ???
+20. Voronoi diagram ??? -- triangulation + coloring by point
+
+18. Unicode/UTF8 in legend-option ?
 
 ============= NEW FEATURES =============
 
 1. Centered curved text (see text2)
-2. Quality=3 for mirror+shadows? Couldn't be in bitmap only mode
-4. "latex on" option ?!?
-5. Add "text3d x y z lx ly lz nx ny nz 'txt' ['stl'='' depth=0.1 depth2=nan]"
-6. Flag to determine discontinuous surfaces in 'fsurf'
-7. Add PGM|PPM export (see https://en.wikipedia.org/wiki/Netpbm_format)
-8. Check title & rasterize
+2. Quality=3 for mirror+shadows + arrow_plot_3d? Could be in bitmap only mode
+3. Add "text3d x y z lx ly lz nx ny nz 'txt' ['stl'='' depth=0.1 depth2=nan]"
+4. Flag to determine discontinuous surfaces in 'fsurf'
+5. mgl.cgi -- add log-file{IP,time,script}, add file-password (enable I/O if pass is the same as in a file)
+
+6. Recurrence plot u_{ij} = |a_i-a_j|<epsilon && Cross-reccurence plot u_{ij} = |a_i-b_j|<epsilon. See http://www.recurrence-plot.tk/crps.php
+7. Calendar diagram -- 1D data as dens for 7-row (day) or 12-row (months) + divisions at month or year
+
+11. Use FreeType for getting font/glyph information. This need quick drawing of quadratic and cubic Bezier curves (see example5.cpp). https://www.freetype.org/freetype2/docs/tutorial/step3.html -- add optimization of bezier curves by number of points. Use it as glyph definition or as default source for all/unknown glyphs!?
+
+12. Triangulation in 3d + rewrite crust (test 2d version too). See https://en.wikipedia.org/wiki/Bowyer%E2%80%93Watson_algorithm
 
-10. mgltask -- add $3-loop, $R=formula for R=4,...,9,0,A,...,Z
-11. mgl.cgi -- add log-file{IP,time,script}, add file-password (enable I/O if pass is the same as in a file)
-12. Chord diagram
-13. Calendar diagram -- 1D data as dens for 7-row (day) or 12-row (months) + divisions at month or year
-14. Dendrogram ???
-15. Voronoi diagram ??? -- triangulation + coloring by point
-16. Sankey diagram ???
+13. Algorithm of combining primitives with the same color to the larger one.
 
-* Add 'connect' for connecting points to set of surfaces
+14. Add interpolated point(s) at boundary of invisible/cutted region at drawing of lines and triangles
 
+15. Use new interface for HDF5 (assume v.1.8 was too many years ago :( )
+16. Add mgl_set_font_hscale() to MGL
+17. Add Rotate() around a point (not {0,0,0} by default).
+22. Add "map res 'eqs' 'vars' ini ['how' A B C [D E]]" -- like "ode" but just simple mapping + progonka.
+28. Try to add ld options: "-init mgl_init -fini mgl_fini" for MSVC ???
 
 
 ZZ. Update *.i for new functions {before release!!!}
@@ -92,12 +105,20 @@ D. Docs about JS interface
        * Example of 'roots'
        * Example of custom dialog
        * Example of 'progress'
+       * Example of 'shuffle'
+       * Example of 'brownian'
        
 3. Docs about mgllab (overview, dialogs, ...)
 4. Example of Evaluate + ".mx" ???
 
-8. 'connect'
+5. Docs about 'connect' ???
+6. Update Widget() to return Fl_MGLView (not Fl_MathGL);
+7. Add doc about mglWnd::Window();
+8. Add docs about Fl_MGLView.
 
+9. Docs and sample about 'tricontv'
+
+19. Docs about mgltask: $1,$2,$3 loops, $0 is rnd, $R are formulas for R=a,b,...,z, which depend on v0=$0, v1=$1, v2=$2, v3=$3.
 
 ZZ. Update time.texi {before release!!!}
 
@@ -131,6 +152,9 @@ Instead of steps 1-2, you can download sources and build the MathGL libraries wi
 * dialog to visual construct "custom dialog" + read/add "##d" to the end of file.
 * check manual dash/mask
 
+* use mgl_default_graph() for drawing ???
+* use mglDataList for viewing/changing in GUI data from external languages (like, Python, ...) ???
+
 X. Own file-chooser dialog -- separate path and fname fields + add sorting by date|size ???
 Y. Window with Zoom/Hidden ???
 
@@ -156,6 +180,11 @@ Y. Window with Zoom/Hidden ???
 * Animation from ##c, ##a + remove old entries at "Put to script" (the same in mgllab)
 * Custom dialog in QMathGL
 
+* Check autoResize=true
+
+* use mgl_default_graph() for drawing ???
+* use mglDataList for viewing/changing in GUI data from external languages (like, Python, ...) ???
+
 ============= UNSURE ===========
 
 1. GTK window/widgets ???
index bef8c5ec8005c5c17fd8ba486542cc64c0f7ee87..93c6182bfb74d4b35e8c1ce399539d344aff4eca 100644 (file)
@@ -75,7 +75,7 @@ AnimParam::AnimParam(QWidget *parent) : QDialog(parent)
        connect(b, SIGNAL(clicked()),this, SLOT(putTxt()));\r
        lbl = new QLabel(_("Delay (in ms)"),this);      a->addWidget(lbl);\r
        delay = new QLineEdit(this);    a->addWidget(delay);\r
-       QString s;      s.sprintf("%d",animDelay);      delay->setText(s);\r
+       QString s;      s.asprintf("%d",animDelay);     delay->setText(s);\r
        // export to gif/jpeg\r
        a = new QHBoxLayout();          o->addLayout(a);\r
 //     fname = new QLineEdit(this);    a->addWidget(fname);\r
@@ -96,7 +96,6 @@ void AnimParam::fillRes()
        else if(rbf->isChecked())\r
        {\r
                res = "";\r
-               QString s;\r
                double x, x2=p2->text().toDouble(), dx=dp->text().toDouble();\r
                for(x=p1->text().toDouble();x<x2;x+=dx)\r
                        res = res+QString::number(x,'g',4)+"\n";\r
index c199541789de237bd935dd0befaba6a472fcd471..e967e5ac7dc18685e3278299f15b7339ad015c0a 100644 (file)
@@ -115,9 +115,9 @@ void DatPanel::refresh()
                dual f = cc->a[i+nx*(j+ny*kz)];
                if(mgl_isnan(f))        s = "nan";
                else if(mgl_isbad(f))   s="inf";
-               else if(imag(f)>0)      s.sprintf("%.15g+%.15gi",real(f),imag(f));
-               else if(imag(f)<0)      s.sprintf("%.15g-%.15gi",real(f),-imag(f));
-               else    s.sprintf("%15g",real(f));
+               else if(imag(f)>0)      s.asprintf("%.15g+%.15gi",real(f),imag(f));
+               else if(imag(f)<0)      s.asprintf("%.15g-%.15gi",real(f),-imag(f));
+               else    s.asprintf("%15g",real(f));
                tab->item(j,i)->setText(s);
        }
        else    for(long i=0;i<nx;i++)  for(long j=0;j<ny;j++)
@@ -125,7 +125,7 @@ void DatPanel::refresh()
                double f = var->v(i,j,kz);
                if(mgl_isnan(f))        s = "nan";
                else if(mgl_isbad(f))   s=f>0?"inf":"-inf";
-               else    s.sprintf("%.15g",f);
+               else    s.asprintf("%.15g",f);
                tab->item(j,i)->setText(s);
        }
        infoDlg->allowRefresh=true;     infoDlg->refresh();
@@ -134,7 +134,7 @@ void DatPanel::refresh()
        QChar *ss = new QChar[m+1];
        for(long i=0;i<m;i++)   ss[i] = vs[i];
        s = QString(ss, m);     delete []ss;
-       d.sprintf("%d * %d * %d", nx, ny, nz);
+       d.asprintf("%d * %d * %d", nx, ny, nz);
        ready = true;
 }
 //-----------------------------------------------------------------------------
@@ -222,9 +222,9 @@ void DatPanel::putValue(int r, int c)
                {
                        if(mgl_isnan(g))        s="nan";
                        else if(mgl_isbad(g))   s="inf";
-                       else if(imag(g)>0)      s.sprintf("%g+%gi",real(g),imag(g));
-                       else if(imag(g)<0)      s.sprintf("%g-%gi",real(g),-imag(g));
-                       else    s.sprintf("%g",real(g));
+                       else if(imag(g)>0)      s.asprintf("%g+%gi",real(g),imag(g));
+                       else if(imag(g)<0)      s.asprintf("%g-%gi",real(g),-imag(g));
+                       else    s.asprintf("%g",real(g));
                        tab->item(r,c)->setText(s);
                }
                cc->a[c+nx*(r+ny*kz)] = g;
@@ -235,7 +235,7 @@ void DatPanel::putValue(int r, int c)
                {
                        if(mgl_isnan(f))        s="nan";
                        else if(mgl_isbad(f))   s=f>0?"inf":"-inf";
-                       else    s.sprintf("%g", f);
+                       else    s.asprintf("%g", f);
                        tab->item(r,c)->setText(s);
                }
                var->set_v(f,c,r,kz);
@@ -290,7 +290,7 @@ void DatPanel::load()
 void DatPanel::copy()
 {
        QTableWidgetSelectionRange ts = tab->selectedRanges().first();
-       QString res, s;
+       QString res;
        for(long j=ts.topRow();j<=ts.bottomRow();j++)
        {
                for(long i=ts.leftColumn();i<=ts.rightColumn();i++)
@@ -338,7 +338,7 @@ void DatPanel::list()       // TODO: in which script insert ???
        {
        for(long i=0;i<nx;i++)
                {
-                       s.sprintf("%g\t",d->a[i+nx*(j+kz*ny)]);
+                       s.asprintf("%g\t",d->a[i+nx*(j+kz*ny)]);
                        res += s;
                }
                if(j<ny-1)      res = res + "|\t";
@@ -398,7 +398,7 @@ void DatPanel::create()
 void DatPanel::reSize()
 {
        QString mx, my, mz;
-       mx.sprintf("%d",nx);    my.sprintf("%d",ny);    mz.sprintf("%d",nz);
+       mx.asprintf("%d",nx);   my.asprintf("%d",ny);   mz.asprintf("%d",nz);
        if(sizesDialog(_("UDAV - Resize data"), _("Enter new data sizes"), _("X-size"), _("Y-size"), _("Z-size"), mx, my, mz))
        {
                mglData *d = dynamic_cast<mglData *>(var);
@@ -432,7 +432,7 @@ void DatPanel::crop()
 void DatPanel::rearrange()
 {
        QString mx, my, mz;
-       mx.sprintf("%d",nx);    my.sprintf("%d",ny);    mz.sprintf("%d",nz);
+       mx.asprintf("%d",nx);   my.asprintf("%d",ny);   mz.asprintf("%d",nz);
        if(sizesDialog(_("UDAV - Rearrange data"), _("Enter new data sizes"), _("X-size"), _("Y-size"), _("Z-size"), mx, my, mz))
        {
                mglData *d = dynamic_cast<mglData *>(var);
index ff511ba6aa452550573e6a8a70995a2334ad3ecd..61964bbe7fa0b7f83ab93c5d71961cb683eb61f6 100644 (file)
@@ -39,8 +39,10 @@ InfoDialog::InfoDialog(QWidget *parent) : QDialog(parent)
        l = new QLabel(_("Select kind of plot"),this);  v->addWidget(l);
        kind = new QComboBox(this);     v->addWidget(kind);
        mgl = new QMathGL(this);        v->addWidget(mgl,1);
-       mgl->autoResize = true;         mgl->appName = _("Data preview");
+       //mgl->autoResize = true;       // TODO: something strange here !!!
+       mgl->appName = _("Data preview");
        mgl->setToolTip(_("Data preview for current slice."));
+       mgl->setDotsPreview(false);
 
        draw = new mglDrawScript(parser.Self());        mgl->setDraw(draw);
 
index 246bf15bb83839c8e2af4b55600aa180785fcf5b..6b203bd1b023d11626ef6476642e2b7e78924065 100644 (file)
@@ -153,7 +153,7 @@ void MemPanel::refresh()
                s = QString::fromWCharArray(v->Name());
                it = new QTableWidgetItem(s);
                tab->setItem(m,0,it);   it->setFlags(flags);
-               s.sprintf("%ld * %ld * %ld", v->GetNx(), v->GetNy(), v->GetNz());
+               s.asprintf("%ld * %ld * %ld", v->GetNx(), v->GetNy(), v->GetNz());
                it = new QTableWidgetItem(s);
                tab->setItem(m,1,it);   it->setFlags(flags);
                it->setTextAlignment(Qt::AlignHCenter|Qt::AlignVCenter);
@@ -167,16 +167,16 @@ void MemPanel::refresh()
                else if(dynamic_cast<mglDataT*>(v))     sv = sizeof(mglDataT);
                if(sv==0)       s = _("unknown");
 #if MGL_SIZEOF_LONG>4
-//             else if((sv>>80L)>0)    s.sprintf("%ld Yb",sv>>80L);
-//             else if((sv>>70L)>0)    s.sprintf("%ld Zb",sv>>70L);
-               else if((sv>>60L)>0)    s.sprintf("%ld Eb",sv>>60L);
-               else if((sv>>50L)>0)    s.sprintf("%ld Pb",sv>>50L);
-               else if((sv>>40L)>0)    s.sprintf("%ld Tb",sv>>40L);
+//             else if((sv>>80L)>0)    s.asprintf("%ld Yb",sv>>80L);
+//             else if((sv>>70L)>0)    s.asprintf("%ld Zb",sv>>70L);
+               else if((sv>>60L)>0)    s.asprintf("%ld Eb",sv>>60L);
+               else if((sv>>50L)>0)    s.asprintf("%ld Pb",sv>>50L);
+               else if((sv>>40L)>0)    s.asprintf("%ld Tb",sv>>40L);
 #endif
-               else if((sv>>30L)>0)    s.sprintf("%ld Gb",sv>>30L);
-               else if((sv>>20L)>0)    s.sprintf("%ld Mb",sv>>20L);
-               else if((sv>>10L)>0)    s.sprintf("%ld Kb",sv>>10L);
-               else    s.sprintf("%ld b",sv);
+               else if((sv>>30L)>0)    s.asprintf("%ld Gb",sv>>30L);
+               else if((sv>>20L)>0)    s.asprintf("%ld Mb",sv>>20L);
+               else if((sv>>10L)>0)    s.asprintf("%ld Kb",sv>>10L);
+               else    s.asprintf("%ld b",sv);
                it = new QTableWidgetItem(s);
                tab->setItem(m,2,it);   it->setFlags(flags);
                it->setTextAlignment(Qt::AlignRight|Qt::AlignVCenter);
index a82b2cc9d55f8ebece5befa478af97ab27a4802f..4f6444ea97e34347771bfe0f1645c9406cc3f9f6 100644 (file)
@@ -123,23 +123,23 @@ void DataOpenDialog::prepareResult()
        {
                v->Read(file.toLocal8Bit().constData());
                if(v->nx==1)    {       v->nx = v->ny;  v->ny = v->nz;  }
-               code=QString("#read %1 '%2'\n").arg(data).arg(file);
+               code=QString("#read %1 '%2'\n").arg(data,file);
        }
        else if(rM->isChecked())        //      manual sizes
        {
                int x=nx->text().toInt(), y=ny->text().toInt(), z=nz->text().toInt();
                v->Read(file.toLocal8Bit().constData(),x,y,z);
-               code=QString("#read %1 '%2' %3 %4 %5\n").arg(data).arg(file).arg(x).arg(y).arg(z);
+               code=QString("#read %1 '%2' %3 %4 %5\n").arg(data,file).arg(x).arg(y).arg(z);
        }
        else if(r2->isChecked())        //      matrix
        {
                v->ReadMat(file.toLocal8Bit().constData());
-               code=QString("#readmat %1 '%2'\n").arg(data).arg(file);         dd=1;
+               code=QString("#readmat %1 '%2'\n").arg(data,file);              dd=1;
        }
        else if(r3->isChecked())        //      3d-data
        {
                v->ReadMat(file.toLocal8Bit().constData(),3);
-               code=QString("#readmat %1 '%2' 3\n").arg(data).arg(file);       dd=2;
+               code=QString("#readmat %1 '%2' 3\n").arg(data,file);    dd=2;
        }
        if(scr->lineEdit()->text().isEmpty() || scr->lineEdit()->text()==_("default"))
        {
index 8495f9bc8f976d4f65cadc1fcdffbd539b42107d..39d8f40b779a11e5eda90b8550056c9ca81be777 100644 (file)
@@ -188,7 +188,7 @@ void PlotPanel::next()
        {
                gr.NewFrame();  execute();      gr.EndFrame();
                if(jpgOn)       gr.WriteFrame();
-               QString s;      s.sprintf(_("%d - %d of %d"),gr.GetNumFrame(),animPos,n);
+               QString s;      s.asprintf(_("%d - %d of %d"),gr.GetNumFrame(),animPos,n);
                setStatus(QString(_("Frame %1 of %2")).arg(animPos).arg(n));
        }
 }
index 0494c8f0091ccd4b8790d8f31de441d91a8d799d..542583086d23d818a9b0252c074d53bfc2ec19e3 100644 (file)
@@ -193,9 +193,9 @@ bool SetupDialog::convert()
                x1=xlight[i]->text().toDouble();        y1=ylight[i]->text().toDouble();
                z1=zlight[i]->text().toDouble();        j = clight[i]->currentIndex();
                if(blight[i]->text().isEmpty())
-                       s.sprintf("light %d %g %g %g '%c'\n", i,x1,y1,z1, col[j].toLatin1());
+                       s.asprintf("light %d %g %g %g '%c'\n", i,x1,y1,z1, col[j].toLatin1());
                else
-                       s.sprintf("light %d %g %g %g '%c' %g\n", i,x1,y1,z1, col[j].toLatin1(), blight[i]->text().toDouble());
+                       s.asprintf("light %d %g %g %g '%c' %g\n", i,x1,y1,z1, col[j].toLatin1(), blight[i]->text().toDouble());
                res += s;
        }
        u1 = !xmin->text().isEmpty();   if(u1)  x1 = xmin->text().toDouble();
@@ -205,21 +205,21 @@ bool SetupDialog::convert()
        w1 = !zmin->text().isEmpty();   if(w1)  z1 = zmin->text().toDouble();
        w2 = !zmin->text().isEmpty();   if(w2)  z2 = zmax->text().toDouble();
        if(u1&&v1&&w1&&u2&&v2&&w2)
-       {       s.sprintf("axis %g %g %g %g %g %g\n",x1,y1,z1,x2,y2,z2);        res += s;       }
+       {       s.asprintf("axis %g %g %g %g %g %g\n",x1,y1,z1,x2,y2,z2);       res += s;       }
        else
        {
-               if(u1 && u2)    {s.sprintf("xrange %g %g\n",x1,x2);     res += s;}
-               if(v1 && v2)    {s.sprintf("yrange %g %g\n",y1,y2);     res += s;}
-               if(w1 && w2)    {s.sprintf("zrange %g %g\n",z1,z2);     res += s;}
+               if(u1 && u2)    {s.asprintf("xrange %g %g\n",x1,x2);    res += s;}
+               if(v1 && v2)    {s.asprintf("yrange %g %g\n",y1,y2);    res += s;}
+               if(w1 && w2)    {s.asprintf("zrange %g %g\n",z1,z2);    res += s;}
        }
        u1 = !cmin->text().isEmpty();   if(u1)  x1 = cmin->text().toDouble();
        u2 = !cmax->text().isEmpty();   if(u2)  x2 = cmax->text().toDouble();
-       if(u1&&u2)      {s.sprintf("crange %g %g\n",x1,x2);     res += s;}
+       if(u1&&u2)      {s.asprintf("crange %g %g\n",x1,x2);    res += s;}
 
        u1 = !xmin->text().isEmpty();   if(u1)  x1 = xorg->text().toDouble();
        v1 = !yorg->text().isEmpty();   if(v1)  y1 = yorg->text().toDouble();
        w1 = !zorg->text().isEmpty();   if(w1)  z1 = zorg->text().toDouble();
-       if(u1&&v1&&w1)  {s.sprintf("origin %g %g %g\n",x1,y1,z1);       res += s;}
+       if(u1&&v1&&w1)  {s.asprintf("origin %g %g %g\n",x1,y1,z1);      res += s;}
 
        u1 = !xtck->text().isEmpty();   if(u1)  x1 = xtck->text().toDouble();
        u2 = !xsub->text().isEmpty();   if(u2)  x2 = xsub->text().toDouble();
@@ -229,25 +229,25 @@ bool SetupDialog::convert()
        w2 = !zsub->text().isEmpty();   if(w2)  z2 = zsub->text().toDouble();
        if(u1 && u2)
        {
-               if(xort->text().isEmpty())      s.sprintf("xtick %g %g\n",x1,x2);
-               else    s.sprintf("xtick %g %g %g\n",x1,x2,xort->text().toDouble());
+               if(xort->text().isEmpty())      s.asprintf("xtick %g %g\n",x1,x2);
+               else    s.asprintf("xtick %g %g %g\n",x1,x2,xort->text().toDouble());
                res += s;
        }
        if(v1 && v2)
        {
-               if(yort->text().isEmpty())      s.sprintf("ytick %g %g\n",y1,y2);
-               else    s.sprintf("ytick %g %g %g\n",y1,y2,yort->text().toDouble());
+               if(yort->text().isEmpty())      s.asprintf("ytick %g %g\n",y1,y2);
+               else    s.asprintf("ytick %g %g %g\n",y1,y2,yort->text().toDouble());
                res += s;
        }
        if(w1 && w2)
        {
-               if(zort->text().isEmpty())      s.sprintf("ztick %g %g\n",z1,z2);
-               else    s.sprintf("ztick %g %g %g\n",z1,z2,zort->text().toDouble());
+               if(zort->text().isEmpty())      s.asprintf("ztick %g %g\n",z1,z2);
+               else    s.asprintf("ztick %g %g %g\n",z1,z2,zort->text().toDouble());
                res += s;
        }
-       if(u1 && !u2)   {s.sprintf("xtick %g\n",x1);    res += s;}
-       if(v1 && !v2)   {s.sprintf("ytick %g\n",y1);    res += s;}
-       if(w1 && !w2)   {s.sprintf("ztick %g\n",z1);    res += s;}
+       if(u1 && !u2)   {s.asprintf("xtick %g\n",x1);   res += s;}
+       if(v1 && !v2)   {s.asprintf("ytick %g\n",y1);   res += s;}
+       if(w1 && !w2)   {s.asprintf("ztick %g\n",z1);   res += s;}
        if(!xtt->text().isEmpty())      res = res + "xtick '" + xtt->text() + "'\n";
        if(!ytt->text().isEmpty())      res = res + "ytick '" + ytt->text() + "'\n";
        if(!ztt->text().isEmpty())      res = res + "ztick '" + ztt->text() + "'\n";
@@ -255,40 +255,40 @@ bool SetupDialog::convert()
 
        if(!xlbl->text().isEmpty())
        {
-               s.sprintf("' %d\n",     xpos->currentIndex()-1);
+               s.asprintf("' %d\n",    xpos->currentIndex()-1);
                res = res + "xlabel '"+ xlbl->text() + s;
        }
        if(!ylbl->text().isEmpty())
        {
-               s.sprintf("' %d\n",     ypos->currentIndex()-1);
+               s.asprintf("' %d\n",    ypos->currentIndex()-1);
                res = res + "ylabel '"+ ylbl->text() + s;
        }
        if(!zlbl->text().isEmpty())
        {
-               s.sprintf("' %d\n",     zpos->currentIndex()-1);
+               s.asprintf("' %d\n",    zpos->currentIndex()-1);
                res = res + "zlabel '"+ zlbl->text() + s;
        }
 
        if(!aldef->text().isEmpty())
-       {       s.sprintf("alphadef %g\n",aldef->text().toDouble());    res += s;       }
+       {       s.asprintf("alphadef %g\n",aldef->text().toDouble());   res += s;       }
        if(!amb->text().isEmpty())
-       {       s.sprintf("ambient %g\n",amb->text().toDouble());               res += s;       }
+       {       s.asprintf("ambient %g\n",amb->text().toDouble());              res += s;       }
 
        if(!basew->text().isEmpty())
-       {       s.sprintf("baselinewidth %g\n",basew->text().toDouble());       res += s;       }
+       {       s.asprintf("baselinewidth %g\n",basew->text().toDouble());      res += s;       }
        if(!mesh->text().isEmpty())
-       {       s.sprintf("meshnum %d\n",mesh->text().toInt()); res += s;       }
+       {       s.asprintf("meshnum %d\n",mesh->text().toInt());        res += s;       }
        if(axial->currentIndex()>0)
        {
-               s.sprintf("axialdir '%c'\n",char('x'+axial->currentIndex()-1));
+               s.asprintf("axialdir '%c'\n",char('x'+axial->currentIndex()-1));
                res += s;
        }
 
        if(!font->text().isEmpty())
        {
                res = res + "font '" + font->text();
-               if(!fsize->text().isEmpty())    s.sprintf("' %g\n",fsize->text().toDouble());
-               else    s.sprintf("'\n");
+               if(!fsize->text().isEmpty())    s.asprintf("' %g\n",fsize->text().toDouble());
+               else    s.asprintf("'\n");
                res += s;
        }
        if(rotate->isChecked()) res = res + "rotatetext off\n";
index 1dc52c50f4d8b52af8725dc06e65766e67feeba2..e1fccc153fd64c751c8f89ccf415449f978e04ea 100644 (file)
@@ -423,7 +423,7 @@ void StyleDialog::updatePic()
        }\r
        result = "";\r
        int i,j;\r
-       QString col="wbgrcmylenuqphkWBGRCMYLENUQPH", mrk=".+x*sdv^<>o.*+xsdv^<>o", dsh="|;=ji: ", arw="AVIKTSDO", s;\r
+       QString col="wbgrcmylenuqphkWBGRCMYLENUQPH", mrk=".+x*sdv^<>o.*+xsdv^<>o", dsh="|;=ji: ", arw="AVIKTSDO";\r
        QString msk="-+=;oOsS~<>jdD*^", dir="/\\I";\r
        switch(tab->currentIndex())\r
        {\r
index 4405b0334727172f661c5342b2877dbe7ef7a598..0542af89ad0a01a5529b4dfc1675016e43ffeb29 100644 (file)
@@ -761,7 +761,6 @@ void MainWindow::messClicked()
        QString q = mess->textCursor().block().text();
        if(q.contains("in line "))
        {
-               QString s = q.section(' ',-1);
                int n = q.section(' ',-1).toInt()-1;    if(n<0) return;
                edit->moveCursor(QTextCursor::Start);
                for(int i=0;i<n;i++)    edit->moveCursor(QTextCursor::NextBlock);
diff --git a/udav_new.png b/udav_new.png
new file mode 100644 (file)
index 0000000..b754eef
Binary files /dev/null and b/udav_new.png differ
index 01bd12c1d77dc77ac3cc34254fa19ce21fdf986a..3e10fa75955f689499e2e2c8face154f45b1d86d 100644 (file)
@@ -1,6 +1,13 @@
 add_executable(make_pas make_pas.cpp)
 
+if(MSVC)
+set(link_type -static)
+else(MSVC)
+set(link_type)
+endif(MSVC)
+
 add_executable(mgltask mgltask.cpp)
+target_link_libraries(mgltask mgl${link_type} ${getopt_lib-static})
 install(
        TARGETS mgltask
        EXPORT MathGLTargets
@@ -8,11 +15,6 @@ install(
 )
 
 add_executable(mglconv mglconv.cpp)
-if(MSVC)
-set(link_type -static)
-else(MSVC)
-set(link_type)
-endif(MSVC)
 target_link_libraries(mglconv mgl${link_type} ${getopt_lib-static})
 install(
        TARGETS mglconv
@@ -29,7 +31,7 @@ install(
        RUNTIME DESTINATION ${MGL_CGI_PATH}
 )
 
-mgl_po_src(mglconv.cpp mglview.cpp mglcgi.cpp)
+mgl_po_src(mglconv.cpp mglview.cpp mglcgi.cpp mgltask.cpp)
 
 if(MGL_HAVE_FLTK)
        add_definitions(-DUSE_FLTK)
index 6f383defdc660b884d723a2fdb9a2db3b75b8012..c9bd75c4d74469d13e18163d313c012983154b20 100644 (file)
@@ -27,7 +27,7 @@ const char *head =
 // Copyright (C) 2008-2013 Mikhail Barg, Alexey Balakin                    *\n\
 //                                                                         *\n\
 //   This program is free software; you can redistribute it and/or modify  *\n\
-//   it under the terms of the GNU Library General Public License as       *\n\
+//   it under the terms of the GNU Lesser General Public License  as       *\n\
 //   published by the Free Software Foundation; either version 2 of the    *\n\
 //   License, or (at your option) any later version.                       *\n\
 //                                                                         *\n\
@@ -36,7 +36,7 @@ const char *head =
 //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\n\
 //   GNU General Public License for more details.                          *\n\
 //                                                                         *\n\
-//   You should have received a copy of the GNU Library General Public     *\n\
+//   You should have received a copy of the GNU Lesser General Public     *\n\
 //   License along with this program; if not, write to the                 *\n\
 //   Free Software Foundation, Inc.,                                       *\n\
 //   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\n\
index 651ed777659be6c62a8aafc9db81730e633602f2..abde554dd163257eb1fc839b2081ea08d9a62364 100644 (file)
@@ -157,7 +157,7 @@ int main(int argc, char *argv[])
                if(gr.Message()[0])     printf("%s\n",gr.Message());\r
                if(!none)       gr.WriteFrame(oname);\r
        }\r
-       if(!mglGlobalMess.empty())      printf("%s",mglGlobalMess.c_str());\r
+       printf("%s",mgl_get_global_warn());\r
        if(!none || gif)        printf("Write output to %s\n",oname);\r
        return 0;\r
 }\r
index c58e1037ed6d5ec1f6cc40fc5efb624b9f42e87c..83e1695a0c58d36811597fb88b0a0c0e65a739bb 100644 (file)
-#include <iostream>\r
-#include <string.h>\r
+#include <locale.h>\r
+#include <getopt.h>\r
 #include <stdio.h>\r
 #include <stdlib.h>\r
+#if ((defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(M_PI))   //_MSC_VER needs this before math.h\r
+#define        _USE_MATH_DEFINES\r
+#endif\r
 #include <math.h>\r
 #include <time.h>\r
-//===================================================================\r
-#define IM1 2147483563\r
-#define IM2 2147483399\r
-#define AM (1.0/IM1)\r
-#define IMM1 (IM1-1)\r
-#define IA1 40014\r
-#define IA2 40692\r
-#define IQ1 53668\r
-#define IQ2 52774\r
-#define IR1 12211\r
-#define IR2 3791\r
-#define NTAB 32\r
-#define NDIV (1+IMM1/NTAB)\r
-#define EPS 1.2e-7\r
-#define RNMX (1.0-EPS)\r
-#ifndef NULL\r
-#define NULL 0L\r
-#endif\r
-//===================================================================\r
-double Random()\r
-// Long period (> 2 * 10^18 ) random number generator of L'Ecuyer with\r
-// Bays-Durham shuffle and added safeguards. Returns a uniform random deviate\r
-// between 0.0 and 1.0 (exclusive of the endpoint values). Call with idum a\r
-// negative integer to initialize; thereafter, do not alter idum between\r
-// successive deviates in a sequence. RNMX should approximate the largest\r
-// floating value that is less than 1.\r
-{\r
-       static long idum=0;\r
-       int j;\r
-       long k;\r
-       static long idum2=123456789;\r
-       static long iy=0;\r
-       static long iv[NTAB];\r
-       double temp;\r
-       if(idum==0)\r
-               idum = -(long)(time(NULL));\r
-       if (idum <= 0) {                                // Initialize.\r
-               if (-(idum) < 1) idum=1;        // Be sure to prevent idum = 0.\r
-               else idum = -(idum);\r
-               idum2=(idum);\r
-               for (j=NTAB+7;j>=0;j--) {       // Load the shuffle table (after 8 warm-ups).\r
-                       k=(idum)/IQ1;\r
-                       idum=IA1*(idum-k*IQ1)-k*IR1;\r
-                       if (idum < 0) idum += IM1;\r
-                       if (j < NTAB) iv[j] = idum;\r
-               }\r
-               iy=iv[0];\r
-       }\r
-       k=(idum)/IQ1;                                   // Start here when not initializing.\r
-       idum=IA1*(idum-k*IQ1)-k*IR1;    // Compute idum=(IA1*idum) % IM1 without\r
-                                                                       // over ows by Schrage's method.\r
-       if (idum < 0) idum += IM1;\r
-       k=idum2/IQ2;\r
-       idum2=IA2*(idum2-k*IQ2)-k*IR2;  // Compute idum2=(IA2*idum) % IM2 likewise.\r
-       if (idum2 < 0) idum2 += IM2;\r
-       j=iy/NDIV;                                              // Will be in the range 0..NTAB-1.\r
-       iy=iv[j]-idum2;                                 // Here idum is shu\ fed, idum and idum2 are\r
-                                                                       // combined to generate output.\r
-       iv[j] = idum;\r
-       if (iy < 1) iy += IMM1;\r
-       if ((temp=AM*iy) > RNMX)        // Because users don't expect endpoint values.\r
-               return RNMX;\r
-       else return temp;\r
-}\r
-//===================================================================\r
-int strpos(char *str,char ch)\r
-{\r
-       char *p=strchr(str,ch);\r
-       int res;\r
-       if(p)   res = p-str;\r
-       else    res = -1;\r
-       return res;\r
-}\r
-//===================================================================\r
-// multi_task empl_7b_tr.ini empl.ini 0:1:2 2:2:6\r
+\r
+#include "mgl2/addon.h"\r
+#include "mgl2/data.h"\r
+//-----------------------------------------------------------------------------\r
 int main(int argc, char *argv[])\r
 {\r
-       bool e[10];\r
-       if(argc<3)    // if incorrect number of arguments then print the help\r
+       const char *args_opt="a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:p:q:r:s:t:u:v:w:x:y:z:";\r
+       std::string eqs[26];\r
+       while(1)\r
        {\r
-               printf("mgltask make output file with a set of copies of mask-file with repeatedly replaced $# by loop values. It useful for making set of initial conditions with a few parameters varied in specified range.\n");\r
-               printf("Usage:\tmgltask maskfile outputfile [min1:step1:max1] [min2:step2:max2]\n\n");\r
-               printf("\tmask file  -- mask file in which all '$#' will be replaced by counter # value\n");\r
-               printf("\t\tHere # = 0 is random number in [0,1].\n");\r
-               printf("\t\tHere # = 1,2...9 is counter number.\n");\r
-               printf("\toutputfile -- file where result will be saved\n");\r
-               printf("\tmin#:step#:max# -- is minimum, step increment and maximum values of counter #\n");\r
-               printf("\t'e'min#:step#:max# -- the same but in exponential form 10^#\n");\r
-//             system("PAUSE");\r
-               return 0;\r
+               int ch = getopt(argc, argv, args_opt);\r
+               if(ch>='a' && ch<='z')  eqs[ch-'a'] = optarg;\r
+               if(ch<0)        break;\r
        }\r
-       //char maskname[256],outname[256];\r
-       char str[1024],*buf;\r
-       double x1[10],x2[10],dx[10],x[10];\r
-       int k,i,n=argc-3;//=(argc==4) ? 1:2;\r
-       FILE *fm,*fo;\r
        \r
-       // first place zeros\r
-       for(i=0;i<10;i++)\r
+       double x1[3]={0,0,0},x2[3]={0,0,0},dx[3]={1,1,1};\r
+       bool e[3]={false,false,false};\r
+       int n=argc-optind-2;    // number of counters\r
+\r
+       if(n<1)    // if incorrect number of arguments then print the help\r
        {\r
-               x1[i] = x2[i] = 0;\r
-               dx[i] = 1;\r
-               e[i] = false;\r
+               printf("mgltask make output file with a set of copies of mask-file with repeatedly replaced $# by loop values. It useful for making set of initial conditions with a few parameters varied in specified range.\n");\r
+               printf("Usage:\tmgltask [options] maskfile outputfile [min1:step1:max1 [min2:step2:max2 [min3:step3:max3]]]\n\n");\r
+               printf("\tmask file  -- mask file in which all '$#' will be replaced by counter # value.\n");\r
+               printf("\t\tHere # = 0 is random number in [0,1]; # = 1,2,3 are counters;\n");\r
+               printf("\t\t# = a,b,...,z are formulas defined by options.\n");\r
+               printf("\toutputfile -- file where result will be saved, the '-' will print in stdout;\n");\r
+               printf("\tmin#:step#:max# -- is minimum, step increment and maximum values of counter #;\n");\r
+               printf("\t'e'min#:step#:max# -- the same but in exponential form 10^#.\n");\r
+               printf("\tOptions -a, -b, ..., -z define formulas for arguments $a,$b,...,$z,\n");\r
+               printf("\t\twhich can depended on counters v0=$0,v1=$1,v2=$2,v3=$3.\n");\r
+//             system("PAUSE");\r
+               return 0;\r
        }\r
-       printf("mask = %s, out = %s\n",argv[1],argv[2]);\r
+\r
+       FILE *fm = fopen(argv[optind],"r");\r
+       FILE *fo = strcmp(argv[optind+1],"-") ? fopen(argv[optind+1],"w"):stdout;\r
+       printf("mask = %s, out = %s\n",argv[optind],argv[optind+1]);\r
        // read parameters of loops\r
-       for(i=0;i<n;i++)\r
+       for(int i=0;i<n;i++)\r
        {\r
-               char *par = argv[i+3];\r
+               const char *par = argv[optind+i+2];\r
                if(par[0]=='e') {       e[i] = true;    par++;  }\r
-               sscanf(par,"%lg:%lg:%lg",&(x1[i]),&(dx[i]),&(x2[i]));\r
-               printf("%g:%g:%g\n",x1[i],dx[i],x2[i]);\r
+               int r=sscanf(par,"%lg:%lg:%lg",x1+i,dx+i,x2+i);\r
+               if(r==2)        {       x2[i]=dx[i];    dx[i]=1;        }\r
+               else if(r!=3)   break;  // something wrong in arguments\r
+               printf("$%d in %g:%g:%g\n",i+1,x1[i],dx[i],x2[i]);\r
        }\r
        // for each variable\r
-       fm = fopen(argv[1],"r");\r
-       fo = fopen(argv[2],"w");\r
-       for(x[0]=x1[0];x[0]<=x2[0];x[0]+=dx[0])\r
-               for(x[1]=x1[1];x[1]<=x2[1];x[1]+=dx[1])\r
+       double v1,v2,v3;\r
+       mglData d0,d1,d2,d3;\r
+       d0.Name("v0");  d1.Name("v1");  d2.Name("v2");  d3.Name("v3");\r
+       double vals[26]={0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0,0,0,0,0, 0};\r
+       for(v3=x1[2];v3<=x2[2];v3+=dx[2])       for(v2=x1[1];v2<=x2[1];v2+=dx[1])       for(v1=x1[0];v1<=x2[0];v1+=dx[0])\r
+       {\r
+               d0.a[0]=mgl_rnd();      d1.a[0]=v1;     d2.a[0]=v2;     d3.a[0]=v3;\r
+               for(int i=0;i<26;i++)   if(!eqs[i].empty())\r
+               {\r
+                       HMDT d = mgl_formula_calc(eqs[i].c_str(), 4, &d0,&d1,&d2,&d3);\r
+                       vals[i] = d->a[0];      mgl_delete_data(d);\r
+               }\r
+               \r
+               fseek(fm,0,0);\r
+               while(!feof(fm))\r
                {\r
-                       fseek(fm,0,0);\r
-                       while(!feof(fm))\r
+                       int i;\r
+                       char str[1024],*buf=str;\r
+                       char *r=fgets(str,1024,fm);             // for each string\r
+                       if(!r)  break;\r
+                       while((i=mgl_chrpos(buf,'$'))!=-1)    // find '$'\r
                        {\r
-                               fgets(str,1024,fm);             // for each string\r
-                               buf = str;\r
-                               while((i=strpos(buf,'$'))!=-1)    // find '$'\r
-                               {\r
-                                       k=buf[i+1]-'1';\r
-                                       buf[i]=0;\r
-                                       if(k<0)                         // random number\r
-                                               fprintf(fo,"%s%g",buf,Random());\r
-                                       if(k>=0 && k<n)         // if parameter is correct then change it\r
-                                               fprintf(fo,"%s%g",buf,e[k] ? exp(M_LN10*x[k]):(fabs(x[k])<1e-10?0:x[k]));\r
-                                       buf = &(buf[i+2]);      // handle the last part\r
-                               }\r
-                               fprintf(fo,"%s",buf);   // write it\r
+                               char k=buf[i+1];\r
+                               buf[i]=0;\r
+                               if(k=='0')      fprintf(fo,"%s%g",buf,d0.a[0]);\r
+                               else if(k=='1')\r
+                                       fprintf(fo,"%s%g",buf,e[0] ? exp(M_LN10*v1):(fabs(v1)<1e-10?0:v1));\r
+                               else if(k=='2')\r
+                                       fprintf(fo,"%s%g",buf,e[1] ? exp(M_LN10*v2):(fabs(v2)<1e-10?0:v2));\r
+                               else if(k=='3')\r
+                                       fprintf(fo,"%s%g",buf,e[2] ? exp(M_LN10*v3):(fabs(v3)<1e-10?0:v3));\r
+                               else if(k>='a' && k<='z')       fprintf(fo,"%s%g",buf,vals[k-'a']);\r
+                               buf = &(buf[i+2]);      // handle the last part\r
                        }\r
-                       fprintf(fo,"\n");\r
+                       fprintf(fo,"%s",buf);   // write it\r
                }\r
-       fclose(fm);\r
-       fclose(fo);\r
+               fprintf(fo,"\n");\r
+       }\r
+       fclose(fm);     fclose(fo);\r
        return 0;\r
 }\r
-//===================================================================\r
+//-----------------------------------------------------------------------------\r
index d360df3574cd7ab379193695e6ba260f93737bff..de7a1bf980a2c8094511c367aa48e9c7b1c20916 100644 (file)
@@ -146,7 +146,7 @@ int main(int argc, char **argv)
                setlocale(LC_NUMERIC, loc.c_str());
                gr.EndFrame();  gr.Update();
        }
-       if(!mglGlobalMess.empty())      printf("%s",mglGlobalMess.c_str());
+       printf("%s",mgl_get_global_warn());
        return gr.Run();
 }
 //-----------------------------------------------------------------------------
index 5c9fc8c6162050e402d75d42d168593702da1496..d88aeb800bed785ac0b1871bd04ab31f429cf800 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -113,6 +113,8 @@ Fl_MathGL::Fl_MathGL(int xx, int yy, int ww, int hh, const char *lbl) : Fl_Widge
        flag=x0=y0=xe=ye=0;     show_warn=true;
        tet_val = phi_val = 0;
        draw_par = 0;   draw_func = 0;  draw_cl = 0;
+       hndl_func = 0;  hndl_par = 0;
+       prop_func = 0;  prop_par = 0;
        last_id = -1;   run = false;
        popup=0;        vpar=0; wpar=0;
 #if (MGL_HAVE_PTHREAD|MGL_HAVE_PTHR_WIDGET)
@@ -244,14 +246,18 @@ void Fl_MathGL::update()
 void Fl_MathGL::resize(int xx, int yy, int ww, int hh)
 {      Fl_Widget::resize(xx,yy,ww,hh); }
 //-----------------------------------------------------------------------------
+void Fl_MGLView::dlg_show()    {       dlg_finish();   dlg_wnd->show();        }       ///< Show window
+void Fl_MGLView::dlg_hide()    {       dlg_wnd->hide();        }       ///< Close window
 int Fl_MathGL::handle(int code)
 {
        static bool busy=false;
        static int last_pos=-1;
+       int r = hndl_func?hndl_func(code, hndl_par):0;
+       if(r)   return r;
        if(handle_keys && code==FL_KEYUP && Fl::event_button()!=FL_LEFT_MOUSE)
        {
                int key=Fl::event_key();
-               if(!strchr(" .,wasdrfx",key))   return 0;
+//             if(!strchr(" .,wasdrfx",key))   return 0;
                if(key==' ')    {       update();       return 1;       }
                if(key=='w')
                {
@@ -943,7 +949,7 @@ Fl_MGLView::~Fl_MGLView()
 //
 //-----------------------------------------------------------------------------
 mglCanvasFL::mglCanvasFL() : mglCanvasWnd()    {       Wnd=0;  mgl=0;  }
-mglCanvasFL::~mglCanvasFL()            {       if(Wnd) {       mgl->FMGL->gr=0;        delete Wnd;     }       }
+mglCanvasFL::~mglCanvasFL()            {       if(Wnd) {       mgl->FMGL->no_graph();  delete Wnd;     }       }
 //-----------------------------------------------------------------------------
 void mglCanvasFL::GotoFrame(int d)
 {
@@ -1085,6 +1091,12 @@ static void mgl_upd_vals(Fl_Widget *, void *p)   {       ((Fl_MGLView *)p)->get_values()
 //-----------------------------------------------------------------------------
 static void mgl_dlg_hide(Fl_Widget *, void *p) {       ((Fl_MGLView *)p)->dlg_hide();  }
 //-----------------------------------------------------------------------------
+void Fl_MGLView::toggle_alpha()        {       toggle(alpha, alpha_bt, _("Graphics/Alpha"));   }
+void Fl_MGLView::toggle_light()        {       toggle(light, light_bt, _("Graphics/Light"));   }
+void Fl_MGLView::toggle_sshow()        {       toggle(sshow, anim_bt, _("Graphics/Animation/Slideshow"));      }
+void Fl_MGLView::toggle_grid() {       toggle(grid, grid_bt, _("Graphics/Grid"));      }
+void Fl_MGLView::toggle_pause()        {       toggle(pauseC, pause_bt, _("Graphics/Pause calc"));     exec_pause();   }
+//-----------------------------------------------------------------------------
 void Fl_MGLView::dlg_window(const char *title)
 {
        if(!title || *title==0) title = "MGL dialog";
@@ -1147,10 +1159,13 @@ void Fl_MGLView::add_widget(char id, const char *args)
        args += 2;
        Fl_Widget *w=NULL;
        char *lbl=0;
-       for(size_t i=0;args[i];i++)     if(args[i]=='|')        // find label
-       {       lbl = (char*)malloc(i); lbl[i]=0;
-               for(size_t j=0;j<i;j++) lbl[j] = args[j];
-               args += i;      break;  }
+       for(size_t i=0;args[i];i++)
+               if(args[i]=='|')        // find label
+               {
+                       lbl = (char*)malloc(i); lbl[i]=0;
+                       for(size_t j=0;j<i;j++) lbl[j] = args[j];
+                       args += i;      break;
+               }
        if(!lbl)
        {       lbl = (char*)malloc(3); lbl[0]='$';     lbl[1]=id;      lbl[2]=0;       }
        else    args++;
index 92b9da7ea4d9a08fc65703bbbbb49255d5350fd6..20af67e5af1c4ef77d1bf8681db9b8819a4f94d6 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r
index b36baccb4d0a4691798f3f17bbe01097c5174423..5bf72eb389d533fd56dee7735c7cf2b74a6beb70 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * modify it under the terms of the GNU Lesser General Public License 
  * as published by the Free Software Foundation
  *
  * This program is distributed in the hope that it will be useful,
index 64825fa61999164b5cfc6b901540b7ce963653ad..6dd81a2efdc12f5e434174f8f7d9d5856459440e 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 2007-2014 Alexey Balakin <mathgl.abalakin@gmail.ru>
  *
  * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License
+ * modify it under the terms of the GNU Lesser General Public License 
  * as published by the Free Software Foundation
  *
  * This program is distributed in the hope that it will be useful,
index 361a987586d4e3190275bf276c8ceb3875645306..05f1c7e2ab876e438cd7879e234fb385528c65b1 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU Library General Public License as       *
+ *   it under the terms of the GNU Lesser General Public License  as       *
  *   published by the Free Software Foundation; either version 3 of the    *
  *   License, or (at your option) any later version.                       *
  *                                                                         *
@@ -12,7 +12,7 @@
  *   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 Library General Public     *
+ *   You should have received a copy of the GNU Lesser General Public     *
  *   License along with this program; if not, write to the                 *
  *   Free Software Foundation, Inc.,                                       *
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
@@ -375,7 +375,7 @@ void QMathGL::drawPrim()
        for(i=0;i<n;i++)
        {
                mgl_set_obj_id(gr,i+MGL_MAX_LINES);
-               QString tst = primitives.section('\n',i,i);
+//             QString tst = primitives.section('\n',i,i);
                pr.Parse(&gg,primitives.section('\n',i,i).toLocal8Bit().constData(),i+MGL_MAX_LINES);
        }
        gg.SetRanges(ox1,ox2);  gg.Pop();       setlocale(LC_NUMERIC, loc.c_str());
@@ -439,7 +439,7 @@ void QMathGL::mousePressEvent(QMouseEvent *ev)
 
                p = gr->CalcXYZ(ev->x(), ev->y(), true);
                if(mgl_isnan(p.x))      mousePos = "";
-               else    mousePos.sprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z);
+               else    mousePos.asprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z);
                emit posChanged(mousePos);
                repaint();
        }
@@ -625,7 +625,7 @@ void QMathGL::mouseMoveEvent(QMouseEvent *ev)
        {
                mglPoint p = gr->CalcXYZ(ev->x(), ev->y(), true);
                if(mgl_isnan(p.x))      mousePos = "";
-               else    mousePos.sprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z);
+               else    mousePos.asprintf("x=%g, y=%g, z=%g",p.x,p.y,p.z);
                emit posChanged(mousePos);
        }*/
        ev->accept();
@@ -971,7 +971,7 @@ void QMathGL::addText(QString txt)
 mglCanvasQT::mglCanvasQT() : mglCanvasWnd()
 {      Wnd = 0;        }
 mglCanvasQT::~mglCanvasQT()
-{      if(Wnd) {       QMGL->gr=0;     delete Wnd;     }       }
+{      if(Wnd) {       QMGL->noGraph();        delete Wnd;     }       }
 //-----------------------------------------------------------------------------
 void mglCanvasQT::GotoFrame(int d)
 {
index 2a3988ef94226b1a7e225ef20927959b973cd336..78a2613276e5f08d7d23ad9276ab6b2fd97ecb5b 100644 (file)
@@ -3,7 +3,7 @@
  * Copyright (C) 2007-2016 Alexey Balakin <mathgl.abalakin@gmail.ru>       *\r
  *                                                                         *\r
  *   This program is free software; you can redistribute it and/or modify  *\r
- *   it under the terms of the GNU Library General Public License as       *\r
+ *   it under the terms of the GNU Lesser General Public License  as       *\r
  *   published by the Free Software Foundation; either version 3 of the    *\r
  *   License, or (at your option) any later version.                       *\r
  *                                                                         *\r
@@ -12,7 +12,7 @@
  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *\r
  *   GNU General Public License for more details.                          *\r
  *                                                                         *\r
- *   You should have received a copy of the GNU Library General Public     *\r
+ *   You should have received a copy of the GNU Lesser General Public     *\r
  *   License along with this program; if not, write to the                 *\r
  *   Free Software Foundation, Inc.,                                       *\r
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *\r