addded documenation for array function and complex

pull/6/merge
Sergey Bakhurin 2019-06-18 16:57:48 +03:00
rodzic 4ebf6f0df4
commit 8df0c8fa66
16 zmienionych plików z 1447 dodań i 376 usunięć

Wyświetl plik

@ -1,4 +1,4 @@
# Doxyfile 1.8.15
# Doxyfile 1.8.10
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@ -17,11 +17,11 @@
# Project related configuration options
#---------------------------------------------------------------------------
# This tag specifies the encoding used for all characters in the configuration
# file that follow. The default is UTF-8 which is also the encoding used for all
# text before the first occurrence of this tag. Doxygen uses libiconv (or the
# iconv built into libc) for the transcoding. See
# https://www.gnu.org/software/libiconv/ for the list of possible encodings.
# This tag specifies the encoding used for all characters in the config file
# that follow. The default is UTF-8 which is also the encoding used for all text
# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
# for the list of possible encodings.
# The default value is: UTF-8.
DOXYFILE_ENCODING = UTF-8
@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.
PROJECT_NAME = libdspl-2.0
PROJECT_NAME =
# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
@ -93,14 +93,6 @@ ALLOW_UNICODE_NAMES = YES
OUTPUT_LANGUAGE = Russian
# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all
# documentation generated by doxygen is written. Doxygen will use this
# information to generate all generated output in the proper direction.
# Possible values are: None, LTR, RTL and Context.
# The default value is: None.
OUTPUT_TEXT_DIRECTION = None
# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member
# descriptions after the members that are listed in the file and class
# documentation (similar to Javadoc). Set to NO to disable this.
@ -244,12 +236,7 @@ TAB_SIZE = 2
# will allow you to put the command \sideeffect (or @sideeffect) in the
# documentation, which will result in a user-defined paragraph with heading
# "Side Effects:". You can put \n's in the value part of an alias to insert
# newlines (in the resulting output). You can put ^^ in the value part of an
# alias to insert a newline as if a physical newline was in the original file.
# When you need a literal { or } or , in the value part of an alias you have to
# escape them by means of a backslash (\), this can lead to conflicts with the
# commands \{ and \} for these it is advised to use the version @{ and @} or use
# a double escape (\\{ and \\})
# newlines.
ALIASES =
@ -287,26 +274,17 @@ OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice
# sources only. Doxygen will then generate output that is more tailored for that
# language. For instance, namespaces will be presented as modules, types will be
# separated into more groups, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_SLICE = NO
# Doxygen selects the parser to use depending on the extension of the files it
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
# tries to guess whether the code is fixed or free formatted code, this is the
# default for Fortran type files), VHDL, tcl. For instance to make doxygen treat
# .inc files as Fortran files (default is PHP), and .f files as C (default is
# Fortran), use: inc=Fortran f=C.
# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
# Fortran. In the later case the parser tries to guess whether the code is fixed
# or free formatted code, this is the default for Fortran type files), VHDL. For
# instance to make doxygen treat .inc files as Fortran files (default is PHP),
# and .f files as C (default is Fortran), use: inc=Fortran f=C.
#
# Note: For files without extension you can use no_extension as a placeholder.
#
@ -317,7 +295,7 @@ EXTENSION_MAPPING =
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
# according to the Markdown format, which allows for more readable
# documentation. See https://daringfireball.net/projects/markdown/ for details.
# documentation. See http://daringfireball.net/projects/markdown/ for details.
# The output of markdown processing is further processed by doxygen, so you can
# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
# case of backward compatibilities issues.
@ -325,15 +303,6 @@ EXTENSION_MAPPING =
MARKDOWN_SUPPORT = YES
# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
# When enabled doxygen tries to link words that correspond to documented
# classes, or namespaces to their corresponding documentation. Such a link can
# be prevented in individual cases by putting a % sign in front of the word or
@ -359,7 +328,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen
# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
# will parse them like normal C++ but will assume all classes use public instead
# of private inheritance when no explicit protection keyword is present.
# The default value is: NO.
@ -730,7 +699,7 @@ LAYOUT_FILE =
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
# extension is automatically appended if omitted. This requires the bibtex tool
# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info.
# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
# For LaTeX the style of the bibliography can be controlled using
# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
# search path. See also \cite for info how to create references.
@ -775,18 +744,11 @@ WARN_IF_DOC_ERROR = YES
# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
# are documented, but have no documentation for their parameters or return
# value. If set to NO, doxygen will only warn about wrong or incomplete
# parameter documentation, but not about the absence of documentation. If
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# parameter documentation, but not about the absence of documentation.
# The default value is: NO.
WARN_NO_PARAMDOC = NO
# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when
# a warning is encountered.
# The default value is: NO.
WARN_AS_ERROR = NO
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
# will be replaced by the file and line number from which the warning originated
@ -824,7 +786,7 @@ INPUT = ru \
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
# documentation (see: https://www.gnu.org/software/libiconv/) for the list of
# documentation (see: http://www.gnu.org/software/libiconv) for the list of
# possible encodings.
# The default value is: UTF-8.
@ -841,8 +803,8 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd,
# *.vhdl, *.ucf, *.qsf, *.as and *.js.
FILE_PATTERNS = *.c \
*.cc \
@ -975,10 +937,6 @@ IMAGE_PATH = ru/img \
# Note that the filter must not add or remove lines; it is applied before the
# code is scanned, but not when the output code is generated. If lines are added
# or removed, the anchors will not be placed correctly.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
INPUT_FILTER =
@ -988,10 +946,6 @@ INPUT_FILTER =
# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
# patterns match the file name, INPUT_FILTER is applied.
#
# Note that for custom extensions or not directly supported extensions you also
# need to set EXTENSION_MAPPING for the extension otherwise the files are not
# properly processed by doxygen.
FILTER_PATTERNS =
@ -1044,7 +998,7 @@ INLINE_SOURCES = NO
STRIP_CODE_COMMENTS = YES
# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
# entity all documented functions referencing it will be listed.
# function all documented functions referencing it will be listed.
# The default value is: NO.
REFERENCED_BY_RELATION = YES
@ -1076,12 +1030,12 @@ SOURCE_TOOLTIPS = YES
# If the USE_HTAGS tag is set to YES then the references to source code will
# point to the HTML generated by the htags(1) tool instead of doxygen built-in
# source browser. The htags tool is part of GNU's global source tagging system
# (see https://www.gnu.org/software/global/global.html). You will need version
# (see http://www.gnu.org/software/global/global.html). You will need version
# 4.8.6 or higher.
#
# To use it do the following:
# - Install the latest version of global
# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file
# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
# - Make sure the INPUT points to the root of the source tree
# - Run doxygen as normal
#
@ -1109,7 +1063,7 @@ VERBATIM_HEADERS = YES
# rich C++ code for which doxygen's built-in parser lacks the necessary type
# information.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
# compiled with the --with-libclang option.
# The default value is: NO.
CLANG_ASSISTED_PARSING = NO
@ -1122,16 +1076,6 @@ CLANG_ASSISTED_PARSING = NO
CLANG_OPTIONS =
# If clang assisted parsing is enabled you can provide the clang parser with the
# path to the compilation database (see:
# http://clang.llvm.org/docs/HowToSetupToolingForLLVM.html) used when the files
# were built. This is equivalent to specifying the "-p" option to a clang tool,
# such as clang-check. These options will then be passed to the parser.
# Note: The availability of this option depends on whether or not doxygen was
# generated with the -Duse_libclang=ON option for CMake.
CLANG_DATABASE_PATH =
#---------------------------------------------------------------------------
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
@ -1250,7 +1194,7 @@ HTML_EXTRA_FILES =
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
# will adjust the colors in the style sheet and background images according to
# this color. Hue is specified as an angle on a colorwheel, see
# https://en.wikipedia.org/wiki/Hue for more information. For instance the value
# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
# purple, and 360 is red again.
# Minimum value: 0, maximum value: 359, default value: 220.
@ -1286,17 +1230,6 @@ HTML_COLORSTYLE_GAMMA = 80
HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
HTML_DYNAMIC_MENUS = YES
# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
# documentation will contain sections that can be hidden and shown after the
# page has loaded.
@ -1320,13 +1253,13 @@ HTML_INDEX_NUM_ENTRIES = 100
# If the GENERATE_DOCSET tag is set to YES, additional index files will be
# generated that can be used as input for Apple's Xcode 3 integrated development
# environment (see: https://developer.apple.com/xcode/), introduced with OSX
# 10.5 (Leopard). To create a documentation set, doxygen will generate a
# environment (see: http://developer.apple.com/tools/xcode/), introduced with
# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
# Makefile in the HTML output directory. Running make will produce the docset in
# that directory and running make install will install the docset in
# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy
# genXcode/_index.html for more information.
# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
# for more information.
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
@ -1365,7 +1298,7 @@ DOCSET_PUBLISHER_NAME = Publisher
# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
# Windows.
#
# The HTML Help Workshop contains a compiler that can convert all HTML output
@ -1441,7 +1374,7 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1449,7 +1382,7 @@ QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1458,7 +1391,7 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1466,7 +1399,7 @@ QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1474,7 +1407,7 @@ QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
@ -1567,7 +1500,7 @@ EXT_LINKS_IN_WINDOW = NO
FORMULA_FONTSIZE = 14
# Use the FORMULA_TRANSPARENT tag to determine whether or not the images
# Use the FORMULA_TRANPARENT tag to determine whether or not the images
# generated for formulas are transparent PNGs. Transparent PNGs are not
# supported properly for IE 6.0, but are supported on all modern browsers.
#
@ -1579,7 +1512,7 @@ FORMULA_FONTSIZE = 14
FORMULA_TRANSPARENT = YES
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# https://www.mathjax.org) which uses client side Javascript for the rendering
# http://www.mathjax.org) which uses client side Javascript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@ -1606,8 +1539,8 @@ MATHJAX_FORMAT = HTML-CSS
# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
# Content Delivery Network so you can quickly see the result without installing
# MathJax. However, it is strongly recommended to install a local copy of
# MathJax from https://www.mathjax.org before deployment.
# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/.
# MathJax from http://www.mathjax.org before deployment.
# The default value is: http://cdn.mathjax.org/mathjax/latest.
# This tag requires that the tag USE_MATHJAX is set to YES.
MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest
@ -1668,7 +1601,7 @@ SERVER_BASED_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/).
# Xapian (see: http://xapian.org/).
#
# See the section "External Indexing and Searching" for details.
# The default value is: NO.
@ -1681,7 +1614,7 @@ EXTERNAL_SEARCH = NO
#
# Doxygen ships with an example indexer (doxyindexer) and search engine
# (doxysearch.cgi) which are based on the open source search engine library
# Xapian (see: https://xapian.org/). See the section "External Indexing and
# Xapian (see: http://xapian.org/). See the section "External Indexing and
# Searching" for details.
# This tag requires that the tag SEARCHENGINE is set to YES.
@ -1733,34 +1666,21 @@ LATEX_OUTPUT = latex
# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
# invoked.
#
# Note that when not enabling USE_PDFLATEX the default is latex when enabling
# USE_PDFLATEX the default is pdflatex and when in the later case latex is
# chosen this is overwritten by pdflatex. For specific output languages the
# default can have been set differently, this depends on the implementation of
# the output language.
# Note that when enabling USE_PDFLATEX this option is only used for generating
# bitmaps for formulas in the HTML output, but not in the Makefile that is
# written to the output directory.
# The default file is: latex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_CMD_NAME = latex
# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
# index for LaTeX.
# Note: This tag is used in the Makefile / make.bat.
# See also: LATEX_MAKEINDEX_CMD for the part in the generated output file
# (.tex).
# The default file is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
MAKEINDEX_CMD_NAME = makeindex
# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
# generate index for LaTeX.
# Note: This tag is used in the generated output file (.tex).
# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
# The default value is: \makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_MAKEINDEX_CMD = \makeindex
# If the COMPACT_LATEX tag is set to YES, doxygen generates more compact LaTeX
# documents. This may be useful for small projects and may help to save some
# trees in general.
@ -1881,28 +1801,12 @@ LATEX_SOURCE_CODE = NO
# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
# bibliography, e.g. plainnat, or ieeetr. See
# https://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
# The default value is: plain.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_BIB_STYLE = plain
# If the LATEX_TIMESTAMP tag is set to YES then the footer of each generated
# page will contain the date and time when the page was generated. Setting this
# to NO can help when comparing the output of multiple runs.
# The default value is: NO.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_TIMESTAMP = NO
# The LATEX_EMOJI_DIRECTORY tag is used to specify the (relative or absolute)
# path from which the emoji images will be read. If a relative path is entered,
# it will be relative to the LATEX_OUTPUT directory. If left blank the
# LATEX_OUTPUT directory will be used.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_EMOJI_DIRECTORY =
#---------------------------------------------------------------------------
# Configuration options related to the RTF output
#---------------------------------------------------------------------------
@ -1942,9 +1846,9 @@ COMPACT_RTF = NO
RTF_HYPERLINKS = NO
# Load stylesheet definitions from file. Syntax is similar to doxygen's
# configuration file, i.e. a series of assignments. You only have to provide
# replacements, missing definitions are set to their default value.
# Load stylesheet definitions from file. Syntax is similar to doxygen's config
# file, i.e. a series of assignments. You only have to provide replacements,
# missing definitions are set to their default value.
#
# See also section "Doxygen usage" for information on how to generate the
# default style sheet that doxygen normally uses.
@ -1953,8 +1857,8 @@ RTF_HYPERLINKS = NO
RTF_STYLESHEET_FILE =
# Set optional variables used in the generation of an RTF document. Syntax is
# similar to doxygen's configuration file. A template extensions file can be
# generated using doxygen -e rtf extensionFile.
# similar to doxygen's config file. A template extensions file can be generated
# using doxygen -e rtf extensionFile.
# This tag requires that the tag GENERATE_RTF is set to YES.
RTF_EXTENSIONS_FILE =
@ -2040,13 +1944,6 @@ XML_OUTPUT = xml
XML_PROGRAMLISTING = YES
# If the XML_NS_MEMB_FILE_SCOPE tag is set to YES, doxygen will include
# namespace members in file scope as well, matching the HTML output.
# The default value is: NO.
# This tag requires that the tag GENERATE_XML is set to YES.
XML_NS_MEMB_FILE_SCOPE = NO
#---------------------------------------------------------------------------
# Configuration options related to the DOCBOOK output
#---------------------------------------------------------------------------
@ -2079,9 +1976,9 @@ DOCBOOK_PROGRAMLISTING = NO
#---------------------------------------------------------------------------
# If the GENERATE_AUTOGEN_DEF tag is set to YES, doxygen will generate an
# AutoGen Definitions (see http://autogen.sourceforge.net/) file that captures
# the structure of the code including all documentation. Note that this feature
# is still experimental and incomplete at the moment.
# AutoGen Definitions (see http://autogen.sf.net) file that captures the
# structure of the code including all documentation. Note that this feature is
# still experimental and incomplete at the moment.
# The default value is: NO.
GENERATE_AUTOGEN_DEF = NO
@ -2505,11 +2402,6 @@ DIAFILE_DIRS =
PLANTUML_JAR_PATH =
# When using plantuml, the PLANTUML_CFG_FILE tag can be used to specify a
# configuration file for plantuml.
PLANTUML_CFG_FILE =
# When using plantuml, the specified paths are searched for files specified by
# the !include statement in a plantuml block.

Wyświetl plik

@ -63,8 +63,7 @@
\ingroup SPEC_MATH_GROUP
\defgroup SPEC_MATH_TRIG_GROUP Тригонометрические и гиперболические функции
вещественного и комплексного аргумента
\defgroup SPEC_MATH_TRIG_GROUP Тригонометрические и гиперболические функции вещественного и комплексного аргумента
\ingroup SPEC_MATH_GROUP
\defgroup SPEC_MATH_TRANSCEND Высшие трансцендентные функции

Wyświetl plik

@ -33,7 +33,7 @@
Функция использует указатели типа `void*` и может быть использована для
конкатенации данных различного типа.<BR>
Например конкатенация массивов типа `double`:
\code
\code{.cpp}
double a[3] = {1.0, 2.0, 3.0};
double b[2] = {4.0, 5.0};
double c[5];
@ -41,13 +41,11 @@ double c[5];
concat((void*)a, 3*sizeof(double), (void*)b, 2*sizeof(double), (void*)c);
\endcode
в результате вектор `c` будет хранить массив данных:
\code
\verbatim
c = [1.0, 2.0, 3.0, 4.0, 5.0]
\endcode
\endverbatim
\author
Бахурин Сергей
www.dsplib.org
\author Бахурин Сергей, www.dsplib.org
**************************************************************************** */
@ -87,7 +85,7 @@ www.dsplib.org
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
Пример децимации вещественного массива данных в 2 раза:
\code
\code{.cpp}
double x[10] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
double y[5];
int d = 2;
@ -97,9 +95,9 @@ decimate(x, 10, d, y, &cnt);
\endcode
в результате в переменную `cnt` будет записан размер 5,
а вектор `y` будет хранить массив данных:
\code
\verbatim
c = [0.0, 2.0, 4.0, 6.0, 8.0]
\endcode
\endverbatim
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
@ -139,7 +137,7 @@ c = [0.0, 2.0, 4.0, 6.0, 8.0]
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
Пример децимации комплексного массива данных в 2 раза:
\code
\code{.cpp}
compex_t x[10] = {{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}, {3.0, 3.0}, {4.0, 4.0},
{5.0, 5.0}, {6.0, 6.0}, {7.0, 7.0}, {8.0, 8.0}, {9.0, 9.0}};
compex_t y[5];
@ -150,11 +148,256 @@ decimate_cmplx(x, 10, d, y, &cnt);
\endcode
в результате в переменную `cnt` будет записан размер 5,
а вектор `y` будет хранить массив данных:
\code
\verbatim
c = [0.0+0.0j, 2.0+2.0j, 4.0+4.0j, 6.0+6.0j, 8.0+8.0j]
\endcode
\endverbatim
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_STAT_GROUP
\fn int find_max_abs(double* a, int n, double* m, int* ind)
\brief Поиск максимального по модулю элемента вещественного вектора `a`
Функция производит поиск максимального по модулю значения вектора `a`.<BR>
Максимальное по модулю значение `max|a[k]|` сохраняется по адресу `m`, а индекс
данного значения в векторе `a` сохраняется по адресу `ind`.<BR>
\param[in] a Указатель на вещественный вектор `a`.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] n Размер входного вектора `a`.<BR><BR>
\param[out] m Указатель на адрес памяти, в который сохранить
максимальное по модулю значение вектора `a`.<BR>
Указатель может быть `NULL`, в этом случае
максимальное по модулю значение не сохраняется.<BR><BR>
\param[out] ind Указатель на переменную, в которую будет сохранен
индекс максимального по модулю значению вектора `a`.<BR>
Указатель может быть `NULL`, в этом случае
индекс не возвращается.<BR><BR>
\return
`RES_OK` если функция выполнена успешно.<BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
Пример:
\code{.cpp}
double a[5] = {0.0, 2.0, -5.0, 4.0, 2.0};
double m;
int ind;
find_max_abs(a, 5, &m, &ind);
printf("\n\nmax absolute value: %8.1f (index %d)", m, ind);
\endcode
в результате в переменную `m` будет записано значение `5`,
а в переменную `ind` значение `2`.
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_COMMON_GROUP
\fn int flipip(double* x, int n)
\brief Функция отражения вещественного вектора `x`
Функция производит отражение вещественного вектора длины `n`
в памяти данных.<BR>
Например исходный вектор `x` длины 6:<BR>
\verbatim
x = [0, 1, 2, 3, 4, 5]
\endverbatim
После отражения вектор `x` будет иметь вид:
\verbatim
x = [5, 4, 3, 2, 1, 0]
\endverbatim
\param[in, out] x Указатель на вещественный вектор `x`.<BR>
Размер вектора `[n x 1]`.<BR>
Результат отражения будет помещен по этому же адресу.<BR>
\param[in] n Размер вектора `x`.<BR><BR>
\return
`RES_OK` если функция выполнена успешно.<BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
Пример:
\code{.cpp}
double x[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
int i;
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
flipip(x, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
\endcode
<BR>
Результат выполнения:
\verbatim
0.0 1.0 2.0 3.0 4.0
4.0 3.0 2.0 1.0 0.0
\endverbatim
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_COMMON_GROUP
\fn int flipip_cmplx(complex_t* x, int n)
\brief Функция отражения комплексного вектора `x`
Функция производит отражение комплексного вектора длины `n`
в памяти данных.<BR>
Например исходный вектор `x` длины 6:<BR>
\verbatim
x = [0+0j, 1+1j, 2+2j, 3+3j, 4+4j, 5+5j]
\endverbatim
После отражения вектор `x` будет иметь вид:
\verbatim
x = [5+5j, 4+4j, 3+3j, 2+2j, 1+1j, 0+0j]
\endverbatim
\param[in, out] x Указатель на комплексный вектор `x`.<BR>
Размер вектора `[n x 1]`.<BR>
Результат отражения будет помещен по этому же адресу.<BR>
\param[in] n Размер вектора `x`.<BR><BR>
\return
`RES_OK` если функция выполнена успешно.<BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки".
Пример:
\code{.cpp}
complex_t y[5] = {{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}, {3.0, 3.0}, {4.0, 4.0}};
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
flipip_cmplx(y, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
\endcode
<BR>
Результат выполнения:
\verbatim
0.0+0.0j 1.0+1.0j 2.0+2.0j 3.0+3.0j 4.0+4.0j
4.0+4.0j 3.0+3.0j 2.0+2.0j 1.0+1.0j 0.0+0.0j
\endverbatim
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_COMMON_GROUP
\fn int verif(double* x, double* y, size_t n, double eps, double* err)
\brief Верификация вещественных массивов
Функция производит расчет максимальной относительной ошибки между вещественными
векторами `x` и `y` равной длины `n`:
\f[
e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad \quad |x(k)| > 0,
\f]
или
\f[
e = \max(|x(k) - y(k)| ), ~\qquad \quad~|x(k)| = 0,
\f]
и возвращает `DSPL_VERIF_SUCCESS` если
разница \f$ e\f$ меньше `eps`.
В противном случае возвращает `DSPL_VERIF_FAILED`.<BR>
Данная функция используется для верификации работы алгоритмов если вектор `x`
результат работы алгоритма пользователя, а `y` -- результат работы этого же
алгоритма сторонней функцией.
\param[in] x Указатель на первый вектор `x`.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] y Указатель на второй вектор `y`.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] n Размер векторов `x` и `y`.<BR><BR>
\param[in] eps Допустимая относительная ошибка.<BR>
Если максимальная относительная ошибка меньше `eps`, то
функция возвращает `DSPL_VERIF_SUCCESS`, в противном случае
`DSPL_VERIF_FAILED`. <BR><BR>
\param[in, out] err Указатель на переменную максимальной
относительной ошибки.<BR>
По данному адресу будет записано значение максимальной
относительной ошибки.<BR>
Указатель может быть `NULL`, значение ошибки в этом
случае не возвращается.<BR><BR>
\return
`DSPL_VERIF_SUCCESS` если относительная ошибка меньше `eps`.<BR>
В противном случае `DSPL_VERIF_FAILED`.
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_COMMON_GROUP
\fn int verif_cmplx(complex_t* x, complex_t* y, size_t n,
double eps, double* err)
\brief Верификация комплексных массивов
Функция производит расчет максимальной относительной ошибки между комплексными
векторами `x` и `y` равной длины `n`:
\f[
e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad \quad |x(k)| > 0,
\f]
или
\f[
e = \max(|x(k) - y(k)| ), ~\qquad \quad~|x(k)| = 0,
\f]
и возвращает `DSPL_VERIF_SUCCESS` если
разница \f$ e\f$ меньше `eps`.
В противном случае возвращает `DSPL_VERIF_FAILED`.<BR>
Данная функция используется для верификации работы алгоритмов если вектор `x`
результат работы алгоритма пользователя, а `y` -- результат работы этого же
алгоритма сторонней функцией.
\param[in] x Указатель на первый вектор `x`.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] y Указатель на второй вектор `y`.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] n Размер векторов `x` и `y`.<BR><BR>
\param[in] eps Допустимая относительная ошибка.<BR>
Если максимальная относительная ошибка меньше `eps`, то
функция возвращает `DSPL_VERIF_SUCCESS`, в противном случае
`DSPL_VERIF_FAILED`. <BR><BR>
\param[in, out] err Указатель на переменную максимальной
относительной ошибки.<BR>
По данному адресу будет записано значение максимальной
относительной ошибки.<BR>
Указатель может быть `NULL`, значение ошибки в этом
случае не возвращается.<BR><BR>
\return
`DSPL_VERIF_SUCCESS` если функция выполнена успешно.<BR>
В противном случае `DSPL_VERIF_FAILED`.
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */

Wyświetl plik

@ -0,0 +1,115 @@
/*! ****************************************************************************
\ingroup SPEC_MATH_TRANSCEND
\fn int cheby_poly1(double* x, int n, int ord, double* y)
\brief Многочлен Чебышева первого рода порядка `ord`
Функция производит расчет многочлена Чебышева первого рода \f$ C_ord(x)\f$ для
вещественного вектора `x` длины `n`на основе рекуррентной формулы
\f[
C_ord(x) = 2 x C_{ord-1}(x) - C_{ord-2}(x),
\f]
где \f$ C_0(x) = 1 \f$, \f$ C_1(x) = x\f$
\param[in] x Указатель на вектор `x` аргумента полинома
Чебышева первого рода.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] n Размер векторов `x` и `y`.<BR><BR>
\param[in] ord Порядок полинома Чебышева первого рода.<BR><BR>
\param[out] y Указатель на вектор значений полинома Чебышева,
соответствующих аргументу `x`.<BR>
Размер вектора `[n x 1]`.<BR>
Память должна быть выделена.<BR><BR>
\return
`RES_OK` Расчет произведен успешно.<BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки".<BR>
Пример использования функции:
\include cheby_poly1_test.c
<BR><BR>
В каталоге `dat` будут созданы текстовые файлы значений
полиномов порядка 1-4:<BR>
<pre>
cheby_poly1_ord1.txt
cheby_poly1_ord2.txt
cheby_poly1_ord3.txt
cheby_poly1_ord4.txt
</pre>
Кроме того программа GNUPLOT произведет построение следующих графиков
по сохраненным в файлах данным:
\image html cheby_poly1.png
Скрипт GNUPLOT для построения графиков из текстовых файлов:
\include cheby_poly1.plt
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_TRANSCEND
\fn int cheby_poly2(double* x, int n, int ord, double* y)
\brief Многочлен Чебышева второго рода порядка `ord`
Функция производит расчет многочлена Чебышева второго рода \f$ U_{ord}(x)\f$ для
вещественного вектора `x` длины `n`на основе рекуррентной формулы
\f[
U_{ord}(x) = 2 x U_{ord-1}(x) - U_{ord-2}(x),
\f]
где \f$ U_0(x) = 1 \f$, \f$ U_1(x) = 2x\f$
\param[in] x Указатель на вектор `x` аргумента полинома
Чебышева второго рода.<BR>
Размер вектора `[n x 1]`.<BR><BR>
\param[in] n Размер векторов `x` и `y`.<BR><BR>
\param[in] ord Порядок полинома Чебышева второго рода.<BR><BR>
\param[out] y Указатель на вектор значений полинома Чебышева,
соответствующих аргументу `x`.<BR>
Размер вектора `[n x 1]`.<BR>
Память должна быть выделена.<BR><BR>
\return
`RES_OK` Расчет произведен успешно.<BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки".<BR>
Пример использования функции:
\include cheby_poly2_test.c
<BR><BR>
В каталоге `dat` будут созданы текстовые файлы значений
полиномов порядка 1-4:<BR>
<pre>
cheby_poly2_ord1.txt
cheby_poly2_ord2.txt
cheby_poly2_ord3.txt
cheby_poly2_ord4.txt
</pre>
Кроме того программа GNUPLOT произведет построение следующих графиков
по сохраненным в файлах данным:
\image html cheby_poly2.png
Скрипт GNUPLOT для построения графиков из текстовых файлов:
\include cheby_poly2.plt
\author Бахурин Сергей www.dsplib.org
**************************************************************************** */

Wyświetl plik

@ -10,7 +10,7 @@
Например:
\code
\code{.cpp}
complex_t z;
z[0] = 1.0;
z[1] = -2.0;
@ -42,7 +42,7 @@
\f]
Например:
\code
\code{.cpp}
complex_t z;
double y;
RE(z) = 1.0;
@ -66,7 +66,7 @@
\brief Макрос определяющий мнимую часть комплексного числа.
Например:
\code
\code{.cpp}
complex_t z;
RE(z) = 1.0;
IM(z) = -2.0;
@ -76,7 +76,7 @@
Аналогично, макрос можно использовать для получения
мнимой части комплексного числа:
\code
\code{.cpp}
complex_t z = {3.0, -4.0};
double r;
r = IM(z);
@ -100,7 +100,7 @@
\brief Макрос определяющий реальную часть комплексного числа.
Например:
\code
\code{.cpp}
complex_t z;
RE(z) = 1.0;
IM(z) = -2.0;
@ -111,7 +111,7 @@
Аналогично, макрос можно использовать для получения
реальной части комплексного числа:
\code
\code{.cpp}
complex_t z = {3.0, -4.0};
double r;
r = RE(z);
@ -125,6 +125,238 @@
/*! ****************************************************************************
\ingroup SPEC_MATH_TRIG_GROUP
\fn int acos_cmplx(complex_t* x, int n, complex_t *y)
\brief Арккосинус комплексного аргумента `x`
Функция рассчитывает значения арккосинуса комплексного аргумента,
заданного вектором `x` длины `n`: <BR>
\f[
\textrm{Arccos}(x) = \frac{\pi}{2} - \textrm{Arcsin}(x) =
\frac{\pi}{2} -j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right)
\f]
\param[in] x Указатель на вектор аргумента комплексного арккосинуса.<BR>
Размер вектора `[n x 1]`. <BR><BR>
\param[in] n Размер входного и выходного векторов `x` и `y`.<BR><BR>
\param[out] y Указатель на вектор значений комплексного арккосинуса,
соответствующего входному вектору `x`.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\return
`RES_OK` если значение функции рассчитано успешно . <BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки":<BR>
\note Функция может использоваться для расчета арккосинуса аргумента
большего единицы, когда вещественная функция `acos` не определена.
Например при выполнении следующего кода
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
acos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("acos_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Результатом работы будет
\verbatim
acos_cmplx(1.0+2.0j) = 1.144-1.529j
acos_cmplx(3.0+4.0j) = 0.937-2.306j
acos_cmplx(5.0+6.0j) = 0.880-2.749j
\endverbatim
\author
Бахурин Сергей www.dsplib.org
***************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_TRIG_GROUP
\fn int asin_cmplx(complex_t* x, int n, complex_t *y)
\brief Арксинус комплексного аргумента `x`
Функция рассчитывает значения арксинуса комплексного аргумента,
заданного вектором `x` длины `n`: <BR>
\f[
\textrm{Arcsin}(x) = j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right)
\f]
\param[in] x Указатель на вектор аргумента комплексного арксинуса.<BR>
Размер вектора `[n x 1]`. <BR><BR>
\param[in] n Размер входного и выходного векторов `x` и `y`.<BR><BR>
\param[out] y Указатель на вектор значений комплексного арксинуса,
соответствующего входному вектору `x`.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\return
`RES_OK` если значение функции рассчитано успешно . <BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки":<BR>
\note Функция может использоваться для расчета арксинуса аргумента
большего единицы, когда вещественная функция `acos` не определена.
Например при выполнении следующего кода
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
asin_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("asin_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Результатом работы будет
\verbatim
asin_cmplx(1.0+2.0j) = 0.427+1.529j
asin_cmplx(3.0+4.0j) = 0.634+2.306j
asin_cmplx(5.0+6.0j) = 0.691+2.749j
\endverbatim
\author
Бахурин Сергей www.dsplib.org
***************************************************************************** */
/*! ****************************************************************************
\ingroup TYPES_GROUP
\fn int cmplx2re(complex_t* x, int n, double* re, double* im)
\brief Преобразование массива комплексных данных в два массива
вещественных данных, содержащих реальную и мнимую части
исходного массива
Функция заполняет реальные массивы `re` и `im` соответствующими значениями
реальной и мнимой частей исходного комплексного массива `x`. <BR>
\param[in] x Указатель на массив комплексных данных.<BR>
Размер массива `[n x 1]`. <BR><BR>
\param[in] n Размер массивов входных и выходных данных.<BR><BR>
\param[out] re Указатель на адрес массива реальной части данных.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\param[out] im Указатель на адрес массива мнимой части данных.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\return
`RES_OK` если преобразование произведено успешно. <BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки":<BR>
Например при выполнении следующего кода
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
double re[3], im[3];
cmplx2re(x, 3, re, im);
\endcode
Элементам массивов `re` и `im` будут присвоены значения:
\verbatim
re[0] = 1.0; im[0] = 2.0;
re[1] = 3.0; im[1] = 4.0;
re[2] = 5.0; im[2] = 6.0;
\endverbatim
\author Бахурин Сергей. www.dsplib.org
***************************************************************************** */
/*! ****************************************************************************
\ingroup SPEC_MATH_TRIG_GROUP
\fn int cos_cmplx(complex_t* x, int n, complex_t *y)
\brief Косинус комплексного аргумента `x`
Функция рассчитывает значения косинуса комплексного аргумента,
заданного вектором `x` длины `n`: <BR>
\f[
\textrm{cos}(x) = \frac{\exp(jx) + \exp(-jx)}{2}
\f]
\param[in] x Указатель на вектор аргумента комплексного косинуса.<BR>
Размер вектора `[n x 1]`. <BR><BR>
\param[in] n Размер входного и выходного векторов `x` и `y`.<BR><BR>
\param[out] y Указатель на вектор значений комплексного косинуса,
соответствующего входному вектору `x`.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\return
`RES_OK` если значение функции рассчитано успешно . <BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки":<BR>
Например при выполнении следующего кода
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
cos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("cos_cmplx(%.1f%+.1fj) = %9.3f%+9.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Результатом работы будет
\verbatim
cos_cmplx(1.0+2.0j) = 2.033 -3.052j
cos_cmplx(3.0+4.0j) = -27.035 -3.851j
cos_cmplx(5.0+6.0j) = 57.219 +193.428j
\endverbatim
\author
Бахурин Сергей www.dsplib.org
***************************************************************************** */
@ -175,58 +407,3 @@
www.dsplib.org
***************************************************************************** */
/*! ****************************************************************************
\ingroup TYPES_GROUP
\fn int cmplx2re(complex_t* x, int n, double *re, double *im)
\brief Преобразование массива комплексных данных в два массива
вещественных данных, содержащих реальную и мнимую части
исходного массива
Функция заполняет реальные массивы `re` и `im` соответсвующими значениями
ральной и мнимой частей исходного комплексного массива `x`. <BR>
\param[in] x Указатель на массв комплексных данных.<BR>
Размер массива `[n x 1]`. <BR><BR>
\param[in] n Размер массивов входных и выходных данных.<BR><BR>
\param[out] re Указатель на адрес массива реальной части данных.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\param[out] im Указатель на адрес массива мнимой части данных.<BR>
Размер массива `[n x 1]`. <BR>
Память должна быть выделена. <BR><BR>
\return
`RES_OK` если преобразование произведено успешно. <BR>
В противном случае \ref ERROR_CODE_GROUP "код ошибки":<BR>
Например при выполнении следующего кода
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
double re[3], im[3];
cmplx2re(x, 3, re, im);
\endcode
Элементам массивов `re` и `im` будут присвоены значения:
\verbatim
re[0] = 1.0; im[0] = 2.0;
re[1] = 3.0; im[1] = 4.0;
re[2] = 5.0; im[2] = 6.0;
\endverbatim
\author
Бахурин Сергей.
www.dsplib.org
***************************************************************************** */

Wyświetl plik

@ -57,7 +57,7 @@ concatenation of these arrays will be array `c` size `na+nb`:<BR>
Function uses pointer type `void*` and can be useful for an arrays
concatenation with different types.<BR>
For example two `double` arrays concatenation:
\code
\code{.cpp}
double a[3] = {1.0, 2.0, 3.0};
double b[2] = {4.0, 5.0};
double c[5];
@ -65,9 +65,9 @@ double c[5];
concat((void*)a, 3*sizeof(double), (void*)b, 2*sizeof(double), (void*)c);
\endcode
Vector `c` keeps follow data:
\code
\verbatim
c = [1.0, 2.0, 3.0, 4.0, 5.0]
\endcode
\endverbatim
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
@ -120,7 +120,7 @@ Output vector `y` keeps values corresponds to:
Else \ref ERROR_CODE_GROUP "code error".
Two-times decimation example:
\code
\code{.cpp}
double x[10] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
double y[5];
int d = 2;
@ -130,9 +130,9 @@ decimate(x, 10, d, y, &cnt);
\endcode
As result variable `cnt` will be written value 5 and
vector `y` will keep array:
\code
\verbatim
c = [0.0, 2.0, 4.0, 6.0, 8.0]
\endcode
\endverbatim
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
@ -194,7 +194,7 @@ Output vector `y` keeps values corresponds to:
Else \ref ERROR_CODE_GROUP "code error".
Two-times complex vector decimation example:
\code
\code{.cpp}
compex_t x[10] = {{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}, {3.0, 3.0}, {4.0, 4.0},
{5.0, 5.0}, {6.0, 6.0}, {7.0, 7.0}, {8.0, 8.0}, {9.0, 9.0}};
compex_t y[5];
@ -205,9 +205,9 @@ decimate_cmplx(x, 10, d, y, &cnt);
\endcode
As result variable `cnt` will be written value 5 and
vector `y` will keep array:
\code
\verbatim
c = [0.0+0.0j, 2.0+2.0j, 4.0+4.0j, 6.0+6.0j, 8.0+8.0j]
\endcode
\endverbatim
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
@ -238,7 +238,44 @@ int DSPL_API decimate_cmplx(complex_t* x, int n, int d, complex_t* y, int* cnt)
/******************************************************************************
Find max(|a|)
\ingroup SPEC_MATH_STAT_GROUP
\fn int find_max_abs(double* a, int n, double* m, int* ind)
\brief Find maximum absolute value from the real vector `a`
Function searches maximum absolute value in the real vector `a`.
This value writes to the address `m` and index keeps to te address `ind`.
\param[in] a Pointer to the real vector `a`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] n Size of the input vector `a`.<BR><BR>
\param[out] m Pointer to the variable which keeps vector `a`
maximum absolute value.<BR>
Pointer can be `NULL`, maximum value will not return
in this case.<BR><BR>
\param[out] ind Pointer to the variable which keeps index of a
maximum absolute value inside vector `a`.<BR>
Pointer can be `NULL`, index will not return
in this case.<BR><BR>
\return
`RES_OK` if function calculates successfully,
else \ref ERROR_CODE_GROUP "code error".
Example:
\code{.cpp}
double a[5] = {0.0, 2.0, -5.0, 4.0, 2.0};
double m;
int ind;
find_max_abs(a, 5, &m, &ind);
printf("\n\nmax absolute value: %8.1f (index %d)", m, ind);
\endcode
As result the variable `m` will keep value `5`,
and variable `ind` will keep `2`.
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API find_max_abs(double* a, int n, double* m, int* ind)
{
@ -254,7 +291,7 @@ int DSPL_API find_max_abs(double* a, int n, double* m, int* ind)
{
if(fabs(a[k]) > t)
{
t = a[k];
t = fabs(a[k]);
i = k;
}
}
@ -268,7 +305,50 @@ int DSPL_API find_max_abs(double* a, int n, double* m, int* ind)
/******************************************************************************
Flip real array in place
\ingroup SPEC_MATH_COMMON_GROUP
\fn int flipip(double* x, int n)
\brief Flip real vector `x` in place
Function flips real vector `x` length `n` in the memory
<BR>
For example real vector `x` length 6:<BR>
\verbatim
x = [0, 1, 2, 3, 4, 5]
\endverbatim
After flipping it will be as follow:
\verbatim
x = [5, 4, 3, 2, 1, 0]
\endverbatim
\param[in, out] x Pointer to the real vector `x`.<BR>
Vector size is `[n x 1]`.<BR>
Flipped vector will be on the same address.<BR>
\param[in] n Length of the vector `x`.<BR><BR>
\return
`RES_OK` if function returns successfully.<BR>
Else \ref ERROR_CODE_GROUP "error code".
Example:
\code{.cpp}
double x[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
int i;
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
flipip(x, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
\endcode
<BR>
Program result:
\verbatim
0.0 1.0 2.0 3.0 4.0
4.0 3.0 2.0 1.0 0.0
\endverbatim
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API flipip(double* x, int n)
{
@ -291,7 +371,49 @@ int DSPL_API flipip(double* x, int n)
/******************************************************************************
Flip complex array in place
\ingroup SPEC_MATH_COMMON_GROUP
\fn int flipip_cmplx(complex_t* x, int n)
\brief Flip complex vector `x` in place
Function flips complex vector `x` length `n` in the memory
<BR>
For example complex vector `x` length 6:<BR>
\verbatim
x = [0+0j, 1+1j, 2+2j, 3+3j, 4+4j, 5+5j]
\endverbatim
After flipping it will be as follow:
\verbatim
x = [5+5j, 4+4j, 3+3j, 2+2j, 1+1j, 0+0j]
\endverbatim
\param[in, out] x Pointer to the complex vector `x`.<BR>
Vector size is `[n x 1]`.<BR>
Flipped vector will be on the same address.<BR>
\param[in] n Length of the vector `x`.<BR><BR>
\return
`RES_OK` if function returns successfully.<BR>
Else \ref ERROR_CODE_GROUP "error code".
Example:
\code{.cpp}
complex_t y[5] = {{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}, {3.0, 3.0}, {4.0, 4.0}};
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
flipip_cmplx(y, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
\endcode
<BR>
Program result:
\verbatim
0.0+0.0j 1.0+1.0j 2.0+2.0j 3.0+3.0j 4.0+4.0j
4.0+4.0j 3.0+3.0j 2.0+2.0j 1.0+1.0j 0.0+0.0j
\endverbatim
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API flipip_cmplx(complex_t* x, int n)
{
@ -319,7 +441,48 @@ int DSPL_API flipip_cmplx(complex_t* x, int n)
/******************************************************************************
Verif double
\ingroup SPEC_MATH_COMMON_GROUP
\fn int verif(double* x, double* y, size_t n, double eps, double* err)
\brief Real arrays verification
Function calculates a maximum relative error between two real arrays `x`
and `y` (both length equals `n`):
\f[
e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad if \quad |x(k)| > 0,
\f]
or
\f[
e = \max(|x(k) - y(k)| ), ~\qquad if \quad~|x(k)| = 0,
\f]
Return `DSPL_VERIF_SUCCESS` if maximum relative error \f$ e\f$ less than `eps`.
Else returns `DSPL_VERIF_FAILED`.<BR>
This function can be used for algorithms verification if vector `x` is user
algorithm result and vector `y` -- reference vector.
\param[in] x Pointer to the first vector `x`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] y Pointer to the second vector `y`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] n Size of vectors `x` and `y`.<BR><BR>
\param[in] eps Relative error threshold.<BR>
If error less than `eps`, then function returns
`DSPL_VERIF_SUCCESS`, else `DSPL_VERIF_FAILED`. <BR><BR>
\param[in, out] err Pointer to the variable which keep
maximum relative error.<BR>
Pointer can be `NULL`, maximum error will not be returned
in this case.<BR><BR>
\return
`DSPL_VERIF_SUCCESS` if maximum relative error less than `eps`.<BR>
Otherwise `DSPL_VERIF_FAILED`.
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API verif(double* x, double* y, size_t n, double eps, double* err)
{
@ -359,7 +522,49 @@ int DSPL_API verif(double* x, double* y, size_t n, double eps, double* err)
/******************************************************************************
Verif double
\ingroup SPEC_MATH_COMMON_GROUP
\fn int verif_cmplx(complex_t* x, complex_t* y, size_t n,
double eps, double* err)
\brief Complex arrays verification
Function calculates a maximum relative error between two complex arrays `x`
and `y` (both length equals `n`):
\f[
e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad if \quad |x(k)| > 0,
\f]
or
\f[
e = \max(|x(k) - y(k)| ), ~\qquad if \quad~|x(k)| = 0,
\f]
Return `DSPL_VERIF_SUCCESS` if maximum relative error \f$ e\f$ less than `eps`.
Else returns `DSPL_VERIF_FAILED`.<BR>
This function can be used for algorithms verification if vector `x` is user
algorithm result and vector `y` -- reference vector.
\param[in] x Pointer to the first vector `x`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] y Pointer to the second vector `y`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] n Size of vectors `x` and `y`.<BR><BR>
\param[in] eps Relative error threshold.<BR>
If error less than `eps`, then function returns
`DSPL_VERIF_SUCCESS`, else `DSPL_VERIF_FAILED`. <BR><BR>
\param[in, out] err Pointer to the variable which keep
maximum relative error.<BR>
Pointer can be `NULL`, maximum error will not be returned
in this case.<BR><BR>
\return
`DSPL_VERIF_SUCCESS` if maximum relative error less than `eps`.<BR>
Otherwise `DSPL_VERIF_FAILED`.
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API verif_cmplx(complex_t* x, complex_t* y, size_t n,
double eps, double* err)

Wyświetl plik

@ -25,7 +25,55 @@
/******************************************************************************
Chebyshev polynomials of the first kind
\ingroup SPEC_MATH_TRANSCEND
\fn int cheby_poly1(double* x, int n, int ord, double* y)
\brief Chebyshev polynomial of the first kind order `ord`
Function calculates Chebyshev polynomial \f$ C_ord(x)\f$ of the first kind
order `ord` for the real vector `x` (length `n`) by recurrent equation:
\f[
C_ord(x) = 2 x C_{ord-1}(x) - C_{ord-2}(x),
\f]
where \f$ C_0(x) = 1 \f$, \f$ C_1(x) = x\f$
\param[in] x Pointer to the real argument vector `x`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] n Size of vectors `x` and `y`.<BR><BR>
\param[in] ord Chebyshev polynomial order.<BR><BR>
\param[out] y Pointer to the Chebyshev polynomial values,
corresponds to the argument `x`.<BR>
Vector size is `[n x 1]`.<BR>
Memory must be allocated.<BR><BR>
\return
`RES_OK` if Chebyshev polynomial is calculated successfully.<BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:
\include cheby_poly1_test.c
<BR><BR>
Text files will be created in `dat` directory:<BR>
<pre>
cheby_poly1_ord1.txt
cheby_poly1_ord2.txt
cheby_poly1_ord3.txt
cheby_poly1_ord4.txt
</pre>
GNUPLOT package will create Chebyshev polynomials plot from saved text-files:
\image html cheby_poly1.png
GNUPLOT script is follow:
\include cheby_poly1.plt
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API cheby_poly1(double* x, int n, int ord, double* y)
{
@ -73,7 +121,55 @@ int DSPL_API cheby_poly1(double* x, int n, int ord, double* y)
/******************************************************************************
Chebyshev polynomials of the second kind
\ingroup SPEC_MATH_TRANSCEND
\fn int cheby_poly2(double* x, int n, int ord, double* y)
\brief Chebyshev polynomial of the second kind order `ord`
Function calculates Chebyshev polynomial \f$ U_ord(x)\f$ of the first kind
order `ord` for the real vector `x` (length `n`) by recurrent equation:
\f[
U_ord(x) = 2 x U_{ord-1}(x) - U_{ord-2}(x),
\f]
where \f$ U_0(x) = 1 \f$, \f$ U_1(x) = 2x\f$
\param[in] x Pointer to the real argument vector `x`.<BR>
Vector size is `[n x 1]`.<BR><BR>
\param[in] n Size of vectors `x` and `y`.<BR><BR>
\param[in] ord Chebyshev polynomial order.<BR><BR>
\param[out] y Pointer to the Chebyshev polynomial values,
corresponds to the argument `x`.<BR>
Vector size is `[n x 1]`.<BR>
Memory must be allocated.<BR><BR>
\return
`RES_OK` if Chebyshev polynomial is calculated successfully.<BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:
\include cheby_poly2_test.c
<BR><BR>
Text files will be created in `dat` directory:<BR>
<pre>
cheby_poly2_ord1.txt
cheby_poly2_ord2.txt
cheby_poly2_ord3.txt
cheby_poly2_ord4.txt
</pre>
GNUPLOT package will create Chebyshev polynomials plot from saved text-files:
\image html cheby_poly2.png
GNUPLOT script is follow:
\include cheby_poly2.plt
\author Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API cheby_poly2(double* x, int n, int ord, double* y)
{
@ -99,7 +195,7 @@ int DSPL_API cheby_poly2(double* x, int n, int ord, double* y)
{
for(k = 0; k < n; k++)
{
y[k] = 2.0*x[n];
y[k] = 2.0*x[k];
};
return RES_OK;
}
@ -107,7 +203,7 @@ int DSPL_API cheby_poly2(double* x, int n, int ord, double* y)
for(k = 0; k < n; k++)
{
m = 2;
t[1] = 2.0*x[n];
t[1] = 2.0*x[k];
t[0] = 1.0;
while(m <= ord)
{

Wyświetl plik

@ -26,7 +26,56 @@
/******************************************************************************
Acos complex
\ingroup SPEC_MATH_TRIG_GROUP
\fn int acos_cmplx(complex_t* x, int n, complex_t *y)
\brief The inverse of the cosine function the complex vector argument `x`
Function calculates the inverse of the cosine function as:<BR>
\f[
\textrm{Arccos}(x) = \frac{\pi}{2} - \textrm{Arcsin}(x) =
\frac{\pi}{2} -j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right)
\f]
\param[in] x Pointer to the argument vector `x`.<BR>
Vector size is `[n x 1]`. <BR><BR>
\param[in] n Input vector `x` and the inverse cosine vector `y` size.<BR><BR>
\param[out] y Pointer to the output complex vector `y`,
corresponds to the input vector `x`.<BR>
Vector size is `[n x 1]`. <BR>
Memory must be allocated. <BR><BR>
\return
`RES_OK` if function calculated successfully. <BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:<BR>
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
acos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("acos_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Output is:<BR>
\verbatim
acos_cmplx(1.0+2.0j) = 1.144-1.529j
acos_cmplx(3.0+4.0j) = 0.937-2.306j
acos_cmplx(5.0+6.0j) = 0.880-2.749j
\endverbatim
\author
Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API acos_cmplx(complex_t* x, int n, complex_t *y)
{
@ -49,7 +98,55 @@ int DSPL_API acos_cmplx(complex_t* x, int n, complex_t *y)
/******************************************************************************
Asin complex
\ingroup SPEC_MATH_TRIG_GROUP
\fn int asin_cmplx(complex_t* x, int n, complex_t *y)
\brief The inverse of the sine function the complex vector argument `x`
Function calculates the inverse of the sine function as:<BR>
\f[
\textrm{Arcsin}(x) = j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right)
\f]
\param[in] x Pointer to the argument vector `x`.<BR>
Vector size is `[n x 1]`. <BR><BR>
\param[in] n Input vector `x` and the inverse sine vector `y` size.<BR><BR>
\param[out] y Pointer to the output complex vector `y`,
corresponds to the input vector `x`.<BR>
Vector size is `[n x 1]`. <BR>
Memory must be allocated. <BR><BR>
\return
`RES_OK` if function calculated successfully. <BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:<BR>
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
asin_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("asin_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Output is:<BR>
\verbatim
asin_cmplx(1.0+2.0j) = 0.427+1.529j
asin_cmplx(3.0+4.0j) = 0.634+2.306j
asin_cmplx(5.0+6.0j) = 0.691+2.749j
\endverbatim
\author
Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API asin_cmplx(complex_t* x, int n, complex_t *y)
{
@ -76,31 +173,51 @@ int DSPL_API asin_cmplx(complex_t* x, int n, complex_t *y)
/******************************************************************************
convert double array to a complex array
*******************************************************************************/
int DSPL_API re2cmplx(double* x, int n, complex_t *y)
{
int k;
if(!x || !y)
return ERROR_PTR;
if(n < 1)
return ERROR_SIZE;
for(k = 0; k < n; k++)
{
RE(y[k]) = x[k];
IM(y[k]) = 0.0;
}
return RES_OK;
}
/******************************************************************************
convert complex array to a re and im arrays
\ingroup TYPES_GROUP
\fn int cmplx2re(complex_t* x, int n, double* re, double* im)
\brief Separate complex vector to the real and image vectors
Function fills `re` and `im` vectors corresponds to real and image
parts of the input complex array `x`. <BR>
\param[in] x Pointer to the real complex vector.<BR>
Vector size is `[n x 1]`. <BR><BR>
\param[in] n Size of the input complex vector `x` and real and image
vectors `re` and `im`.<BR><BR>
\param[out] re Pointer to the real part vector.<BR>
Vector size is `[n x 1]`. <BR>
Memory must be allocated. <BR><BR>
\param[out] im Pointer to the image part vector.<BR>
Vector size is `[n x 1]`. <BR>
Memory must be allocated. <BR><BR>
\return
`RES_OK` if function converts complex vector successfully. <BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:<BR>
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
double re[3], im[3];
cmplx2re(x, 3, re, im);
\endcode
Vectors `re` and `im` will contains:
\verbatim
re[0] = 1.0; im[0] = 2.0;
re[1] = 3.0; im[1] = 4.0;
re[2] = 5.0; im[2] = 6.0;
\endverbatim
\author Sergey Bakhurin. www.dsplib.org
*******************************************************************************/
int DSPL_API cmplx2re(complex_t* x, int n, double* re, double* im)
{
@ -127,9 +244,57 @@ int DSPL_API cmplx2re(complex_t* x, int n, double *re, double *im)
/******************************************************************************
Complex cosine
\ingroup SPEC_MATH_TRIG_GROUP
\fn int cos_cmplx(complex_t* x, int n, complex_t *y)
\brief The cosine function the complex vector argument `x`
Function calculates the cosine function as:<BR>
\f[
\textrm{cos}(x) = \frac{\exp(jx) + \exp(-jx)}{2}
\f]
\param[in] x Pointer to the argument vector `x`.<BR>
Vector size is `[n x 1]`. <BR><BR>
\param[in] n Input vector `x` and the cosine vector `y` size.<BR><BR>
\param[out] y Pointer to the output complex vector `y`,
corresponds to the input vector `x`.<BR>
Vector size is `[n x 1]`. <BR>
Memory must be allocated. <BR><BR>
\return
`RES_OK` if function calculated successfully. <BR>
Else \ref ERROR_CODE_GROUP "code error".<BR>
Example:<BR>
\code{.cpp}
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
cos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("cos_cmplx(%.1f%+.1fj) = %9.3f%+9.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
\endcode
<BR>
Output is:<BR>
\verbatim
cos_cmplx(1.0+2.0j) = 2.033 -3.052j
cos_cmplx(3.0+4.0j) = -27.035 -3.851j
cos_cmplx(5.0+6.0j) = 57.219 +193.428j
\endverbatim
\author
Sergey Bakhurin www.dsplib.org
*******************************************************************************/
int DSPL_API cos_cmplx(complex_t* x, int n, complex_t *y)
{
@ -155,6 +320,54 @@ int DSPL_API cos_cmplx(complex_t* x, int n, complex_t *y)
/******************************************************************************
Logarithm complex
*******************************************************************************/
int DSPL_API log_cmplx(complex_t* x, int n, complex_t *y)
{
int k;
if(!x || !y)
return ERROR_PTR;
if(n < 1)
return ERROR_SIZE;
for(k = 0; k < n; k++)
{
RE(y[k]) = 0.5 * log(ABSSQR(x[k]));
IM(y[k]) = atan2(IM(x[k]), RE(x[k]));
}
return RES_OK;
}
/******************************************************************************
convert double array to a complex array
*******************************************************************************/
int DSPL_API re2cmplx(double* x, int n, complex_t* y)
{
int k;
if(!x || !y)
return ERROR_PTR;
if(n < 1)
return ERROR_SIZE;
for(k = 0; k < n; k++)
{
RE(y[k]) = x[k];
IM(y[k]) = 0.0;
}
return RES_OK;
}
/******************************************************************************
Complex cosine
*******************************************************************************/
@ -182,26 +395,6 @@ int DSPL_API sin_cmplx(complex_t* x, int n, complex_t *y)
/******************************************************************************
Logarithm complex
*******************************************************************************/
int DSPL_API log_cmplx(complex_t* x, int n, complex_t *y)
{
int k;
if(!x || !y)
return ERROR_PTR;
if(n < 1)
return ERROR_SIZE;
for(k = 0; k < n; k++)
{
RE(y[k]) = 0.5 * log(ABSSQR(x[k]));
IM(y[k]) = atan2(IM(x[k]), RE(x[k]));
}
return RES_OK;
}
/******************************************************************************

Wyświetl plik

@ -26,9 +26,6 @@
/*******************************************************************************
Real vectors linear convolution
*******************************************************************************/

Wyświetl plik

@ -31,8 +31,8 @@ Print DSPL info
void DSPL_API dspl_info()
{
printf("\n\n D S P L - 2.0\n");
printf(" version 2.18.10.05\n");
printf("\n Copyright (C) 2015-2018\n");
printf(" version 2.19.06.18\n");
printf("\n Copyright (C) 2015-2019\n");
printf(" Sergey Bakhurin www.dsplib.org\n\n");
}

Wyświetl plik

@ -0,0 +1,15 @@
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set terminal pngcairo size 560,380 enhanced font 'Verdana,8'
set output 'img/cheby_poly1.png'
set ylabel "C_N(x)"
set yrange [-1.5:1.5]
plot 'dat/cheby_poly1_ord1.txt' with lines, \
'dat/cheby_poly1_ord2.txt' with lines, \
'dat/cheby_poly1_ord3.txt' with lines, \
'dat/cheby_poly1_ord4.txt' with lines

Wyświetl plik

@ -0,0 +1,15 @@
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set terminal pngcairo size 560,380 enhanced font 'Verdana,8'
set output 'img/cheby_poly2.png'
set ylabel "C_N(x)"
set yrange [-3.5:3.5]
plot 'dat/cheby_poly2_ord1.txt' with lines, \
'dat/cheby_poly2_ord2.txt' with lines, \
'dat/cheby_poly2_ord3.txt' with lines, \
'dat/cheby_poly2_ord4.txt' with lines

Wyświetl plik

@ -26,6 +26,35 @@ int main()
for (k = 0; k < n; k++)
printf("%6.1f", d[k]);
// find max abs value
double am[5] = {0.0, 2.0, -5.0, 4.0, 2.0};
double m;
int ind;
err = find_max_abs(am, 5, &m, &ind);
printf("\n\nmax absolute value: %8.1f (index %d)", m, ind);
printf("\n\nFlipip function test:\n\n");
double x[5] = {0.0, 1.0, 2.0, 3.0, 4.0};
int i;
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
flipip(x, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f ", x[i]);
printf("\n\nflipip_cmplx function test:\n\n");
complex_t y[5] = {{0.0, 0.0}, {1.0, 1.0}, {2.0, 2.0}, {3.0, 3.0}, {4.0, 4.0}};
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
flipip_cmplx(y, 5);
printf("\n");
for(i = 0; i < 5; i++)
printf("%6.1f%+.1fj ", RE(y[i]), IM(y[i]));
dspl_free(handle); // free dspl handle
return err;

Wyświetl plik

@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dspl.h"
#define N 250
int main()
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
double x[N], y[N];
int ord;
char fn[64];
linspace(-1.0, 1.0, N, DSPL_SYMMETRIC, x);
for(ord = 1; ord < 5; ord++)
{
cheby_poly1(x, N, ord, y);
sprintf(fn, "dat/cheby_poly1_ord%d.txt", ord);
writetxt(x,y,N,fn);
}
dspl_free(handle); // free dspl handle
return system("gnuplot gnuplot/cheby_poly1.plt");
}

Wyświetl plik

@ -0,0 +1,28 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dspl.h"
#define N 250
int main()
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
double x[N], y[N];
int ord;
char fn[64];
linspace(-1.0, 1.0, N, DSPL_SYMMETRIC, x);
for(ord = 1; ord < 5; ord++)
{
cheby_poly2(x, N, ord, y);
sprintf(fn, "dat/cheby_poly2_ord%d.txt", ord);
writetxt(x,y,N,fn);
}
dspl_free(handle); // free dspl handle
return system("gnuplot gnuplot/cheby_poly2.plt");
}

Wyświetl plik

@ -0,0 +1,39 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dspl.h"
int main()
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
complex_t x[3] = {{1.0, 2.0}, {3.0, 4.0}, {5.0, 6.0}};
complex_t y[3];
int k;
printf("\n\nacos_cmplx\n---------------------------------\n");
acos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("acos_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
printf("\n\nasin_cmplx\n---------------------------------\n");
asin_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("asin_cmplx(%.1f%+.1fj) = %.3f%+.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
printf("\n\ncos_cmplx\n---------------------------------\n");
cos_cmplx(x, 3, y);
for(k = 0; k < 3; k++)
printf("cos_cmplx(%.1f%+.1fj) = %9.3f%+9.3fj\n",
RE(x[k]), IM(x[k]), RE(y[k]), IM(y[k]));
dspl_free(handle); // free dspl handle
return 0;
}